• 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

how a servlet calls for another servlet

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a servlet named ServerReq.java and in which there is a piece of code which calls for another servlet.
here is the snippet

public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException,java.io.IOException

{
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();

out.println("<html>");
out.println("<head>");
out.println("<title>Servlet</title>");
out.println("</head>");
out.println("<FORM method =post action= http://localhost:8080/d/DisplayTasks>");
out.println("<body>");
out.println("<SELECT id=select1 name=select1 >");

can someone help me and tell me if the part below has been properly written:

out.println("<FORM method =post action= http://localhost:8080/d/DisplayTasks>");

or another war to link a servlet to another one

thanks
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You need not give the entire path (http://localhost/.....) .. just make sure that the class file corresponding to the servlet which you are calling is also present in the "classes/" directory of WEB-INF (or any other folder which you have chosen to be your classes container) and then you can invoke the servlet by giving action="/classfile"/.

hope this helps you,

regards,
royal
 
I am Arthur, King of the Britons. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic