您的位置:首页 > 其它

访问action的注意事项

2008-07-24 13:07 169 查看
1.确定是否已经在struts.xml中进行action的配置
2.确定在该action中是否有该方法的存在
3.确定包名空间是否正确namespace="/cya"
如下配置文件:
<struts>
<package name="cya" namespace="/cya" extends="struts-default">
<interceptors>
<!-- 定义权限控制拦截器 -->
<interceptor name="authority"
class="com.topsoft.cya.web.interceptor.AuthorizationInterceptor" />
</interceptors>
<!-- 定义全局处理结果 -->
<global-results>
<result name="login">/admin/index.jsp</result>
</global-results>
<!-- 信息操作 -->
<action name="*_Info" method="{1}"
class="com.topsoft.cya.web.action.info.InfoAction">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="authority" />
<result name="ZuiXinGG">/admin/info/ZuiXinGG.jsp</result>
</action>
</package>
</struts>

4.要访问InfoAction中的某一方法时的访问路径应该如下:
cya/save_Info.action
注:save 是InfoAction类中的一个方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: