Templating
Scenario: Sort of a templating system, based on the usual design patterns: Template, Attribute-Value, etc... (don't remember the exact names, but I'm confident you all know what I mean) :-) There are different entities whose (type's) properties are stored as attributes that are grouped and related altogether by an entity type (the Template). Therefore, the name and number of properties may vary from entity type to entity type. In order to manage (paint, enter data, store, etc...) this model, I understand there is something in Struts called indexed properties. Is that what I need to implement the right solution? Are there any best practices to solve the typical issues associated to this paradigm (data flow and validation, mainly)? I've implemented this before; however, the first time I try to do on a Struts-based application. All suggestion are welcome. Cheers, Freddy.
Basic Templating Recommendations?
I've tried asking this a few times, but I think I haven't been clear. I need a simple way to have requests converted into calls to Tiles definitions. So, requests like /pages/pageone.thtml, would get turned into a call to the tile pageone. /pages/main/pagetwo.thtml = main.pageone, etc. I thought creating an Action that would figure out the defintion based on the request URI, using the ideas in org.apache.struts.tiles.actions.DefinitionDispatcherAction. However, I've just read that you can't have multiple servlet-mappings. Also, I feel that my approach isn't great. Please, I know people must be doing something for the many generic html pages on their dynamic sites, ideas? Thank you, A. -- Adam Sherman Software Developer Teach and Travel Inc. +1.613.241.3103 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Basic Templating Recommendations?
I don't understand what you are asking. With struts you can specify the template you want to use by placing a tiles definition in the forward mappings. It will map you request url to a definition. Just make sure that everything is happening through struts controller and map you forward to tiles definitions. Have you tried nesting definition in your tiles-def or using the inheritance feature? Brandon Goodin Phase Web and Multimedia P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Adam Sherman [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 03, 2002 8:18 AM To: Struts Users Mailing List Subject: Basic Templating Recommendations? I've tried asking this a few times, but I think I haven't been clear. I need a simple way to have requests converted into calls to Tiles definitions. So, requests like /pages/pageone.thtml, would get turned into a call to the tile pageone. /pages/main/pagetwo.thtml = main.pageone, etc. I thought creating an Action that would figure out the defintion based on the request URI, using the ideas in org.apache.struts.tiles.actions.DefinitionDispatcherAction. However, I've just read that you can't have multiple servlet-mappings. Also, I feel that my approach isn't great. Please, I know people must be doing something for the many generic html pages on their dynamic sites, ideas? Thank you, A. -- Adam Sherman Software Developer Teach and Travel Inc. +1.613.241.3103 -- 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: Basic Templating Recommendations?
Phase Web and Multimedia wrote: I don't understand what you are asking. With struts you can specify the template you want to use by placing a tiles definition in the forward mappings. It will map you request url to a definition. Just make sure that everything is happening through struts controller and map you forward to tiles definitions. Have you tried nesting definition in your tiles-def or using the inheritance feature? Basically, I've got a bunch of pages in a site that are static. I need a simple way to template them. I would like to use Tiles, but I don't want to have links to tiles?def=main.index and such. I want links to look like below. So, I'm asking about recommendations to do simple templating of static content, in conjunction with a dynamic site built using Struts. (So I want to reuse the tiles.) Thanks for your help, A. I've tried asking this a few times, but I think I haven't been clear. I need a simple way to have requests converted into calls to Tiles definitions. So, requests like /pages/pageone.thtml, would get turned into a call to the tile pageone. /pages/main/pagetwo.thtml = main.pageone, etc. I thought creating an Action that would figure out the defintion based on the request URI, using the ideas in org.apache.struts.tiles.actions.DefinitionDispatcherAction. However, I've just read that you can't have multiple servlet-mappings. Also, I feel that my approach isn't great. Please, I know people must be doing something for the many generic html pages on their dynamic sites, ideas? -- Adam Sherman Software Developer Teach and Travel Inc. +1.613.241.3103 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Advice needed for frame templating
Hi all, Reading severall articles, It seems to be a better solution to avoid the use of frames in web project. However I'm afraid not to have the choice (I need an applet running in background). Could someone give advice on frame templating using Struts. Thanks in advance. -Th. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Advice needed for frame templating
We have got round the problem of passing javabeans into other frames by using javascript to set variables in the other frames(the alternative to to using jsp:includes and jsp usebeans). This is one of the possible issues that you may run into (as we have) when using frames. IMHO I think it's much more maintainable to use includes and usebeans to create a frame like appearance instead of using frames and javascript but we also have been forced into it by the powers that be. If anyone out there in Struts land knows of a nicer than using javascript to populate frames with objects passed back by action I'd certainly love to hear about it. The thought of having to map the javabeans placed in to the request by the action into javascript objects purely so that they can be used to populate other frames is still making me shudder. HTH Jin - Original Message - From: Thierry Ruiz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 10:58 AM Subject: Advice needed for frame templating Hi all, Reading severall articles, It seems to be a better solution to avoid the use of frames in web project. However I'm afraid not to have the choice (I need an applet running in background). Could someone give advice on frame templating using Struts. Thanks in advance. -Th. -- 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: can content be dynamic in JSP templating
Hi, Ken == Ken Domen Domen writes: Ken Do we have to create a separate content.jsp for every content that's Ken different? Ken Doesn't that mean that you have to create 2 jsp's for every page that's Ken different? Ken Is there a way to make the content dynamic so that I don't have to create an Ken extra JSP page per content change? Ken template:put name='content' content='/login.jsp'/ Ken Can the above be: Ken template:put name='content' content='%=dynamic_value%'/ I have not used this, but you might consider looking at the Struts Tiles taglib, instead of using the Struts template taglib. I don't believe you get any more dynamic flexibility, but if you have two (or more) pages that only differ by the value of the content attribute, then instead of creating a separate JSP page for each variation, you can just specify an additional element in the Tiles configuration file. This makes the content variations a little easier to manage. If you're interested, read the recent article in JavaWorld about Tiles. The complete URL for the article is: http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html? Comments and suggestions are most welcome, -Prakash - eBuilt, Inc. - Builders of Industrial-Strength e-Business (http://www.eBuilt.com) Learn Java! (http://www.cact.csupomona.edu/javacert.html) Learn Design Patterns! (http://www.cact.csupomona.edu/UML_Specialist.htm) Want answers to Java, OOAD, UML, Design Patterns, EJBs, JSPs, Servlets, XP, etc? (http://clubs.yahoo.com/clubs/bartssandbox) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
can content be dynamic in JSP templating
Do we have to create a separate content.jsp for every content that's different? Doesn't that mean that you have to create 2 jsp's for every page that's different? Is there a way to make the content dynamic so that I don't have to create an extra JSP page per content change? template:put name='content' content='/login.jsp'/ Can the above be: template:put name='content' content='%=dynamic_value%'/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: can content be dynamic in JSP templating
Ken == Ken Domen Domen writes: Ken Do we have to create a separate content.jsp for every content that's Ken different? Ken Doesn't that mean that you have to create 2 jsp's for every page that's Ken different? Ken Is there a way to make the content dynamic so that I don't have to create an Ken extra JSP page per content change? Ken template:put name='content' content='/login.jsp'/ Ken Can the above be: Ken template:put name='content' content='%=dynamic_value%'/ I have not used this, but you might consider looking at the Struts Tiles taglib, instead of using the Struts template taglib. I don't believe you get any more dynamic flexibility, but if you have two (or more) pages that only differ by the value of the content attribute, then instead of creating a separate JSP page for each variation, you can just specify an additional element in the Tiles configuration file. This makes the content variations a little easier to manage. If you're interested, read the recent article in JavaWorld about Tiles. -- === David M. Karr ; Best Consulting [EMAIL PROTECTED] ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Template -struts-template and generated HTML / templating using PUSH model
Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Template -struts-template and generated HTML / templating using PUSH model
J'espere, que cela prendra en compte l'internationnalisation. Les fichiers de resources, ne permettent pas de gerer des pages stylises. Ce qui m'interesserait, dans un systeme de templates, ce sont des feuilles de style (pas xsl) qui s'appliqueraient sur des beans, et qui permettrait au graphiste de dfinir globalement comment s'affiche l'objet, puis de l'utiliser via des tags. a+ Cedric Dumoulin a crit : Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Template -struts-template and generated HTML / templating using PUSH model
Merci. I will have a look at it. For my problem, I use . . . heuh, Tomcat 3.2.1 :( I just tried with Catalina 4.0b1 and . . . wow, it works fine :) Does I need a special parameter in server.xml, something else ??? Vincent -Message d'origine- De : Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Envoye : mercredi 28 mars 2001 11:06 A : [EMAIL PROTECTED] Objet : Re: Template -struts-template and generated HTML / templating using PUSH model Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Template -struts-template and generated HTML / templating using PUSH model
Hi, Christophe, I understand that you prefer to talk in French. But we cannot read your email. If you would like to talk only with Cedric, you can send email only to him, not all struts users. Thanks and sorry for any interruption. Maya Christophe Vigny wrote: J'espere, que cela prendra en compte l'internationnalisation. Les fichiers de resources, ne permettent pas de gerer des pages stylises. Ce qui m'interesserait, dans un systeme de templates, ce sont des feuilles de style (pas xsl) qui s'appliqueraient sur des beans, et qui permettrait au graphiste de dfinir globalement comment s'affiche l'objet, puis de l'utiliser via des tags. a+ Cedric Dumoulin a crit : Hi Vincent, Have a look to Components proposal. Components proposal can be seen as "extended templates". With Components you can define your template's contents/attributes in a separate file, and insert content by using its name. A content, named a component, can also inherit from other definitions. Components proposal also contains other features. See (main site) http://www.lifl.fr/~dumoulin/components (mirror) http://www.geocities.com/cedricdumoulin/components/ I am currently working on the possibility to define or modify the template/component inside the action or inside the jsp. This will be available soon (see a previous mail 'Re: PROPOSAL: Template Screens'). Furthermore, useful Components features will be progressively introduce in Struts version 1.1 For your first question, see intermixed. Cedric Vincent Harcq wrote: Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? What jsp server do you use ? This happens because your server doesn't flush included page. You can try to use the components library instead of template one, it is fully compatible. 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Template -struts-template and generated HTML / templating using PUSH model
Harcq, I just ran into this problem myself with WebSphere. The GetTag.java - the source behind the template:get tag that actually does the include calls pageContext and includes whatever content should go in. By default, the servlet engine should flush the buffer (that's what allows an include to go somewhere within your page). However, apparently some servers don't do that by default (WS 3.5.3 doesn't seem to). The solution is an easy one, but you'll need to recompile Struts. Under struts/src/share/org/apache/struts/taglib/template you will see a file called GetTag.java. Open that file. In the doStartTag() method you'll find the following code: pageContext.include(content.toString()); To fix your problem (hopefully, worked for me) add the following line above it: pageContext.getOut().flush(); So your end result will look like: pageContext.getOut().flush(); pageContext.include(content.toString()); By hardcoding the flush your problems should be solved. Recompiling struts is documented on the Struts installation web page. :) HTH, Chris Assenza -Original Message- From: Vincent Harcq [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 28, 2001 2:59 AM To: User Struts Subject: Template -struts-template and generated HTML / templating using PUSH model Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Template -struts-template and generated HTML / templating using PUSH model
Hi, 1. I am beginning to look at Templating mechanism and so use the example struts-template using version pre-beta-2 (23/03/01). The result is a strange for me. Can somebody explain me this. On the first page, when I look at the generated code (look at the end of message), I got something where the side-bar.jsp and header.jsp is included BEFORE the html tag; while from what I see in chapterTemplate.jsp, the html should appear first. Is there a problem somewhere ? Does somebody is aware of that ? Is it my browser ? 2. I was also thinking about another mean of doing templating. The fact that I have two create each 2 files (introduction.jsp and introduction.html) is not really needed if you consider you have a little number of different templates to work with. Say you have only two templates (side-bar header content footer) (left-bar header content right-bar footer), it is too much for me to create each time the page that will use template:put. I have done that before I used Struts in a "request processor" by setting the value of a "content" field, forwarding to one of two pages template1.jsp and template2.jsp that uses jsp include tags. My plan was to do that in the findForward() method of ActionForwards and forward all the time to one of the 2 template pages that I have and setting the "content" value before. To speak "philosophically", but wishing to not re-open this debate, the PUSH method is for me more convenient that the "PULL" one for Page Templating Mechanism. But I do not want to "mix" Velocity and Struts """"only""" to solve this templating problem. Any ideas ? HTML generated: --- font size='5'a name="top"Topics/a/fontp table width='145' trtda href='introduction.jsp' Introduction /a/td/tr trtda href='using.jsp' Using Templates /a/td/tr trtda href='optional.jsp' Optional Content /a/td/tr trtda href='more.jsp' ... and more .../a/td/tr /table/p table tr tdimg src='graphics/java.gif'//td tdimg src='graphics/templates.gif'//td /tr /tablehr html . . . _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
RE: Templating Mechanism
Will it be soon available in a struts release? -alain -Original Message- From: David Geary [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 6:47 PM To: [EMAIL PROTECTED]; Struts dev Subject: Re: Templating Mechanism I just committed changes to the template:put tag and the template tld. The tag works exactly like it did before, but now you can put direct content in the body of the put tag. If the put tag has body content: 1. You can't have a content attribute. (the tag body is the content) 2. You can't specify direct='false'. (tag body content is printed directly) The tag will throw an exception if either of those conditions are violated. david "Holloway, Kevin (DEH)" wrote: Hi, For a trial, we modified the template code so that a template:put tag with NO "content" attribute took its content from the tag body. A template:put with a "content" attribute took its content by including the file named by the content attribute. This did away with the "direct" attribute entirely. The only small issue was what if you had both content attribute and tag body. An exception could be thrown. We just ignore the body, making it clear in the documentation that this is what happens. We can send our code if that would help. Kevin Holloway Applications Architect Department for Environment and Heritage Government of South Australia -Original Message- From: Tan Siow Boon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 28, 2000 11:59 AM To: [EMAIL PROTECTED] Subject: Re: Templating Mechanism Hi, We found the template:ExtPut tag extension provided by Oleg V Alexeev very useful. Is there a plan to incorporate it into Struts 1.0 ? Regards, SiowBoon Oleg V Alexeev wrote: Hello Andrew, Some time ago I write tag to extend template mechanism in this way. Use it if you find it useful. This tag can be used like template:put tag except one feature - if you omit content property in it, then body of this tag will be treated as content. For example - template:extput name="body" Some content /template:extput Sourse you can find in attachment. This class - whole mirror of PutTag except some strings of code. Strings to add to the struts-template.tld tag nameextput/name tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass bodycontentJSP/bodycontent attribute namename/name requiredtrue/required rtexprvaluetrue/rtexprvalue /attribute attribute namecontent/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namedirect/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Monday, November 13, 2000, 7:45:55 PM, you wrote: The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. AB I've been looking at the templating code, and AB have what I hope is a simple question. AB When using direct="true" in the template:put tag, AB to place literal text into the template, the text must AB necessarily be very limited because it's contained in AB the value of the content attribute. What I'd like to be AB able to do is something like: AB !-- the contents of a specific page -- AB template:insert template='/pagetemplate.jsp' AB template:put name="navigation" AB... page-specific navigation here AB /template:put AB template:put name="pagebody" AB... page body here... AB /template:put AB /template:insert AB which seems similar to your examples, except that the AB contents of the navigation and pagebody sections are AB stated in line, instead of loaded from external files, AB which I'd rather not do because of how many tiny AB little documents that would end up creating. AB Is this feasible? If the tag lib doesn't already AB support this function (and I believe it doesn't), AB is it possible to implement, and is it contrary to AB the intent? I'm not comfortable enough with AB taglib implementation to know if doing it this way AB would affect the evaluation of the page body in AB some undesirable way. AB Andy Boyko [EMAIL PROTECTED] -- Best regards, Oleg mailto:[EMAIL PROTECTED] Name: ExtPutTag.java ExtPutTag.javaType: application/x-unknown-content-type-java_auto_file Encoding: base64
Re: Templating Mechanism
I just committed changes to the template:put tag and the template tld. The tag works exactly like it did before, but now you can put direct content in the body of the put tag. If the put tag has body content: 1. You can't have a content attribute. (the tag body is the content) 2. You can't specify direct='false'. (tag body content is printed directly) The tag will throw an exception if either of those conditions are violated. david "Holloway, Kevin (DEH)" wrote: Hi, For a trial, we modified the template code so that a template:put tag with NO "content" attribute took its content from the tag body. A template:put with a "content" attribute took its content by including the file named by the content attribute. This did away with the "direct" attribute entirely. The only small issue was what if you had both content attribute and tag body. An exception could be thrown. We just ignore the body, making it clear in the documentation that this is what happens. We can send our code if that would help. Kevin Holloway Applications Architect Department for Environment and Heritage Government of South Australia -Original Message- From: Tan Siow Boon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 28, 2000 11:59 AM To: [EMAIL PROTECTED] Subject: Re: Templating Mechanism Hi, We found the template:ExtPut tag extension provided by Oleg V Alexeev very useful. Is there a plan to incorporate it into Struts 1.0 ? Regards, SiowBoon Oleg V Alexeev wrote: Hello Andrew, Some time ago I write tag to extend template mechanism in this way. Use it if you find it useful. This tag can be used like template:put tag except one feature - if you omit content property in it, then body of this tag will be treated as content. For example - template:extput name="body" Some content /template:extput Sourse you can find in attachment. This class - whole mirror of PutTag except some strings of code. Strings to add to the struts-template.tld tag nameextput/name tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass bodycontentJSP/bodycontent attribute namename/name requiredtrue/required rtexprvaluetrue/rtexprvalue /attribute attribute namecontent/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namedirect/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Monday, November 13, 2000, 7:45:55 PM, you wrote: The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. AB I've been looking at the templating code, and AB have what I hope is a simple question. AB When using direct="true" in the template:put tag, AB to place literal text into the template, the text must AB necessarily be very limited because it's contained in AB the value of the content attribute. What I'd like to be AB able to do is something like: AB !-- the contents of a specific page -- AB template:insert template='/pagetemplate.jsp' AB template:put name="navigation" AB... page-specific navigation here AB /template:put AB template:put name="pagebody" AB... page body here... AB /template:put AB /template:insert AB which seems similar to your examples, except that the AB contents of the navigation and pagebody sections are AB stated in line, instead of loaded from external files, AB which I'd rather not do because of how many tiny AB little documents that would end up creating. AB Is this feasible? If the tag lib doesn't already AB support this function (and I believe it doesn't), AB is it possible to implement, and is it contrary to AB the intent? I'm not comfortable enough with AB taglib implementation to know if doing it this way AB would affect the evaluation of the page body in AB some undesirable way. AB Andy Boyko [EMAIL PROTECTED] -- Best regards, Oleg mailto:[EMAIL PROTECTED] Name: ExtPutTag.java ExtPutTag.javaType: application/x-unknown-content-type-java_auto_file Encoding: base64
RE: Templating Mechanism
Hi, For a trial, we modified the template code so that a template:put tag with NO "content" attribute took its content from the tag body. A template:put with a "content" attribute took its content by including the file named by the content attribute. This did away with the "direct" attribute entirely. The only small issue was what if you had both content attribute and tag body. An exception could be thrown. We just ignore the body, making it clear in the documentation that this is what happens. We can send our code if that would help. Kevin Holloway Applications Architect Department for Environment and Heritage Government of South Australia -Original Message- From: Tan Siow Boon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 28, 2000 11:59 AM To: [EMAIL PROTECTED] Subject: Re: Templating Mechanism Hi, We found the template:ExtPut tag extension provided by Oleg V Alexeev very useful. Is there a plan to incorporate it into Struts 1.0 ? Regards, SiowBoon Oleg V Alexeev wrote: Hello Andrew, Some time ago I write tag to extend template mechanism in this way. Use it if you find it useful. This tag can be used like template:put tag except one feature - if you omit content property in it, then body of this tag will be treated as content. For example - template:extput name="body" Some content /template:extput Sourse you can find in attachment. This class - whole mirror of PutTag except some strings of code. Strings to add to the struts-template.tld tag nameextput/name tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass bodycontentJSP/bodycontent attribute namename/name requiredtrue/required rtexprvaluetrue/rtexprvalue /attribute attribute namecontent/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namedirect/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Monday, November 13, 2000, 7:45:55 PM, you wrote: The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. AB I've been looking at the templating code, and AB have what I hope is a simple question. AB When using direct="true" in the template:put tag, AB to place literal text into the template, the text must AB necessarily be very limited because it's contained in AB the value of the content attribute. What I'd like to be AB able to do is something like: AB !-- the contents of a specific page -- AB template:insert template='/pagetemplate.jsp' AB template:put name="navigation" AB... page-specific navigation here AB /template:put AB template:put name="pagebody" AB... page body here... AB /template:put AB /template:insert AB which seems similar to your examples, except that the AB contents of the navigation and pagebody sections are AB stated in line, instead of loaded from external files, AB which I'd rather not do because of how many tiny AB little documents that would end up creating. AB Is this feasible? If the tag lib doesn't already AB support this function (and I believe it doesn't), AB is it possible to implement, and is it contrary to AB the intent? I'm not comfortable enough with AB taglib implementation to know if doing it this way AB would affect the evaluation of the page body in AB some undesirable way. AB Andy Boyko [EMAIL PROTECTED] -- Best regards, Olegmailto:[EMAIL PROTECTED] Name: ExtPutTag.java ExtPutTag.javaType: application/x-unknown-content-type-java_auto_file Encoding: base64
RE: Re[2]: Templating Mechanism
This tag is perfect; it's working exactly like I'd hope. Is there reason not to make it replace the existing template:put tag? It seems not to remove of the original tag's features. Andy Boyko [EMAIL PROTECTED] -Original Message- From: Oleg V Alexeev [mailto:[EMAIL PROTECTED]] Sent: Monday, November 13, 2000 12:10 PM To: Andrew Boyko Subject: Re[2]: Templating Mechanism Hello Andrew, Some time ago I write tag to extend template mechanism in this way. Use it if you find it useful. This tag can be used like template:put tag except one feature - if you omit content property in it, then body of this tag will be treated as content. For example - template:extput name="body" Some content /template:extput Sourse you can find in attachment. This class - whole mirror of PutTag except some strings of code. Strings to add to the struts-template.tld tag nameextput/name tagclassorg.apache.struts.taglib.template.ExtPutTag/tagclass bodycontentJSP/bodycontent attribute namename/name requiredtrue/required rtexprvaluetrue/rtexprvalue /attribute attribute namecontent/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute attribute namedirect/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Monday, November 13, 2000, 7:45:55 PM, you wrote: The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. AB I've been looking at the templating code, and AB have what I hope is a simple question. AB When using direct="true" in the template:put tag, AB to place literal text into the template, the text must AB necessarily be very limited because it's contained in AB the value of the content attribute. What I'd like to be AB able to do is something like: AB !-- the contents of a specific page -- AB template:insert template='/pagetemplate.jsp' AB template:put name="navigation" AB... page-specific navigation here AB /template:put AB template:put name="pagebody" AB... page body here... AB /template:put AB /template:insert AB which seems similar to your examples, except that the AB contents of the navigation and pagebody sections are AB stated in line, instead of loaded from external files, AB which I'd rather not do because of how many tiny AB little documents that would end up creating. AB Is this feasible? If the tag lib doesn't already AB support this function (and I believe it doesn't), AB is it possible to implement, and is it contrary to AB the intent? I'm not comfortable enough with AB taglib implementation to know if doing it this way AB would affect the evaluation of the page body in AB some undesirable way. AB Andy Boyko [EMAIL PROTECTED] -- Best regards, Olegmailto:[EMAIL PROTECTED]
Templating Mechanism
After reading the User Guide, I am not sure if Struts does have a Templating Mechanism or not. By that I mean one (or 2 or 3) that defines the basic structure of the site in 3 (for example) parts : a header, the left panel and a body. This template will always be the jsp:forward and have two jsp:include to include the two static (for example) header and left panes pages and one jsp:include that would get a parameter from the request to now which page to include. Something similar to the PetStore example. I like that because it push a lot of DIV or LAYER HTML code in only the template page. Is it possible ? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Templating Mechanism
Take a look at this Sept Javaworld article. It explains how to use a JSP template mechanism with three custom tags. http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html Matt "Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM Please respond to [EMAIL PROTECTED]; Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Matas Veitas/AMS/AMSINC) Subject: Templating Mechanism After reading the User Guide, I am not sure if Struts does have a Templating Mechanism or not. By that I mean one (or 2 or 3) that defines the basic structure of the site in 3 (for example) parts : a header, the left panel and a body. This template will always be the jsp:forward and have two jsp:include to include the two static (for example) header and left panes pages and one jsp:include that would get a parameter from the request to now which page to include. Something similar to the PetStore example. I like that because it push a lot of DIV or LAYER HTML code in only the template page. Is it possible ? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Templating Mechanism
The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. david [EMAIL PROTECTED] wrote: Take a look at this Sept Javaworld article. It explains how to use a JSP template mechanism with three custom tags. http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html Matt "Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM Please respond to [EMAIL PROTECTED]; Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Matas Veitas/AMS/AMSINC) Subject: Templating Mechanism After reading the User Guide, I am not sure if Struts does have a Templating Mechanism or not. By that I mean one (or 2 or 3) that defines the basic structure of the site in 3 (for example) parts : a header, the left panel and a body. This template will always be the jsp:forward and have two jsp:include to include the two static (for example) header and left panes pages and one jsp:include that would get a parameter from the request to now which page to include. Something similar to the PetStore example. I like that because it push a lot of DIV or LAYER HTML code in only the template page. Is it possible ? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Templating Mechanism
David Geary wrote: The template mechanism in the article is nearly identical to the one in Struts. See org.apache.struts.taglib.template. I just updated the documentation on the website http://jakarta.apache.org/struts to be up to date with respect to the changes for 1.0. You'll now see the template library documented. david Craig [EMAIL PROTECTED] wrote: Take a look at this Sept Javaworld article. It explains how to use a JSP template mechanism with three custom tags. http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html Matt "Vincent Harcq" [EMAIL PROTECTED] on 11/12/2000 10:46:39 PM Please respond to [EMAIL PROTECTED]; Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Matas Veitas/AMS/AMSINC) Subject: Templating Mechanism After reading the User Guide, I am not sure if Struts does have a Templating Mechanism or not. By that I mean one (or 2 or 3) that defines the basic structure of the site in 3 (for example) parts : a header, the left panel and a body. This template will always be the jsp:forward and have two jsp:include to include the two static (for example) header and left panes pages and one jsp:include that would get a parameter from the request to now which page to include. Something similar to the PetStore example. I like that because it push a lot of DIV or LAYER HTML code in only the template page. Is it possible ? _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com