Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how a servlet calls for another servlet  RSS feed

 
mazoun yusuf
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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
 
Bharath Prathipati
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!