You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Gabriel Moreno <ga...@cs.cmu.edu> on 2001/05/29 19:57:14 UTC

SetScreen vs. SetScreenTemplate

Hi,
I'm not sure when to use data.setScreen and when to use
data.setScreenTemplate.
I 'm using setScreenTemplate to redirect to other pages and that works.
But if I try to redirect to Error.vm after catching an exception, I have
to use setScreen, other wise it doesn't work.
Could someone explain me the difference?

In addition, is the parameter the name of the template or the class? I'm
using "Error.vm".
Thanks a lot,

Gabriel


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: SetScreen vs. SetScreenTemplate

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/30/01 5:54 AM, "Gabriel Moreno" <ga...@cs.cmu.edu> wrote:

> Jon Stevens wrote:
>> 
>> on 5/29/01 10:57 AM, "Gabriel Moreno" <ga...@cs.cmu.edu> wrote:
>> 
>>> Hi,
>>> I'm not sure when to use data.setScreen and when to use
>>> data.setScreenTemplate.
>> 
>> Well, one points to the Screen and one points to the Template.
>> 
> So, let me check if I understand right. setScreenTemplate should be used
> inside a Screen class in order to select the template to be used.
> setScreen should be used to activate a completely different screen (both
> class and template), for instance, within an Action class. Am I right?

Yup.

> 
>>> I'm using setScreenTemplate to redirect to other pages and that works.
>> 
>> Ok.
>> 
>>> But if I try to redirect to Error.vm after catching an exception, I have
>>> to use setScreen, other wise it doesn't work.
>>> Could someone explain me the difference?
>> 
>> The "right way" is to re-display the original screen with the error. If you
>> show an Error.vm screen, that doesn't do anyone any good. Also, Error.vm is
>> "special" in the system in that it is used by default as a catch all in
>> Turbine.java for major errors (ie: Horrible Exceptions), so that may be why
>> things are not working the way that you want.
>> 
>>> In addition, is the parameter the name of the template or the class? I'm
>>> using "Error.vm".
>>> Thanks a lot,
>> 
>> What parameter?
>> 
> 
> The parameter to setScreen and setScreenTemplate.

SetScreen is the class and setScreenTemplate is the template.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: SetScreen vs. SetScreenTemplate

Posted by Gabriel Moreno <ga...@cs.cmu.edu>.
Jon Stevens wrote:
> 
> on 5/29/01 10:57 AM, "Gabriel Moreno" <ga...@cs.cmu.edu> wrote:
> 
> > Hi,
> > I'm not sure when to use data.setScreen and when to use
> > data.setScreenTemplate.
> 
> Well, one points to the Screen and one points to the Template.
> 
So, let me check if I understand right. setScreenTemplate should be used
inside a Screen class in order to select the template to be used.
setScreen should be used to activate a completely different screen (both
class and template), for instance, within an Action class. Am I right?


> > I'm using setScreenTemplate to redirect to other pages and that works.
> 
> Ok.
> 
> > But if I try to redirect to Error.vm after catching an exception, I have
> > to use setScreen, other wise it doesn't work.
> > Could someone explain me the difference?
> 
> The "right way" is to re-display the original screen with the error. If you
> show an Error.vm screen, that doesn't do anyone any good. Also, Error.vm is
> "special" in the system in that it is used by default as a catch all in
> Turbine.java for major errors (ie: Horrible Exceptions), so that may be why
> things are not working the way that you want.
> 
> > In addition, is the parameter the name of the template or the class? I'm
> > using "Error.vm".
> > Thanks a lot,
> 
> What parameter?
> 

The parameter to setScreen and setScreenTemplate.

Thanks,
Gabriel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: SetScreen vs. SetScreenTemplate

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/29/01 10:57 AM, "Gabriel Moreno" <ga...@cs.cmu.edu> wrote:

> Hi,
> I'm not sure when to use data.setScreen and when to use
> data.setScreenTemplate.

Well, one points to the Screen and one points to the Template.

> I'm using setScreenTemplate to redirect to other pages and that works.

Ok.

> But if I try to redirect to Error.vm after catching an exception, I have
> to use setScreen, other wise it doesn't work.
> Could someone explain me the difference?

The "right way" is to re-display the original screen with the error. If you
show an Error.vm screen, that doesn't do anyone any good. Also, Error.vm is
"special" in the system in that it is used by default as a catch all in
Turbine.java for major errors (ie: Horrible Exceptions), so that may be why
things are not working the way that you want.

> In addition, is the parameter the name of the template or the class? I'm
> using "Error.vm".
> Thanks a lot,

What parameter?

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org