Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: can we add query string to the jsp file

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default can we add query string to the jsp file

    <% for(int i=0;i<al.size();++i)
    {
    app.Item item = (app.Item)al.get(i); %>

    <tr>
    <td><%= item.getCode() %> </td>
    <td><%= item.getName() %> </td>
    <td><%= item.getCost() %> </td>
    <td><a href="Edit.jsp?i="+i>modify</a> </td>
    <td><a href="Delete.jsp">delete</a> </td><br>[
    </tr>

    <% } %>

    I coudn't get the value i in Edit.jsp...plz help me..


  2. #2
    Member
    Join Date
    Nov 2013
    Location
    Bangalore, India
    Posts
    70
    My Mood
    Cool
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Default Re: can we add query string to the jsp file

    Problem is i is defined in scriplet block of java and you are trying to access it in javascript after the block is closed and hence you are not getting it,

  3. #3
    Member Ganeprog's Avatar
    Join Date
    Jan 2014
    Location
    Chennai,India
    Posts
    80
    My Mood
    Love
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: can we add query string to the jsp file

    hi,

    <td><a href="Edit.jsp?i="+i>modify</a> </td>
    You just use the expression tag like this <%=i%> instead of i . Try it

    Thanks,

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,151
    My Mood
    Mellow
    Thanks
    187
    Thanked 660 Times in 647 Posts

    Default Re: can we add query string to the jsp file

    The original post was over a year ago, and the OP has one post from then to now. I suspect the OP won't be back to discuss this further.

    Please note these details before dredging up old posts with long periods of inactivity and/or inactive members.

    Closing the thread in hopes it will die and stay dead.

Similar Threads

  1. How to Run PostgreSQL Query in JSP?!
    By Akoori in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: April 15th, 2012, 04:05 PM
  2. [jsp/jsf] Send string(file name) to other class
    By barni120 in forum JavaServer Pages: JSP & JSTL
    Replies: 13
    Last Post: February 10th, 2012, 06:48 AM
  3. update query is firing first then insert query
    By salmondavid88 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 8th, 2011, 10:15 AM
  4. Replies: 5
    Last Post: April 7th, 2011, 11:22 AM
  5. Add MS Office communicator presence indicator into JSP.
    By priteshg23 in forum Java Native Interface
    Replies: 0
    Last Post: November 9th, 2010, 01:53 AM