You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Zidarics Zoltan <za...@vili.pmmf.hu> on 2006/05/09 15:42:09 UTC

linking to screen?

Hello All,

I would like to exec a screen which is a descendant of RawScreen.
The module is in modules/screens named Captcha.java.
It provide a gif for a form in any vm.  
I tried to link it :
$link.setScreen('Captcha') which is processed like this: 
<img src="/portal/app/screen/Captcha" border="0">
 but it doesn' t work:(

Seems to be Turbine using Default template name if link doesn't 
have 'template' in params, and doesn' t find screen.

Are there any TR.prop settings to configure it, or any solution to use 
RawScreen ?

I am usinng Turbine 2.3.2
-- 
thx,
----------------------------------------------------
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694

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


Re: linking to screen?

Posted by Zidarics Zoltan <za...@vili.pmmf.hu>.
Hi All,

Thx a lot Helge, it works well :)

2006. május 9. 18.39 dátummal Helge Weissig ezt írta:
> Hi Zoltan,
>
> 	if you want to create an image on the fly, you may want to use the
> DirectResponseLayout template within an action class (I think this
> was just recently discussed here). We recently converted our Turbine-
> based secondary servlets to action classes by simply extending the
> following class instead of a copy of BaseTurbineServlet that we had
> moved into our packages:
>
> public abstract class AbstractDirectAction extends VelocityAction {
> 	public void doPerform(RunData data, Context ctx) throws Exception {
> 		data.declareDirectResponse();
> 		data.setLayout("DirectResponseLayout");
> 		processRequest(data);
> 	}
>
> 	public abstract void processRequest(RunData data) throws
> ServletException,
> 			IOException;
> }
>
> see also http://wiki.apache.org/jakarta-turbine/Turbine2/
> VelocityOnlyLayout
>
> Don't forget to set the headers correctly in your subclass'
> processRequest method. In it, just get the HttpServletResponse object
> from the RunData object and from it, get the outputstream to write to.
>
> good luck,
> h.
>
> On May 9, 2006, at 6:42 AM, Zidarics Zoltan wrote:
> > Hello All,
> >
> > I would like to exec a screen which is a descendant of RawScreen.
> > The module is in modules/screens named Captcha.java.
> > It provide a gif for a form in any vm.
> > I tried to link it :
> > $link.setScreen('Captcha') which is processed like this:
> > <img src="/portal/app/screen/Captcha" border="0">
> >  but it doesn' t work:(
> >
> > Seems to be Turbine using Default template name if link doesn't
> > have 'template' in params, and doesn' t find screen.
> >
> > Are there any TR.prop settings to configure it, or any solution to use
> > RawScreen ?
> >
> > I am usinng Turbine 2.3.2
> > --
> > thx,
> > ----------------------------------------------------
> > Zoltan Zidarics programmer
> > PTE University Pecs, Hungary
> > icq: 43288694
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

-- 
Zoltan Zidarics programmer
PTE University Pecs, Hungary
icq: 43288694

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


Re: linking to screen?

Posted by Helge Weissig <he...@grajagan.org>.
Hi Zoltan,

	if you want to create an image on the fly, you may want to use the  
DirectResponseLayout template within an action class (I think this  
was just recently discussed here). We recently converted our Turbine- 
based secondary servlets to action classes by simply extending the  
following class instead of a copy of BaseTurbineServlet that we had  
moved into our packages:

public abstract class AbstractDirectAction extends VelocityAction {
	public void doPerform(RunData data, Context ctx) throws Exception {
		data.declareDirectResponse();
		data.setLayout("DirectResponseLayout");
		processRequest(data);
	}

	public abstract void processRequest(RunData data) throws  
ServletException,
			IOException;
}

see also http://wiki.apache.org/jakarta-turbine/Turbine2/ 
VelocityOnlyLayout

Don't forget to set the headers correctly in your subclass'  
processRequest method. In it, just get the HttpServletResponse object  
from the RunData object and from it, get the outputstream to write to.

good luck,
h.

On May 9, 2006, at 6:42 AM, Zidarics Zoltan wrote:

> Hello All,
>
> I would like to exec a screen which is a descendant of RawScreen.
> The module is in modules/screens named Captcha.java.
> It provide a gif for a form in any vm.
> I tried to link it :
> $link.setScreen('Captcha') which is processed like this:
> <img src="/portal/app/screen/Captcha" border="0">
>  but it doesn' t work:(
>
> Seems to be Turbine using Default template name if link doesn't
> have 'template' in params, and doesn' t find screen.
>
> Are there any TR.prop settings to configure it, or any solution to use
> RawScreen ?
>
> I am usinng Turbine 2.3.2
> -- 
> thx,
> ----------------------------------------------------
> Zoltan Zidarics programmer
> PTE University Pecs, Hungary
> icq: 43288694
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


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