You have to set the current viewId on the UIViewRoot first, but then yes, you could do that.

On Apr 12, 2005 1:44 PM, Virtudazo, Dennis (Exchange) <[EMAIL PROTECTED]> wrote:
Why not just do a simple forward?

getServletContext().getRequestDispatcher(forwardUrl).forward(req, res);

-----Original Message-----
From: Tim Pyle [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 11, 2005 10:48 AM
To: [email protected]
Subject: JSF Forward -- Off Subject

I do not think this really is myFaces specific or not as i have not
tried with Sun's RI. But I think it is more just my lack of JSF
navigation knowledge.  I am attempting to build a tag that can check for
certain data at the begining of page. This tag takes the attributes,
var, and url. What it is supposed to do is check the session for valid
data in the "var" attribute. And if the data is not there or valid, it
should then forward the request off to the given "url". Can someone look
at the code and tell me where I am messing up, or if I am going down the
wrong path altogether. Any help is greatly appreciated.

Current strUrl is "/buPage.jsp"

               if (session.getAttribute(strVar) == null) {
                       Logger.debugln("viewRoot before: " +
context.getViewRoot().getViewId());
                       UIViewRoot viewRoot =
context.getApplication().getViewHandler().createView(context,strUrl);
                       viewRoot.setViewId(strUrl);
                       context.setViewRoot(viewRoot);
                       Logger.debugln("viewRoot after : " +
context.getViewRoot().getViewId());
                       context.renderResponse();
               }

Tim

***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************




--
-Heath Borders-Wing
[EMAIL PROTECTED]

Reply via email to