?
Solved

Unable to pass a hidden variable from a JSP page to the action class

Posted on 2006-05-12
4
Medium Priority
?
1,193 Views
Last Modified: 2008-01-16
Hi,

I am unable to pass a hidden variable in my JSP page to the action class..
I have a button which when clicked should popup a page and pass the frame from which it is popping up to my action class..
Could you please suggest something?
0
Comment
Question by:crazydiode
2 Comments
 
LVL 14

Accepted Solution

by:
hoomanv earned 1000 total points
ID: 16671276
we cant suggest unless you post the code where you think it needs correctness
however read the below examples about reading form data thru JSP

http://www.java2s.com/Code/Java/JSP/Form-Hidden-Field.htm

using bean:
http://www.jsptut.com/Forms.jsp
0
 
LVL 1

Assisted Solution

by:olgavillamizar
olgavillamizar earned 1000 total points
ID: 16671471
you can use

request.setAttribute("name", variable);

and then
request.getParameter("name") to recover it

Or you can declare the hidden
<html:hidden property="id"/>  in the jsp page

and in the action class you revover it using the form associated to the action...
Form fform = new Form();
String id = fform.getId();

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 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