| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 973 人关注过本帖
标题:servlet
只看楼主 加入收藏
ych2806
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-5-11
收藏
 问题点数:0 回复次数:2 
servlet
我运行个源码。出现下列错误
type Status report

message /JavaLibrary/servlet/sjservlets.LoginProcess

description The requested resource (/JavaLibrary/servlet/sjservlets.LoginProcess) is not available.

我怀疑我的路径有错误?但不知道哪点;
这是我的登陆页面;
<%@ include file="../common/common.jsp" %>
<%  response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cahce");
%>
<%@ page language="java"  pageEncoding="GB2312" %>
<html>
<head>
<title>Library Management System : Login</title>
<META NAME="description" CONTENT="">
<META NAME="keywords" CONTENT="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
   A:link                  { text-decoration:  none; font-weight: bold; color: #660033}
   A:active                { text-decoration:  none; font-weight: bold; color: #660033}
   A:visited               { text-decoration:  none; font-weight: bold; color: #336699}
   A:hover                 { text-decoration:  underline; font-weight: bold; color: #FF9999}
.footerLink {  font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: bold; color: #000099}
-->
</style>
</head>

<body bgcolor="#0099ff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="">
<a name="top"></a>
<%@ include file="../common/header_select.jsp" %>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#f1f1f1">
    <td width="180" align="left" valign="top">
      <%@ include file = "../common/navi.jsp" %>
    </td>
        <TD width=1 bgColor=#999999><IMG height=1 alt=""
      src="../images/common/1ptrans.gif"
      width=1 border=0></TD>
    <td valign="top" width="100%" bgcolor="#f1f1f1"><center>
<%
    // Checking either had login or not, if not then display login menu
    if (login.isUserLogin()) { %>
    <% out.println("Hey... U already login as: <b>"); %> <jsp:getProperty name="login" property="userID" />
    <% out.println("</b><br>So... wanna to logout?"); %>
    <form name="frmLogout" action="/JavaLibrary/servlet/sjservlets.LogoutProcess" method="post"">
        <input type="submit" name="Submit" value="Logout">
    </form>
<%    } else { %>
  <form name=login action="/JavaLibrary/servlet/sjservlets.LoginProcess" method="post">
    <p><img src="../images/login/header.gif" width="538" height="85"></p>
    <table width=225 border=0 cellpadding=3>
      <tr>
        <td colspan=2>
          <center>
            <font size="+2"><b><img src="../images/login/login.gif" width="85" height="115">Login</b></font>
          </center>
        </td>
      </tr>
      <tr>
        <td>账号:</td>
        <td>
          <input type=text name=loginname>
        </td>
      </tr>
      <tr>
        <td>密码:</td>
        <td>
          <input type=password name=password>
        </td>
      </tr>
      <tr>
        <td colspan=2 align=center>
          <input type=submit value="登陆" name="Submit">
        </td>
      </tr>
    </table>
  </form>
<%    } %>
</center><hr>
<p align="center"><font size="+2"><img src="../images/login/small_logo.gif" width="37" height="46"></font><font face="arial, helvetica" size="-1">(c)
  2008,zzu ych</font> </td>
  </tr>
</table>
<jsp:include page="../common/footer.jsp" flush="true" />
</body>
</html>
这是我的web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.

<web-app>
  <servlet>
    <servlet-name>
      ShowMsg
    </servlet-name>

    <servlet-class>
      coreservlets.ShowMessage
    </servlet-class>

    <init-param>
      <param-name>
        message
      </param-name>
      <param-value>
        Shibboleth
      </param-value>
    </init-param>

    <init-param>
      <param-name>
        repeats
      </param-name>
      <param-value>
        5
      </param-value>
    </init-param>
  </servlet>

   <servlet>
        <servlet-name>LoginProcess</servlet-name>
        <servlet-class>sjservlets.LoginProcess</servlet-class>
    </servlet>
   
      <servlet-mapping>
        <servlet-name>LoginProcess</servlet-name>
        <url-pattern>/LoginProcess</url-pattern>
    </servlet-mapping>
   
    <servlet>
        <servlet-name>FormProcess</servlet-name>
        <servlet-class>sjservlets.FormProcess</servlet-class>
    </servlet>
   
      <servlet-mapping>
        <servlet-name>FormProcess</servlet-name>
        <url-pattern>/FormProcess</url-pattern>
    </servlet-mapping>


</web-app>

我的LoginProcess在WEB-INF\classes\sjservlets下面;
大虾们帮帮啊!!!
搜索更多相关主题的帖子: servlet 
2008-05-11 09:11
菜鸟也疯狂
Rank: 1
等 级:新手上路
帖 子:134
专家分:0
注 册:2007-3-20
收藏
得分:0 
The requested resource (/JavaLibrary/servlet/sjservlets.LoginProcess) is not available.应该是Action请求路径的问题:你这里的路径应该是要跟你xml文件里配置里的一致。

2008-05-11 23:40
ltdtfking
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2007-10-7
收藏
得分:0 
在界面上提示的是什么错误,404还是500如果是404的话那就是你路径有问题.你的servelt没有问题
2008-05-16 11:21
快速回复:servlet
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013742 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved