• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Head fisrt servlets and jsp:- unable to run the first example

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am newbie to servlets and jsp. when i was trying to execute simple helloworld servlet, it is giving an error "description The requested resource (/first/HelloWorld/) is not available."

OS- > Win7
Tomcat -> 5.5

HelloWorld.java


web.xml



my directory structure is
webapps->first->WEB-INF->web.xml
webapps->first->WEB-INF->classes->HelloWorld.class

I am accesing that servlet via http://localhost:8080/first/HelloWorld

due to this error im stuck with the first example. how can i resolve this?
NB:- All those servlets and jsp examples coming with tomcat is working fine

Jasim Aboobacker
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check your Tomcat logs to see if there are any errors happening at startup. (check the "logs" directory)
 
Jasim Aboobacker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christophe

In log i can see some java.io.UnsupportedEncodingException

 
Jasim Aboobacker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

Now its working. i replaced encoding="ISO-8851-1" with encoding="ISO-8859-1" in web.xml

Thank you
 
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whoa! I didn't know encoding could also affect successful running of an application.
As the book says, we needn't memorize this all and I frankly thought it may create a glitch or two but not a total failure of the app.

Thanks for bringing this up, I can make sure to check all these things in future. :-)
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error is unbelievable, it took me ages to figure it out. I solved it thanks to this:

Now its working. i replaced encoding="ISO-8851-1" with encoding="ISO-8859-1" in web.xml

 
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