• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why my servlet not working

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the ServletsFAQ page?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
reply
    Bookmark Topic Watch Topic
  • New Topic