websphere程序部署到tomcat上,后台登陆出现404错误
websphere里的web.xml与tomcat里的web.xml的有什么区别?
这是登陆页面里的form
<form name= "frmLogin " method= "POST " action= "checksv ">
web.xml里的
<servlet id= "Servlet_1140687778128 ">
<servlet-name> checksv </servlet-name>
<servlet-class> cms.servlets.adminLogin.checkSV </servlet-class>
</servlet>
下面是checkSV.class
package cms.servlets.adminLogin;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class checkSV
extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=GBK ";
//Initialize global variables
public void init() throws ServletException {
}
//Process the HTTP Get request
public void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
response.setContentType(CONTENT_TYPE);
checkLogCtrl checkL=new checkLogCtrl(request,response);//
String checkLog=request.getParameter( "action ");
if (checkLog!=null ){
if(checkLog.trim().equals( "checkLog ")){//后台登陆。
if(checkL.checking()){//进入后台管理首页。
System.out.print( "登陆成功! ");
response.sendRedirect( "index.jsp ");
}
else{//转发到错误页面
forward( "Errors.jsp ",request,response);
}
}
else if(checkLog.trim().equals( "logout ")){//退出登陆
request.getSession().invalidate();
forward( "login.jsp ",request,response);
}
}//if (checkLog!=null )
}
//Process the HTTP Post request
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
doGet(request, response);
}
//forward
public void forward(String objectPage,HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher disp=request.getRequestDispatcher(objectPage);
disp.forward(request,response);
}
//Clean up resources
public void destroy() {
}
}
输入帐号后出现404错误
HTTP Status 404 - /chub/cms/checksv