Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running Servlet

 
Kumar Navin
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
Pls Guide me how do I run and check my servlets locally ? Am not getting any tool such as servletrunner as was in jsdk2.0. Currently am using j2sdkee1.4 whose bin directory is having only batch files and no exe to run.
Else tell me how do I run my servlets in Weblogic 8.1, i.e where to place the file and how to call it from the browser.
Thanks in advance.

-Navin.
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kumar Navin:
Dear Friends,
Else tell me how do I run my servlets in Weblogic 8.1, i.e where to place the file and how to call it from the browser.
Thanks in advance.

-Navin.

That is a rather broad question and is not one that can be answered with any proper justification in a few sentences. The short answer is you need to place the Servlet class, following proper package naming conventions for any subdirectories, within the <web-root>/WEB-INF/classes directory of your web application. You then need to configure the web.xml file (which is located in the WEB-INF directory) to map a URL or URL pattern to your Servlet.

You can take a look at the FAQ topic The Invoker Servlet which give a brief description of how to set up a servlet mapping in the web.xml file. Also take a look at the Weblogic documentation, From what I've seen of it, it is some of the better documentation out there. Lastly there are many good books available on the subject. Most any book on Servlets or JSP will have a chapter on servlet deployment within a Web Application. Take a look at the webpage(http://www.moreservlets.com) for the book More Servlets and JavaServer Pages. One of the sample chapters is on setting up the web.xml file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic