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 Is there any other possibility to retain data other than 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 "Is there any other possibility to retain data other than session" Watch "Is there any other possibility to retain data other than session" New topic
Author

Is there any other possibility to retain data other than session

Manjush Manjush
Greenhorn

Joined: Feb 23, 2013
Posts: 10
Is there any way to retain data in Struts tabs , when resultSet is in request rather than session,
When we move randomly from tabs and go for some other functionalities in one tab and move to the next tab the resultset will be lost.

Once more i like to ask, Is there any other possibility to retain data other than session ???
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8834
    
    7

Welcome to the JavaRanch. I'm not sure what you mean by "Struts tabs". The most common way to preserve data between requests is to use the user session. There are a couple of other options, like writing data in hidden fields on a form or saving it to a database and requesting it in a later request.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Manjush Manjush
Greenhorn

Joined: Feb 23, 2013
Posts: 10
Hi

What i mean is to store value objects,
Other than session is there any other way, In struts 2 its actually a POJO , instead of form ,so the value object stored may loose when we move to other functionalities and then come back to the functionality where we have to use this value object.

Can anyone give any other way which can go for replacement for a session to store value objects.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

You seem to be mixing things up. First you say tabs, which is client side, then you say session, which is server side. Are you talking about saving data on the client side or server side?
Manjush Manjush
Greenhorn

Joined: Feb 23, 2013
Posts: 10
Hi,

The possibility for loosing data is there while working with tabs ,
Imagine first in search page selecting the conditions and going for result
In result page based on ID there may be a hyperlink to get more details on that particular ID
When we click that ID Details may be shown on another page in Tab
in tab on a particular page there may be buttons to navigate to other pages too and and can come back to tab , then the values may not get displayed, possibilities of exception are there

Robert ,

i am looking for both Client and server side an alternative to session and request objects in storing data.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Manjush Manjush wrote:i am looking for both Client and server side an alternative to session and request objects in storing data.


Why? Session and request objects work perfectly well for that.
Manjush Manjush
Greenhorn

Joined: Feb 23, 2013
Posts: 10
Hi Paul,

In Request the value object wont retain for long , if moved to other functionality and come back to old functionality ,then value wont be able to retain in request scope,but in Session yes it will work
but session handling will be a tedious one , when its a large application,

So like to know whether there is any other possibility other than session

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I don't know what you mean by "tedious". The session is specifically designed for storing user data which persists longer than a single request, so before you start looking for alternatives you need to figure out why you're doing that. So far all I see is that you might have to do an inconvenient amount of programming -- but correct me if I misunderstand. And it seems to me you would have to do the same programming to manage the data outside of a session, only it might be more inconvenient because now you're not using a feature which is specifically designed for storing long-lived user data.

But as I said, probably I don't understand your requirements. I'm just suggesting that you should make sure that you understand them yourself before you start looking for alternatives.
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

I agree with Paul. The session is made for this and it's easy to do. Othere ways that I can think of to save imormation aside from the session would be to use a database or to save the information in hidden fields in the web page.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is there any other possibility to retain data other than session
 
Similar Threads
Submits all the tabs.
Session Data Vs Session Overhead
jsp response problem
show the tabbed properties view of eclipse through action item
Minimal Javascript,,,