• Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing parameter to next managed bean through request  RSS feed

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I am new to JSF. I created a JSP page createProduct. On submit, it goes to managed bean where product is created and stored in database. I take the Id of the product and save it to session. Then the page navigates to viewProduct.jsp. There in Managed bean I take the id from session, get product from database and show ity on screen.
I need to know if there is anyway of passing the id parameter to next managed bean through request instead of putting it in session.
 
Qussay Najjar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're dealing with JSF in the same concept of JSP, which loses the power of jsf.
in such scenarios you can follow the next:

you can have only one managed bean, session scoped if for more than one-page process.
you managed bean can be like the next:


now in createProduct.jsp


so in page viewProduct.jsp simply you can have the next:


as long as your managed bean is on session scope that would work perfectly.
the code is applied with jsf 1.2.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!