sweet, thanks much......much better than the answer I got on sun's forums :).
thanks,
dean

Mario Ivankovits wrote:
Hi Dean!
  
but, unfortunately, I have to query another service for the URL to
really redirect to!!!  This means, I can't put the URL in the
faces-config.xml file.  Is there any way to do any of these options(or
others....list is not exhaustive probably)
    
I am not definitely sure, but maybe a navigation handler could help.

*) create a class which extends from
"javax.faces.application.NavigationHandler"
*) create a constructor which takes one parameter which is also a
NavigationHandler - we call it originalHandler
*) override handleNavigation
*) configure this class in your faces-config.xml
*) if the fromAction is a url (e.g. starts with http://) get the
externalContext/response object - cast it to httpServletresponse and
*) call sendRedirect (or so, cant remember now)
*) else call originalHandler.handleNavigation

  
1. return a URL from action methods like http://xxxxx.com
    
this is required for the above
  
2. modify the faces-config dynamically like changing a mapping for
"success" and then returning "success" in the submit method.
    
Not possible. myFaces wont reload it, the best you can archive here is
to reload the whole application - for sure not what you want ;-)
  
3. interact with ServletRequest and tell it to redirect(though I don't
want to depend on servlets and would like to be portable between
portlets and servlets maybe....I know nothing about portlets so don't
know if portability is useful or not yet)
    
This is what the above does. But for sure, not portlet compatible. But I
think the requirement itself isnt protlet compatible. What should a
protlet engine do if you direct the browser to do a redirect.
  
4. add a servlet filter somehow such that it can look at the url
returned from the submit method?
    
not possible.

So, now dig into JSF an try it ;-)

Ciao,
Mario

  

Reply via email to