Solved

store jsp value of one page in another

Posted on 2011-02-16
1
787 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 34910789
>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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
null output 3 43
Cisco ASA: Java web start no go, asdm launcher no go 3 58
jsp CRUD operations with and without prepared statement also hibernatge 1 31
Java Eclipse Loop 3 31
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

730 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