Solved

store jsp value of one page in another

Posted on 2011-02-16
1
777 Views
Last Modified: 2012-06-21


I had a jsp page and index.jsp


<form method="post">

<select name ="getselected" id="getselected">
<option>fox</option>
<option>fox2</option>
<option>fox3</option>
</selected>

<input type="hidden" name="hidden" value="<%=getselected%>">

</form>


 
which had a drop down list...
I get that value in server...
and set it to request

String selected_value = request.getParameter("getselected");
request.setAttribute("selected_value", selected_value );



now in index2.jsp

I imported this class and

used

Selected is <%=request.getAttribute("selected_value") %>


I got the value, i mean i got the output something like
selected is fox

but once i reload the page

I get output like

selected is null

how to store the value and when value is changed in index.jsp how to
reflect it in index2.jsp automatically...

0
Comment
Question by:shragi
1 Comment
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
Comment Utility
>but once i reload the page  
When you reload the page, you are making a new request.
If you want the value to persist, then you could use a session-scoped object.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

743 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

18 Experts available now in Live!

Get 1:1 Help Now