Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why my servlet not working

 
Ajharul Abedeen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted the same problem but unable to edit that post, for that uploaded again.
Servlet Code Example

I am very upset cause  i am unable to run servlet code. I have downloaded tomacat server and extracted it into my D drive and then copy and the past the my servlet code folder into the web apps folder. The Servelt code i have shared by google drive and the link has given above.
Form command prompt i have started the server by typing the following command
D:\apache-tomcat-7.0.70-windows-x64\apache-tomcat-7.0.70\bin>startup.bat
And confirmed that browser started successfully by typing localhost:8080 in the browser. and also the console with message that server start up in 1920ms come.
Then i typed the following url in my browser but it showing nothing in the server console..
http://localhost:8080/lifecycle/life
Please tell me what the wrong i have made.
It showing the following error..

HTTP Status 404 - /lifecycle/life

type Status report

message /lifecycle/life

description The requested resource is not available.

Apache Tomcat/7.0.70

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65340
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the ServletsFAQ page?
 
Alexander Brank
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I see your web.xml and you have to add the fully-qualified class name of the servlet in <servlet-class> tag.

For example, where com.action is the package name and JsonServlet is the name of the servlet.

<servlet>
    <servlet-name>JsonServlet</servlet-name>
    <servlet-class>com.action.JsonServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>JsonServlet</servlet-name>
    <url-pattern>/JsonServlet/*</url-pattern>
  </servlet-mapping>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic