Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Problem with Apache Tomcat 5.5.12 and calling Servlets

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi guys, hope you can help...

I have two Servlets, one called LoginServlet & another called UploadServlet.

The problem I am having is, whilst my program will call/run the LoginServlet fine. When I
come to calling the UploadServlet, I get the following page error:

HTTP Status 404 - /admin/secure/uploader/UploadServlet
--------------------------------------------------------------------------------
type Status report
message /admin/secure/uploader/UploadServlet
description The requested resource (/admin/secure/uploader/UploadServlet) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.12

There appears to be no error in the Tomcat logs to help explain what is going on. It's just like the Servlet class just isn;t
physically there (obviously it is).

Could someone help, it's really holding me up at the moment.

(Below are some details of file locations and stuff to help you out).

JSP location:
C:\Java\Tomcat 5.5\webapps\web\secure\uploader\upload.jsp

Form that calls Servlet:
<form name="frmUploader" action="UploadServlet" method="POST">

Servlet package:
package uk.co.domain.servlets;

Servlet class location:
C:\Java\Tomcat 5.5\webapps\web\WEB-INF\classes\uk\co\domain\servlets\UploadServlet.class

web.xml location:
C:\Java\Tomcat 5.5\webapps\web\WEB-INF\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_1136308273688">
<servlet id="Servlet_1136308272594">
<servlet-name>LoginServlet</servlet-name>
<servlet-class>uk.co.domain.servlets.LoginServlet</servlet-class>
</servlet>
<servlet id="Servlet_1136308272595">
<servlet-name>UploadServlet</servlet-name>
<servlet-class>uk.co.domain.servlets.UploadServlet</servlet-class>
</servlet>

<servlet-mapping id="ServletMapping_1136308273704">
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
<servlet-mapping id="ServletMapping_1136308273705">
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/UploadServlet</url-pattern>
</servlet-mapping>

<welcome-file-list id="WelcomeFileList_1136308273703">
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
 
Amit Kumar Kaushik
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
change the folloing line and try again.

<form name="frmUploader" action="http:\\localhost:8080\web\UploadServlet" method="POST">


or



<form name="frmUploader" action="/web/UploadServlet" method="POST">
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
K Secker,

Please don't ask the same question multiple times in the same forum.
If the details from your first thread have changed, update that one.

Please continue this conversation in the original thread:
http://www.coderanch.com/t/85684/Tomcat/Tomvat-having-trouble-finding-Servlets
 
    Bookmark Topic Watch Topic
  • New Topic