日期:2014-05-17  浏览次数:20856 次

怎么同时使用struts和servlet?
服务器后台登陆使用struts,客户端登录使用servlet,但是现在客户端action不可用,错误:

HTTP Status 404 - /em-mallServer/Login

--------------------------------------------

type Status report

message /em-mallServer/Login

description The requested resource is not available.



web:
<!-- struts配置的拦截 -->
<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>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!-- android请求的拦截 -->
<servlet>
<servlet-name>android_login</servlet-name>
<servlet-class>com.xunfang.em_mallServer.servlet.MyServlet</servlet-class>
<init-param>
<param-name>code</param-name>
<param-value>GBK</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>android_login</servlet-name>
<url-pattern>/user</url-pattern>
</servlet-mapping>


jsp:
<center>
<form action="Login" method="post" name="myform"
onsubmit="javascript:return check();">
用户名:
<input type="text" name="username">
<br>
密码:
<input type="password" name="password">
<br>
<input type="submit" value="登录">
</form>
</center>


struts:
<package name="struts2" extends="struts-default" namespace="/">
<action name="Login" class="com.xunfang.em_mallServer.action.LoginAction">
<result name="success">/main_page.jsp</result> <!-- 登录成功转到主页面 -->
<result name="failer">/index.jsp</result>
</action>


客户端处理的servlet类可以运行正常,后台请求的action出现404错误,求大神解决