anithashetty
Programmer
how to pass parameter from one servlet to another using url-rewriting.
my first servlet contains code as follows
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ur extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html"
PrintWriter out = res.getWriter();
String name=req.getParameter("ite"
out.println("<html>"
out.println("<body>"
out.println(name);
out.println("<form id='frm' name='frm' action= method='get'>"
out.println("<input type=submit>"
out.println("</form>"
out.println("</body>"
out.println("</html>"
}
}
second servlet contains code as follows
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ur1 extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html"
PrintWriter out = res.getWriter();
String name=req.getParameter("ite"
out.print("<html><body>hjdhfjhdf+'" + name + "'</body></html>"
}
}
my first servlet contains code as follows
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ur extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html"
PrintWriter out = res.getWriter();
String name=req.getParameter("ite"
out.println("<html>"
out.println("<body>"
out.println(name);
out.println("<form id='frm' name='frm' action= method='get'>"
out.println("<input type=submit>"
out.println("</form>"
out.println("</body>"
out.println("</html>"
}
}
second servlet contains code as follows
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class ur1 extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
res.setContentType("text/html"
PrintWriter out = res.getWriter();
String name=req.getParameter("ite"
out.print("<html><body>hjdhfjhdf+'" + name + "'</body></html>"
}
}