This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes storing values in a session... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "storing values in a session..." Watch "storing values in a session..." New topic
Author

storing values in a session...

Pradeep Adibatla
Ranch Hand

Joined: Oct 27, 2009
Posts: 336
I have a 2 objects... concept object which has concepts(conceptNames) and Attribute object which has attributes and datatypes...

These 3 form my row in the table... So my row would sample as : ROW1: concept1 attribute1 datatype1

Each row represents one vocabulary object i.e attributes are added to concepts and concepts are inturn stored in vocabulary object...

How to store in a session?

I implemented sessionAware in my action class... (i am not clear whether to use application or session Aware)







session.put(???) what key, value pair should go? vocabulary?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Well since the SessionAware interface gives you a Map<String, Object> of session attributes, you need to store a String which will uniquely identify the session attribute as the key and Vocabulary object as the value. Something like this


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
Consider Paul's rocket mass heater.
 
subject: storing values in a session...
 
Similar Threads
handling objects with DB
Which attribute scopes are thread-safe ?
struts.xml doubt (Action classes,struts-2)
vocabulary
JSF custom tag requirement