Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting passed variable and displaying it on the page??

Posted on 2003-10-21
6
Medium Priority
?
175 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
[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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whoever said that “a picture is worth one thousand words” observed a fact that can dramatically affect your marketing success. Most people tend to learn visually, so many publishers commonly acknowledge the effectiveness of visual learning by using…
The online market is growing at an unprecedented rate and retail eCommerce sales are expected to reach $4 trillion by 2020. Yet, the profit is not just there for the taking because you have to set yourself apart from the competition.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
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…
Suggested Courses

688 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