• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem in deploying a servlet

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,

I am having an problem in deploying a servlet.
Its like i have created the following directory structure in my tomact's webapps directory:

servletAPI/WEB-INF/classes/basicServlets/BasicServlet.class

My BasicServlet.java is in the package named 'basicServlets'.

Now when i am executing the following URL in the address bar:

http://localhost:8080/servletAPI/servlet/basicServlets.BasicServlet

the tomcat is displaying an error message that the resource is not available.

But when i am putting the same basicServlets/BasicServlet.class in the

examples/WEB-INF/classes/basicServlets/BasicServlet.class

it is getting executed exactly.

So could anybody please tell me what might be the problem with my

servletAPI/WEB-INF/classes/basicServlets/BasicServlet.class

directory structure.

Thanking you,
Jignesh
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The servlets-example app uses an invoker servlet.
The global invoker has been disabled in all but the oldest versions of Tomcat.
You can read why here: http://faq.javaranch.com/view?InvokerServlet

Mapping a servlet is very easy.



Try using that as your deployment descriptor (web.xml).

Then access your servlet with the following URL:
http://localhost:8080/servletAPI/BasicServlet
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic