• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Navigate between two page tranfering parameters

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to move from one JSF page to another (to create a new entity) and,
when finished, go back to the source page (consumer of entity) by transferring the newly created entity?.
Is there a standard way to move from one page to another by passing parameters?

A pratical example would be appreciated.

Thank you.

Domenico
 
Saloon Keeper
Posts: 28831
212
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes there is. Don't transfer parameters.

JSF is a Model/View/Controller architecture, and rather than transferring parameters old-school style, one would normally simple transfer values from one mode to another. You can do this in one of 2 ways:

1. Inject one model into another and use POJO set/get methods to do the transfer (normally this is done in the action processor that handles the original form submit).

2. Inject a common object into both the source and destination objects and use it as an intermediary.

Normal scope rules apply - you can't inject a request-scope object into a session-scope object, but other than that, it's quite simple and it has both less network overhead and greater security than pumping values out to the client and back in again.
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic