Results 1 to 3 of 3
  1. #1
    mutuah is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default response.sendRedirect(url)

    Hi all.

    1: Am trying to pass a couple of parameters from servlet to jsp page thru url re-writing, but i dont seem to make it. Here is my part of syntax: response.sendRedirect("editPerson.jsp?prov=prov&di st=dist"); I want to assign parameter prov to prov and dist to dist. Thru this approach, am trying to avoid creating a session. Anyone can help?

    2: Is there a limit to a number of sessions one can create in a jsp/servlet project?

    Thanks in advance.

  2. #2
    mutuah is offline Member
    Join Date
    Jul 2007
    Posts
    9
    Rep Power
    0

    Default

    I have sorted my problem BUT one more problem cropped up. This is how i did:
    String paramString = "prov="+prov + "dist="+dist+"div="+div+
    "loc="+loc+"subloc="+subloc+"eano="+eano+"hhldno=" +hhldno+
    "eano="+eano+"serial="+serial+"name="+name+
    "relate="+relate+"sex="+sex+"age="+age+"mstatu s="+
    m_status+"educ="+educLevel;
    response.sendRedirect("editPerson.jsp?"+paramStrin g);

    Whenever the parameters are sent to jsp, they all go to prov textbox. I want to pass all the parameters to various textboxes. I have used
    <&#37;
    String prov = request.getParameter("prov");
    String dist = request.getParameter("dist");
    String div = request.getParameter("div");
    String loc = request.getParameter("loc");
    String subloc = request.getParameter("subloc");
    String eano = request.getParameter("eano");
    String hhldno = request.getParameter("hhldno");
    String serial = request.getParameter("serial");

    String name = request.getParameter("name");
    String relate = request.getParameter("relate");
    String sex = request.getParameter("sex");
    String age = request.getParameter("age");
    String mstatus = request.getParameter("mstatus");
    String educ = request.getParameter("educ");
    %>
    to read the values from servlet.

    What else do i do?????????

  3. #3
    Join Date
    Aug 2007
    Posts
    2
    Rep Power
    0

    Default

    Next you have to pass the values to your textboxes:

    <input name="txtProv" type="textbox" value="<%=prov %>" />

    In place of value in all textboxes, write "<%=the variable name holding the value%>"

Similar Threads

  1. response.setContentType
    By bbq in forum Java Servlet
    Replies: 3
    Last Post: 01-17-2012, 05:37 PM
  2. sendredirect not working
    By ranga in forum Java Servlet
    Replies: 0
    Last Post: 02-11-2008, 10:48 AM
  3. help with response.sendRedirect method
    By katie in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 02:22 AM
  4. response.sendRedirect problem
    By christina in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-03-2007, 05:23 PM
  5. Velocity / XML response
    By sabatier in forum XML
    Replies: 0
    Last Post: 07-24-2007, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •