Solved

retaining session variables

Posted on 2004-10-27
167 Views
Last Modified: 2010-04-01
a servlet page is calling a a Jsp page, this jsp page contains a hyperlink. When i click on the hyperlink, i have to call a jsp page with some parameters. I want to know how to pass the parameters to the jsp page on click of the hyperlink.

Do we need to use the session if so how?

 
0
Question by:bharathk50
    1 Comment
     
    LVL 35

    Accepted Solution

    by:
    <a href="other.jsp?param1=a&param2=b">click</a>

    will allow you to do:

    <%
        String a = request.getParameter( "param1" ) ;
        String b = request.getParameter( "param2" ) ;
    %>

    in "other.jsp"

    otherwise, yeah, you can store the values in the session...  but they will be in the session no matter if the user clicks the link or not (as the JSP session code will run before the user gets the html page)

    Tim
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
    With the shift in today’s hiring climate (http://blog.experts-exchange.com/ee-blog/5-tips-on-succeeding-in-the-new-gig-economy/?cid=Blog_031816), many companies are choosing to hire freelancers to get projects completed efficiently and inexpensively…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now