1.我定义了struts-android.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="androidPackage" extends="struts-default">
<action name="enterpriseAction" class="jnew.action.android.servlet.EnterpriseInfoServlet">
<result name="success">admin/login.jsp</result>
</action>
</package>
</struts>
2.把struts2-android.xml文件包含到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>
<constant name="struts.action.extension" value="do" />
<constant name="struts.i18n.encoding" value="GBK"></constant>
<include file ="struts-default.xml" />
<include file ="struts-manage.xml" />
<include file ="struts-news.xml" />
<include file ="struts-enterprise.xml" />
<include file ="struts-trade.xml" />
<include file ="struts-member.xml" />
<include file ="struts-pub.xml" />
<include file ="struts-android.xml"/>
<package name="loginPackage" extends="struts-default">
<action name="login" class="jnews.action.SystemAction" method="login">
<result name="input">admin/login.jsp</result>
<result name="success">admin/admin_main.html</result>
</action>
<action name="closeSystem" class="jnews.action.SystemAction" method="closeSystem">
<result name="success">admin/login.jsp</result>
</action>
</package>
3.我的web.xml文件配置是<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> 4我往地址栏输入的地址是http://localhost:8080/daxing/enterpriseAction.do daixing是我的项目名
5.我报的错误是HTTP Status 404 - There is no Action mapped for namespace / and action name enterpriseAction.--------------------------------------------------------------------------------type Status reportmessage There is no Action mapped for namespace / and action name enterpriseAction.description The requested resource is not available.
struts2 404
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<package name="androidPackage" extends="struts-default">
<action name="enterpriseAction" class="jnew.action.android.servlet.EnterpriseInfoServlet">
<result name="success">admin/login.jsp</result>
</action>
</package>
</struts>
2.把struts2-android.xml文件包含到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>
<constant name="struts.action.extension" value="do" />
<constant name="struts.i18n.encoding" value="GBK"></constant>
<include file ="struts-default.xml" />
<include file ="struts-manage.xml" />
<include file ="struts-news.xml" />
<include file ="struts-enterprise.xml" />
<include file ="struts-trade.xml" />
<include file ="struts-member.xml" />
<include file ="struts-pub.xml" />
<include file ="struts-android.xml"/>
<package name="loginPackage" extends="struts-default">
<action name="login" class="jnews.action.SystemAction" method="login">
<result name="input">admin/login.jsp</result>
<result name="success">admin/admin_main.html</result>
</action>
<action name="closeSystem" class="jnews.action.SystemAction" method="closeSystem">
<result name="success">admin/login.jsp</result>
</action>
</package>
3.我的web.xml文件配置是<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> 4我往地址栏输入的地址是http://localhost:8080/daxing/enterpriseAction.do daixing是我的项目名
5.我报的错误是HTTP Status 404 - There is no Action mapped for namespace / and action name enterpriseAction.--------------------------------------------------------------------------------type Status reportmessage There is no Action mapped for namespace / and action name enterpriseAction.description The requested resource is not available.
struts2 404
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货