设置struts2的默认页,设置struts2默认页,在struts2中默认情
分享于 点击 16197 次 点评:81
设置struts2的默认页,设置struts2默认页,在struts2中默认情
在struts2中默认情况下都需要指定action的名称,可以通过配置设置默认路径/对应的action,例如下面的地址:
http://localhost:8080/user/
需要在strtus.xml文件中配置<default-action-ref />配置,如下示例配置:
<package name="home" namespace="/user" extends="struts-default"> <default-action-ref name="index" /> <action name="index" class="cn.outofmemory.actions.HomeAction"> <result name="success">user/index.jsp</result> </action></package>
用户点评