Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting passed variable and displaying it on the page??

Posted on 2003-10-21
6
Medium Priority
?
182 Views
Last Modified: 2010-04-01
How do I get a variable being passed (named "myVar") from one page and display it once it is passed to another page? it is a hidden form element.
0
Comment
Question by:894359
6 Comments
 
LVL 6

Expert Comment

by:kotan
ID: 9594953
Enumeration e = request.getParameterNames();
while (e.hasMoreElements())
{
    System.out.println(e.nextElement());
}
0
 
LVL 15

Accepted Solution

by:
jimmack earned 500 total points
ID: 9595067
<%
String value = request.getParameter("myVar");
%>

<P>myVar = <%= myVar %>
0
 

Author Comment

by:894359
ID: 9595173
My jsp page chokes on this:
<P>myVar = <%= myVar %>

???????
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Expert Comment

by:kotan
ID: 9595235
<P>myVar = <%= value %>
0
 
LVL 3

Expert Comment

by:applekanna
ID: 9596079
extending jimmacks answer

in page 1 set the values as
<input type = "hidden" name = "myVar" value = "sampleData">

in page 2 where you want to get the data

 add the following in ur jsp page
<%
String myVar = request.getParameter("myVar");
%>

to display the data in HTM on the page

use <%=myVar%>

Cheers!
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9597283
Oops :-(

Good catch kotan ;-)

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Following on from our article on "The Murky World of Consent and opt in", we thought we would issue some helpful guidance, not only on consent itself but knowing what information you are capturing, what you are doing with this data and how you can p…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

773 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