Solved

Getting passed variable and displaying it on the page??

Posted on 2003-10-21
6
169 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 125 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 43
rebasing and merging used in SCM 1 72
session bean client machine 9 63
Limiting the number of characters a user can type in a text field 6 56
Knowing where your website is hosted is as important as the features you receive, the monthly fee, and the support you receive. Due diligence should be done when choosing your next hosting provider.
Read about the importance of offline branding in the digital age.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

823 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