Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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

 
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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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
 
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. :-)
 
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

reply
    Bookmark Topic Watch Topic
  • New Topic