You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by David Philippi <se...@juris.de> on 2003/08/18 16:24:59 UTC

Using TDK with JSP

I've got some problems regardings JSP's in turbine (using Velocity is not an
option). 
I can't find where the layout is defined. If I'm not completly on the wrong
track, the option
services.JspService.default.layout = DefaultLayout
causes turbine to use DefaultLayout for my screens. I can guess that this is
what yields the "Turbine - A Servlet Framework for building Secure Dynamic
Websites." before and after my page but: where is that defined? 
I'd like to know where I can change the content of the DefaultLayout for my
app and how to change the layout for a single screen. I guess setLayout()
may be what's required but I know neither what I should use as layout
parameter (I suppose a file residing in X, using Y as the placeholder for
the current screen name) nor where to call it. doBuildTemplate() seems to be
too late in the process for a call to setLayout() but on the other hand it's
the only place where I've got a RunData object (that I know of).
Any help would be very appreciated, I'm in the fortunate situation of never
having done anything with JSP, ServerPages or similar except CGI with Perl
and I'm working on a project right now where I must use Turbine and I must
use JSP instead of Velocity. Unfortunately, most if not all documentation
that I find is based on Velocity and in most cases I don't know enough about
Turbine yet to apply the information in the context of JSP. :-(

Bye David


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


Re: Using TDK with JSP

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Gabriel Moreno <ga...@itcsoluciones.com> writes:

>David,
>The tag library was removed from Turbine tars and CVS sometime ago, and
>apparently nobody knows why. I have sent it to the Turbine developers so
>that they can put it back. Maybe it's that they're very busy preparing
>2.3, but I don't understand why is it that the tag library hasn't been
>restored yet, considering that Turbine's homepage mentions JSP a lot.
>Everyone trying to use Turbine with JSP faces the same problem.

I have it here. I will try to polish it up a little and put it into
the proposals. They won't make it to 2.3 final unless someone steps up
next week and actually gets them done properly and test them (and
writes some docs).

	Regards
		Henning




>If you want, I can email you the tag library.

>Gabriel

>On Thu, 2003-08-21 at 11:10, David Philippi wrote:
>> I've found the taglib template.tld and copied it into web-apps/tlds, now
>> I've got the problem that I don't know where to get the class files for it:
>> 
>> Unable to load class org.apache.turbine.services.jsp.tags.ScreenTag
>> 
>> Bye David
>> 
>> -----Original Message-----
>> From: Gabriel Moreno [mailto:gabrielm@itcsoluciones.com] 
>> Sent: Wednesday, August 20, 2003 2:38 PM
>> To: Turbine Users List
>> 
>> You can't reference the screen explicitly from the layout. In the layout you
>> always have:
>> 	<turbine:screen section="body" />
>> to reference the screen body. If you want a screen named MyScreen.jsp to
>> have a different layout, you have to create a layout called MyScreen.jsp and
>> it will be used whenever you request MyScreen.jsp screen.
>> 
>> 
>> ---------------------------------------------------------------------
>> 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

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" 
      -- AOL CD when played backwards  (User Friendly - 200-10-15)

RE: Using TDK with JSP

Posted by Eric Pugh <ep...@upstate.com>.
Gabriel,

I must have missed that email as well.  Could you send it to me and I look
at integrating it in t2.4?  I am very curious about it as well..

Eric

> -----Original Message-----
> From: Gabriel Moreno [mailto:
> Sent: Thursday, August 21, 2003 9:10 PM
> To: Turbine Users List
> Subject: RE: Using TDK with JSP
>
>
> David,
> The tag library was removed from Turbine tars and CVS
> sometime ago, and
> apparently nobody knows why. I have sent it to the Turbine
> developers so
> that they can put it back. Maybe it's that they're very busy preparing
> 2.3, but I don't understand why is it that the tag library hasn't been
> restored yet, considering that Turbine's homepage mentions JSP a lot.
> Everyone trying to use Turbine with JSP faces the same problem.
>
> If you want, I can email you the tag library.
>
> Gabriel
>
> On Thu, 2003-08-21 at 11:10, David Philippi wrote:
> > I've found the taglib template.tld and copied it into
> web-apps/tlds, now
> > I've got the problem that I don't know where to get the
> class files for it:
> >
> > Unable to load class org.apache.turbine.services.jsp.tags.ScreenTag
> >
> > Bye David
> >
> > -----Original Message-----
> > From: Gabriel Moreno [mailto:gabrielm@itcsoluciones.com]
> > Sent: Wednesday, August 20, 2003 2:38 PM
> > To: Turbine Users List
> >
> > You can't reference the screen explicitly from the layout.
> In the layout you
> > always have:
> > 	<turbine:screen section="body" />
> > to reference the screen body. If you want a screen named
> MyScreen.jsp to
> > have a different layout, you have to create a layout called
> MyScreen.jsp and
> > it will be used whenever you request MyScreen.jsp screen.
> >
> >
> >
> ---------------------------------------------------------------------
> > 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


RE: Using TDK with JSP

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
David,
The tag library was removed from Turbine tars and CVS sometime ago, and
apparently nobody knows why. I have sent it to the Turbine developers so
that they can put it back. Maybe it's that they're very busy preparing
2.3, but I don't understand why is it that the tag library hasn't been
restored yet, considering that Turbine's homepage mentions JSP a lot.
Everyone trying to use Turbine with JSP faces the same problem.

If you want, I can email you the tag library.

Gabriel

On Thu, 2003-08-21 at 11:10, David Philippi wrote:
> I've found the taglib template.tld and copied it into web-apps/tlds, now
> I've got the problem that I don't know where to get the class files for it:
> 
> Unable to load class org.apache.turbine.services.jsp.tags.ScreenTag
> 
> Bye David
> 
> -----Original Message-----
> From: Gabriel Moreno [mailto:gabrielm@itcsoluciones.com] 
> Sent: Wednesday, August 20, 2003 2:38 PM
> To: Turbine Users List
> 
> You can't reference the screen explicitly from the layout. In the layout you
> always have:
> 	<turbine:screen section="body" />
> to reference the screen body. If you want a screen named MyScreen.jsp to
> have a different layout, you have to create a layout called MyScreen.jsp and
> it will be used whenever you request MyScreen.jsp screen.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: JSP templates

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
You can set the layout by overriding the getLayout method in the screen
class for the template:
public String getLayout(RunData data) {
    data.setLayoutTemplate("/CommonLayout.jsp");
    return super.getLayout(data);
}

When I have several screens that share a layout, I usually create a
screen class that does what I wrote before. Then, I use this class as
the base for the screen classes for which I want the common layout.

Gabriel

> Hi!
> 
> I need help with JSP templates. 
> 
> I'm using JSP with turbine (Velocity is not an option). I have 4 templates for
> 10 screens and I want to know how I can set the template for a page. 
> 
> I just know that the layout for the screen A.jsp is also named A.jsp. When I
> tried rundata.setLayoutTemplate("B.jsp"), it is not reflected to the page but I
> know that the layout template is set to B.jsp bec of rundata.getLayoutTemplate().
> 
> Thank you!
> 
> Fina 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
-- 
Gabriel Moreno <ga...@itcsoluciones.com>
ITC Soluciones


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


RE: Using TDK with JSP

Posted by David Philippi <se...@juris.de>.
I've found the taglib template.tld and copied it into web-apps/tlds, now
I've got the problem that I don't know where to get the class files for it:

Unable to load class org.apache.turbine.services.jsp.tags.ScreenTag

Bye David

-----Original Message-----
From: Gabriel Moreno [mailto:gabrielm@itcsoluciones.com] 
Sent: Wednesday, August 20, 2003 2:38 PM
To: Turbine Users List

You can't reference the screen explicitly from the layout. In the layout you
always have:
	<turbine:screen section="body" />
to reference the screen body. If you want a screen named MyScreen.jsp to
have a different layout, you have to create a layout called MyScreen.jsp and
it will be used whenever you request MyScreen.jsp screen.


RE: Using TDK with JSP

Posted by David Philippi <se...@juris.de>.
I've found the taglib template.tld and copied it into web-apps/tlds, now
I've got the problem that I don't know where to get the class files for it:

Unable to load class org.apache.turbine.services.jsp.tags.ScreenTag

Bye David

-----Original Message-----
From: Gabriel Moreno [mailto:gabrielm@itcsoluciones.com] 
Sent: Wednesday, August 20, 2003 2:38 PM
To: Turbine Users List

You can't reference the screen explicitly from the layout. In the layout you
always have:
	<turbine:screen section="body" />
to reference the screen body. If you want a screen named MyScreen.jsp to
have a different layout, you have to create a layout called MyScreen.jsp and
it will be used whenever you request MyScreen.jsp screen.


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


RE: Using TDK with JSP

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
You can't reference the screen explicitly from the layout. In the layout
you always have:
	<turbine:screen section="body" />
to reference the screen body. If you want a screen named MyScreen.jsp to
have a different layout, you have to create a layout called MyScreen.jsp
and it will be used whenever you request MyScreen.jsp screen.

On Wed, 2003-08-20 at 05:45, David Philippi wrote:
> Could you send me an example layout template? I don't know how to reference
> the screen from within the default.jsp. I could try to include it
> explicitely when using a layout with the same name but when I tried that I
> got exceptions due to the same name of the JSP pages.
> 
> Bye David
> 
> 
> -----Original Message-----
> I hadn't been able to use setLayout(). What I do is to have a layout
> template with the same name of the screen for which I want a different
> layout. Layout templates are located in a directory named layouts at the
> same level that the screens directory. Usually, this is
> templates/app/layouts
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Using TDK with JSP

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
You can't reference the screen explicitly from the layout. In the layout
you always have:
	<turbine:screen section="body" />
to reference the screen body. If you want a screen named MyScreen.jsp to
have a different layout, you have to create a layout called MyScreen.jsp
and it will be used whenever you request MyScreen.jsp screen.

On Wed, 2003-08-20 at 05:45, David Philippi wrote:
> Could you send me an example layout template? I don't know how to reference
> the screen from within the default.jsp. I could try to include it
> explicitely when using a layout with the same name but when I tried that I
> got exceptions due to the same name of the JSP pages.
> 
> Bye David
> 
> 
> -----Original Message-----
> I hadn't been able to use setLayout(). What I do is to have a layout
> template with the same name of the screen for which I want a different
> layout. Layout templates are located in a directory named layouts at the
> same level that the screens directory. Usually, this is
> templates/app/layouts
> 
> 
> ---------------------------------------------------------------------
> 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


RE: Using TDK with JSP

Posted by David Philippi <se...@juris.de>.
Could you send me an example layout template? I don't know how to reference
the screen from within the default.jsp. I could try to include it
explicitely when using a layout with the same name but when I tried that I
got exceptions due to the same name of the JSP pages.

Bye David


-----Original Message-----
I hadn't been able to use setLayout(). What I do is to have a layout
template with the same name of the screen for which I want a different
layout. Layout templates are located in a directory named layouts at the
same level that the screens directory. Usually, this is
templates/app/layouts


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


RE: Using TDK with JSP

Posted by David Philippi <se...@juris.de>.
Could you send me an example layout template? I don't know how to reference
the screen from within the default.jsp. I could try to include it
explicitely when using a layout with the same name but when I tried that I
got exceptions due to the same name of the JSP pages.

Bye David


-----Original Message-----
I hadn't been able to use setLayout(). What I do is to have a layout
template with the same name of the screen for which I want a different
layout. Layout templates are located in a directory named layouts at the
same level that the screens directory. Usually, this is
templates/app/layouts


Re: Using TDK with JSP

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
David,
I hadn't been able to use setLayout(). What I do is to have a layout
template with the same name of the screen for which I want a different
layout. Layout templates are located in a directory named layouts at the
same level that the screens directory. Usually, this is
templates/app/layouts

Gabriel

On Mon, 2003-08-18 at 11:24, David Philippi wrote:
> I've got some problems regardings JSP's in turbine (using Velocity is not an
> option). 
> I can't find where the layout is defined. If I'm not completly on the wrong
> track, the option
> services.JspService.default.layout = DefaultLayout
> causes turbine to use DefaultLayout for my screens. I can guess that this is
> what yields the "Turbine - A Servlet Framework for building Secure Dynamic
> Websites." before and after my page but: where is that defined? 
> I'd like to know where I can change the content of the DefaultLayout for my
> app and how to change the layout for a single screen. I guess setLayout()
> may be what's required but I know neither what I should use as layout
> parameter (I suppose a file residing in X, using Y as the placeholder for
> the current screen name) nor where to call it. doBuildTemplate() seems to be
> too late in the process for a call to setLayout() but on the other hand it's
> the only place where I've got a RunData object (that I know of).
> Any help would be very appreciated, I'm in the fortunate situation of never
> having done anything with JSP, ServerPages or similar except CGI with Perl
> and I'm working on a project right now where I must use Turbine and I must
> use JSP instead of Velocity. Unfortunately, most if not all documentation
> that I find is based on Velocity and in most cases I don't know enough about
> Turbine yet to apply the information in the context of JSP. :-(
> 
> Bye David
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Using TDK with JSP

Posted by Gabriel Moreno <ga...@itcsoluciones.com>.
David,
I hadn't been able to use setLayout(). What I do is to have a layout
template with the same name of the screen for which I want a different
layout. Layout templates are located in a directory named layouts at the
same level that the screens directory. Usually, this is
templates/app/layouts

Gabriel

On Mon, 2003-08-18 at 11:24, David Philippi wrote:
> I've got some problems regardings JSP's in turbine (using Velocity is not an
> option). 
> I can't find where the layout is defined. If I'm not completly on the wrong
> track, the option
> services.JspService.default.layout = DefaultLayout
> causes turbine to use DefaultLayout for my screens. I can guess that this is
> what yields the "Turbine - A Servlet Framework for building Secure Dynamic
> Websites." before and after my page but: where is that defined? 
> I'd like to know where I can change the content of the DefaultLayout for my
> app and how to change the layout for a single screen. I guess setLayout()
> may be what's required but I know neither what I should use as layout
> parameter (I suppose a file residing in X, using Y as the placeholder for
> the current screen name) nor where to call it. doBuildTemplate() seems to be
> too late in the process for a call to setLayout() but on the other hand it's
> the only place where I've got a RunData object (that I know of).
> Any help would be very appreciated, I'm in the fortunate situation of never
> having done anything with JSP, ServerPages or similar except CGI with Perl
> and I'm working on a project right now where I must use Turbine and I must
> use JSP instead of Velocity. Unfortunately, most if not all documentation
> that I find is based on Velocity and in most cases I don't know enough about
> Turbine yet to apply the information in the context of JSP. :-(
> 
> Bye David
> 
> 
> ---------------------------------------------------------------------
> 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