Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot Load Servlet from JSP  RSS feed

 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

I use NetBeans and the project is configured using Sun Application sErver. I created a normal jsp page & am calling LoginServlet from the action of the form.

LoginServlet is located at Source Folder- appSys/LoginServlet & is mapped as /LoginServlet in web.xml

When I click Submit on the form, it shows the following :
HTTP Status 404 -

--------------------------------------------------------------------------------

type Status report

message

descriptionThe requested resource () is not available.


--------------------------------------------------------------------------------

Sun Java System Application Server 9.1_01

404 means file not found. in action I tried "appSys/LoginSErvlet" & "/LoginServlet" - both shows the same results. appSys is the package name declared while creating a java file i.e. LoginServlet.java

No other changes have been made to the default NetBeans settings. Remember, the application server is in the running stage.

Kindly help me out for the problem. I tried a lot, but don't know where am I going wring. Please help me at the earliest.

Thanks
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trupti Mehta wrote: in action I tried "appSys/LoginSErvlet" & "/LoginServlet"



try this
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either the servlet is not been placed in a package, or not compiled at all, or not been placed in the classpath, or not there in the classpath where you think it is, or the servlet mapping in web.xml is bogus, or the form action value is bogus.
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post your web.xml file contents here......???

 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Seetharaman Venkatasamy, your code helped me, it runs the servlet. Thanks once again.

seetharaman venkatasamy wrote:
try this
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although it works, it is not the way to "solve" this problem.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!