当前位置: 代码迷 >> Java Web开发 >> struts2 type="redirect"该如何处理
  详细解决方案

struts2 type="redirect"该如何处理

热度:5552   发布时间:2013-02-25 21:13:32.0
struts2 type="redirect"
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.custom.i18n.resources" value="message"></constant>
<constant name="struts.multipart.maxSize" value="1000000000" />
<package name="default" extends="struts-default">
<action name="work*" class="WorkAction"
method="{1}">
<result name="success">/itassets/work/work_list.jsp</result>
<result name="display">/itassets/work_info.jsp</result>
<result name="tocreate">/itassets/work_create.jsp</result>
<result name="toupdate">/itassets/work_update.jsp</result>
<result name="error">/common/error.jsp</result>
<result name="tolist" type="redirect">
worklist.do?server=${server}
</result> </action>
</package>
</struts>
为什么worklist.do?server=${server}无法传值呢


------解决方案--------------------------------------------------------
Action中server是否有getter和setter 方法并且在方法中调用了setter方法赋值
------解决方案--------------------------------------------------------
action中server属性必须有get/set方法
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Thu Dec 13 17:48:19 CST 2018
  • 最近登录:Thu Dec 13 17:48:19 CST 2018
  • 最近登录:Thu Dec 13 17:48:19 CST 2018
  • 最近登录:Thu Dec 13 17:48:19 CST 2018
  • 最近登录:Thu Dec 13 17:48:19 CST 2018