struts2在struts.xml配置多个action时的问题

peijh peijh 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想在一个struts.xml中配置多个action,这些action是在同一个包里的
struts.xml
<?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>
<package name="logintest" namespace="/example" extends="struts-default">
<action name="myuser" class="login.LoginAction" method="execute">
<result name="success">/welcome.jsp</result>
<result name="login">/login.jsp</result>
</action>


<action name="mycheck" class="login.CheckAction" method="execute">
<result name="yes">/yes.jsp</result>
<result name="no">/no.jsp</result>
</action>
</package>
</struts>
只有第一个action可以访问,第二个就访问不了了,500错误
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

第一个action的url:http://localhost:8099/mystruts2/example/myuser
第二个action的url:http://localhost:8099/mystruts2/example/mycheck

各位高手指点一下,在同一个package配置多个action需要注意些什么
...全文
评论 29
收藏 已收藏
分享
返回顶部
peijh
Web 开发 81,108 成员 341,720 内容