File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Getting ActionForm values from Java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting ActionForm values from Java class" Watch "Getting ActionForm values from Java class" New topic
Author

Getting ActionForm values from Java class

Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63
When I need to get a value into a Java class from an ActionForm I generally just pass it in from my Action class. Since the Action class is always passed in the ActionForm item mapped to the action class I can easily get grab my desired value and pass it along.

Now though I am calling a class from an Action class, but I want to pass in another variable that is residing in an unrelated form that is session scoped. I need this value since it is required by a stored procedure for security validation.

How can I get an arbitrary session variable's value like this?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
134

Bloo,

This gets you an arbitrary form from the session. Then name to pass in is whatever you used in the struts config file.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Consider Paul's rocket mass heater.
 
subject: Getting ActionForm values from Java class
 
Similar Threads
Secure session Data
Setting up form data
Action Class
Passing values across pages for that session/user
First struts app help! Drop-down lists