• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Passing parameter to next managed bean through request

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic