• Post Reply 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

WAS 5.0 and Servlets (web.xml)

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am having a little trouble with Websphere 5.0 and a little login Servlet, basically I have created my loginservlet and jsp pages, zipped them all up into a .war file (the structure is correct) and installed it into WAS5.0 with no problem.

The problem comes when I click on the 'login' button. Now the jsp should call the login Servlet (LoginServlet) but instead I get a URL not found on this server, error.

Here is a brief description of what/where the files are kept and the 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_1136296849094">
<servlet id="Servlet_1136296848734">
<servlet-name>LoginServlet</servlet-name>
<servlet-class>uk.co.domain.servlets.LoginServlet</servlet-class>
</servlet>
<servlet-mapping id="ServletMapping_1136296849094">
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
</web-app>

WAS 5.0 installed under:
C:\Program Files\WebSphere\AppServer

And my servlet is under:
...\installedApps\devsrv\domain.ear\domain.war\WEB-INF\classes\uk\co\domain\servlets\LoginServlet.class

login.jsp uses the following form:
<form name="frmLogin" action="/LoginServlet" method="POST">
...
</form>

Error:
The requested URL /LoginServlet was not found on this server.

Any help would be greatly appreciated, this is doing my nut!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Secker,

What is the target url in the "html form", where you are doing a submit?

If your target url is /LoginServlet, then you should have an url entry in web.xml.

sample,


<servlet>
<servlet-name>LoginServlet</servlet-name>
<display-name>LoginServlet</display-name>
<servlet-class>com.whereever.LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>

Make an entry for your target in the web.xml and try it.

[ January 03, 2006: Message edited by: Deepak Shankar ]
[ January 03, 2006: Message edited by: Deepak Shankar ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic