Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

url-rewriting

Status
Not open for further replies.

anithashetty

Programmer
May 6, 2003
25
IN
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(&quot;<html>&quot;);
out.println(&quot;<body>&quot;);
out.println(name);
out.println(&quot;<form id='frm' name='frm' action= method='get'>&quot;);
out.println(&quot;<input type=submit>&quot;);
out.println(&quot;</form>&quot;);
out.println(&quot;</body>&quot;);
out.println(&quot;</html>&quot;);


}
}

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(&quot;text/html&quot;);
PrintWriter out = res.getWriter();
String name=req.getParameter(&quot;ite&quot;);
out.print(&quot;<html><body>hjdhfjhdf+'&quot; + name + &quot;'</body></html>&quot;);


}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top