struts2在struts.xml配置多个action时的问题
我想在一个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需要注意些什么
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需要注意些什么
...全文
相关推荐
Struts2的bug----------关于Struts2中找不到Action的
NULL 博文链接:https://tianhandigeng.iteye.com/blog/995031
Struts2+Hibernate Action+struts.xml+jsp
NULL 博文链接:https://chaoyi.iteye.com/blog/2161842
初次配置Struts2环境碰到的一系列问题汇总
工程创建过程截图及源码 博文链接:https://lgsun592.iteye.com/blog/865723
·Struts2配置文件介绍 超级详细
·Struts2配置文件介绍 struts.xml action package ·Struts2配置文件介绍 struts.xml action package
struts2中常用Result类型(type)的用法和出现的问题
struts2 常用Result类型(type)的用法 Invalid result location value/parameter错误的解决办法


Web 开发
