Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problem while connecting to a servlet from JSP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is already one topic in this forum for same topic but as it is locked I'm not able to add anything there..
If there is a way to do it sorry for this as I don't know.

I'm not able to call my servlet from JSP....
My directory structure is

TestApp
|---index.html (login page)
|---WEB-INF
---- |---web.xml
---- |---userLogged.jsp(shows on successful login)
---- |---classes
---- ----- |----LoginServlet.java
---- ----- |----UserBean.java
---- ----- |----UserDAO.java
---- ----- |----ConnectionManager.java

Here is the code of the <form> tag in index.jsp
<form action="LoginServlet" method="post">



Here is the code forom web.xml


When i click submit button "HTTP Status 404 - /TestApp/LoginServlet

Description : The requested resource is not available."
error is showing.

The error must be due to url/path mistake or something else which i'm not able to figure out.
Please help
 
Rancher
Posts: 1041
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tushar Bhujbal wrote:
Here is the code of the <form> tag in index.jsp
<form action="LoginServlet" method="post">

<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/logserv</url-pattern>
</servlet-mapping>



The action of the form is "LoginServlet", which does not match the url-pattern.
 
Tushar Bhujbal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ivan :
Thank you...it worked "/" in the action was giving problem apart from attribute value
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic