• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

My jsp page does not get refreshed

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.
 
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic