You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Darren Gilroy <DG...@CONSONUS.com> on 2002/02/06 22:22:08 UTC

TemplateScreen.doRedirect()

Hi - 

I'm calling doRedirect() from my screen class, and It's not working how I
expected.  I hope somebody can adjust my expectations.

I expected doRedirect( data, templateName ) to load and run the screen class
that it would run if you called the template with
/app/servlet/app/template/something.vm

I see a doRedirect( data, screenName, templateName ) - How can I look up the
screenName to use based on the templateName, using the same logic that
Turbine normally does?

Or, do you recommend a data.setRedirectURI() instead? Or something else?

Thanks!
-best-darr-


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: TemplateScreen.doRedirect()

Posted by Gary Bisaga <ga...@maximus.com>.
Darren - If you get an answer to your question, I'd be interested to hear
since we're investigating this exact same question right now.

Piggybacking on this question, I can cause a real redirect to occur by
setting data.setRedirectURI(). However, in this case, there really is no
need for page content to go out, is there? Or at most minimal page content
needs to go out (perhaps just a forward link to wherever the redirect would
have taken you, in case the forward doesn't work). Is there any existing
support in Turbine to do this, or should my page class just check if
data.getRedirectURI() has been set and, if it has, then don't output
anything (or output just a single template)?

Thanks!
<>< gary

-----Original Message-----
From: Darren Gilroy [mailto:DGilroy@CONSONUS.com]
Sent: Wednesday, February 06, 2002 4:22 PM
To: Turbine Users List
Subject: TemplateScreen.doRedirect()


Hi -

I'm calling doRedirect() from my screen class, and It's not working how I
expected.  I hope somebody can adjust my expectations.

I expected doRedirect( data, templateName ) to load and run the screen class
that it would run if you called the template with
/app/servlet/app/template/something.vm

I see a doRedirect( data, screenName, templateName ) - How can I look up the
screenName to use based on the templateName, using the same logic that
Turbine normally does?

Or, do you recommend a data.setRedirectURI() instead? Or something else?

Thanks!
-best-darr-


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: TemplateScreen.doRedirect()

Posted by Gary Bisaga <ga...@maximus.com>.
Dazza- found the answer. Look at TemplatePage - the doBuildAfterAction uses
TurbineTemplate converts the template name to a screen name if no screen
name is given. But is this really what you want to do?

Seems like though, upon further reflection, you might want to start the page
all over again (e.g. to give you a chance to change the layout etc.) and so
to do a real redirect (data.setRedirectURI). What's more, usually in these
kinds of situations I've found that a real redirect is safer because the
browser's URL line is now correct: instead of showing the old,
redirected-from URL, it will show the new, redirected-to one.

<>< gary

-----Original Message-----
From: Darren Gilroy [mailto:DGilroy@CONSONUS.com]
Sent: Wednesday, February 06, 2002 4:22 PM
To: Turbine Users List
Subject: TemplateScreen.doRedirect()


Hi -

I'm calling doRedirect() from my screen class, and It's not working how I
expected.  I hope somebody can adjust my expectations.

I expected doRedirect( data, templateName ) to load and run the screen class
that it would run if you called the template with
/app/servlet/app/template/something.vm

I see a doRedirect( data, screenName, templateName ) - How can I look up the
screenName to use based on the templateName, using the same logic that
Turbine normally does?

Or, do you recommend a data.setRedirectURI() instead? Or something else?

Thanks!
-best-darr-


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>