*_*这样我知道是可以正常执行下去的,如果name="actionname.*" method="{1}"这样,就完全不行了,就连action类都进不去(我特地写构造函数,发现没执行,根本没生成实例),请问要怎么做才能正常显示。最好是比如<action name="student.*" class="com.oa.StudentAction" method="{1}">
当输入student.add.xhtml这样,就会进入该action的add方法。是不是要通过拦截器?拜谢!
<action name="student.*" class="com.oa.StudentAction" method="{1}">
å¦æä½ å¨struts.xmléè¿æ ·åçè¯ï¼
student.add.xhtmlè¿æ ·ç请æ±æç说 åºè¯¥ç±å®æ¥å¤çï¼å¦æactionè¿ä¸å»çè¯ï¼
å¯ä»¥æ£æ¥ä¸web.xmléç
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
ä½ çç ä½ åç<url-pattern>å¼æ¯ä»ä¹ï¼ä¸ªäººè®¤ä¸ºå¯è½è·å®æå ³ç³»å§
å¦æä½ å¨struts.xmléè¿æ ·åçè¯ï¼
student.add.xhtmlè¿æ ·ç请æ±æç说 åºè¯¥ç±å®æ¥å¤çï¼å¦æactionè¿ä¸å»çè¯ï¼
å¯ä»¥æ£æ¥ä¸web.xmléç
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
ä½ çç ä½ åç<url-pattern>å¼æ¯ä»ä¹ï¼ä¸ªäººè®¤ä¸ºå¯è½è·å®æå ³ç³»å§
温馨提示:答案为网友推荐,仅供参考