This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Easy question (kind of)  RSS feed

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet that needs to execute an HTML file when a submit button is pressed. The HTML file is called LogOff.html, the code I'm using is shown below:


However this does not work, the browser keeps coming up with a STATUS 404 message saying:-

The requested resource (/servlet/LogOff.html) is not available.

Does any one know how to resolve this?
Thanks
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first step is to stop using the InvokerServlet, you should never refer to a servlet as /context/servlet/MyServlet.

You can either give a relative path ie ../LogOff.html or add the context and give an absolute reference ie request.getContextPath()+"/LogOff.html"
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much, I used the relative path "../someFile.html"
and that works, cheers.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please consider the first point mentioned. If you do not get used to configuring your Servlets correctly it will only cause you pain in the long run.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!