On 10/5/05, Craig McClanahan <[EMAIL PROTECTED]> wrote: > On 10/5/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > > > On 10/5/05, Werner Punz <[EMAIL PROTECTED]> wrote: > > > But the basic mechanisms regarding the whole page flow system are very > similar > > > in jsf and struts > > > > Please correct me if I am wrong, but in JSF I always ask for a page. > > In Struts I can ask for any arbitrary service, then Struts action > > would generate output (if any) itself, and return null. This is more > > flexible. > > You have similar flexibility in JSF, you just ask for it differently. If > your action method wants to produce its own output instead of navigating to > another JSF page, simply call FacesContext.responseComplete() at some point > in your processing. This tells JSF to bypass the Render Response phase. It > presumes you've either grabbed a ResponseWriter or ResponseStream, and > written the response yourself.
I see, I have to look into it, thanks. > A JSF action method that returns null, on the other hand, is asking for the > same page to be redisplayed ... sort of like what Struts will do for you on > validation errors, but without having to configure the "input" parameter in > your configuration file. Right. I have the same exact functionality in Struts Dialogs. It redirects to the same action ("reloads" the action), if execute() returns EventForward.DIALOG_RELOAD. Then action displays a page relevant to action's current state. Because state could have been changed, the action can display a different JSP page after being reloaded. I believe, that similar behaviour (different presentation depending on action/page state) is possible in JSF with subviews and "rendered" attribute. At least that what David Geary advised me to do, when I was porting my wizard engine to JSF. Michael. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]