Andrew,

In your response, you wrote "build the full URL including 'https'". 
However, when you get the viewId in handleNavigation, it has the actual
file name, e.g., "page.xhtml" (I am using facelets).  However, I think
(maybe I am wrong) that an actual URL has to be of the form "page.jsf"
(if using ".jsf" as the filter url-pattern).  Would it be safe to simply
replace ".xhtml" with ".jsf" to form the URL (along with "https://";)? 
Or is there a way to change the protocol to HTTPS and then just use the
same viewId (without the "secure:" prefix)?

Thanks!

----- Original Message -----
From: Andrew Robinson <[EMAIL PROTECTED]>
Date: Thursday, May 3, 2007 1:41 pm
Subject: Re: Navigation to and from an HTTPS URL
To: MyFaces Discussion <[email protected]>

> > > For the custom navigation handler, I don't have an example, but 
> you> > could just setup some kind of pattern that you could parse 
> via regex.
> > > Something like
> > >
> > > secure:/myview.xhtml
> > >
> > > Then in the navigation handler, see:
> > > private final static String SECURE = "secure:";
> > > ...
> > > if (viewId.startsWith(SECURE))
> > > {
> > >  viewId = viewId.substring(SECURE.length());
> > >  // see if the HttpServletRequest.isSecure() returns false
> > >  // if so then:
> > >  // get the faces external context
> > >  // build the full URL including "https"
> > >  // call external context.redirect
> > >  // call context.responseComplete();
> > > }
> > > else ...
> > >

Reply via email to