Problemer med Tomcat og Web-xml
Hej vi skal have et program til at køre på en Tomcat server.vi får følgende fejl besked fra Tomcat når vi kører vores login.jsp, der kalder en servlet.
HTTP Status 404 - /TT0325/servlet/timetrack.servlets.LoginServlet
--------------------------------------------------------------------------------
type Status report
message /TT0325/servlet/timetrack.servlets.LoginServlet
description The requested resource (/TT0325/servlet/timetrack.servlets.LoginServlet) is not available.
--------------------------------------------------------------------------------
Vi mener at det er i vores web-xml dokument at fejlen ligger. her er vores web-xml- samt jsp filen:
JSP fil __________________
<%--
Login side til Time Track
--%>
<jsp:useBean id="loginUser" class="timetrack.model.User" scope="session"></jsp:useBean>
<jsp:useBean id="errMsg" class="java.lang.String" scope="session"></jsp:useBean>
<?xml version="1.0" encoding="WINDOWS-1252" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ page
language="java"
contentType="text/html; charset=WINDOWS-1252"
pageEncoding="WINDOWS-1252"
%>
<meta http-equiv="Content-Type"
content="text/html; charset=WINDOWS-1252" />
<meta name="GENERATOR" content="IBM WebSphere Studio" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="theme/Master.css" rel="stylesheet" type="text/css" />
<title>Time Track</title>
</head>
<body>
<table border="0" width="937">
<tbody>
<tr>
<td valign="top" width="197">
<table class="menu">
<tbody>
<tr>
<td colspan="2"><font size="+3">Time Track </font></td>
</tr>
<tr>
<td colspan="2">
<hr />
</td>
</tr>
<tr>
<td width="183">Time Registration</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">
<ul>
<li class="disabledLink">Register Time</li>
</ul>
</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">History</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">
<ul>
<li class="disabledLink">Project</li>
<li class="disabledLink" User>user</li>
</ul>
</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">User</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">
<ul>
<li class="disabledLink">New</li>
<li class="disabledLink">Edit</li>
</ul>
</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">Project</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">
<ul>
<li class="disabledLink">New</li>
<li class="disabledLink">Edit</li>
<li class="disabledLink">Activity</li>
</ul>
</td>
<td width="10"></td>
</tr>
<tr>
<td width="183">Logged in</td>
<td width="10"></td>
</tr>
<tr>
<td width="183"></td>
<td width="10"></td>
</tr>
<tr>
<td width="183" height="180" valign="top">
</td>
<td width="10"></td>
</tr>
<tr>
</tr>
</tbody>
</table>
</td>
<td valign="top" width="800" align="center">
<!-- Indhold i hovedvinduet -->
<%=errMsg%>
<br />
<h2> <br />
<br />Time
Track Login</h2>
<form method="post"
action="servlet/timetrack.servlets.LoginServlet"><table border="0">
<tbody>
<tr>
<td></td>
<td>Initials</td>
<td><input type="text" name="initials" size="3" maxlength="3" /></td>
<td>Password</td>
<td><input type="password" name="password" size="20"
maxlength="12" /></td>
<td><input type="submit" name="login" value="Login" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</tbody>
</table>
</script>
</body>
</html>
Web xml_____________________
<?xml version="1.0" encoding="UTF-8"?>
<!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 id="WebApp">
<display-name>TimeTrack0202</display-name>
<servlet>
<servlet-name>ActivityServlet</servlet-name>
<display-name>ActivityServlet</display-name>
<servlet-class>timetrack.servlets.ActivityServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>NewUserServlet</servlet-name>
<display-name>NewUserServlet</display-name>
<servlet-class>timetrack.servlets.NewUserServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ProjectEditIniServlet</servlet-name>
<display-name>ProjectEditIniServlet</display-name>
<servlet-class>timetrack.servlets.ProjectEditIniServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ProjectEditServlet</servlet-name>
<display-name>ProjectEditServlet</display-name>
<servlet-class>timetrack.servlets.ProjectEditServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>ProjectNewServlet</servlet-name>
<display-name>ProjectNewServlet</display-name>
<servlet-class>timetrack.servlets.ProjectNewServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>TimeRegServlet</servlet-name>
<display-name>TimeRegServlet</display-name>
<servlet-class>timetrack.servlets.TimeRegServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>UserEditServlet</servlet-name>
<display-name>UserEditServlet</display-name>
<servlet-class>timetrack.servlets.UserEditServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>UserShadowAdminServlet</servlet-name>
<display-name>UserShadowAdminServlet</display-name>
<servlet-class>timetrack.servlets.UserShadowAdminServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>CommentServlet</servlet-name>
<display-name>CommentServlet</display-name>
<servlet-class>timetrack.servlets.CommentServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<display-name>LoginServlet</display-name>
<servlet-class>timetrack.servlets.LoginServlet</servlet-class>
</servlet>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
er der nogle der kan se hvorfor vi får den fejlbesked