Solved

Getting passed variable and displaying it on the page??

Posted on 2003-10-21
6
166 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
Comment Utility
Enumeration e = request.getParameterNames();
while (e.hasMoreElements())
{
    System.out.println(e.nextElement());
}
0
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
Comment Utility
<%
String value = request.getParameter("myVar");
%>

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

Author Comment

by:894359
Comment Utility
My jsp page chokes on this:
<P>myVar = <%= myVar %>

???????
0
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.

 
LVL 6

Expert Comment

by:kotan
Comment Utility
<P>myVar = <%= value %>
0
 
LVL 3

Expert Comment

by:applekanna
Comment Utility
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
Comment Utility
Oops :-(

Good catch kotan ;-)

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 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

11 Experts available now in Live!

Get 1:1 Help Now