使用在result节点中使用param属性,如下
xxx
如果设置的new_id是一个动态的,那么
${id}id必须为action的一个属性(这样才能去得到id的值)
struts2的核心是过滤器
首先进入的是web.xml
需要在web.xml配置struts2过滤器,如下:
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
然后再在struts.xml配置action例如
最后在你的登陆类action类中写好你的方法就行了。
public class LoginAction {
public String Login() {
.....
return "success";
}
}
写的已经很明白了