JSP Include Vs. Struts Template Include

2004-02-10 Thread ssrinivasrao
Hi guys,

Can anyone help me understand the diff. between the JSP include (say including 2
to 3 .jsp pages in the main jsp) and Struts Template include tags.

My main doubt is  Why Struts template include tag is preferred over its
counterpart?

Confused with the pros. and cons. of both the approach.

Awaiting your powerful replies.

Friendly,
S.Srikanth



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



RE: JSP Include Vs. Struts Template Include

2004-02-10 Thread Andrew Hill
Not sure, but if you after a really good templating mechanism forget those
two and take a look at the struts Tiles extension.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 10 February 2004 17:04
To: [EMAIL PROTECTED]
Subject: JSP Include Vs. Struts Template Include


Hi guys,

Can anyone help me understand the diff. between the JSP include (say
including 2
to 3 .jsp pages in the main jsp) and Struts Template include tags.

My main doubt is  Why Struts template include tag is preferred over its
counterpart?

Confused with the pros. and cons. of both the approach.

Awaiting your powerful replies.

Friendly,
S.Srikanth



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



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



Can I use template library tags directly with struts-faces?

2004-01-15 Thread Diego Louzán Martínez
I'm porting a Struts application to JSF using struts-faces.
Thisapplication uses the template tags from Struts and for now I
don'twant to migrate them to Tiles. My question is: can I use template
tagsdirectly with the implementation of the request processor
ofstruts-faces (FacesRequestProcessor) or do I have to implement
somevariant (like FacesTilesRequestProcessor)?Thanks in advance.
-- 
Diego Louzán Martínez


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



Announce: JPlates 3.0.1 released - object-oriented template processing for Java, JSP, and Struts

2004-01-05 Thread Dan Jacobs
JPlates Inc has announced the general availability of JPlates 3.0.1.  
JPlates 3.0.1 adds template processing to Java, providing fully 
compiled, object-oriented template processing with template objects and 
template methods.  JPlates dramatically improves productivity for Java 
and JSP and Struts developers.  A free evaluation version is available.

The new features in JPlates 3.0.1 include support for using JPlates 
template components with JSPs, even more support for Struts 
applications, dynamic class and configuration reloading for JPlates and 
Struts, enhanced Ant integration, and a new template visualization tool.

For more information and JPlates examples, visit http://www.jplates.com.

JPlates 3.0.1 syntax extends Java 1.4 syntax with JPlates template 
methods. Template methods are called just like other methods, but use 
JPlates template syntax for their method bodies.  The result is 
callable, executable templates.  The template method syntax combines 
template literal text with:  substitution and i18n expressions, control 
flow statements and method calls, variable declarations and assignments, 
and output format control statements.

JPlates classes are compiled into Java to ensure 100% compatibility with 
Java. The JPlates compiler is fast and robust, and maintains line 
numbers between the JPlates source and the generated Java to support 
easy debugging. The JPlates 3.0.1 runtime provides high performance 
template processing support for Servlets, Struts, JSP, J2EE, and J2SE 
applications.

JPlates 3.0.1 offers the most usable, flexible, and powerful technology 
for dynamic content generation on the web, for XML transformation, for 
source code generation, for generating personalized email, or for any 
other application involving template-based processing.  Use JPlates 
3.0.1 along with or in place of JSP, XSLT, and other template 
processors, wherever you generate stylized text, whether in a 
web-application, a code-generator, or any other kind of Java application.



template and html:messages/

2003-11-17 Thread Jürgen Scheffler
Hi experts,

my english isn´t good, so I use simple english:

I got a template.jsp :

%@ include file=taglibs.jsp %
html:html locale=true
head
html:base target='_self'/
link href=../css/main.css rel=stylesheet type=text/css /head
body html:errors/ html:messages  id=message /html:messages p
template:get name='content'/ /p brbrbr template.jsp ;-)
/body !--FOOTER-- /html:html

then I got a fahrplan.jsp:

%@ include file=taglibs.jsp %
template:insert template='/pages/template.jsp' 
template:put name='content'
content='/pages/portal/content.jsp'/
/template:insert

The content.jsp can start Actions and make a new Messages object, the
control is returned to fahrplan.jsp
What do I have do write into the content.jsp or ActionClass, so that
the fahrplan.jsp shows me the messages?

I tried:

logic:messagesPresent message=true
html:messages id=message message=true
bean:write name=message/
/html:messages
/logic:messagesPresent

The message get writen, but not to the position html:messages
id=message/html:messages in the fahrplan.jsp

Greetings

Jürgen


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



sharing tiles template across multiple applications?

2003-11-07 Thread Raymaker, Dora
Hello, I've got a number of separate struts/tiles web applications which
I'm consolidating under a single login.  These separate applications
need to be kept separate because they may need to exist on different
physical servers, have different hardware needs, etc.  Also, we do not
want to have to reload everything every time one piece of functionality
changes.  However, from the user's point of view, they should all look
like a single application.

 

To that end, I'd like to have my tiles template and certain of the
common tiles (header, footer, etc.) centralized, able to be used by all
of the distinct applications.

 

Is there a way to do this?

 

Currently we are running Struts 1.0, but will probably be moving to 1.1
for the consolidation project.

 

Is there a better way of achieving the goals of 1. unified maintainable
interface; 2. single login; 3. webapps with very distinct physical
needs; 4. enable updates to a single app w/o having to touch all apps?

 

Thanks!

 

Dora Raymaker

Sr. Technical Writer

XO Communications, Interactive Division

503.972.6808

[EMAIL PROTECTED]

 



Where did the template tags doc's go?

2003-10-27 Thread Greg Hess








Does anyone know where I can find the docs for the
template tags?




 
  
  Greg
   Hess
  
 
 
  
  Software
  Engineer
  
 
 
  
  Wrapped
  Apps Corporation
  
 
 
  
  275 Michael Cowpland Dr.
  
 
 
  
  Suite
   201
  
 
 
  
  Ottawa, Ontario
  
 
 
  
  K2M
  2G2
  
 
 
  
  Tel:
  (613) 591 -7552
  
 
 
  
  Fax:
  (613) 591-0523
  
 
 
  
  1 (877) 388-6742
  
 
 
  
  www.wrappedapps.com
  
 
 
  
  
  
 











Re: Where did the template tags doc's go?

2003-10-27 Thread jbaker
http://www.lifl.fr/~dumoulin/tiles/

Joe Baker
Director of Internet Communications
Amnesty International USA





Greg Hess [EMAIL PROTECTED]
10/21/03 12:39 PM
Please respond to Struts Users Mailing List

 
To: Struts [EMAIL PROTECTED]
cc: 
Subject:Where did the template tags doc's go?


Does anyone know where I can find the doc's for the template tags?
 

Greg Hess
Software Engineer
Wrapped Apps Corporation
275 Michael Cowpland Dr.
Suite 201
Ottawa, Ontario
K2M 2G2
Tel: (613) 591 -7552
Fax: (613) 591-0523
1 (877) 388-6742
www.wrappedapps.com

 



Template Method Design

2003-09-18 Thread Vijay K Hegde
Hi,

  I have a requirement. Anybody has created an abstract action class that extends 
Action. It makes the perform method as final. And creates an abstract method 
satPerform that has to implemented by the classes extending thus providing sort of a 
base class.

The intention behind is to take care of exception handling in the abstract class and 
rest in the child classes.

Action   perform()
Abstract Class extends Action final perform(), abstract satPerform()
SatAction extends Abstract - satPerform().

The pattern is Template Method Design.

If anybody has used such approach, please share the details.

If somebody could shed some light in this topic i would be grateful.

Vijay K. Hegde
Software Engineer
Infosys Technologies Limited, Hyderabad
* (040) 2300 5222 extn 23239



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



Re: Template Method Design

2003-09-18 Thread Pat Quinn
Take a look at Chapter 10 - Exception Handling in Programming Jakarta Struts 
by chuck cavaness.. i think you'll find this very helpful.

I've implement this with Action but ill soon need to do the same for 
Dispatch Action too... has anyone done likewise for Dispatch and other such 
actions?



From: Vijay K Hegde [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Template Method Design
Date: Thu, 18 Sep 2003 15:01:59 +0530
Hi,

  I have a requirement. Anybody has created an abstract action class that 
extends Action. It makes the perform method as final. And creates an 
abstract method satPerform that has to implemented by the classes extending 
thus providing sort of a base class.

The intention behind is to take care of exception handling in the abstract 
class and rest in the child classes.

Action   perform()
Abstract Class extends Action final perform(), abstract satPerform()
SatAction extends Abstract - satPerform().
The pattern is Template Method Design.

If anybody has used such approach, please share the details.

If somebody could shed some light in this topic i would be grateful.

Vijay K. Hegde
Software Engineer
Infosys Technologies Limited, Hyderabad
* (040) 2300 5222 extn 23239


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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


RE: Template Method Design

2003-09-18 Thread Andrew Hill
I use the technique of finalising execute (1.1 equivelent of perform) and
having it do the lions share of the work for things. For example in a crud
action most of the work is occuring in execute and the subclasses just do
those things that are specific to the record type in question...

I find it works *very* well, and indeed I would suggest that for all but the
most trivial apps your wasting a lot of your own time by having any concrete
action class do ALL the work when you could be using inheritance and an
abstract superclass 'template' to take care of the generic stuff.

(Incidentally one thing Ive found useful when doing things this way is to
have the superclass execute method create
an 'ActionContext' bean that encapsulates the four parameters that get
passed to execute, and then you pass that to your subclasses. Saves a lot of
time, and gives you a spot you can add extra stuff to later instead of
having to change lots of method signatures.)


In terms of exception handling though, you may be better off using the
struts ExceptionHandler feature for dealing with exceptions thrown by
actions.

-Original Message-
From: Vijay K Hegde [mailto:[EMAIL PROTECTED]
Sent: Thursday, 18 September 2003 17:32
To: Struts Users Mailing List
Subject: Template Method Design


Hi,

  I have a requirement. Anybody has created an abstract action class that
extends Action. It makes the perform method as final. And creates an
abstract method satPerform that has to implemented by the classes extending
thus providing sort of a base class.

The intention behind is to take care of exception handling in the abstract
class and rest in the child classes.

Action   perform()
Abstract Class extends Action final perform(), abstract satPerform()
SatAction extends Abstract - satPerform().

The pattern is Template Method Design.

If anybody has used such approach, please share the details.

If somebody could shed some light in this topic i would be grateful.

Vijay K. Hegde
Software Engineer
Infosys Technologies Limited, Hyderabad
* (040) 2300 5222 extn 23239



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


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



Quick template question

2003-09-10 Thread Stephane Grenier
Hello all.

I've got the following template file:

%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %
template:insert template='/tilesExample.jsp'
 template:put name='title' content='Templates' direct='true'/
 template:put name='header' content='/header.html' /
 template:put name='sidebar' content='/menu.html' /
 template:insert name='content' content='/content.html' /
 template:put name='footer' content='/footer.html' /
/template:insert

Is there a mechanism to have just one file rather than 2 seperate files for the 
content ? Is it possible to at least replace the line:

 template:insert name='content' content='/content.html' /

with just the html code for that page directly in this file ? And if so how would I do 
that ?

Thank you,
Stephane




Required Template Variables

2003-08-16 Thread Met @ Uber
I have about 10 variables that I need assigned to every single
template.  Most of them come from a database or XML file.  Is there a
way to do this without hard coding them into each and every action? 
Like perhaps the class that deals with my action forward could gather
them?  Any suggestions would be greatly appreciated.

~ Matthew


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



Re: Required Template Variables

2003-08-16 Thread Sgarlata Matt
I'm not sure exactly what you are trying to do, but I have 2 different 
ideas you can choose from:

1) Subclass the Action class to do this for you, and have all of your 
Action classes extend from this new subclass.
2) Store this information in the session so you don't have to pass it 
back and forth with each request/response.

Matt

Met @ Uber wrote:

I have about 10 variables that I need assigned to every single
template.  Most of them come from a database or XML file.  Is there a
way to do this without hard coding them into each and every action? 
Like perhaps the class that deals with my action forward could gather
them?  Any suggestions would be greatly appreciated.

~ Matthew

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Matthew Sgarlata
Senior Consultant
Booz Allen Hamilton Inc.
Work: 703-377-0871
Fax: 703-902-3608
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Using Sturts-HTML tags in Template

2003-08-01 Thread Joe Krause
I am trying to place the bulk of my navigation and HTML header code into a
header.jsp file. Each JSP view page then includes a header.jsp and a
footer.jsp file using the following:

 

%@ include file = /templates/header.jsp %

 

// Page specific implementation

 

%@ include file = /templates/footer.jsp %

 

This works great. But when I added the %@ taglib
uri=/WEB-INF/struts-html.tld prefix=html % taglib directive and made
html become html:html in the header.jsp file and /html become
/html:html in the footer file, I get the following error:

 

org.apache.jasper.JasperException:
/WEB-INF/jsp/admin/employee/list.jsp(16,0) /templates/header.jsp(39,0)
Unterminated  tag

 

 

Is there a way to have the html:html and the /html:html tags be in
different physical .jsp files? I thought that by using the PAGE DIRECTIVE
INCLUDE versus the TAGLIB INCLUDE I would be assured that the pages would be
included at compile time and thus work.

 

Please advise!

 

Joe



RE: Using Sturts-HTML tags in Template

2003-08-01 Thread James Childers
First off, it's a very good rule to not break up opening and closing HTML tags into 
separate files. Second, this is required when your tags are custom tags: the include 
file is its own compilation unit, so as far as the interpreter is concerned the 
closing tag doesn't exist unless it is in the same file.

It's far better to a) use Tiles instead of include files, and b) make a single main 
page that contains your html:html/html:html tags, body tags, and so forth. The 
sub-tiles will populate your body elements.

In any case, Jasper is doing what it should. Put your opening and closing tags in the 
same file. In the case of JSPs, it's not just a good idea, it's the law.

-= J

 -Original Message-
 From: Joe Krause [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 01, 2003 2:59 PM
 To: '[EMAIL PROTECTED]'
 Subject: Using Sturts-HTML tags in Template
 
 
 I am trying to place the bulk of my navigation and HTML 
 header code into a
 header.jsp file. Each JSP view page then includes a header.jsp and a
 footer.jsp file using the following:
 
  
 
 %@ include file = /templates/header.jsp %
 
  
 
 // Page specific implementation
 
  
 
 %@ include file = /templates/footer.jsp %
 
  
 
 This works great. But when I added the %@ taglib
 uri=/WEB-INF/struts-html.tld prefix=html % taglib 
 directive and made
 html become html:html in the header.jsp file and /html become
 /html:html in the footer file, I get the following error:
 
  
 
 org.apache.jasper.JasperException:
 /WEB-INF/jsp/admin/employee/list.jsp(16,0) /templates/header.jsp(39,0)
 Unterminated  tag
 
  
 
  
 
 Is there a way to have the html:html and the /html:html tags be in
 different physical .jsp files? I thought that by using the 
 PAGE DIRECTIVE
 INCLUDE versus the TAGLIB INCLUDE I would be assured that the 
 pages would be
 included at compile time and thus work.
 
  
 
 Please advise!
 
  
 
 Joe
 
 

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



template theme idea

2003-07-18 Thread Dan Allen
I have an idea which I think would help to make struts more flexible
when it comes to skinning an application.  I might get shot down
for this, but it makes a lot of sense to be, so here goes.

Currently in struts, the paths in the configuration file (and
taglibs) can follow a forwardPattern and pagePattern which in
turn can currently use two variables, $M for the module directory
and $P for the path value.  I propose to add a third variable named
$T which would be replaced with the theme name.  The theme can be
specified as an init parameter for the servlet in web.xml and
possibly overridden by a BaseAction if a certain cookie is read in.
It looks as though the best place for the getter/setter would be in
the ActionServlet since it needs to be available to all Actions that
are created.  Better I guess would be to place it in a
THEME_NAME_KEY in the servletContext and then use put the get/set
method in the Action.

Before I make a patch I need to know where one would place this
information in order to modify.  The other issue I forsee is that
using WEB-INF for the jsp pages no longer becomes a viable option
since the path element would be 

/WEB-INF/jsp/example.jsp

doing

$M$T$P

would leave behind (in the default module configuration)

/default/WEB-INF/jsp/example.jsp

...so container security can be used instead.

The only issue I see with this in the taglibs is if you wanted to
include a common file to all themes.  Is there already a way to
change the pattern for creating the path in the taglibs...or is the
pattern sticky once it is set?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
When you're raised by the Jesuits, you become either obedient 
or impertinent 
 -- Jack McCoy, Law and Order
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: possible to parameterize template path in tiles definition whenusing tile def config file?

2003-06-20 Thread Cedric Dumoulin
 The current implementation of Tiles doesn't allow to change 
dynamically the path/layout of a definition. This is an enhancement request.
 A workaround is to have a struts action forwarding to different 
definitions, according to the path you want to use.
 Another trick is to have a jsp/tiles used as indirection. This tile is 
used as the path of your definition. This tile do an insert with the 
path set from one of the attribute (as you suggested), and pass all 
others attribute.

 Hope this help,

   Cedric

Trevor Porter wrote:

I'm trying to figure out if it's at all possible to parameterize the 
template path for a tiles defintion dynamically at runtime while at 
the same time declaring the tile definitions from a config file. I 
understand that this is straightforward when declaring a tile 
definition within a JSP (tiles:definition id=definitionName 
page=%layout%), but I want to use my tile definitions as 
ActionForwards, thus I need to declare them in a config file. This 
would be useful for scenarios where pages need to be laid out 
differently based on some key (such as user preference or browser 
type) but the struts-config file only knows of a single definition to 
forward to for a given action. For example, imagine the following 
struts-config action mapping:

  action path=/login
  type=LoginAction
  input=/index.jsp
  name=loginForm
  validate=true
  scope=request
forward name=success path=.account.home/  The forward path 
points to a tiles definition that renders the account home page. I 
would like to dynamically control which template layout page is used 
for this definition from within the LoginAction. Is this possible?

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



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


Re: possible to parameterize template path in tiles definition whenusing tile def config file?

2003-06-20 Thread Trevor Porter
Thanks. I eventually stumbled across the Tile Advanced Features document 
and am now doing just that -- using a Struts action in my tiles 
definition path to dynamically select my layout. Works perfectly for my 
needs.

...Trevor

Cedric Dumoulin wrote:

 The current implementation of Tiles doesn't allow to change 
dynamically the path/layout of a definition. This is an enhancement 
request.
 A workaround is to have a struts action forwarding to different 
definitions, according to the path you want to use.
 Another trick is to have a jsp/tiles used as indirection. This tile 
is used as the path of your definition. This tile do an insert with 
the path set from one of the attribute (as you suggested), and pass 
all others attribute.

 Hope this help,

   Cedric

Trevor Porter wrote:

I'm trying to figure out if it's at all possible to parameterize the 
template path for a tiles defintion dynamically at runtime while at 
the same time declaring the tile definitions from a config file. I 
understand that this is straightforward when declaring a tile 
definition within a JSP (tiles:definition id=definitionName 
page=%layout%), but I want to use my tile definitions as 
ActionForwards, thus I need to declare them in a config file. This 
would be useful for scenarios where pages need to be laid out 
differently based on some key (such as user preference or browser 
type) but the struts-config file only knows of a single definition to 
forward to for a given action. For example, imagine the following 
struts-config action mapping:

  action path=/login
  type=LoginAction
  input=/index.jsp
  name=loginForm
  validate=true
  scope=request
forward name=success path=.account.home/  The forward path 
points to a tiles definition that renders the account home page. I 
would like to dynamically control which template layout page is used 
for this definition from within the LoginAction. Is this possible?

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



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



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


possible to parameterize template path in tiles definition when usingtile def config file?

2003-06-18 Thread Trevor Porter
I'm trying to figure out if it's at all possible to parameterize the 
template path for a tiles defintion dynamically at runtime while at the 
same time declaring the tile definitions from a config file. I 
understand that this is straightforward when declaring a tile definition 
within a JSP (tiles:definition id=definitionName page=%layout%), 
but I want to use my tile definitions as ActionForwards, thus I need to 
declare them in a config file. This would be useful for scenarios where 
pages need to be laid out differently based on some key (such as user 
preference or browser type) but the struts-config file only knows of a 
single definition to forward to for a given action. For example, imagine 
the following struts-config action mapping:

  action path=/login
  type=LoginAction
  input=/index.jsp
  name=loginForm
  validate=true
  scope=request
forward name=success path=.account.home/  
The forward path points to a tiles definition that renders the account 
home page. I would like to dynamically control which template layout 
page is used for this definition from within the LoginAction. Is this 
possible?

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


RE: Template VS JSP:include

2003-06-12 Thread shirishchandra.sakhare
But u are missing the obvious point...
With jsp include, if you want to change the layout, or some generic cahange, u will 
have to change all n pages..And with template u will just change 1 jsp..The template 
jsp..That is the real reason..to make the maintenance easy..

BTW, if u use tiles instead of Tmplate tags then u will have just n +1 jsps plus 1 
definition file...And it is very easy to implement..Very similar to the template...

-Original Message-
From: Peng Zhao [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 1:03 AM
To: [EMAIL PROTECTED]
Subject: Template VS JSP:include


which one is better?

As a website of n pages, the template method will have
  1(template) + 2*n(one use template, the other is content) = 2*n+1 JSPs

the jsp:include method only have
  n(pages) + m(header, footer...) = n+m



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


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



RE: Template VS JSP:include

2003-06-12 Thread Nimish Chourey , Tidel Park - Chennai
There has been a discussion on this before on the maling list .. 
If you are using Tiles with Struts then this can be taken care of .. 

-Original Message-
From: Peng Zhao [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 4:33 AM
To: [EMAIL PROTECTED]
Subject: Template VS JSP:include


which one is better?

As a website of n pages, the template method will have
  1(template) + 2*n(one use template, the other is content) = 2*n+1 JSPs

the jsp:include method only have
  n(pages) + m(header, footer...) = n+m



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


Template VS JSP:include

2003-06-11 Thread Peng Zhao
which one is better?

As a website of n pages, the template method will have
  1(template) + 2*n(one use template, the other is content) = 2*n+1 JSPs

the jsp:include method only have
  n(pages) + m(header, footer...) = n+m



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



Re: Template VS JSP:include

2003-06-11 Thread Max Cooper
You can combine the use of template and content pages into one JSP to
get n+1 JSPs.

template:insert
  template:put
!-- actual content --
  /template:put
/template:insert

-Max

- Original Message - 
From: Peng Zhao [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 4:02 PM
Subject: Template VS JSP:include


 which one is better?

 As a website of n pages, the template method will have
   1(template) + 2*n(one use template, the other is content) = 2*n+1 JSPs

 the jsp:include method only have
   n(pages) + m(header, footer...) = n+m



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





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



Re: Problem forwarding from a Tile or Template.

2003-04-02 Thread Cedric Dumoulin
 Hi,

 The provided code should work with Tiles if you have set the 
TilesRequestProcessor.

 The problem is that the jsp spec forbid the use of forward once the 
response is committed. But the jsp spec also said that a response is 
committed when you do an insert(). Tiles, and Templates, use 
include(). Struts action forward tag use forward(). So there is a 
problem. The TilesRequestProcessor takes care of this problem, and use 
include() instead of forward() when you use a forward ... in a struts 
action.

  Cedric

[EMAIL PROTECTED] wrote:

I get Cannot forward because the response has already been committed. I get the same response using Templates or Tiles. Here is a simplistic version of my problem.

My JSP is ...
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
tiles:insert page=/one-pane-template.jsp 
   tiles:put name=main value=/requestCreate1.do /
/tiles:insert
one-pane-template.jsp is 
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
html
head /
body
tiles:insert name=main/
   /body
/html
I am trying to attain a Tiled display, where one of the Tiles is a wizard. As there are a lot of initial form parameters for this app, I call the action and form to initialise the data. Hence, the .do call.

If I create an Action for the Tile container (one-pane-template.*) and populate the necessary beans there, calling one-pane-template.do and requestCreate1.jsp works, but this seems the wrong place to put the logic.

FYI - I initially raised this as a bug (for Templates)   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18469, but it was invalidated as Tiles had superseded it.

Thanks

Tony. 

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

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



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


RE: Problem forwarding from a Tile or Template.

2003-04-02 Thread Anthony . Leon
I assume you mean, add the following to the struts-config.xml

controller
contentType=text/html;charset=UTF-8
debug=3
locale=true
nocache=true
processorClass=org.apache.struts.tiles.TilesRequestProcessor
/

But having done this I now get;

Cannot initialize RequestProcessor of class 
org.apache.struts.tiles.TilesRequestProcessor: java.lang.ClassCastException: 
org.apache.struts.tiles.TilesUtilImpl

Am I going in the right direction?

T.

-Original Message-
From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 09:58
To: Struts Users Mailing List
Subject: Re: Problem forwarding from a Tile or Template.



  Hi,

  The provided code should work with Tiles if you have set the 
TilesRequestProcessor.

  The problem is that the jsp spec forbid the use of forward once the 
response is committed. But the jsp spec also said that a response is 
committed when you do an insert(). Tiles, and Templates, use 
include(). Struts action forward tag use forward(). So there is a 
problem. The TilesRequestProcessor takes care of this problem, and use 
include() instead of forward() when you use a forward ... in a struts 
action.

   Cedric
 

[EMAIL PROTECTED] wrote:

I get Cannot forward because the response has already been committed. I get the 
same response using Templates or Tiles. Here is a simplistic version of my problem.

My JSP is ...
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
tiles:insert page=/one-pane-template.jsp 
tiles:put name=main value=/requestCreate1.do /
/tiles:insert

one-pane-template.jsp is 
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
html
   head /
   body
   tiles:insert name=main/
/body
/html

I am trying to attain a Tiled display, where one of the Tiles is a wizard. As there 
are a lot of initial form parameters for this app, I call the action and form to 
initialise the data. Hence, the .do call.

If I create an Action for the Tile container (one-pane-template.*) and populate the 
necessary beans there, calling one-pane-template.do and requestCreate1.jsp works, 
but this seems the wrong place to put the logic.

FYI - I initially raised this as a bug (for Templates)   
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18469, but it was invalidated as 
Tiles had superseded it.

Thanks

Tony. 


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


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


  



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


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



Re: Problem forwarding from a Tile or Template.

2003-04-02 Thread Cedric Dumoulin
 You are going in the right direction, but you should declare the tiles 
plugin as follow in the struts-config.xml:

 plug-in className=org.apache.struts.tiles.TilesPlugin 
   set-property property=definitions-config
value=/WEB-INF/tiles-defs.xml /
   set-property property=moduleAware value=true /
 /plug-in
 This should be inserted after the /action-mappings tags.

 You can check the struts-config.xml file in tiles-documentation.war as 
example.

  Cedric

[EMAIL PROTECTED] wrote:

I assume you mean, add the following to the struts-config.xml

controller
contentType=text/html;charset=UTF-8
debug=3
locale=true
nocache=true
processorClass=org.apache.struts.tiles.TilesRequestProcessor
/
But having done this I now get;

Cannot initialize RequestProcessor of class org.apache.struts.tiles.TilesRequestProcessor: java.lang.ClassCastException: org.apache.struts.tiles.TilesUtilImpl

Am I going in the right direction?

T.

-Original Message-
From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]
Sent: 02 April 2003 09:58
To: Struts Users Mailing List
Subject: Re: Problem forwarding from a Tile or Template.


 Hi,

 The provided code should work with Tiles if you have set the 
TilesRequestProcessor.

 The problem is that the jsp spec forbid the use of forward once the 
response is committed. But the jsp spec also said that a response is 
committed when you do an insert(). Tiles, and Templates, use 
include(). Struts action forward tag use forward(). So there is a 
problem. The TilesRequestProcessor takes care of this problem, and use 
include() instead of forward() when you use a forward ... in a struts 
action.

  Cedric

[EMAIL PROTECTED] wrote:

 

I get Cannot forward because the response has already been committed. I get the same response using Templates or Tiles. Here is a simplistic version of my problem.

My JSP is ...
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
tiles:insert page=/one-pane-template.jsp 
  tiles:put name=main value=/requestCreate1.do /
/tiles:insert
one-pane-template.jsp is 
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
html
head /
body
tiles:insert name=main/
  /body
/html
I am trying to attain a Tiled display, where one of the Tiles is a wizard. As there are a lot of initial form parameters for this app, I call the action and form to initialise the data. Hence, the .do call.

If I create an Action for the Tile container (one-pane-template.*) and populate the necessary beans there, calling one-pane-template.do and requestCreate1.jsp works, but this seems the wrong place to put the logic.

FYI - I initially raised this as a bug (for Templates)   http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18469, but it was invalidated as Tiles had superseded it.

Thanks

Tony. 

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

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


   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version

Problem forwarding from a Tile or Template.

2003-04-01 Thread Anthony . Leon
I get Cannot forward because the response has already been committed. I get the same 
response using Templates or Tiles. Here is a simplistic version of my problem.

My JSP is ...
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
tiles:insert page=/one-pane-template.jsp 
tiles:put name=main value=/requestCreate1.do /
/tiles:insert

one-pane-template.jsp is 
%@ taglib uri=/WEB-INF/tld/struts-tiles.tld prefix=tiles %
html
head /
body
tiles:insert name=main/
/body
/html

I am trying to attain a Tiled display, where one of the Tiles is a wizard. As there 
are a lot of initial form parameters for this app, I call the action and form to 
initialise the data. Hence, the .do call.

If I create an Action for the Tile container (one-pane-template.*) and populate the 
necessary beans there, calling one-pane-template.do and requestCreate1.jsp works, 
but this seems the wrong place to put the logic.

FYI - I initially raised this as a bug (for Templates)   
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18469, but it was invalidated as 
Tiles had superseded it.

Thanks

Tony. 


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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



Re: modules, is it possible to share tiles template?

2003-03-18 Thread Cedric Dumoulin
 A possible workaround:

link rel=stylesheet type=text/css href=%=request.getContextPath()%/css/onelook_ie.css 

 Cedric

Mark Zeltser wrote:

Example:

Global Tile:
 link rel=stylesheet type=text/css href=html:rewrite
page='/css/onelook_ie.css'/ 
Regualar reference, html output:
link rel=stylesheet type=text/css href=/sample/css/onelook_ie.css 
Reference from sub module, html output:
link rel=stylesheet type=text/css
href=/sample/module/css/onelook_ie.css 
How to avoid having /module/ as part of URI when referenced from sub module?

Thanks,
Mark.
Mark Zeltser wrote:

 

Hi,

Is it possible to share tiles template from submodule? I woudlike to set
common look and feel for all sub apps. However, when sub module accesses
common tile, all image, stylesheet, etc, referenceses are changed to
include sub module as part of the URI. How can I solve this?
I tried to use /html:base tag with no success.

Env:
struts 1.1_b3
tomcat 4.1.8
Thanks,
Mark.
--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

--
NOTICE: If received in error, please destroy and notify sender.  Sender does
not waive confidentiality or privilege, and use is prohibited.


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



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


modules, is it possible to share tiles template?

2003-03-17 Thread Mark Zeltser
Hi,

Is it possible to share tiles template from submodule? I woudlike to set
common look and feel for all sub apps. However, when sub module accesses
common tile, all image, stylesheet, etc, referenceses are changed to
include sub module as part of the URI. How can I solve this?

I tried to use /html:base tag with no success.

Env:
struts 1.1_b3
tomcat 4.1.8

Thanks,
Mark.

--
NOTICE: If received in error, please destroy and notify sender.  Sender
does not waive confidentiality or privilege, and use is prohibited.



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



Re: modules, is it possible to share tiles template?

2003-03-17 Thread Mark Zeltser
Example:

Global Tile:
  link rel=stylesheet type=text/css href=html:rewrite
page='/css/onelook_ie.css'/ 

Regualar reference, html output:
link rel=stylesheet type=text/css href=/sample/css/onelook_ie.css 

Reference from sub module, html output:
 link rel=stylesheet type=text/css
href=/sample/module/css/onelook_ie.css 

How to avoid having /module/ as part of URI when referenced from sub module?

Thanks,
Mark.

Mark Zeltser wrote:

 Hi,

 Is it possible to share tiles template from submodule? I woudlike to set
 common look and feel for all sub apps. However, when sub module accesses
 common tile, all image, stylesheet, etc, referenceses are changed to
 include sub module as part of the URI. How can I solve this?

 I tried to use /html:base tag with no success.

 Env:
 struts 1.1_b3
 tomcat 4.1.8

 Thanks,
 Mark.

 --
 NOTICE: If received in error, please destroy and notify sender.  Sender
 does not waive confidentiality or privilege, and use is prohibited.

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

--
NOTICE: If received in error, please destroy and notify sender.  Sender does
not waive confidentiality or privilege, and use is prohibited.



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



[Q] struts-template - I centralized the layout file, but am I missing something?

2003-03-15 Thread Jeff Smith
I have 3 different pages in my test app:
Greet Unauthenticated User, Login and Greet Authenticated User

There is a PageUnauthGreet.jsp, PageAuthGreet.jsp and PageLoginUser.jsp.
Each has an identical structure:

%@ taglib uri='/tags/struts-template' prefix='template' %
template:insert template='/TemplateMain.jsp'
 template:put name='pagename' content='Logon' direct='true'/
 template:put name='header' content='/TileHeader.jsp'/
 template:put name='sidebar' content='/TileSidebar.jsp'/
 template:put name='content' content='FOO.jsp'/
/template:insert

The only difference between the 3 files is the FOO.jsp which loads the
content tile specific for that particular page.
Each one loads a different tile: TileUnauth.jsp, TileAuth.jsp and
FormLogon.jsp

This structure works fine. But it started to bug me that whenever I create a
new page, I had to create the structure.jsp and then the tile.jsp

So then I implemented a MasterLayout.jsp page like this:

%@ taglib uri='/tags/struts-template' prefix='template' %
%@ taglib uri='/tags/struts-bean' prefix='bean' %
bean:parameter id=tilePage name=tilePage/
bean:define id=fullTilePage value='%= tilePage %'/
template:insert template='/TemplateMain.jsp'
 template:put name='pagename' content='Logon' direct='true'/
 template:put name='header' content='/TileHeader.jsp'/
 template:put name='sidebar' content='/TileSidebar.jsp'/
 template:put name='content' content='%=fullTilePage%'/
/template:insert

Now I've been able to get rid of all my structure.jsp files and replace it
with this single MasterLayout.jsp

I can invoke it from the struts-config.xml with an action reference like
this:

 action path=/Logon
 type=org.apache.struts.actions.ForwardAction
 parameter=/MasterLayout.jsp?tilePage=FormLogon.jsp/

So essentially, I can now display any page that follows the standard
structure by writing a single tile for the content section of the page and
then invoking the MasterLayout with a tilePage= parameter to indicate which
tile should be thrown into the content section.

I have two questions:

1) Am I overlooking something that is likely to bite me?

2) Is there a more elegant way to control the filler tile?

In particular, I'm not crazy about the resulting URL line displayed in the
browser location. When I forwarded to the logon success page, I had a nice
url that just said:
http://localhost/MyAppName/LogonSubmit.do

But now that I am redirecting (instead of forwarding - to break the
back-button stomping issue) it shows a much icky-er
http://localhost:/MyAppName/MasterLayout.jsp?tilePage=/TileWelcome.jsp

I can live with it the way it is, but I want to be sure I'm exploiting all
the power there is to be had from the templates and tiles system, the action
forwarding syntax and all of that stuff.

Thanks,
Jefficus


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



Re: [Q] struts-template - I centralized the layout file, but am I missing something?

2003-03-15 Thread Dan Allen

Jeff Smith ([EMAIL PROTECTED]) wrote:

 I have 3 different pages in my test app:
 Greet Unauthenticated User, Login and Greet Authenticated User
 
 There is a PageUnauthGreet.jsp, PageAuthGreet.jsp and PageLoginUser.jsp.
 Each has an identical structure:
 
 %@ taglib uri='/tags/struts-template' prefix='template' %
 template:insert template='/TemplateMain.jsp'
  template:put name='pagename' content='Logon' direct='true'/
  template:put name='header' content='/TileHeader.jsp'/
  template:put name='sidebar' content='/TileSidebar.jsp'/
  template:put name='content' content='FOO.jsp'/
 /template:insert
 
 The only difference between the 3 files is the FOO.jsp which loads the
 content tile specific for that particular page.
 Each one loads a different tile: TileUnauth.jsp, TileAuth.jsp and
 FormLogon.jsp
 
 This structure works fine. But it started to bug me that whenever I create a
 new page, I had to create the structure.jsp and then the tile.jsp
 
 So then I implemented a MasterLayout.jsp page like this:
 
 %@ taglib uri='/tags/struts-template' prefix='template' %
 %@ taglib uri='/tags/struts-bean' prefix='bean' %
 bean:parameter id=tilePage name=tilePage/
 bean:define id=fullTilePage value='%= tilePage %'/
 template:insert template='/TemplateMain.jsp'
  template:put name='pagename' content='Logon' direct='true'/
  template:put name='header' content='/TileHeader.jsp'/
  template:put name='sidebar' content='/TileSidebar.jsp'/
  template:put name='content' content='%=fullTilePage%'/
 /template:insert
 
 Now I've been able to get rid of all my structure.jsp files and replace it
 with this single MasterLayout.jsp
 
 I can invoke it from the struts-config.xml with an action reference like
 this:
 
  action path=/Logon
  type=org.apache.struts.actions.ForwardAction
  parameter=/MasterLayout.jsp?tilePage=FormLogon.jsp/
 
 So essentially, I can now display any page that follows the standard
 structure by writing a single tile for the content section of the page and
 then invoking the MasterLayout with a tilePage= parameter to indicate which
 tile should be thrown into the content section.
 
 I have two questions:
 
 1) Am I overlooking something that is likely to bite me?
 
 2) Is there a more elegant way to control the filler tile?
 
 In particular, I'm not crazy about the resulting URL line displayed in the
 browser location. When I forwarded to the logon success page, I had a nice
 url that just said:
 http://localhost/MyAppName/LogonSubmit.do
 
 But now that I am redirecting (instead of forwarding - to break the
 back-button stomping issue) it shows a much icky-er
 http://localhost:/MyAppName/MasterLayout.jsp?tilePage=/TileWelcome.jsp
 
 I can live with it the way it is, but I want to be sure I'm exploiting all
 the power there is to be had from the templates and tiles system, the action
 forwarding syntax and all of that stuff.

You are on the verge of using tiles, go for it.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
While they're pumping, you're soaking them 
 -- Speed Loader TV Advert
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: [Q] struts-template - I centralized the layout file, but am Imissing something?

2003-03-15 Thread James CE Johnson
Hi Jeff,

I generally use Tiles to handle these kinds of things.

In your struts-config.xml install the Tiles plugin:
   plug-in className=org.apache.struts.tiles.TilesPlugin 
   set-property property=definitions-config
   value=/WEB-INF/tiles-definitions.xml/
   set-property property=definitions-parser-validate value=true /
   set-property property=moduleAware value=true /
   /plug-in
In your tiles-definitions.xml define your layout and other tiles:
  
tiles-definitions

 definition name=layout path=/WEB-INF/jsp/layout.jsp
   put name=title   value=Portfolio Analytics /
   put name=header  value=/WEB-INF/jsp/header.jsp /
   put name=footer  value=/WEB-INF/jsp/footer.jsp/
   put name=bodyvalue=/WEB-INF/jsp/blank.jsp /
   put name=menuvalue=/WEB-INF/jsp/menus/menuAll.jsp /
 /definition
 
 definition name=welcome extends=layout
  !-- replace the value of body in layout with something 
different  --
 put name=body value=/WEB-INF/jsp/welcome.jsp/
 /definition

/tiles-definitions

Back in struts-config your actions forward to tiles instead of jsps:

 action-mappings
   action path=/index type=some.object.Name
 forward name=success path=welcome/
   /action
 /action-mappings
Finally, your layout.jsp
%@ taglib uri=/WEB-INF/tiles.tld prefix=tiles %
html
 body
   tiles:insert attribute=header/
   tiles:insert attribute=menu/
   tiles:insert attribute=body/
   tiles:insert attribute=footer/
 /body
/html
Hope that helps a bit,
J
Jeff Smith wrote:

I have 3 different pages in my test app:
Greet Unauthenticated User, Login and Greet Authenticated User
There is a PageUnauthGreet.jsp, PageAuthGreet.jsp and PageLoginUser.jsp.
Each has an identical structure:
%@ taglib uri='/tags/struts-template' prefix='template' %
template:insert template='/TemplateMain.jsp'
template:put name='pagename' content='Logon' direct='true'/
template:put name='header' content='/TileHeader.jsp'/
template:put name='sidebar' content='/TileSidebar.jsp'/
template:put name='content' content='FOO.jsp'/
/template:insert
The only difference between the 3 files is the FOO.jsp which loads the
content tile specific for that particular page.
Each one loads a different tile: TileUnauth.jsp, TileAuth.jsp and
FormLogon.jsp
This structure works fine. But it started to bug me that whenever I create a
new page, I had to create the structure.jsp and then the tile.jsp
So then I implemented a MasterLayout.jsp page like this:

%@ taglib uri='/tags/struts-template' prefix='template' %
%@ taglib uri='/tags/struts-bean' prefix='bean' %
bean:parameter id=tilePage name=tilePage/
bean:define id=fullTilePage value='%= tilePage %'/
template:insert template='/TemplateMain.jsp'
template:put name='pagename' content='Logon' direct='true'/
template:put name='header' content='/TileHeader.jsp'/
template:put name='sidebar' content='/TileSidebar.jsp'/
template:put name='content' content='%=fullTilePage%'/
/template:insert
Now I've been able to get rid of all my structure.jsp files and replace it
with this single MasterLayout.jsp
I can invoke it from the struts-config.xml with an action reference like
this:
action path=/Logon
type=org.apache.struts.actions.ForwardAction
parameter=/MasterLayout.jsp?tilePage=FormLogon.jsp/
So essentially, I can now display any page that follows the standard
structure by writing a single tile for the content section of the page and
then invoking the MasterLayout with a tilePage= parameter to indicate which
tile should be thrown into the content section.
I have two questions:

1) Am I overlooking something that is likely to bite me?

2) Is there a more elegant way to control the filler tile?

In particular, I'm not crazy about the resulting URL line displayed in the
browser location. When I forwarded to the logon success page, I had a nice
url that just said:
http://localhost/MyAppName/LogonSubmit.do
But now that I am redirecting (instead of forwarding - to break the
back-button stomping issue) it shows a much icky-er
http://localhost:/MyAppName/MasterLayout.jsp?tilePage=/TileWelcome.jsp
I can live with it the way it is, but I want to be sure I'm exploiting all
the power there is to be had from the templates and tiles system, the action
forwarding syntax and all of that stuff.
Thanks,
Jefficus
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



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


Problem porting JSPs with template to tiles

2003-01-28 Thread Boris Folgmann
Hi!

I tried to port a set of JSPs using the template taglib of struts 1.0 to
struts 1.1. Simply replacing template: with tiles: did the job. But it
does not work in a lot of JSPs where I have no matching tiles:put for one
of the tiles:get in the template JSP. I get an Exception text at the
position of the tiles:get. Using tiles:get ignore='true' did not help.
Does anybody have a clue?

Here's the exception:
java.lang.IllegalStateException
at
org.apache.catalina.connector.HttpResponseFacade.sendError(HttpResponseFacade.java:145)
at
org.netbeans.modules.web.monitor.server.MonitorResponseWrapper.sendError(MonitorResponseWrapper.java:63)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1056)
at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at org.apache.jsp.template$jsp._jspService(template$jsp.java:482)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:562)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:223)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246

Problem porting JSPs with template to tiles

2003-01-28 Thread Boris Folgmann
Hi!

I tried to port a set of JSPs using the template taglib of struts 1.0 to
struts 1.1. Simply replacing template: with tiles: did the job. But it
does not work in a lot of JSPs where I have no matching tiles:put for one
of the tiles:get in the template JSP. I get an Exception text at the
position of the tiles:get. Using tiles:get ignore='true' did not help.
Does anybody have a clue?

Here's the exception:
java.lang.IllegalStateException
at
org.apache.catalina.connector.HttpResponseFacade.sendError(HttpResponseFacade.java:145)
at
org.netbeans.modules.web.monitor.server.MonitorResponseWrapper.sendError(MonitorResponseWrapper.java:63)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1056)
at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at org.apache.jsp.template$jsp._jspService(template$jsp.java:482)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:818)
at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at org.apache.jsp.index$jsp._jspService(index$jsp.java:562)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWrapper.service(IDEJspServlet.java:173)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFile(IDEJspServlet.java:246)
at
org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:223)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246

Using keys for template titles

2003-01-25 Thread Ramtin Khosravi
Hi,

I use struts-template taglib (not Tiles) and want to select the title of my
JSPs from the application resources. In other words, I want to use the value
of template:get name=title/ as the key to look up a title string (like
the way we do it by bean:message ...).

How can I do it? Or is there some other way to pass a parameter to the
template JSP?

Thanks,
--Ramtin


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




template

2002-12-19 Thread Amit Badheka
HI All,

I am using struts templates in my project. I am including three pages in my template.

My requirements are such that I want to open a jsp page in new window (onlys that 
single page). 
Is it a right idea by the mean of MVC?

also, the problem I am having is when I tried to do this, main window gets refreshed 
on click event ( thought nothing is specified on submit).

Is anybody has any idea??

please help.





Problem with Struts Template and proxy caching

2002-12-17 Thread dumps
Hi everyone,

we are facing a problem with Struts templates (Struts 1.02) and proxy
caching :

The response headers we are setting in jsp files are not being sent back to
the browser whenever a template:insert tag is used :

...
   template:insert template='Template.jsp'
 template:put name='navigation' content='/navigation.jsp'/
 template:put name='header' content='/blankHeader.jsp'/
 template:put name='content'content='/mainMenuContent.jsp'/
   /template:insert
...
  

 %
response.addHeader(Cache-Control,no-cache); 
response.addHeader(Pragma,no-cache); 
response.setDateHeader (Expires, 0);
response.setHeader(Hello, hello123);
 %


If we remove the template tags, everything's ok with the headers... (we are
checking the http headers using a local proxy server). We also tried to set
nocache to
'true' in web.xml and/or add the response headers inside the Template.jsp
file,
but neither solved the problem. That's why we assume the templating
mechanism is messing with the headers.


Thanks for your time,
Christof

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!


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




Re: Problem with Struts Template and proxy caching

2002-12-17 Thread Cedric Dumoulin

 Hi,

 I think that once the response is committed, you can't change the 
response's header (check the spec).
 So, if you set the header after the template is inserted, the change 
has no effect because the insert commit the response.

  Cedric

dumps wrote:

Hi everyone,

we are facing a problem with Struts templates (Struts 1.02) and proxy
caching :

The response headers we are setting in jsp files are not being sent back to
the browser whenever a template:insert tag is used :

...
  template:insert template='Template.jsp'
template:put name='navigation' content='/navigation.jsp'/
template:put name='header' content='/blankHeader.jsp'/
template:put name='content'content='/mainMenuContent.jsp'/
  /template:insert
...
 

%
   response.addHeader(Cache-Control,no-cache); 
   response.addHeader(Pragma,no-cache); 
   response.setDateHeader (Expires, 0);
   response.setHeader(Hello, hello123);
%


If we remove the template tags, everything's ok with the headers... (we are
checking the http headers using a local proxy server). We also tried to set
nocache to
'true' in web.xml and/or add the response headers inside the Template.jsp
file,
but neither solved the problem. That's why we assume the templating
mechanism is messing with the headers.


Thanks for your time,
Christof

 



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




Use of Struts 1.0.2 template tag doesn't display jsp errors in included files

2002-12-13 Thread Michael Echerer
Hi all,

I'm using Tomcat 4.1.15 with Struts 1.0.2 and set up a framework to use templates with 
the template-Tags.

I already set template:get flush=false but I still don't get any exceptions dumps 
if a part of jsp code is incorrect in any of the included files. 

The template part causing that error is either empty or the template is not processed 
any further which is quite difficult to debug.

Testing each inserted file separately also doesn't help me in every case, because some 
included files require beans that had been stored into the request scope by an earlier 
included file for example. So the bean cannot be found if I don't include everything 
in the correct order.

Is there any better solution for debugging jsp pages that are template generated?
What is the closest I can get to have a jsp page using any kind of includes to only 
one page which contains all the content?
Is that include + no error display problem solved if I use the tiles tags instead 
or will I have the same difficulties for jsp debugging?

I would like to separate design from content without considering for debugging so much 
that I don't have just one large page. What is a better practice for that?

Thanks a lot.
Michael





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




RE: Use of Struts 1.0.2 template tag doesn't display jsp errors in included files

2002-12-13 Thread mech
Solved the problem myself by migrating to Struts 1.1b2 and using the
tiles instead. Now I get an jsp error message in each tile and can
debug more easily.

Also solved some other difficulties with pathes to resources that can
now be context relative instead of template relative...

 -Original Message-
 From: Michael Echerer [mailto:[EMAIL PROTECTED]] 
 Sent: Freitag, 13. Dezember 2002 14:02
 To: [EMAIL PROTECTED]
 Subject: Use of Struts 1.0.2 template tag doesn't display jsp 
 errors in included files
 
 
 Hi all,
 
 I'm using Tomcat 4.1.15 with Struts 1.0.2 and set up a 
 framework to use templates with the template-Tags.
 
 I already set template:get flush=false but I still don't 
 get any exceptions dumps if a part of jsp code is incorrect 
 in any of the included files. 
 
 The template part causing that error is either empty or the 
 template is not processed any further which is quite 
 difficult to debug.
 
 Testing each inserted file separately also doesn't help me in 
 every case, because some included files require beans that 
 had been stored into the request scope by an earlier included 
 file for example. So the bean cannot be found if I don't 
 include everything in the correct order.
 
 Is there any better solution for debugging jsp pages that are 
 template generated? What is the closest I can get to have a 
 jsp page using any kind of includes to only one page which 
 contains all the content? Is that include + no error 
 display problem solved if I use the tiles tags instead or 
 will I have the same difficulties for jsp debugging?
 
 I would like to separate design from content without 
 considering for debugging so much that I don't have just one 
 large page. What is a better practice for that?
 
 Thanks a lot.
 Michael
 
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user- [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]




Detecting value in a template

2002-12-03 Thread Míguel Ángel Mulero Martínez
Hi all,
I'm using templates from Struts 1.0.2 and I can't use tiles. Mi problem is
that I would like to pass a value with template:put and in the target JSP
change the behaviour attending this value (with something like logic:equal
or logic:present.

Anybody knows how to verify if exists or the value without a scriptlet?

Thanks!
Miguel


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




Re: Template problem

2002-11-22 Thread Cedric Dumoulin

 The reason is that your action do a RequestDispatcher.forward(...), 
which is not allowed once the response is committed. This is a problem 
with the template library.
 So, you should consider to use Tiles and its ActionComponentServlet, 
which allows such insertion.

 Cedric

Amit Godbole (RBIN/DBA-JOT) * wrote:

Hello All,

I am using template taglib for my screens. (Using Struts 1.0.2)
When i put the content as jsp page then it works file.
But when i put the ActionMapping in the content(/do/navigation), then it
goes for a toss  throws the ServletException.

Does any one know what is the reason  how to overcome it ?

Thanks in advance
Amit

Sample Code :

%@ page language=java %
%@ taglib uri='/WEB-INF/lib/struts-template.tld' prefix='template' %

template:insert template='/template.jsp'
 template:put name='logo' content='/Logo.html' direct=true/
 template:put name='navigation' content='/do/navigation' direct=false /
 template:put name='querydesc' content='/QueryDesc.html' direct=true/
 template:put name='querytitle' content='/QueryTitle.html' direct=true
/
 template:put name='queryform' content='/Query.html' direct=true/
/template:insert

Exception thrown is :
Error Location: /ProvisorTest/do/navigation
Internal Servlet Error:
javax.servlet.ServletException: Servlet Exception
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
	at
_0002fprovisor_00031_0002ejspprovisor1_jsp_3._jspService(_0002fprovisor_0003
1_0002ejspprovisor1_jsp_3.java:270)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
	at org.apache.tomcat.core.Handler.service(Handler.java:286)
	at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
	at java.lang.Thread.run(Thread.java:484)


--
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]




Template problem

2002-11-20 Thread Amit Godbole (RBIN/DBA-JOT) *
Hello All,

I am using template taglib for my screens. (Using Struts 1.0.2)
When i put the content as jsp page then it works file.
But when i put the ActionMapping in the content(/do/navigation), then it
goes for a toss  throws the ServletException.

Does any one know what is the reason  how to overcome it ?

Thanks in advance
Amit

Sample Code :

%@ page language=java %
%@ taglib uri='/WEB-INF/lib/struts-template.tld' prefix='template' %

template:insert template='/template.jsp'
  template:put name='logo' content='/Logo.html' direct=true/
  template:put name='navigation' content='/do/navigation' direct=false /
  template:put name='querydesc' content='/QueryDesc.html' direct=true/
  template:put name='querytitle' content='/QueryTitle.html' direct=true
/
  template:put name='queryform' content='/Query.html' direct=true/
/template:insert

Exception thrown is :
Error Location: /ProvisorTest/do/navigation
Internal Servlet Error:
javax.servlet.ServletException: Servlet Exception
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
at
_0002fprovisor_00031_0002ejspprovisor1_jsp_3._jspService(_0002fprovisor_0003
1_0002ejspprovisor1_jsp_3.java:270)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)


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




Struts template tag

2002-11-18 Thread Jean-Baptiste Onofré
Hello all,

i would like to use template tags.

For exemple, i will define a JSP template like this :

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
html
head
titletemplate:get name=title//title
link rel=stylesheet type=text/css href=toto.css/
/head
body
template:get name=subtitle/br
template:get name=corpus/br


In the using JSP, can i use bean in ApplicationResource or in request
scope in put of the template ? like this :

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

template:insert template=/template.jsp
template:put name=title content=index.title direct=true/
!--
// it's like bean:message key=index.title/
--
template:put name=subtitle content=toto.name direct=true/
!--
// it's like bean:write name=toto property=name/
--
template:put name=corpus content=index.corpus direct=true/
!--
// it's like bean:message key=index.corpus/
--
/template:insert

Blablabla

/body
/html



Must i define a template with all html page or can i use two template in
one page like this :

template:insert template=/beginning.jsp
...
/template:insert

Blablablabla

template:insert template=/end.jsp
...
/template:insert




Actualy, i use jsp:include, one for the beginning of the JSP and one
for the end of the JSP.

If someone can mail me a sample or help for me :)

Best regards
-- 
Jean-Baptiste Onofré (Nanthrax)
Membre fondateur de phpFR.org
http://www.phpfr.org
[EMAIL PROTECTED]
Membre fondateur du LUG Béziers
http://www.lug-beziers.org
[EMAIL PROTECTED]

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




Re: Struts template tag

2002-11-18 Thread David Graham
The template tags are deprecated in 1.1 in favor of Tiles.

David







From: Jean-Baptiste Onofré [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Struts template tag
Date: Mon, 18 Nov 2002 17:08:06 +0100

Hello all,

i would like to use template tags.

For exemple, i will define a JSP template like this :

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
html
head
titletemplate:get name=title//title
link rel=stylesheet type=text/css href=toto.css/
/head
body
template:get name=subtitle/br
template:get name=corpus/br


In the using JSP, can i use bean in ApplicationResource or in request
scope in put of the template ? like this :

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

template:insert template=/template.jsp
	template:put name=title content=index.title direct=true/
	!--
		// it's like bean:message key=index.title/
	--
	template:put name=subtitle content=toto.name direct=true/
	!--
		// it's like bean:write name=toto property=name/
	--
	template:put name=corpus content=index.corpus direct=true/
	!--
		// it's like bean:message key=index.corpus/
	--
/template:insert

Blablabla

/body
/html



Must i define a template with all html page or can i use two template in
one page like this :

template:insert template=/beginning.jsp
	...
/template:insert

Blablablabla

template:insert template=/end.jsp
	...
/template:insert




Actualy, i use jsp:include, one for the beginning of the JSP and one
for the end of the JSP.

If someone can mail me a sample or help for me :)

Best regards
--
Jean-Baptiste Onofré (Nanthrax)
Membre fondateur de phpFR.org
http://www.phpfr.org
[EMAIL PROTECTED]
Membre fondateur du LUG Béziers
http://www.lug-beziers.org
[EMAIL PROTECTED]

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


_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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



Re: Struts template tag

2002-11-18 Thread Jean-Baptiste Onofré
Thanks for info,

but i'm in 1.0.2 in my dev.

I will try that i have write :)

Best regards
-- 
Jean-Baptiste Onofré (Nanthrax)
Membre fondateur de phpFR.org
http://www.phpfr.org
[EMAIL PROTECTED]
Membre fondateur du LUG Béziers
http://www.lug-beziers.org
[EMAIL PROTECTED]

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




imp: frameset in template

2002-11-08 Thread Amit Badheka
Is there any way to put a jsp page that contains frameset, in template?

I tried the same but the page contents are included as it is, and not the pages 
included in frames.

template

template:insert template='/common/b2bPageTemplate.jsp'
  template:put name='title' content='Otto B2B Admintool' direct='true'/
  template:put name='header' content='/jsp/header.jsp' /
  template:put name='content' content='/jsp/index.jsp' /
/template:insert

template-end---

-index
HEAD
TITLEbean:message key=ecatalog.admin.title//TITLE
script src=../script/index.js language=JavaScript1.2 
/script
/HEAD
  in index-
  FRAMESET ROWS=81,* FRAMEBORDER=NO BORDER=0 FRAMESPACING=0 ID=fs1
frame  frameName=Top scrolling=no src=header.jsp marginwidth=0 
marginheight=0 frameborder=0
FRAMESET COLS=140,* FRAMEBORDER=NO BORDER=0 FRAMESPACING=0 ID=fs2
  frame  frameName=Left   scrolling=no src=sitemap.jsp marginwidth=0 
marginheight=0 frameborder=0
  frame  frameName=Main   scrolling=no src=welcome.jsp marginwidth=0 
marginheight=0 frameborder=0
/FRAMESET
  /FRAMESET
  NOFRAMES
BODY BGCOLOR=#FF TOPMARGIN=0 LEFTMARGIN=0
/BODY
  /NOFRAMES
index-end--

any help will highly appreciated.





Re: hrame in template

2002-11-05 Thread Eddie Bush
You wouldn't want to do a typical insert for a frameset.  All you care 
about is retrieving the string representation of the file-name in your 
app's URL namespace.  See getAsString or getString (I forget which) tag 
in the tiles taglib.  There are examples on this ... (no, not frames, 
but there are examples of just getting the item as a string and not 
doing an include).

Amit Badheka wrote:

Can I include a frameset into Template?

I have a page called index.jsp, that contains frameset defined.

Now, I want to include this page in my template. I tried it but it does not includeing the pages inside the frames, but when I saw the generated html source the file contents are included.

Please help.



 


--
Eddie Bush





--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: frame in template

2002-11-05 Thread Eddie Bush
There are two ways Tiles will bring content in - as an include or as a 
value.  You want to bring your content in as a value (to be specified in 
your frameset), but currently your bringing it in as an include.  The 
same type of thing happens when you want to set the title for a 
document.  Go look at the example and you can't miss it (hint:  it's not 
an include!).

Amit Badheka wrote:

frame, and not hrame.

sorry.
- Original Message -
From: Amit Badheka [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, November 05, 2002 12:28 PM
Subject: hrame in template


Can I include a frameset into Template?

I have a page called index.jsp, that contains frameset defined.

Now, I want to include this page in my template. I tried it but it does not
includeing the pages inside the frames, but when I saw the generated html
source the file contents are included.

Please help.



--
Eddie Bush





--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




hrame in template

2002-11-04 Thread Amit Badheka
Can I include a frameset into Template?

I have a page called index.jsp, that contains frameset defined.

Now, I want to include this page in my template. I tried it but it does not includeing 
the pages inside the frames, but when I saw the generated html source the file 
contents are included.

Please help.





Re:frame in template

2002-11-04 Thread Amit Badheka
frame, and not hrame.

sorry.
- Original Message -
From: Amit Badheka [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, November 05, 2002 12:28 PM
Subject: hrame in template


Can I include a frameset into Template?

I have a page called index.jsp, that contains frameset defined.

Now, I want to include this page in my template. I tried it but it does not
includeing the pages inside the frames, but when I saw the generated html
source the file contents are included.

Please help.






--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: [TILES] Problem using struts actions in tile's template

2002-10-24 Thread Cedric Dumoulin

 You can add a try/catch around the RequestDispatcher.forward(..) call, 
catch the undesired exception, and do an include when the exception 
happen. This should work.

   Cedric


Ken Riley wrote:

Thanks Cedric, Danny, James for all of your help. I understand what you are
saying (re:forwards/includes). 

As a test I modified the struts 1.02 ActionServlet
(I love OSS:-)) to check response.isCommitted() and do a forward or include
accordingly. This works great in Tomcat. Unfortunately it does not work in 
WL6.1 SP3.  The WL response object seems to always isCommitted==false so I never do
an include and it never works :-/.  

Oh well, I guess I'll have to do the thing I was dreading most, re-writing 
the whole site templating. Ugh.

Thanks again for the quick and knowledgeable response!!

Ken

-Original Message-
From: Cedric Dumoulin [mailto:cedric;apache.org]
Sent: Wednesday, October 23, 2002 11:50 AM
To: Struts Users Mailing List
Subject: Re: [TILES] Problem using struts actions in tile's template



 Hi,

 Danny has well explained what is happening. The problem is that Struts 
RequestProcessor do a forward in response to the forward in the config 
file. If you use the Tiles servlet, your code should work because the 
TilesRequestProcessor check if the response has already been committed. 
If yes, TilesRequestProcessor do an include instead of a forward.

 To be short, use the TilesRequestProcessor, and it should work ;-).

  Cedric

Trieu, Danny wrote:

 

Think of the template.jsp is the servlet that currently running, and
rendering text in response to the broser.  Your other section on the
template.jsp, the content and the header, do a dynamic include which in
result as a forward to the intented jsp.  We all know that once the server
start writing to the response stream, any attemp to forward control to other
servlet will result with exception telling 
You that you can't do this.  

Instead of wanting action class to something before the template attempted
to include the targeted jsp
You can use Tiles' controller class or action controller to do it.

Hope this would help

danny

-Original Message-
From: Ken Riley [mailto:kriley;allconnect.com] 
Sent: Tuesday, October 22, 2002 2:19 PM
To: Struts Users Mailing List
Subject: [TILES] Problem using struts actions in tile's template


I'm probably being dense here (not an uncommon occurance) but I seem to be
unable to 
create a tile layout that uses multiple actions. I have a sample below that
I'm using to 
test. When I run this, I don't get any output for the header.do action call.
Ultimately I would like to have a layout that calls 4 or 5 actions but I'd
like to get my test app working first :).

   

 Omitted for brevity **

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org


 



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Tiles vs Template Tags

2002-10-23 Thread David Graham
Use Tiles, the template library is deprecated in favor of Tiles because 
tiles has more functionality.

I believe using the JSTL if tag with the empty keyword will return true when 
the value is false.

David



From: Affan Qureshi [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Tiles vs Template Tags
Date: Tue, 22 Oct 2002 22:01:22 -0700

I want the layout of my application in such a way that if I want to change 
it I have to make changes in a minimum number of places. What should I use 
Tiles or Template Tags? Can someone highlight the difference between the 
two?

Also when iterating a collection i want to check whether a value is null or 
not. Should I use logic:isEmpty tag? Or how else?

Thanks a lot.


_
Get a speedy connection with MSN Broadband.  Join now! 
http://resourcecenter.msn.com/access/plans/freeactivation.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



RE: [TILES] Problem using struts actions in tile's template

2002-10-23 Thread Trieu, Danny
Think of the template.jsp is the servlet that currently running, and
rendering text in response to the broser.  Your other section on the
template.jsp, the content and the header, do a dynamic include which in
result as a forward to the intented jsp.  We all know that once the server
start writing to the response stream, any attemp to forward control to other
servlet will result with exception telling 
You that you can't do this.  

Instead of wanting action class to something before the template attempted
to include the targeted jsp
You can use Tiles' controller class or action controller to do it.

Hope this would help

danny

-Original Message-
From: Ken Riley [mailto:kriley;allconnect.com] 
Sent: Tuesday, October 22, 2002 2:19 PM
To: Struts Users Mailing List
Subject: [TILES] Problem using struts actions in tile's template


I'm probably being dense here (not an uncommon occurance) but I seem to be
unable to 
create a tile layout that uses multiple actions. I have a sample below that
I'm using to 
test. When I run this, I don't get any output for the header.do action call.
Ultimately I would like to have a layout that calls 4 or 5 actions but I'd
like to get my test app working first :).

struts-config.xml---
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
struts-config
  form-beans/form-beans

  action-mappings
actionpath=/header
   type=com.mycompany.test.HeaderAction
forward name=success path=/jsp/header.jsp/

/action
  
actionpath=/content
   type=com.mycompany.test.HeaderAction
forward name=success path=/jsp/content.jsp/

/action
  /action-mappings
/struts-config
---END struts-config.xml-

--temptest.jsp---
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert
template=/template.jsp
tiles:put name=title content=Service Address direct=true /
tiles:put name=header content=/header.do /
tiles:put name=content content=/content.do/ /tiles:insert
--END temptest.jsp---

--template.jsp---
% taglib uri=/WEB-INF/struts-html.tld prefix=html %
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

html:html
headtitletiles:get name=title//title
/head
body
table align=left width=100% border=0 cellspacing=0 cellpadding=0
trtdtiles:get name=header //td/tr trtd/td/tr trtd
   table border=0 cellspacing=0 cellpadding=0 width=100%
   tr
   td/td
   tdtiles:get name=content//td
   /tr/table/td

/tr
trtd/td/tr
/table
/body
/html:html
--END template.jsp---

--header.jsp-
h3THIS IS THE HEADER/h3
--END header.jsp-

--content.jsp
BTHIS IS THE CONTENT!!/B
--END content.jsp

Note:HeaderAction and ContentAction are identical except for their name.
just used for testing
--ContentAction.java-
package com.mycompany.test;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class ContentAction extends Action {

public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {

return mapping.findForward(success);  
}

}
-END ContentAction.java--

The output I get (Struts 1.1b2/Tomcat 4.1.12)
[Exception in:/header.do] Cannot forward after response has been committed

[Exception in:/content.do] Cannot forward after response has been committed


Thanks for any help/suggestions! 

--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: [TILES] Problem using struts actions in tile's template

2002-10-23 Thread Cedric Dumoulin

 Hi,

 Danny has well explained what is happening. The problem is that Struts 
RequestProcessor do a forward in response to the forward in the config 
file. If you use the Tiles servlet, your code should work because the 
TilesRequestProcessor check if the response has already been committed. 
If yes, TilesRequestProcessor do an include instead of a forward.

 To be short, use the TilesRequestProcessor, and it should work ;-).

  Cedric

Trieu, Danny wrote:

Think of the template.jsp is the servlet that currently running, and
rendering text in response to the broser.  Your other section on the
template.jsp, the content and the header, do a dynamic include which in
result as a forward to the intented jsp.  We all know that once the server
start writing to the response stream, any attemp to forward control to other
servlet will result with exception telling 
You that you can't do this.  

Instead of wanting action class to something before the template attempted
to include the targeted jsp
You can use Tiles' controller class or action controller to do it.

Hope this would help

danny

-Original Message-
From: Ken Riley [mailto:kriley;allconnect.com] 
Sent: Tuesday, October 22, 2002 2:19 PM
To: Struts Users Mailing List
Subject: [TILES] Problem using struts actions in tile's template


I'm probably being dense here (not an uncommon occurance) but I seem to be
unable to 
create a tile layout that uses multiple actions. I have a sample below that
I'm using to 
test. When I run this, I don't get any output for the header.do action call.
Ultimately I would like to have a layout that calls 4 or 5 actions but I'd
like to get my test app working first :).

struts-config.xml---
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
 http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
struts-config
 form-beans/form-beans

 action-mappings
   actionpath=/header
  type=com.mycompany.test.HeaderAction
		forward name=success path=/jsp/header.jsp/

   /action
 
   actionpath=/content
  type=com.mycompany.test.HeaderAction
		forward name=success path=/jsp/content.jsp/

   /action
 /action-mappings
/struts-config
---END struts-config.xml-

--temptest.jsp---
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert
template=/template.jsp
   tiles:put name=title content=Service Address direct=true /
   tiles:put name=header content=/header.do /
   tiles:put name=content content=/content.do/ /tiles:insert
--END temptest.jsp---

--template.jsp---
% taglib uri=/WEB-INF/struts-html.tld prefix=html %
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

html:html
headtitletiles:get name=title//title
/head
body
table align=left width=100% border=0 cellspacing=0 cellpadding=0
trtdtiles:get name=header //td/tr trtd/td/tr trtd
  table border=0 cellspacing=0 cellpadding=0 width=100%
  tr
  td/td
  tdtiles:get name=content//td
  /tr/table/td

/tr
trtd/td/tr
/table
/body
/html:html
--END template.jsp---

--header.jsp-
h3THIS IS THE HEADER/h3
--END header.jsp-

--content.jsp
BTHIS IS THE CONTENT!!/B
--END content.jsp

Note:HeaderAction and ContentAction are identical except for their name.
just used for testing
--ContentAction.java-
package com.mycompany.test;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class ContentAction extends Action {

   public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
   throws IOException, ServletException {

   return mapping.findForward(success);  
   }

}
-END ContentAction.java--

The output I get (Struts 1.1b2/Tomcat 4.1.12)
[Exception in:/header.do] Cannot forward after response has been committed

[Exception in:/content.do] Cannot forward after response has been committed


Thanks for any help/suggestions! 

--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org


 



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: [TILES] Problem using struts actions in tile's template

2002-10-23 Thread Ken Riley
Thanks Cedric, Danny, James for all of your help. I understand what you are
saying (re:forwards/includes). 

As a test I modified the struts 1.02 ActionServlet
(I love OSS:-)) to check response.isCommitted() and do a forward or include
accordingly. This works great in Tomcat. Unfortunately it does not work in 
WL6.1 SP3.  The WL response object seems to always isCommitted==false so I never do
an include and it never works :-/.  

Oh well, I guess I'll have to do the thing I was dreading most, re-writing 
the whole site templating. Ugh.

Thanks again for the quick and knowledgeable response!!

Ken

-Original Message-
From: Cedric Dumoulin [mailto:cedric;apache.org]
Sent: Wednesday, October 23, 2002 11:50 AM
To: Struts Users Mailing List
Subject: Re: [TILES] Problem using struts actions in tile's template



  Hi,

  Danny has well explained what is happening. The problem is that Struts 
RequestProcessor do a forward in response to the forward in the config 
file. If you use the Tiles servlet, your code should work because the 
TilesRequestProcessor check if the response has already been committed. 
If yes, TilesRequestProcessor do an include instead of a forward.

  To be short, use the TilesRequestProcessor, and it should work ;-).

   Cedric

Trieu, Danny wrote:

Think of the template.jsp is the servlet that currently running, and
rendering text in response to the broser.  Your other section on the
template.jsp, the content and the header, do a dynamic include which in
result as a forward to the intented jsp.  We all know that once the server
start writing to the response stream, any attemp to forward control to other
servlet will result with exception telling 
You that you can't do this.  

Instead of wanting action class to something before the template attempted
to include the targeted jsp
You can use Tiles' controller class or action controller to do it.

Hope this would help

danny

-Original Message-
From: Ken Riley [mailto:kriley;allconnect.com] 
Sent: Tuesday, October 22, 2002 2:19 PM
To: Struts Users Mailing List
Subject: [TILES] Problem using struts actions in tile's template


I'm probably being dense here (not an uncommon occurance) but I seem to be
unable to 
create a tile layout that uses multiple actions. I have a sample below that
I'm using to 
test. When I run this, I don't get any output for the header.do action call.
Ultimately I would like to have a layout that calls 4 or 5 actions but I'd
like to get my test app working first :).

 Omitted for brevity **

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




[TILES] Problem using struts actions in tile's template

2002-10-22 Thread Ken Riley
I'm probably being dense here (not an uncommon occurance) but I seem to be unable to 
create a tile layout that uses multiple actions. I have a sample below that I'm using 
to 
test. When I run this, I don't get any output for the header.do action call. 
Ultimately I would
like to have a layout that calls 4 or 5 actions but I'd like to get my test app 
working first :).

struts-config.xml---
?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
struts-config
  form-beans/form-beans

  action-mappings
actionpath=/header
   type=com.mycompany.test.HeaderAction
forward name=success path=/jsp/header.jsp/  
/action
  
actionpath=/content
   type=com.mycompany.test.HeaderAction
forward name=success path=/jsp/content.jsp/  
/action
  /action-mappings
/struts-config
---END struts-config.xml-

--temptest.jsp---
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %
tiles:insert template=/template.jsp
tiles:put name=title content=Service Address direct=true /
tiles:put name=header content=/header.do /
tiles:put name=content content=/content.do/
/tiles:insert
--END temptest.jsp---

--template.jsp---
% taglib uri=/WEB-INF/struts-html.tld prefix=html %
% taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

html:html
headtitletiles:get name=title//title
/head
body
table align=left width=100% border=0 cellspacing=0 cellpadding=0
trtdtiles:get name=header //td/tr
trtd/td/tr
trtd
   table border=0 cellspacing=0 cellpadding=0 width=100%
   tr
   td/td
   tdtiles:get name=content//td
   /tr/table/td

/tr
trtd/td/tr
/table
/body
/html:html
--END template.jsp---

--header.jsp-
h3THIS IS THE HEADER/h3
--END header.jsp-

--content.jsp
BTHIS IS THE CONTENT!!/B
--END content.jsp

Note:HeaderAction and ContentAction are identical except for their name. just used for 
testing
--ContentAction.java-
package com.mycompany.test;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class ContentAction extends Action {

public ActionForward perform(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws IOException, ServletException {

return mapping.findForward(success);  
}

}
-END ContentAction.java--

The output I get (Struts 1.1b2/Tomcat 4.1.12)
[Exception in:/header.do] Cannot forward after response has been committed   
[Exception in:/content.do] Cannot forward after response has been committed  

Thanks for any help/suggestions! 

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: [TILES] Problem using struts actions in tile's template

2002-10-22 Thread James Mitchell
Ken, (long time no type)

It's hard (for me at least) to determine the problem from those spots of
code, but I have a working example that (I think) will demonstrate just what
you are trying to do.

The site it listed below (in my sig block) and the source is available here:
http://www.open-tools.org/struts-atlanta/downloads



James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
- Albert Einstein (1879-1955)


 -Original Message-
 From: Ken Riley [mailto:kriley;allconnect.com]
 Sent: Tuesday, October 22, 2002 5:19 PM
 To: Struts Users Mailing List
 Subject: [TILES] Problem using struts actions in tile's template


 I'm probably being dense here (not an uncommon occurance) but I
 seem to be unable to
 create a tile layout that uses multiple actions. I have a sample
 below that I'm using to
 test. When I run this, I don't get any output for the header.do
 action call. Ultimately I would
 like to have a layout that calls 4 or 5 actions but I'd like to
 get my test app working first :).

 struts-config.xml---
 ?xml version=1.0 encoding=ISO-8859-1 ?

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts
 Configuration 1.0//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
 struts-config
   form-beans/form-beans

   action-mappings
 actionpath=/header
type=com.mycompany.test.HeaderAction
   forward name=success path=/jsp/header.jsp/

 /action

 actionpath=/content
type=com.mycompany.test.HeaderAction
   forward name=success path=/jsp/content.jsp/

 /action
   /action-mappings
 /struts-config
 ---END struts-config.xml-

 --temptest.jsp---
 % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %
 tiles:insert template=/template.jsp
 tiles:put name=title content=Service Address direct=true /
 tiles:put name=header content=/header.do /
 tiles:put name=content content=/content.do/
 /tiles:insert
 --END temptest.jsp---

 --template.jsp---
 % taglib uri=/WEB-INF/struts-html.tld prefix=html %
 % taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles %

 html:html
 headtitletiles:get name=title//title
 /head
 body
 table align=left width=100% border=0 cellspacing=0
 cellpadding=0
 trtdtiles:get name=header //td/tr
 trtd/td/tr
 trtd
table border=0 cellspacing=0 cellpadding=0 width=100%
tr
td/td
tdtiles:get name=content//td
/tr/table/td

 /tr
 trtd/td/tr
 /table
 /body
 /html:html
 --END template.jsp---

 --header.jsp-
 h3THIS IS THE HEADER/h3
 --END header.jsp-

 --content.jsp
 BTHIS IS THE CONTENT!!/B
 --END content.jsp

 Note:HeaderAction and ContentAction are identical except for
 their name. just used for testing
 --ContentAction.java-
 package com.mycompany.test;

 import org.apache.struts.action.*;
 import javax.servlet.http.*;
 import javax.servlet.*;
 import java.io.*;

 public class ContentAction extends Action {

 public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
 throws IOException, ServletException {

 return mapping.findForward(success);
 }

 }
 -END ContentAction.java--

 The output I get (Struts 1.1b2/Tomcat 4.1.12)
 [Exception in:/header.do] Cannot forward after response has been
 committed
 [Exception in:/content.do] Cannot forward after response has been
 committed

 Thanks for any help/suggestions!

 --
 To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Tiles vs Template Tags

2002-10-22 Thread Affan Qureshi
I want the layout of my application in such a way that if I want to change it I have 
to make changes in a minimum number of places. What should I use Tiles or Template 
Tags? Can someone highlight the difference between the two?

Also when iterating a collection i want to check whether a value is null or not. 
Should I use logic:isEmpty tag? Or how else?

Thanks a lot.



Re: Pros and Cons of Hard coding a JSP page in a Struts template vs using aparameter?

2002-10-18 Thread David Graham
You won't notice any difference in speed or memory between the two.  Looks 
like the second one is more flexible though.  Why are you importing 
javax.servlet and javax.servlet.jsp?

David






From: Smith, Johnathan M. [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Pros and Cons of Hard coding a JSP page in a Struts template vs 
using a parameter?
Date: Thu, 17 Oct 2002 08:26:42 -0400

I would like to know the pros and cons of hard coding a JSP page in a 
struts
template.

Which struts template is better on speed and memory?

EXAMPLE1
%@ page language=java %
%@ page import=javax.servlet.http.* %
%@ page import=javax.servlet.jsp.* %
%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
%@ taglib uri=/WEB-INF/cdd.tld prefix=cdd  %
template:insert template=TempTest.jsp
template:put name=header content=header.jsp/
template:put name=navbar content=navbar.jsp/
template:put name=body content=JSP/AddVendor.jsp/
/template:insert

EXAMPLE2:
%@ page language=java %
%@ page import=javax.servlet.http.* %
%@ page import=javax.servlet.jsp.* %
%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
%@ taglib uri=/WEB-INF/cdd.tld prefix=cdd  %
template:insert template=TempTest.jsp
template:put name=header content=header.jsp/
template:put name=navbar content=navbar.jsp/
template:put name=body content=%= request.getParameter(\body\) %/
/template:insertHTML

I would think that example number 1 is better and faster??  From looking at
the source code example 1 is bigger do to a include inline?


--
To unsubscribe, e-mail:   
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: 
mailto:struts-user-help;jakarta.apache.org


_
Broadband? Dial-up? Get reliable MSN Internet Access. 
http://resourcecenter.msn.com/access/plans/default.asp


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org



Pros and Cons of Hard coding a JSP page in a Struts template vs using a parameter?

2002-10-18 Thread Smith, Johnathan M.
I would like to know the pros and cons of hard coding a JSP page in a struts
template.

Which struts template is better on speed and memory?

EXAMPLE1
% page language=java %
% page import=javax.servlet.http.* %
% page import=javax.servlet.jsp.* %
% taglib uri=/WEB-INF/struts-template.tld prefix=template %
% taglib uri=/WEB-INF/cdd.tld prefix=cdd  %
template:insert template=TempTest.jsp
template:put name=header content=header.jsp/
template:put name=navbar content=navbar.jsp/
template:put name=body content=JSP/AddVendor.jsp/
/template:insert

EXAMPLE2:
% page language=java %
% page import=javax.servlet.http.* %
% page import=javax.servlet.jsp.* %
% taglib uri=/WEB-INF/struts-template.tld prefix=template %
% taglib uri=/WEB-INF/cdd.tld prefix=cdd  %
template:insert template=TempTest.jsp
template:put name=header content=header.jsp/
template:put name=navbar content=navbar.jsp/
template:put name=body content=%= request.getParameter(\body\) %/
/template:insertHTML

I would think that example number 1 is better and faster??  From looking at
the source code example 1 is bigger do to a include inline?


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: anyone using struts template ??

2002-10-16 Thread David Graham

You'd probably be better off using tiles as it's the more popular/developed 
feature.  I haven't seen too much interest in template since tiles was added 
to 1.1.

David






From: Smith, Johnathan M. [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: anyone using struts template ??
Date: Wed, 16 Oct 2002 15:29:55 -0400

Please email me I have a number of questions and I am looking for a good
sample


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


_
Get a speedy connection with MSN Broadband.  Join now! 
http://resourcecenter.msn.com/access/plans/freeactivation.asp


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




RE: anyone using struts template ??

2002-10-16 Thread Smith, Johnathan M.

Is template going to be removed?

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 3:37 PM
To: [EMAIL PROTECTED]
Subject: Re: anyone using struts template ??


You'd probably be better off using tiles as it's the more popular/developed 
feature.  I haven't seen too much interest in template since tiles was added

to 1.1.

David






From: Smith, Johnathan M. [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: anyone using struts template ??
Date: Wed, 16 Oct 2002 15:29:55 -0400

Please email me I have a number of questions and I am looking for a good
sample


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


_
Get a speedy connection with MSN Broadband.  Join now! 
http://resourcecenter.msn.com/access/plans/freeactivation.asp


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




RE: anyone using struts template ??

2002-10-16 Thread David Graham

Not that I know of.

David






From: Smith, Johnathan M. [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'David Graham' [EMAIL PROTECTED], 
[EMAIL PROTECTED]
Subject: RE: anyone using struts template ??
Date: Wed, 16 Oct 2002 17:32:15 -0400

Is template going to be removed?

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 16, 2002 3:37 PM
To: [EMAIL PROTECTED]
Subject: Re: anyone using struts template ??


You'd probably be better off using tiles as it's the more popular/developed
feature.  I haven't seen too much interest in template since tiles was 
added

to 1.1.

David






 From: Smith, Johnathan M. [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: anyone using struts template ??
 Date: Wed, 16 Oct 2002 15:29:55 -0400
 
 Please email me I have a number of questions and I am looking for a good
 sample
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


_
Get a speedy connection with MSN Broadband.  Join now!
http://resourcecenter.msn.com/access/plans/freeactivation.asp


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


_
Surf the Web without missing calls! Get MSN Broadband. 
http://resourcecenter.msn.com/access/plans/freeactivation.asp


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




Re: Tiles/Template Automation

2002-09-27 Thread Cedric Dumoulin


Hi,

   Sorry for this late answer, I am abroad since 2 weeks, and have some 
trouble with my mails.

The preferred way is to use definitions defined in a centralized xml
file. This is more flexible than having some attributes hardcoded in the
jsp files themselves.

Cedric

Adam Sherman wrote:

   If I want to avoid defining attributes in multiple locations, and
   modifying more than one file for each new page, how should I use
   Tiles/Templates?

  
  
   To clarify:
  
   I want all files in a certain directory to use the same template.
   I also want the attributes, like Title, to be contained in the files
   themselves.
  
   This means that I can add a page, simply by creating it in the right
   location.
  
   Any ideas?
  
   Thanks,
  
   A.
  
  





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




Tiles/Template Automation

2002-09-17 Thread Adam Sherman

If I want to avoid defining attributes in multiple locations, and modifying 
more than one file for each new page, how should I use Tiles/Templates?

To clarify:

I want all files in a certain directory to use the same template.
I also want the attributes, like Title, to be contained in the files 
themselves.

This means that I can add a page, simply by creating it in the right 
location.

Any ideas?

Thanks,

A.


-- 
Adam Sherman
President  Chief Technologist
Tritus CG Inc.
+1 (613) 797-6819

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




Re: global forward and Struts template--(error)can't forward responseafter it's commited

2002-09-09 Thread Cedric Dumoulin


Hello Keven,

The error message you got says exactly what is wrong: you can't do a
forward once the response is committed.

Checking your code, it appears that you do a forward in a page inserted
by the template. This is not possible due to jsp specification.
Templates use include to do the insert. A side effect is that the
output stream is flushed, and response committed. So, once you have done
an include, you can't do a forward ...

Cedric

Keven wrote:

Hi, all:

I appreciate any/all helps from you.

The senario:
There is a JoinUs link on the top menu of a page. When I click on the
link, I want the registration form displayed in the body area.

The Problem:
When I click on JoinUs link, I got nothing on the body area. on the
log, I got the error message saying: can't forward response after it is
commited.

My Related Jsps:
-
...
a href=join.jspjoinUs/a(this link is on the top menu)
-

join.jsp
-
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template=home_template.jsp

  template:put name=header content=header.jsp/
  template:put name=body content=joinUs_body.jsp/

 /template:insert


joinUs_body.jsp
--
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 logic:forward name=joinus/

---
Struts-config.xml
--
global-forwards
  forward name=joinus path=/editRegistration.do?action=Create/
/global-forwards

 actionpath=/editRegistration

type=com.ces.p2pbet.client.registration.EditRegistrationAction
name=registrationForm
scope=request
validate=false
  forward name=success  path=/registration.jsp/
  /action

--
It complains that the response has commited when it excute
logic:forward name=joinus/  in the joinUs_body.jsp.

I tried but I can't figure out what is wrong here. I appreciate your help.
Thank you very much

Regards,
Keven














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




Re: global forward and Struts template--(error)can't forward responseafter it's commited

2002-09-09 Thread Cedric Dumoulin


Hello Keven,

The error message you got says exactly what is wrong: you can't do a
forward once the response is committed.

Checking your code, it appears that you do a forward in a page inserted
by the template. This is not possible due to jsp specification.
Templates use include to do the insert. A side effect is that the
output stream is flushed, and response committed. So, once you have done
an include, you can't do a forward ...

Cedric

Keven wrote:

Hi, all:

I appreciate any/all helps from you.

The senario:
There is a JoinUs link on the top menu of a page. When I click on the link, I want 
the registration form displayed in the body area.

The Problem:
When I click on JoinUs link, I got nothing on the body area. on the log, I got the 
error message saying: can't forward response after it is commited.

My Related Jsps:
-
...
a href=join.jspjoinUs/a(this link is on the top menu)
-

join.jsp
-
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template=home_template.jsp
  
  template:put name=header content=header.jsp/
  template:put name=body content=joinUs_body.jsp/ 
 
 /template:insert  


joinUs_body.jsp
--
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 logic:forward name=joinus/ 

---
Struts-config.xml
--
global-forwards
  forward name=joinus path=/editRegistration.do?action=Create/
/global-forwards

 actionpath=/editRegistration
type=com.ces.p2pbet.client.registration.EditRegistrationAction
name=registrationForm
scope=request
validate=false
  forward name=success  path=/registration.jsp/
  /action

--
It complains that the response has commited when it excute logic:forward 
name=joinus/  in the joinUs_body.jsp.

I tried but I can't figure out what is wrong here. I appreciate your help.
Thank you very much

Regards,
Keven








  




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




Re: global forward and Struts template--(error)can't forward response after it's commited

2002-09-07 Thread Keven

Please help me on the following issue.
Thank you very much.

Keven
- Original Message -
From: Keven [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 10:55 PM
Subject: global forward and Struts template--(error)can't forward response
after it's commited


Hi, all:

I appreciate any/all helps from you.

The senario:
There is a JoinUs link on the top menu of a page. When I click on the
link, I want the registration form displayed in the body area.

The Problem:
When I click on JoinUs link, I got nothing on the body area. on the log, I
got the error message saying: can't forward response after it is commited.

My Related Jsps:

-
...
a href=join.jspjoinUs/a(this link is on the top menu)

-

join.jsp
-
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template=home_template.jsp

  template:put name=header content=header.jsp/
  template:put name=body content=joinUs_body.jsp/

 /template:insert



joinUs_body.jsp
--
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 logic:forward name=joinus/


---
Struts-config.xml
--
global-forwards
  forward name=joinus path=/editRegistration.do?action=Create/
/global-forwards

 actionpath=/editRegistration

type=com.ces.p2pbet.client.registration.EditRegistrationAction
name=registrationForm
scope=request
validate=false
  forward name=success  path=/registration.jsp/
  /action


--
It complains that the response has commited when it excute logic:forward
name=joinus/  in the joinUs_body.jsp.

I tried but I can't figure out what is wrong here. I appreciate your help.
Thank you very much

Regards,
Keven









__ 
Post your ad for free now! http://personals.yahoo.ca

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




global forward and Struts template--(error)can't forward response after it's commited

2002-09-06 Thread Keven

Hi, all:

I appreciate any/all helps from you.

The senario:
There is a JoinUs link on the top menu of a page. When I click on the link, I want 
the registration form displayed in the body area.

The Problem:
When I click on JoinUs link, I got nothing on the body area. on the log, I got the 
error message saying: can't forward response after it is commited.

My Related Jsps:
-
...
a href=join.jspjoinUs/a(this link is on the top menu)
-

join.jsp
-
% page language=java %
% taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template=home_template.jsp
  
  template:put name=header content=header.jsp/
  template:put name=body content=joinUs_body.jsp/ 
 
 /template:insert  


joinUs_body.jsp
--
% page language=java %
% taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 logic:forward name=joinus/ 

---
Struts-config.xml
--
global-forwards
  forward name=joinus path=/editRegistration.do?action=Create/
/global-forwards

 actionpath=/editRegistration
type=com.ces.p2pbet.client.registration.EditRegistrationAction
name=registrationForm
scope=request
validate=false
  forward name=success  path=/registration.jsp/
  /action

--
It complains that the response has commited when it excute logic:forward 
name=joinus/  in the joinUs_body.jsp.

I tried but I can't figure out what is wrong here. I appreciate your help.
Thank you very much

Regards,
Keven










Re: template

2002-09-04 Thread Cedric Dumoulin


Hello,

Check more carefully my previous reply. When I said see intermixed, I
mean see lines intermixed in your reply. I am not referring to any tool.

Cedric

Keven wrote:

Hi,Sean, David and Cedric:

Thank you very much for your reply.
Sean, I tried with the ziped files. It works fine. Thank you very much to make it so 
clear.

Now, I am trying to use the same strategy to work with struts example(I modified the 
example for practise only). I have put all jsp files under Struts-example directory. 
I have index.jsp as following:

template.jsp
--

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

  FRAME src=template:get name='header'/
  FRAME src=template:get name='content'/

/frameset
/html
-

index.jsp:


%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
template:insert template='template.jsp'
  template:put name='title' content='Templates' direct='true'/
  template:put name='header' direct='true' 
   %= request.getContextPath() %/Heading.jsp
  /template:put
  template:put name='content' direct='true'
   %= request.getContextPath() %/tour.html
  /template:put
/template:insert


Heading.jsp:
---

%@ page import=org.apache.struts.webapp.example.Constants %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

logic:present name=Constants.USER_KEY scope = session

  a href=editRegistration.do?action=Edit MyAccount/a

  /logic:present

  logic:notPresent name=Constants.USER_KEY scope = session

  a href=editRegistration.do?action=Create join us/a

/logic:notPresent
-
When I enter http://localhost:8080/Struts-example/index.jsp, I got the a page with 
join us on the header(top frame), and the content of tour.html on the bottom frame.

When I click Join us link at the header, I want to have 1). URL changed to 
http://localhost:8080/Struts-example/editRegistration.do?action=Create, 2)  MyAccount 
on the header(top frame), and 3)  whatever content the above URL corresponding to on 
the bottom frame. In order to achieve this, I need to implement a jsp file which uses 
the template.jsp. The jsp file should be something like:

myJsp.jsp:


%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
template:insert template='template.jsp'
  template:put name='title' content='Templates' direct='true'/
  template:put name='header' direct='true' 
   %= request.getContextPath() %/Heading.jsp
  /template:put
  template:put name='content' direct='true'
   %= request.getContextPath() %/?(What should I put here)
  /template:put
/template:insert

My question is: what should I put in the above commented area? I tried to put 
registration.jsp. It just doesn't work.

David, you said that Struts templates do not work with HTML frames. So we have no 
way to achieve this by using Struts template. Is my understanding right? From 
Cedric's answer, it seems there is a way in intermixed. I never used intermixed 
before. I will have a look at it.

My boss likes to use frame with Struts framework. Is it really possible to do it? or 
we have to make decision to not use frame? Your opinion and help is appreciated.

Once again, many thanks to Sean, David and Cedric.

Regards.
Keven





- Original Message - 
From: Sean Gay [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 02, 2002 10:28 PM
Subject: RE: template


  

Kevin,

Firstly let me apologise for giving you slightly incorrect information about
your problem initially. Never fear though I have a working solution for you.

Using the direct=true is correct in this case as you are putting the output
into a frameset (I missed this initially) and not including the file into
the template. This being the case you need to treat it like a string and
have the full path to the file placed in here. I think where things are
going wrong is where you may have a context path which is making your app
look in the wrong spot for the file when it tries to display within the
frameset. If you include this context path where you are outputting
welcome.html you should be right.

I have done this in the attached zip. If you just unzip and place in the
directory that you have your app running you should be able to see what I am
explaining.

Again sorry for the initial goose chase that I sent you on.

Regards,
Sean

-Original Message-
From: Keven [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 10:06 AM
To: Struts Users

Re: template

2002-09-03 Thread Cedric Dumoulin


Hi,

See intermixed.

Cedric

David Geary wrote:

Hi Keven,

Struts templates do not work with HTML frames; I believe that's the
cause of your problem. (If anyone has gotten them to work with frames,
please holler). When I originally developed templates, I tried to get
them to work with frames, but it was very difficult. If I remember
correctly it's because each frame creates its own request, which wreaks
havoc with templates.

That said, you really shouldn't need to resort to frames, because
templates gives you pretty much the same functionality, except for being
able to resize regions.

Personally I avoid using frameset because it results in several requests.


I don't know if Tiles (which is an extension of templates) works with
frames; my guess is that they don't, but Cedric should be able to answer
that. Cedric, are you listening?

Tiles, and I think Templates also (not tested), work with frameset. But
you need to a well understanding of how frameset and Tiles/Templates work.
The frameset declaration look like the following:
frameset rows=3
frame src=template:get name=header / name=header id=header
scrolling=Auto
frame src=template:get name=body / name=body id=header
scrolling=Auto
frame src=template:get name=footer / name=footer id=header
scrolling=Auto
/frameset

And your insert tag:
template:insert template=/tutorial/basic/myFramesetLayout.jsp 
template:put name=title content=My first frameset page direct=true /
template:put name=header content=/tutorial/common/header.jsp
direct=true/
template:put name=footer content=/tutorial/common/footer.jsp
direct=true/
ttemplate:put name=menu content=/tutorial/basic/menu.jsp
direct=true/
template:put name=body content=/tutorial/basic/helloBody.jsp
direct=true/
/template:insert

The key point is that the insertion of the body/header/footer is not
done with a insert tag on the server, but by the frameset from the
client browser. Thus, you have one request for each inserted tiles or
region.
There is a simple example of using frameset and tiles in
tiles-documentation.war (under tutorial/).


btw, you're probably better off using Tiles or a later version of
templates. Both implementations offer similar capabilities; which you
prefer is largely a matter of taste. You can read about the later
version of templates and download the source code at:

http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-jsptemplate_p.html.


david

Keven wrote:

  

Hi, All:

I have a template jsp called template.jsp. The content of template.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

 FRAME src=template:get name='header' flush='true'/
 FRAME src=template:get name='content' flush='true'/

/frameset
/html

I have another jsp file called  index.jsp which uses the template.jsp. The content 
of index.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

 template:put name='title' content='Templates' direct='true'/
 template:put name='header' content='/welcome.html' direct='true'/ 
 template:put name='content' content='/tour.html' direct='true' /
/template:insert

Whenever I tried to run it in tomcat, I got 
Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html

type Status report

message /Welcome.html

description The requested resource (/Welcome.html) is not available.


Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html

type Status report

message /tour.html

description The requested resource (/tour.html) is not available.



I got the above messages in different frame.I don't know what cause the problem. 
Some one knows how to fix it?

Thank you very much

Keven





 






--
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: template

2002-09-03 Thread Keven

Hi,Sean, David and Cedric:

Thank you very much for your reply.
Sean, I tried with the ziped files. It works fine. Thank you very much to make it so 
clear.

Now, I am trying to use the same strategy to work with struts example(I modified the 
example for practise only). I have put all jsp files under Struts-example directory. I 
have index.jsp as following:

template.jsp
--

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

  FRAME src=template:get name='header'/
  FRAME src=template:get name='content'/

/frameset
/html
-

index.jsp:


%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
template:insert template='template.jsp'
  template:put name='title' content='Templates' direct='true'/
  template:put name='header' direct='true' 
   %= request.getContextPath() %/Heading.jsp
  /template:put
  template:put name='content' direct='true'
   %= request.getContextPath() %/tour.html
  /template:put
/template:insert


Heading.jsp:
---

%@ page import=org.apache.struts.webapp.example.Constants %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

logic:present name=Constants.USER_KEY scope = session

  a href=editRegistration.do?action=Edit MyAccount/a

  /logic:present

  logic:notPresent name=Constants.USER_KEY scope = session

  a href=editRegistration.do?action=Create join us/a

/logic:notPresent
-
When I enter http://localhost:8080/Struts-example/index.jsp, I got the a page with 
join us on the header(top frame), and the content of tour.html on the bottom frame.

When I click Join us link at the header, I want to have 1). URL changed to 
http://localhost:8080/Struts-example/editRegistration.do?action=Create, 2)  MyAccount 
on the header(top frame), and 3)  whatever content the above URL corresponding to on 
the bottom frame. In order to achieve this, I need to implement a jsp file which uses 
the template.jsp. The jsp file should be something like:

myJsp.jsp:


%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
template:insert template='template.jsp'
  template:put name='title' content='Templates' direct='true'/
  template:put name='header' direct='true' 
   %= request.getContextPath() %/Heading.jsp
  /template:put
  template:put name='content' direct='true'
   %= request.getContextPath() %/?(What should I put here)
  /template:put
/template:insert

My question is: what should I put in the above commented area? I tried to put 
registration.jsp. It just doesn't work.

David, you said that Struts templates do not work with HTML frames. So we have no 
way to achieve this by using Struts template. Is my understanding right? From Cedric's 
answer, it seems there is a way in intermixed. I never used intermixed before. I will 
have a look at it.

My boss likes to use frame with Struts framework. Is it really possible to do it? or 
we have to make decision to not use frame? Your opinion and help is appreciated.

Once again, many thanks to Sean, David and Cedric.

Regards.
Keven





- Original Message - 
From: Sean Gay [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 02, 2002 10:28 PM
Subject: RE: template


 Kevin,
 
 Firstly let me apologise for giving you slightly incorrect information about
 your problem initially. Never fear though I have a working solution for you.
 
 Using the direct=true is correct in this case as you are putting the output
 into a frameset (I missed this initially) and not including the file into
 the template. This being the case you need to treat it like a string and
 have the full path to the file placed in here. I think where things are
 going wrong is where you may have a context path which is making your app
 look in the wrong spot for the file when it tries to display within the
 frameset. If you include this context path where you are outputting
 welcome.html you should be right.
 
 I have done this in the attached zip. If you just unzip and place in the
 directory that you have your app running you should be able to see what I am
 explaining.
 
 Again sorry for the initial goose chase that I sent you on.
 
 Regards,
 Sean
 
 -Original Message-
 From: Keven [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 03, 2002 10:06 AM
 To: Struts Users Mailing List
 Subject: Re: template
 
 
 Sean:
 
 Thank you for your reply.
 I removed direct='true'. So the index.jsp is look like:
 
 %@ taglib uri

struts template

2002-09-02 Thread Keven

 
Hi, All:

I would like to implement web pages using struts. the page layout consist of four 
parts: top menu, side bar, main content area, and footer. Depend on the role of users, 
the top menu will change accordingly--some button wii be disappeared, some buttons are 
added. I think this should be achieved by struts template. And for every page, there 
are two jsps, one is template jsp, and one is the jsp that uses the template jsp. I 
haven't actually implement it yet. Does anyone know the best way to achieve it? Thank 
you for your time and help.

Keven



struts template

2002-09-02 Thread Keven

Hi, All:

I would like to implement web pages using struts. the page layout consist of four 
parts: top menu, side bar, main content area, and footer. Depend on the role of users, 
the top menu will change accordingly--some button wii be disappeared, some buttons are 
added. I think this should be achieved by struts template. And for every page, there 
are two jsps, one is template jsp, and one is the jsp that uses the template jsp. I 
haven't actually implement it yet. Does anyone know the best way to achieve it? Thank 
you for your time and help.

Keven




template

2002-09-02 Thread Keven

Hi, All:

I have a template jsp called template.jsp. The content of template.jsp is:

% taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

  FRAME src=template:get name='header' flush='true'/
  FRAME src=template:get name='content' flush='true'/

/frameset
/html

I have another jsp file called  index.jsp which uses the template.jsp. The content of 
index.jsp is:

% taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

  template:put name='title' content='Templates' direct='true'/
  template:put name='header' content='/welcome.html' direct='true'/ 
  template:put name='content' content='/tour.html' direct='true' /
/template:insert

Whenever I tried to run it in tomcat, I got 
Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html

type Status report

message /Welcome.html

description The requested resource (/Welcome.html) is not available.


Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html

type Status report

message /tour.html

description The requested resource (/tour.html) is not available.



I got the above messages in different frame.I don't know what cause the problem. Some 
one knows how to fix it?

Thank you very much

Keven







RE: template

2002-09-02 Thread Sean Gay

Hey Kevin,

I think I know what is going on here.

When you are doing template:put name='header' content='/welcome.html'
direct='true'/ you are using direct=true which directly outputs the string
/welcome.html as the file to be used for the header. This would mean that
any contextPath that you have for your server is not being applied and as
such no file can be found as it is looking for it in the root of your web
server.

I think that what you should be using is something like the following which
will include the file rather than just outputting the string. template:put
name='header' content='/welcome.html'/

The same would apply for the content.

Hopefully this solves your problem. I usually only create separate files if
they are going to be used over multiple pages, such as navigation, page
headers etc. You could also do something like this to save having
superfluous files lying around.

template:put name='content'
INSERT YOUR PAGE CONTENT IN HERE
/template:put

Regards,
Sean

-Original Message-
From: Keven [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 8:48 AM
To: Struts Users Mailing List
Subject: template


Hi, All:

I have a template jsp called template.jsp. The content of template.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

  FRAME src=template:get name='header' flush='true'/
  FRAME src=template:get name='content' flush='true'/

/frameset
/html

I have another jsp file called  index.jsp which uses the template.jsp. The
content of index.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

  template:put name='title' content='Templates' direct='true'/
  template:put name='header' content='/welcome.html' direct='true'/
  template:put name='content' content='/tour.html' direct='true' /
/template:insert

Whenever I tried to run it in tomcat, I got
Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html

type Status report

message /Welcome.html

description The requested resource (/Welcome.html) is not available.


Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html

type Status report

message /tour.html

description The requested resource (/tour.html) is not available.



I got the above messages in different frame.I don't know what cause the
problem. Some one knows how to fix it?

Thank you very much

Keven






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




Re: template

2002-09-02 Thread Keven

Sean:

Thank you for your reply.
I removed direct='true'. So the index.jsp is look like:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

  template:put name='title' content='Templates' direct='true'/
  template:put name='header' content='/welcome.html' / 
  template:put name='content' content='/welcome.html'  /
/template:insert

welcome.jsp is:

html 
head
title New Document /title
/head

body
 Hello
/body
/html

When I run index.jsp, the error changed to: 

Apache Tomcat/4.0.4 - HTTP Status 404 - /html headtitle New Document 
/title/headbodyHello/body/html



type Status report

message /html headtitle New Document /title/headbodyHello/body/html

description The requested resource (/html headtitle New Document 
/title/headbodyHello/body/html) is not available.

Could you please give me a clue what is wrong this time?

Thank you very much!

Keven




- Original Message - 
From: Sean Gay [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 02, 2002 7:21 PM
Subject: RE: template


 Hey Kevin,
 
 I think I know what is going on here.
 
 When you are doing template:put name='header' content='/welcome.html'
 direct='true'/ you are using direct=true which directly outputs the string
 /welcome.html as the file to be used for the header. This would mean that
 any contextPath that you have for your server is not being applied and as
 such no file can be found as it is looking for it in the root of your web
 server.
 
 I think that what you should be using is something like the following which
 will include the file rather than just outputting the string. template:put
 name='header' content='/welcome.html'/
 
 The same would apply for the content.
 
 Hopefully this solves your problem. I usually only create separate files if
 they are going to be used over multiple pages, such as navigation, page
 headers etc. You could also do something like this to save having
 superfluous files lying around.
 
 template:put name='content'
 INSERT YOUR PAGE CONTENT IN HERE
 /template:put
 
 Regards,
 Sean
 
 -Original Message-
 From: Keven [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 03, 2002 8:48 AM
 To: Struts Users Mailing List
 Subject: template
 
 
 Hi, All:
 
 I have a template jsp called template.jsp. The content of template.jsp is:
 
 %@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
 
 html
 head
 titletemplate:get name='title'//title
 /head
 
 frameset  rows=20%,*
 
   FRAME src=template:get name='header' flush='true'/
   FRAME src=template:get name='content' flush='true'/
 
 /frameset
 /html
 
 I have another jsp file called  index.jsp which uses the template.jsp. The
 content of index.jsp is:
 
 %@ taglib uri=/WEB-INF/struts-template.tld prefix=template %
 
 template:insert template='/template.jsp'
 
   template:put name='title' content='Templates' direct='true'/
   template:put name='header' content='/welcome.html' direct='true'/
   template:put name='content' content='/tour.html' direct='true' /
 /template:insert
 
 Whenever I tried to run it in tomcat, I got
 Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html
 
 type Status report
 
 message /Welcome.html
 
 description The requested resource (/Welcome.html) is not available.
 
 
 Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html
 
 type Status report
 
 message /tour.html
 
 description The requested resource (/tour.html) is not available.
 
 
 
 I got the above messages in different frame.I don't know what cause the
 problem. Some one knows how to fix it?
 
 Thank you very much
 
 Keven
 
 
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]



RE: template

2002-09-02 Thread Sean Gay

Kevin,

Firstly let me apologise for giving you slightly incorrect information about
your problem initially. Never fear though I have a working solution for you.

Using the direct=true is correct in this case as you are putting the output
into a frameset (I missed this initially) and not including the file into
the template. This being the case you need to treat it like a string and
have the full path to the file placed in here. I think where things are
going wrong is where you may have a context path which is making your app
look in the wrong spot for the file when it tries to display within the
frameset. If you include this context path where you are outputting
welcome.html you should be right.

I have done this in the attached zip. If you just unzip and place in the
directory that you have your app running you should be able to see what I am
explaining.

Again sorry for the initial goose chase that I sent you on.

Regards,
Sean

-Original Message-
From: Keven [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 10:06 AM
To: Struts Users Mailing List
Subject: Re: template


Sean:

Thank you for your reply.
I removed direct='true'. So the index.jsp is look like:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

  template:put name='title' content='Templates' direct='true'/
  template:put name='header' content='/welcome.html' /
  template:put name='content' content='/welcome.html'  /
/template:insert

welcome.jsp is:

html
head
title New Document /title
/head

body
 Hello
/body
/html

When I run index.jsp, the error changed to:

Apache Tomcat/4.0.4 - HTTP Status 404 - /html headtitle New Document
/title/headbodyHello/body/html




type Status report

message /html headtitle New Document
/title/headbodyHello/body/html

description The requested resource (/html headtitle New Document
/title/headbodyHello/body/html) is not available.

Could you please give me a clue what is wrong this time?

Thank you very much!

Keven




- Original Message -
From: Sean Gay [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 02, 2002 7:21 PM
Subject: RE: template


 Hey Kevin,

 I think I know what is going on here.

 When you are doing template:put name='header' content='/welcome.html'
 direct='true'/ you are using direct=true which directly outputs the
string
 /welcome.html as the file to be used for the header. This would mean
that
 any contextPath that you have for your server is not being applied and as
 such no file can be found as it is looking for it in the root of your web
 server.

 I think that what you should be using is something like the following
which
 will include the file rather than just outputting the string.
template:put
 name='header' content='/welcome.html'/

 The same would apply for the content.

 Hopefully this solves your problem. I usually only create separate files
if
 they are going to be used over multiple pages, such as navigation, page
 headers etc. You could also do something like this to save having
 superfluous files lying around.

 template:put name='content'
 INSERT YOUR PAGE CONTENT IN HERE
 /template:put

 Regards,
 Sean

 -Original Message-
 From: Keven [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 03, 2002 8:48 AM
 To: Struts Users Mailing List
 Subject: template


 Hi, All:

 I have a template jsp called template.jsp. The content of template.jsp is:

 %@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

 html
 head
 titletemplate:get name='title'//title
 /head

 frameset  rows=20%,*

   FRAME src=template:get name='header' flush='true'/
   FRAME src=template:get name='content' flush='true'/

 /frameset
 /html

 I have another jsp file called  index.jsp which uses the template.jsp. The
 content of index.jsp is:

 %@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

 template:insert template='/template.jsp'

   template:put name='title' content='Templates' direct='true'/
   template:put name='header' content='/welcome.html' direct='true'/
   template:put name='content' content='/tour.html' direct='true' /
 /template:insert

 Whenever I tried to run it in tomcat, I got
 Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html

 type Status report

 message /Welcome.html

 description The requested resource (/Welcome.html) is not available.

 
 Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html

 type Status report

 message /tour.html

 description The requested resource (/tour.html) is not available.



 I got the above messages in different frame.I don't know what cause the
 problem. Some one knows how to fix it?

 Thank you very much

 Keven






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



test.zip
Description: Zip compressed data

--
To unsubscribe, e-mail

Re: template

2002-09-02 Thread David Geary

Hi Keven,

Struts templates do not work with HTML frames; I believe that's the
cause of your problem. (If anyone has gotten them to work with frames,
please holler). When I originally developed templates, I tried to get
them to work with frames, but it was very difficult. If I remember
correctly it's because each frame creates its own request, which wreaks
havoc with templates.

That said, you really shouldn't need to resort to frames, because
templates gives you pretty much the same functionality, except for being
able to resize regions.

I don't know if Tiles (which is an extension of templates) works with
frames; my guess is that they don't, but Cedric should be able to answer
that. Cedric, are you listening?

btw, you're probably better off using Tiles or a later version of
templates. Both implementations offer similar capabilities; which you
prefer is largely a matter of taste. You can read about the later
version of templates and download the source code at:

http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-jsptemplate_p.html.


david

Keven wrote:

Hi, All:

I have a template jsp called template.jsp. The content of template.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

html
head
titletemplate:get name='title'//title
/head

frameset  rows=20%,*

  FRAME src=template:get name='header' flush='true'/
  FRAME src=template:get name='content' flush='true'/

/frameset
/html

I have another jsp file called  index.jsp which uses the template.jsp. The content of 
index.jsp is:

%@ taglib uri=/WEB-INF/struts-template.tld prefix=template %

template:insert template='/template.jsp'

  template:put name='title' content='Templates' direct='true'/
  template:put name='header' content='/welcome.html' direct='true'/ 
  template:put name='content' content='/tour.html' direct='true' /
/template:insert

Whenever I tried to run it in tomcat, I got 
Apache Tomcat/4.0.4 - HTTP Status 404 - /welcome.html

type Status report

message /Welcome.html

description The requested resource (/Welcome.html) is not available.


Apache Tomcat/4.0.4 - HTTP Status 404 - /tour.html

type Status report

message /tour.html

description The requested resource (/tour.html) is not available.



I got the above messages in different frame.I don't know what cause the problem. Some 
one knows how to fix it?

Thank you very much

Keven





  




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




Using the template tag library with parameters like jsp:param

2002-08-31 Thread CB Thomas

With jsp:include, I can pass parameter values to the included page by using 
jsp:param.

Can I get this functionality using the Struts template tag library?  If so, 
can I use request.getParameter to retrieve values in the included page?

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Re: Using the template tag library with parameters like jsp:param

2002-08-31 Thread David Geary

CB Thomas wrote:

 With jsp:include, I can pass parameter values to the included page by 
 using jsp:param.

 Can I get this functionality using the Struts template tag library?

Yes. Use the direct attribute, like this:

template:put name='title' content='Templates' direct='true'/

Then in your template, you can access that value; for example, like this:

htmlheadtitletemplate:get name='title'//title/head.../html

Normally, the template:get tag will include content associated with 
the named parameter, but if you
specify direct='true' with template:put, the template:get tag will 
just retrieve the value.

See http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb_p.html 
for more information about templates and the direct attribute.

btw, if at all possible, I suggest that you use Tiles instead of 
templates. The former, which is an extension of the latter, has more 
functionality.

   If so, can I use request.getParameter to retrieve values in the 
 included page? 

No, but you can use template:get as illustrated above.


david



 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com


 -- 
 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: Using the template tag library with parameters like jsp:param

2002-08-31 Thread Eddie Bush

There is also Tiles for this sort of thing.

David Geary wrote:

 CB Thomas wrote:

 With jsp:include, I can pass parameter values to the included page by 
 using jsp:param.

 Can I get this functionality using the Struts template tag library?

 Yes. Use the direct attribute, like this: 

Tiles is a more feature-rich version of the template mechanism in 
Struts.  It supports this as well.

 template:put name='title' content='Templates' direct='true'/

 Then in your template, you can access that value; for example, like this:

 htmlheadtitletemplate:get name='title'//title/head.../html

 Normally, the template:get tag will include content associated with 
 the named parameter, but if you
 specify direct='true' with template:put, the template:get tag will 
 just retrieve the value.

 See 
 http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb_p.html 
 for more information about templates and the direct attribute.

 btw, if at all possible, I suggest that you use Tiles instead of 
 templates. The former, which is an extension of the latter, has more 
 functionality.

   If so, can I use request.getParameter to retrieve values in the 
 included page? 

 No, but you can use template:get as illustrated above.

 david 

Regards,

Eddie



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




Re: Using the template tag library with parameters like jsp:param

2002-08-31 Thread jw

Hi All!

I've seen a number of posts looking for help/info on the this type of error message 
(i.e., javax.servlet.ServletException: Exception creating bean of class 
???.???.xxxForm: java.lang.ClassNotFoundException: ???.???.xxxForm) that occurs when 
they attempt to test their struts application.

I have not seen a solution/ explanation, thus far, as to why this occurs.

Any help or insight as to why this happens, would be much appreciated.   Once again, 
I'm cutting and pasting a code example - that theoretically should work 
out-of-the-box, and once again its not working (whaddya gonna do?)..

Here is the information/example code that I'm trying to get working when this error 
occurs... (NOTE: I'm using jakarta-tomcat-4.0.4,j2sdk1.4.0_01,
jakarta-struts-1.0.2)

*** SubmitForm.java***
package hansen.playground;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

public final class SubmitForm extends ActionForm {

  /* Last Name */
  private String lastName = Hansen; // default value
  public String getLastName() {
return (this.lastName);
  }
  public void setLastName(String lastName) {
this.lastName = lastName;
  }

  /* Address */
  private String address = null;
  public String getAddress() {
return (this.address);
  }
  public void setAddress(String address) {
this.address = address;
  }

  /* Sex */
  private String sex = null;
  public String getSex() {
return (this.sex);
  }
  public void setSex(String sex) {
this.sex = sex;
  }

  /* Married status */
  private String married = null;
  public String getMarried() {
return (this.married);
  }
  public void setMarried(String married) {
this.married = married;
  }

  /* Age */
  private String age = null;
  public String getAge() {
return (this.age);
  }
  public void setAge(String age) {
this.age = age;
  }

}


*** SubmitAction.java ***
package hansen.playground;

import javax.servlet.http.*;
import org.apache.struts.action.*;

public final class SubmitAction extends Action {

  public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response) {

SubmitForm f = (SubmitForm) form; // get the form bean
// and take the last name value
String lastName = f.getLastName();
// Translate the name to upper case
//and save it in the request object
request.setAttribute(lastName, lastName.toUpperCase());

// Forward control to the specified success target
return (mapping.findForward(success));
  }
}

*** submit.jsp***
% page language=java %
% taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
% taglib uri=/WEB-INF/struts-html.tld prefix=html %
% taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html
headtitleSubmit example/title/head
body

h3Example Submit Page/h3

html:errors/

html:form action=submit.do
Last Name: html:text property=lastName/br
Address:   html:textarea property=address/br
Sex:   html:radio property=sex value=M/Male
   html:radio property=sex value=F/Femalebr
Married:   html:checkbox property=married/br
Age:   html:select property=age
 html:option value=a0-19/html:option
 html:option value=b20-49/html:option
 html:option value=c50-/html:option
   /html:selectbr
   html:submit/
/html:form

/body
/html


*** struts-config.xml ***
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts 
Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

struts-config


  !-- == Form Bean Definitions === --
  form-beans
form-bean name=submitForm type=hansen.playground.SubmitForm
/form-bean
  /form-beans


  !-- == Global Forward Definitions == --
  global-forwards
  /global-forwards


  !-- == Action Mapping Definitions == --
  action-mappings

action   path=/submit
  type=hansen.playground.SubmitAction
  name=submitForm
  input=/submit.jsp
  scope=request
forward name=success path=/submit.jsp/  
forward name=failure path=/submit.jsp/  
/action


  /action-mappings

/struts-config

*** ***

jw


*** error that I receive ***

javax.servlet.ServletException: Exception creating bean of class 
hansen.playground.SubmitForm: java.lang.ClassNotFoundException: 
hansen.playground.SubmitForm
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.submit$jsp._jspService(submit$jsp.java:485)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at 

Re: Using the template tag library with parameters like jsp:param

2002-08-31 Thread jw

Hi All

Sorry for the bother - but, who knew - i.e., The issue was apparently
related to the struts version I was using (i.e.,
jakarta-struts-1.0.2)...

Apparently, the examples will work only with jakarta-struts-1.1-b2.At
least in my current environment (winXP/j2sdk1.4.0_01/jakarta-tomcat-4.0.4)

Thanks!

jw
- Original Message -
From: jw [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Saturday, August 31, 2002 1:28 PM
Subject: Re: Using the template tag library with parameters like jsp:param


Hi All!

I've seen a number of posts looking for help/info on the this type of error
message (i.e., javax.servlet.ServletException: Exception creating bean of
class ???.???.xxxForm: java.lang.ClassNotFoundException: ???.???.xxxForm)
that occurs when they attempt to test their struts application.

I have not seen a solution/ explanation, thus far, as to why this occurs.

Any help or insight as to why this happens, would be much appreciated.
Once again, I'm cutting and pasting a code example - that theoretically
should work out-of-the-box, and once again its not working (whaddya gonna
do?)..

Here is the information/example code that I'm trying to get working when
this error occurs... (NOTE: I'm using jakarta-tomcat-4.0.4,
j2sdk1.4.0_01,jakarta-struts-1.0.2)

*** SubmitForm.java***
package hansen.playground;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

public final class SubmitForm extends ActionForm {

  /* Last Name */
  private String lastName = Hansen; // default value
  public String getLastName() {
return (this.lastName);
  }
  public void setLastName(String lastName) {
this.lastName = lastName;
  }

  /* Address */
  private String address = null;
  public String getAddress() {
return (this.address);
  }
  public void setAddress(String address) {
this.address = address;
  }

  /* Sex */
  private String sex = null;
  public String getSex() {
return (this.sex);
  }
  public void setSex(String sex) {
this.sex = sex;
  }

  /* Married status */
  private String married = null;
  public String getMarried() {
return (this.married);
  }
  public void setMarried(String married) {
this.married = married;
  }

  /* Age */
  private String age = null;
  public String getAge() {
return (this.age);
  }
  public void setAge(String age) {
this.age = age;
  }

}


*** SubmitAction.java ***
package hansen.playground;

import javax.servlet.http.*;
import org.apache.struts.action.*;

public final class SubmitAction extends Action {

  public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response) {

SubmitForm f = (SubmitForm) form; // get the form bean
// and take the last name value
String lastName = f.getLastName();
// Translate the name to upper case
//and save it in the request object
request.setAttribute(lastName, lastName.toUpperCase());

// Forward control to the specified success target
return (mapping.findForward(success));
  }
}

*** submit.jsp***
%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html
headtitleSubmit example/title/head
body

h3Example Submit Page/h3

html:errors/

html:form action=submit.do
Last Name: html:text property=lastName/br
Address:   html:textarea property=address/br
Sex:   html:radio property=sex value=M/Male
   html:radio property=sex value=F/Femalebr
Married:   html:checkbox property=married/br
Age:   html:select property=age
 html:option value=a0-19/html:option
 html:option value=b20-49/html:option
 html:option value=c50-/html:option
   /html:selectbr
   html:submit/
/html:form

/body
/html


*** struts-config.xml ***
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.0//EN
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

struts-config


  !-- == Form Bean Definitions
=== --
  form-beans
form-bean name=submitForm type=hansen.playground.SubmitForm
/form-bean
  /form-beans


  !-- == Global Forward Definitions
== --
  global-forwards
  /global-forwards


  !-- == Action Mapping Definitions
== --
  action-mappings

action   path=/submit
  type=hansen.playground.SubmitAction
  name=submitForm
  input=/submit.jsp
  scope=request
forward name=success path=/submit.jsp/
forward name=failure path=/submit.jsp/
/action


  /action-mappings

/struts-config

*** ***

jw


*** error that I receive ***

javax.servlet.ServletException: Exception creating bean of class
hansen.playground.SubmitForm

Re: Mapping troubles with a dynamically generated template include

2002-08-29 Thread Cedric Dumoulin


  Hi,

  Check Tiles. They are compatible with templates, and accept an action 
has content. Also, you can associate a controller to a tile. This 
controller will populate your tile.

  Hope this help,
 Cedric

Chip Paul wrote:

My site features a news sidebar that is present on
every page.  It is pulled from a database.

My files use the templates and set news.jsp as a
content spot.

template:insert template='template.jsp'
   template:put name='news' content='news.jsp' /
/template:insert

My question is: How can I have my NewsAction called
and the results populated into the news.jsp file, and
all this work in a templated mode so it appears on
every page.

I tried using /news.do as the template, but that
causes an exception when the forward gets processed
after the JSPWriter has begun writing.  I remapped
news.jsp in my struts config to auto-call the action
and forward to a different jsp file, but I still get
the exception:

java.lang.IllegalStateException: Cannot forward after
response has been committed

I'm sure this has been done since it's common in
Blogger type apps, but I can't find a reference to
how to do it correctly.

Thanks,

Chip

__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
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]




Mapping troubles with a dynamically generated template include

2002-08-25 Thread Chip Paul

My site features a news sidebar that is present on
every page.  It is pulled from a database.

My files use the templates and set news.jsp as a
content spot.

template:insert template='template.jsp'
template:put name='news' content='news.jsp' /
/template:insert

My question is: How can I have my NewsAction called
and the results populated into the news.jsp file, and
all this work in a templated mode so it appears on
every page.

I tried using /news.do as the template, but that
causes an exception when the forward gets processed
after the JSPWriter has begun writing.  I remapped
news.jsp in my struts config to auto-call the action
and forward to a different jsp file, but I still get
the exception:

java.lang.IllegalStateException: Cannot forward after
response has been committed

I'm sure this has been done since it's common in
Blogger type apps, but I can't find a reference to
how to do it correctly.

Thanks,

Chip

__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




Problem using nested struts template tag

2002-08-15 Thread Ying Gao

I use nested template tag as the following:

template:insert template=template.jsp

  template:put name=header content=header.jsp/

  template:put name=content direct=true
 template:insert template=contentTemplate.jsp
 template:put name=contentTitleImage
content=images/content_01.gif direct=true/
 template:put name=contentTable content=myContent.jsp/
 /template:insert
  /template:put

  template:put name=footer content=footer.jsp/

/template:insert

template.jsp is a template that contains header, content and footer.
contentTemplate.jsp is a template that contains a title image and a detail
content jsp to which I pass myContent.jsp. It works fine except that the
browser (both IE and Netscape) keeps busy for a while after the page header,
content and footer are loaded. It seems that the browser tries to load
something else.
JavaScript won't work until the browser finish loading. I have no idea what
it is loading.
It only happens when I use template:put tag to pass a content
(myContent.jsp) to the nested
template (contentTemplate.jsp) without using 'direct=true'. If I use
'direct=true'
the browser returns immediately but that is not what I want. I want the
content to be
included instead of printed directly.
Does anyone know what the problem is? Is there any solution or workaround?
Thanks.

Iris


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




struts template opinion

2002-07-25 Thread Michelle Popovits

Hi,

I am considering using Struts templating tag library.
Can anyone tell me what you think of it and what it's benefit is over not 
using it (is it worth the extra effort??).

Thanks,
Michelle



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: struts template opinion

2002-07-25 Thread @Basebeans.com

Subject: Re: struts template opinion
From: Vic C. [EMAIL PROTECTED]
 ===
Use tiles instead.
V.

Michelle Popovits wrote:
 Hi,
 
 I am considering using Struts templating tag library.
 Can anyone tell me what you think of it and what it's benefit is over 
 not using it (is it worth the extra effort??).
 
 Thanks,
 Michelle
 
 
 
 _
 Join the world's largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com
 
 
 -- 
 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: struts template opinion

2002-07-25 Thread Bartley, Chris P

Take a look at Tiles:

   http://www.lifl.fr/~dumoulin/tiles/

Mmmm mmm good.  Definitely worth the effort (and you'll sing the Cedric is
my hero! song every time your client calls wanting to change a header
color, menus, page layout style, etc.).  In addition to breaking up your
pages into reusable components, it also makes presenting different views for
different roles and/or user-agents (e.g. phone, PC browser, etc) a snap.

 -Original Message-
 From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 25, 2002 4:51 PM
 To: [EMAIL PROTECTED]
 Subject: struts template opinion
 
 
 Hi,
 
 I am considering using Struts templating tag library.
 Can anyone tell me what you think of it and what it's benefit 
 is over not 
 using it (is it worth the extra effort??).
 
 Thanks,
 Michelle
 
 
 
 _
 Join the world's largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com
 
 
 --
 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: struts template opinion

2002-07-25 Thread Eddie Bush

Extra effort?  How is it extra effort to use a template scheme?  You 
reduce the number of places you have to maintain information down to 
(ideally) just one.  Tiles is even better, by the way.  It takes things 
one step further and lets you seperate your layout definition from it's 
actual presentation.  This is very powerful - not only do you gain the 
ability to inherit definitions (layouts) and only modify what you really 
need to, you also gain the ability to write you definitions in the XML 
config file and do away with any JSP files that were once dedicated just 
to specifying layouts.  It is a bit more work (learning - brain-work - 
phew! hard brain work at first too, but it pays off!) initially, but ... 
you have to try it and use it to come to a genuine realization of the 
power it has.  Once you have, you won't want to use anything else!

Regards,

Eddie

Michelle Popovits wrote:

 Hi,

 I am considering using Struts templating tag library.
 Can anyone tell me what you think of it and what it's benefit is over 
 not using it (is it worth the extra effort??).

 Thanks,
 Michelle 




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




RE: struts template opinion

2002-07-25 Thread Michelle Popovits

What is the difference between Template and Tiles?

I am currently limited to using the Struts 1.0.2 so I think that Tiles is 
out for the time being.

Is there a migration path from Templates to Tiles?

So i'm looking at jsp includes vs. templates??

Thanks,
Michelle


From: Bartley, Chris P [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: struts template opinion
Date: Thu, 25 Jul 2002 16:58:27 -0500

Take a look at Tiles:

http://www.lifl.fr/~dumoulin/tiles/

Mmmm mmm good.  Definitely worth the effort (and you'll sing the Cedric is
my hero! song every time your client calls wanting to change a header
color, menus, page layout style, etc.).  In addition to breaking up your
pages into reusable components, it also makes presenting different views 
for
different roles and/or user-agents (e.g. phone, PC browser, etc) a snap.

  -Original Message-
  From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, July 25, 2002 4:51 PM
  To: [EMAIL PROTECTED]
  Subject: struts template opinion
 
 
  Hi,
 
  I am considering using Struts templating tag library.
  Can anyone tell me what you think of it and what it's benefit
  is over not
  using it (is it worth the extra effort??).
 
  Thanks,
  Michelle
 
 
 
  _
  Join the world's largest e-mail service with MSN Hotmail.
  http://www.hotmail.com
 
 
  --
  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]




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: struts template opinion

2002-07-25 Thread Eddie Bush

I looked at the Struts templating mechanism ages ago but I don't 
remember anything about it now.  I do believe that you can use Tiles 
with 1.0.2.  Search the list.  Cedric just posted a reply to someone 
either today or yesterday on this very topic.

Good Luck!

Eddie

Michelle Popovits wrote:

 What is the difference between Template and Tiles?

 I am currently limited to using the Struts 1.0.2 so I think that Tiles 
 is out for the time being.

 Is there a migration path from Templates to Tiles?

 So i'm looking at jsp includes vs. templates??

 Thanks,
 Michelle 




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




RE: struts template opinion

2002-07-25 Thread Bartley, Chris P

No, Tiles works great with 1.0.2.

 -Original Message-
 From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 25, 2002 5:04 PM
 To: [EMAIL PROTECTED]
 Subject: RE: struts template opinion
 
 
 [snip]

 I am currently limited to using the Struts 1.0.2 so I think 
 that Tiles is out for the time being.

 [snip]

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




RE: struts template opinion

2002-07-25 Thread Michelle Popovits

ok, Thanks for the info.
Can anyone tell me the best source of information on how to develop with 
Tiles?  I know there a chapter in the ServerSide struts book, is that 
considered the best source?

Thanks,
Michelle


From: Bartley, Chris P [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: struts template opinion
Date: Thu, 25 Jul 2002 17:08:42 -0500

No, Tiles works great with 1.0.2.

  -Original Message-
  From: Michelle Popovits [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, July 25, 2002 5:04 PM
  To: [EMAIL PROTECTED]
  Subject: RE: struts template opinion
 
 
  [snip]
 
  I am currently limited to using the Struts 1.0.2 so I think
  that Tiles is out for the time being.
 
  [snip]

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





_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: struts template opinion

2002-07-25 Thread Eddie Bush

You will certainly want to visit that :-)  Chuck does a  pretty good job 
of laying it all out.  One tip:  remember when ti comes to tiles - if 
you want to forward to them the action you use must come from 
org.apache.struts.tiles.actions.* - not org.apache.struts.actions.*! 
 Hopefully that will save you the frustration I initially had :-)

Regards,

Eddie

Michelle Popovits wrote:

 ok, Thanks for the info.
 Can anyone tell me the best source of information on how to develop 
 with Tiles?  I know there a chapter in the ServerSide struts book, is 
 that considered the best source?

 Thanks,
 Michelle 




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




Re: struts template opinion

2002-07-25 Thread Eddie Bush

You only need to use the tiles actions if you forward DIRECTLY to a tile 
though - ie. there is no physical page and you want to forward to it. 
 Look at Chuck's chapter and try it out - and then post here if you have 
questions ;-)  Playing with it is the _best_ way to learn it.

Good Luck!

Eddie

Eddie Bush wrote:

 You will certainly want to visit that :-)  Chuck does a  pretty good 
 job of laying it all out.  One tip:  remember when ti comes to tiles 
 - if you want to forward to them the action you use must come from 
 org.apache.struts.tiles.actions.* - not org.apache.struts.actions.*! 
 Hopefully that will save you the frustration I initially had :-)

 Regards,

 Eddie 




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




  1   2   3   4   >