Re: How to avoid a separate .jsp page for body definition when us ing Templates?

2002-04-04 Thread Jens Viebig

You don't need tiles for this issue
Just use direct='true' in your template tag.

template:insert template='/templates/template.jsp'
template:put name='menu' content='/menu.jsp'/
template:put name='content' direct='true'
   body
  h1Your body goes here/h1
   /body
/template:put
/template:insert

- Original Message -
From: Wellie W. Chao [EMAIL PROTECTED]
Newsgroups: Struts
Sent: Wednesday, April 03, 2002 6:38 PM
Subject: RE: How to avoid a separate .jsp page for body definition when us
ing Templates?


 Hi Alex,

 I agree with Mark. I had your same problem a while back and decided to
 switch to Tiles, which is much more flexible. For each page, I have an
entry
 in struts-config.xml and one in tiles-defs.xml. A really simple page looks
 like this:

 struts-config.xml:
 action path=/security/authIndex
forward=site.page.security.authIndex/

 tiles-defs.xml:
 definition name=site.page.security.authIndex
 path=/security/authIndex.jsp/

 /security/authIndex.jsp:
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
 logic:present role=guest
   logic:redirect page=/guest/index.do/
 /logic:present
 logic:present role=admin
   logic:redirect page=/admin/index.do/
 /logic:present
 logic:present role=candidate
   logic:redirect page=/candidate/index.do/
 /logic:present
 logic:present role=employer
   logic:redirect page=/employer/index.do/
 /logic:present

 You could put whatever you wanted in /security/authIndex.jsp. Also, you
can
 have the site.page.security.authIndex inherit from a base layout if you
 wanted to. You no longer need two files per page. It's one master layout
 file plus a file for each logical content page (a page body).

 -Original Message-
 From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:21 AM
 To: 'Struts Users Mailing List'
 Subject: RE: How to avoid a separate .jsp page for body definition when
 us ing Templates?


 Hi Alex,

 That was one of the reasons I used Tiles. You can put all your page
 definitions in tiles-defs.xml. This single configuration files will
replace
 all your page.jsp(s).

 Mark.

 -Original Message-
 From: Alex Paransky [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:19 AM
 To: 'Struts Users'
 Subject: How to avoid a separate .jsp page for body definition when
 using Templates?


 I am currently using Templates (not Tiles) to layout our pages.  While
 general components such as menu, header, footer are well defined, same for
 all pages, and are included from a global single location, the body is
 always different.  So, for every page, we wind up with 2 pages.

 page.jsp - uses the template tags to define the layout
 pageContent.jsp - used from page.jsp to define the body content

 This is quite cumbersome.  Is there a way to put the layout definition and
 the contents of at least the body into the same page?  Other things such
 as the title, and help text change on a page  by page basis, so it would
be
 nice to package these two items in to the same page as well.

 Is this easier done with Tiles?

 Thanks.

 -AP_
 http://www.alexparansky.com
 Java/J2EE Architect/Consultant
 http://www.myprofiles.com/member/view.do?profileId=127


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



 --
--
 --
 This message is intended only for the personal and confidential use of the
 designated recipient(s) named above.  If you are not the intended
recipient
 of this message you are hereby notified that any review, dissemination,
 distribution or copying of this message is strictly prohibited.  This
 communication is for information purposes only and should not be regarded
as
 an offer to sell or as a solicitation of an offer to buy any financial
 product, an official confirmation of any transaction, or as an official
 statement of Lehman Brothers.  Email transmission cannot be guaranteed to
be
 secure or error-free.  Therefore, we do not represent that this
information
 is complete or accurate and it should not be relied upon as such.  All
 information is subject to change without notice.



 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: How to avoid a separate .jsp page for body definition when us ing Templates?

2002-04-03 Thread Wellie W. Chao

Hi Alex,

I agree with Mark. I had your same problem a while back and decided to
switch to Tiles, which is much more flexible. For each page, I have an entry
in struts-config.xml and one in tiles-defs.xml. A really simple page looks
like this:

struts-config.xml:
action path=/security/authIndex forward=site.page.security.authIndex/

tiles-defs.xml:
definition name=site.page.security.authIndex
path=/security/authIndex.jsp/

/security/authIndex.jsp:
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
logic:present role=guest
  logic:redirect page=/guest/index.do/
/logic:present
logic:present role=admin
  logic:redirect page=/admin/index.do/
/logic:present
logic:present role=candidate
  logic:redirect page=/candidate/index.do/
/logic:present
logic:present role=employer
  logic:redirect page=/employer/index.do/
/logic:present

You could put whatever you wanted in /security/authIndex.jsp. Also, you can
have the site.page.security.authIndex inherit from a base layout if you
wanted to. You no longer need two files per page. It's one master layout
file plus a file for each logical content page (a page body).

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:21 AM
To: 'Struts Users Mailing List'
Subject: RE: How to avoid a separate .jsp page for body definition when
us ing Templates?


Hi Alex,

That was one of the reasons I used Tiles. You can put all your page
definitions in tiles-defs.xml. This single configuration files will replace
all your page.jsp(s).

Mark.

-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:19 AM
To: 'Struts Users'
Subject: How to avoid a separate .jsp page for body definition when
using Templates?


I am currently using Templates (not Tiles) to layout our pages.  While
general components such as menu, header, footer are well defined, same for
all pages, and are included from a global single location, the body is
always different.  So, for every page, we wind up with 2 pages.

page.jsp - uses the template tags to define the layout
pageContent.jsp - used from page.jsp to define the body content

This is quite cumbersome.  Is there a way to put the layout definition and
the contents of at least the body into the same page?  Other things such
as the title, and help text change on a page  by page basis, so it would be
nice to package these two items in to the same page as well.

Is this easier done with Tiles?

Thanks.

-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/view.do?profileId=127


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]