File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reinit all bean variables on page load

 
Herve Dibot
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a JSP application and i'm facing issues about beans. On a page i have drop down lists, filled "on page loads " thanks to bean, but if i leave the page, visit another page of my website, and then come back to the first page, drop down lists are still focused on the selected values before i leave.
Same for a simple "for each" which add table rows after submitting a form, if I leave the page, and come back, the table is still there with previous values...

I would like to reinit the page like the very first time I come.

Thank you for your help, and sorry for my english. Hope it was clear
Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

We'll need more information on how the beans are being used during the loading of the page. It sounds like you are trying to do too much work in the JSP that should be handled by the page controller.
 
Herve Dibot
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example of a DDL in mypage.jsp



I though about stateful/stateless ? but how making my bean stateless ?
 
Herve Dibot
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved ! I change the scope of my bean from Session to Request and that did the trick.




Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's JSF markup. Please be sure to ask JSF questions in the JSF forum. I have moved this post there for you.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic