ä¸ä¸ªjspå¯ä»¥åå¤ä¸ªacitonï¼éæ©æ§è¡è·³è½¬ä¸åçå¨ä½æ¥æ§è¡åå°æ¹æ³ï¼
index.jspé
<s:action name="action1" executeResult="true" namespace="/" />
<s:action name="action2" executeResult="true" namespace="/" />
struts.xmléï¼
<package name="default" namespace="/" extends="struts-default">
<action name="action1" class="cn.java.Action1">
<result>/action1.jsp</result>
</action>
<action name="action2" class="cn.java.Action2">
<result>/action2.jsp</result>
</action>
</package>
å¨action1.jspé<s:property value="#attr.name" />å°±å¾å°action1éçå±æ§nameçå¼äºï¼nameéè¦ægetæ¹æ³ï¼ï¼å¦æaction1éæ¯ServletActionContext.getRequest().setAttribute("name", "ACTION1"); action1.jspéç´æ¥ç¨request.getAttributeå°±å¯ä»¥
è¿æ ·å°±å¯ä»¥æå个模ååç¬ç¨ä¸ä¸ªjspæ件ä¿åï¼å个主页é¢åªéè¦å®ä¹HTMLçå¸å±ï¼å°±å¯ä»¥æå个模åå
å«è¿æ¥ï¼å个主页é¢éè¦é£ä¸ªæ¨¡åå°±å个<s:action name="xxx" executeResult="true" namespace="/" />,模åéå¤ä½¿ç¨ã
温馨提示:内容为网友见解,仅供参考