• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jasim Aboobacker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Ashutosh M Kulkarni
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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. :-)
 
Syed Islam
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic