my dog learned polymorphism*
The moose likes Struts and the fly likes Help with hidden field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help with hidden field" Watch "Help with hidden field" New topic
Author

Help with hidden field

rahul vasishta
Greenhorn

Joined: Sep 22, 2009
Posts: 7
Hi all,


How to set the value of hidden field from Action class? I have JSP and Action class defined for the JSP Page. I havent defined the Form class for it.
Is it possible to set value for hidden filed and retrieve it on submit without having Form class defined for JSP Page?

-Rahul
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

without having Form class defined for JSP Page

This is a little confusing. In struts form classes are defined for Actions not JSP pages. There's a html:hidden tag which can be easily used for your requirement...

[After reading David's reply, I think I misunderstood the question , but I beat David by 10 seconds ]


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can always get values directly from the request, but... I'm not so sure that I would.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with hidden field
 
Similar Threads
Buttons EventHandler and Property-Setting
using ajax to populate select box
request.setAttribute and getAttribute problem
Struts 2 hidden values
validator, same field, same formbean, diff JSP,diff validations