This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes My jsp page does not get refreshed 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 "My jsp page does not get refreshed" Watch "My jsp page does not get refreshed" New topic

My jsp page does not get refreshed

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
I have a jsp page which looks like -

the top portion of the page has 3 textboxes and a submit button to add an entity.

the rest of the page displays a list of all the entities in the system.

when i load the jsp and add a new entity, the new entity shows up on the list. when i try to add a new entity second time, the entity does get added into the database, but does not show up in the list.

In the action class, i make a request to the dao and print all the values from the list, returned by the dao. the newly added entities are present in the list. i dont understand, why it does not show up in the jsp page.

any ideas. i am wondering if the data is being cached, so, in the jsp page i have also set the following parameters:

Has this to do anything with Struts and Hibernate which i use in my application? The same thing happens, when i edit. when i click on edit button, it takes the user to a different page, i edit the details and click on save button. the control returns back to the list page, but the changes are not shown, although the changes are saved to the db. how do i prevent cache. i am putting my entire list in a request object, before doing an action forward to the jsp page.

SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Robin Rath

Joined: Jan 07, 2008
Posts: 10

I think there is no error in your JSP page, after adding the no-cache in your header also it won't help you.
The error is in your bean. or any of your DAO class. check your list object in those classes. I can guess two things
i. You are creating ArrayList object in a wrong place. (OR)
ii. Closing your ArrayList object in a wrong place.
Vas Miriyala
Ranch Hand

Joined: Sep 14, 2009
Posts: 114

Seems to be I am also facing the same problem.I was not able to figure it out what went wrong.As Robin Rath having said,I checked twice in classes and dao and printed the list of values which i am retrieving from the db after update,its giving the correct values but when it comes to jsp am facing the strange problem.any help on this?
Don't get me started about those stupid light bulbs.
subject: My jsp page does not get refreshed
Similar Threads
I need to cache a page
Caching Issue: How to force HTML/JSP to refresh?
action class gets skipped when opening link via javascript
No Cache in IE
Log out Functionality for my Web Application