cancel
Showing results for 
Search instead for 
Did you mean: 

Session Expire / Object Destroy

former_member81750
Active Participant
0 Kudos
154

Hi All

I am wondering what is the best way to do this. Let's say I have JSP Dynpage with a HTMLB Form containing an search text field. Users does the search and results are displayed in a htmlb table on it using the hbj tags. I have stored the model for this table in the IComponentProfile. Lets say user Amy visits this component via the portal. See enters some search text and sees some results in the htmlb table. Then the user closes the browser and visits the same component after an hour. Fun part is users sees the same table again.

Is there way to get rid of this behaviour.

Thanks and Regards

Pankaj

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member81750
Active Participant
0 Kudos

As always this is to put this post in the top.

Pankaj

Former Member
0 Kudos

Hi Pankaj,

just create a new object on initialize() and put it into the profile.

regards, jens

former_member81750
Active Participant
0 Kudos

Hi Jens

I didn't get what you mean by "create a new object on initialize() and put it into the profile". Still let me rephrase my questions.

I already have a Search form which is generated by a portal component lets say PeopleSearch. When a user comes in, they enter the Search Crieterion lets say first name of a person. User submits the form. PeopleSearch component captures the search criterion and performs a search on a database for people with provided first name. The component then populates a table model with the search results. And finally the htmlb table is presented as search results. So user finds the info about the guys he was looking at and leaves the portlal, by closing the browser.

After 2 hours when the user again comes in to launch another search and goes in to use PeopleSearch, even before launching the search. user sees the result of previous search. Reason for that is becuase users session didn't expired even when he left the portal earlier. I want to avoid this.

Hope my problem is clear now.

Regards

Pankaj

Former Member
0 Kudos

ok. I got you right. what sort of object do you store in the profile? A TableViewModel?

I had a the opposite problem with beans which was stored in the profile...

doInitialization()....

Object o = getPortalProfile().getValue("goodsBookingInitBean");

if (o == null || !(o instanceof GoodsBookingInitBean))

{

goodsBookingInitBean = new GoodsBookingInitBean();

getPortalProfile().putValue("goodsBookingInitBean", goodsBookingInitBean);

}

else

{

goodsBookingInitBean = (GoodsBookingInitBean) o;

}

so in your case just create a new Instance of your object everytime the iview is started and put it into the profile... regards, jens

former_member81750
Active Participant
0 Kudos

Hi Jens

Thanks for the input. It is working now. I am ashamed now that I didn't thought of that. What I was doing was in the doInitialization() method was calling a method ensureTableViewModel(). This method would check context and if the object was there it would just usr the existing one. This was good enough for the first visit of the user but situation on the the user's next visit was not predictiable. But any way now it is solved.

Thanks for the help.

Regards

Pankaj