Win a copy of Java Challengers this week in the Java in General forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Problem with Apache Tomcat 5.5.12 and calling Servlets

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
https://coderanch.com/t/85684/Tomcat/Tomvat-having-trouble-finding-Servlets
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic