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. 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. Craig