急!!!明天交 100 分求!!!
nieweiqi
|
1#
nieweiqi 发表于 2007-01-09 21:06
急!!!明天交 100 分求!!!
怎么web.xml 中的servlet mapping 不起作用!!!
代码如下: <?xml version= "1.0 " encoding= "ISO-8859-1 "?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN " "http://java.sun.com/dtd/web-app_2_3.dtd "> <web-app> <display-name> Welcome to Tomcat </display-name> <description> Welcome to Tomcat </description> <filter> <filter-name> Set Character Encoding </filter-name> <filter-class> filters.SetCharacterEncodingFilter </filter-class> <init-param> <param-name> encoding </param-name> <param-value> gb2312 </param-value> </init-param> </filter> <filter-mapping> <filter-name> Set Character Encoding </filter-name> <url-pattern> /* </url-pattern> </filter-mapping> <servlet> <servlet-name> login </servlet-name> <servlet-class> login.Login </servlet-class> </servlet> <servlet-mapping> <servlet-name> login </servlet-name> <url-pattern> servlet/login </url-pattern> </servlet-mapping> <servlet> <servlet-name> register </servlet-name> <servlet-class> register.Register </servlet-class> </servlet> <servlet-mapping> <servlet-name> register </servlet-name> <url-pattern> /servlet/register </url-pattern> </servlet-mapping> <servlet> <servlet-name> addgood </servlet-name> <servlet-class> admin.AddGood </servlet-class> </servlet> <servlet-mapping> <servlet-name> addgood </servlet-name> <url-pattern> /servlet/addgood </url-pattern> </servlet-mapping> <servlet> <servlet-name> delgood </servlet-name> <servlet-class> admin.DelGood </servlet-class> </servlet> <servlet-mapping> <servlet-name> delgood </servlet-name> <url-pattern> /servlet/delgood </url-pattern> </servlet-mapping> <servlet> <servlet-name> modigood </servlet-name> <servlet-class> admin.ModiGood </servlet-class> </servlet> <servlet-mapping> <servlet-name> modigood </servlet-name> <url-pattern> /servlet/modigood </url-pattern> </servlet-mapping> <servlet> <servlet-name> operate </servlet-name> <servlet-class> custom.Operate </servlet-class> </servlet> <servlet-mapping> <servlet-name> operate </servlet-name> <url-pattern> /servlet/operate </url-pattern> </servlet-mapping> <servlet> <servlet-name> makeorder </servlet-name> <servlet-class> custom.MakeOrder </servlet-class> </servlet> <servlet-mapping> <servlet-name> makeorder </servlet-name> <url-pattern> /servlet/makeorder </url-pattern> </servlet-mapping> <servlet> <servlet-name> realizeorder </servlet-name> <servlet-class> admin.RealizeOrder </servlet-class> </servlet> <servlet-mapping> <servlet-name> realizeorder </servlet-name> <url-pattern> /servlet/realizeorder </url-pattern> </servlet-mapping> </web-app> 第一个请求如下: <%@ page contentType= "text/html;charset=gb2312 "%> <script language= "JavaScript "> function checkform(form) { if(form.username.value== " "||form.userpasswd.value== " "){ alert( "用户名或密码为空! "); return false; } return true; } </script> <html> <head> <title> Untitled Document </title> <meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 "> <br> <br> <br> <br> <br> <body> <form method=post action= "/servlet/login " onsubmit= "return checkform(this) "> <table width=500 border=0 height=300 align=center cellspacing=0 cellpadding=0 bgcolor=ffcc00> <tbody> <tr height= "20% "> <td align= "center "> <br> <br> <font size=6> <b> 物流管理系统 </b> </font> </td> </tr> <tr height= "70% "> <td> <table width= "100% "> <tbody> <tr height= "30% "> <td width= "49% " align= "right "> <font size=5> 角 色: </font> </td> <td width= "51% " align= "left "> <select name= "role "> <option value= "0 "> 管理员 </option> <option value= "1 "> 客户 </option> </select> </td> </tr> <tr height= "30% "> <td align= "right "> <font size=5> 用户名: </font> </td> <td align= "left "> <input type=text name= "username " size=15> </td> </tr> <tr height= "30% "> <td align= "right "> <font size=5> 密 码: </font> </td> <td align= "left "> <input type=password name= "userpasswd " size=15> </td> </tr> <tr height= "30% "> <td height= "28 " align= "right "> <br> <input type= "submit " value= "确定 "> </td> <td align= "left "> <br> <input type= "reset " value= "重置 "> </td> </tr> </tbody> </table> </td> </tr> <tr height= "10% "> <td> <table width= "100% "> <tbody> <tr> <td align= "right "> <font size=5> 新用户请点击这里 <a href= "register.jsp "> <b> 注册 </b> </a> </font> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </form> </body> </html> 在线请教!!! |