Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Servlet invocation from a WAR file  RSS feed

 
Prasad Bijur
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an EAR file which I am trying to host on WLS 6.1. The WAR file in the EAR file consists of servlets as loose classes in the WEB-INF\classes
folder. In the web.xml descriptor, I have defined one such servlet to be used and the url mapping is something like "/MyServlet". My EAR's application.xml sets the context path to be "/" so that I can access my application in this
format http://localhost:7001/. Now, the welcome file works fine when I use this URL but when I click on the link within the resultant page, it throws a 404 - File Not Found error. The link is pointing to a registered servlet in the war file. The link is something like this - "<a href="/MyServlet">Link</a>". What is the problem here? Why do I get the 404 error when I have configured the servlet to respond to "/MyServlet".
Regards,
Prasad
 
sathish kannan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Instead of using <a href="/Myservlet"> try using <a href="Myservlet"> since if u give in the first way, it will go and search the file from the root directory and the context path will be different. so to keep the context path same either u give contextpath/Myservlet or Myservlet. try and let me know what happens.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!