Re: Advice: how strutty should I be??
The Action can render the response when convenient. The Struts reload Action in 1.0.x does this to print OK after its complete. It can also be convenient to have an Action do something like render XML for use by another system. It's just that using Actions to render the presentation is not resusable in an another environment. In most cases, it's just as easy and much cleaner to use another servlet to render the response. The coding effort is equivalent, and you then have the ability to use the servlet outside of Struts. This also corresponds to how Struts works with other presentation systems. JSPs are glorified servlets, and JSPs are not part of Struts. The framework just provides some tags that interact with framework. Likewise, Velocity provided a servlet and toolset that works with the framework but acts as an independently. If you are using your own presentation system with Struts, I'd recommend following the same approach and using your own servlet rather than tweaking-out an Action. But, again, it's a matter of degree. If you just need to pop out some text or XML, go for it. But if there is other processing to do be done on the stream before it is rendered, get it out where it can be reused. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Andrew Hill wrote: soapbox Nah. JSPs are definately evil. They arent real (x)html, and they arent real Java. (And of course as anything that isnt Java is by definition evil , so it follows that jsps... heheh) My main objection to JSPs is that they are inelegant (yes - I know thats strong language , but its true!). The struts taglibs make them a lot less inelegant and make developing apps with them a lot more straightforward, but they remain ugly. I have a strong distaste for the idea of mixing the code and layout like that. html, scriptlets, tags that you have to rtfm before you know what they do..., all very messy and most it definately offends my artistic appreciation of the code. I feel it is much better to have the dynamic rendering be done using proper clean java code, and the layout be done using good pure xhtml (with no non xhtml tags! (not that notepad really cares about tags anyhow hehe ;- )) /soapbox We were making use of XMLC to achieve this, however Ive had to ditch it as the DOMs it creates have a very dodgy structure and dont even maintain the original nesting of elements correctly (not to mention still being glued to a hacked version of xerces1.2 !). (I suppose this is what one gets for making use of stuff from Barracuda. At this point Im very glad I only decided to use the xmlc stuff, and stuck to good ol' struts for my controller framework!) Ive now written my own (well its not actually mine - the company owns everything we write) code which does lots of fun stuff to allow me to obtain an org.w3c.Document (without having to type too much code or for the user to wait forever for the parser to do its thing) and by manipulating this dom I can insert the dynamic content in much the same way as one does it using XMLC. Its actually quite a good way to learn the inner workings of struts, as since Im not using jsps, Im finding myself taking lots of looks at the way the taglib source is coded so I can get similar functionality in my code. ;-) question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view) or because its good design to do it this way or becuase of some other gotcha I havent noticed yet? /question -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Thanks for the response Ted :-) I ended up implementing it using a servlet which will call my renderers (helper classes that perform 'DOM surgery') and this rendering servlet takes care of the code to output the dom tree as xhtml to the browser. The action chooses which renderers to use (Im still rather uneasy about the amount of knowledge this implies the actions having about the view, but alas my tight schedule prohibits me from giving it too much more thought at this stage) and forwards them to the rendering servlet. Im glad to see I had chosen the option you recommend. :-) thanks Andrew -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 09, 2002 18:36 To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? The Action can render the response when convenient. The Struts reload Action in 1.0.x does this to print OK after its complete. It can also be convenient to have an Action do something like render XML for use by another system. It's just that using Actions to render the presentation is not resusable in an another environment. In most cases, it's just as easy and much cleaner to use another servlet to render the response. The coding effort is equivalent, and you then have the ability to use the servlet outside of Struts. This also corresponds to how Struts works with other presentation systems. JSPs are glorified servlets, and JSPs are not part of Struts. The framework just provides some tags that interact with framework. Likewise, Velocity provided a servlet and toolset that works with the framework but acts as an independently. If you are using your own presentation system with Struts, I'd recommend following the same approach and using your own servlet rather than tweaking-out an Action. But, again, it's a matter of degree. If you just need to pop out some text or XML, go for it. But if there is other processing to do be done on the stream before it is rendered, get it out where it can be reused. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Andrew Hill wrote: soapbox Nah. JSPs are definately evil. They arent real (x)html, and they arent real Java. (And of course as anything that isnt Java is by definition evil , so it follows that jsps... heheh) My main objection to JSPs is that they are inelegant (yes - I know thats strong language , but its true!). The struts taglibs make them a lot less inelegant and make developing apps with them a lot more straightforward, but they remain ugly. I have a strong distaste for the idea of mixing the code and layout like that. html, scriptlets, tags that you have to rtfm before you know what they do..., all very messy and most it definately offends my artistic appreciation of the code. I feel it is much better to have the dynamic rendering be done using proper clean java code, and the layout be done using good pure xhtml (with no non xhtml tags! (not that notepad really cares about tags anyhow hehe ;- )) /soapbox We were making use of XMLC to achieve this, however Ive had to ditch it as the DOMs it creates have a very dodgy structure and dont even maintain the original nesting of elements correctly (not to mention still being glued to a hacked version of xerces1.2 !). (I suppose this is what one gets for making use of stuff from Barracuda. At this point Im very glad I only decided to use the xmlc stuff, and stuck to good ol' struts for my controller framework!) Ive now written my own (well its not actually mine - the company owns everything we write) code which does lots of fun stuff to allow me to obtain an org.w3c.Document (without having to type too much code or for the user to wait forever for the parser to do its thing) and by manipulating this dom I can insert the dynamic content in much the same way as one does it using XMLC. Its actually quite a good way to learn the inner workings of struts, as since Im not using jsps, Im finding myself taking lots of looks at the way the taglib source is coded so I can get similar functionality in my code. ;-) question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view
Re: Advice: how strutty should I be??
If you haven't seen them already, be sure to check out http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html and http://www.openroad.ca/opencode/ Right now, stxx extends ActionForward, ActionServlet, and Action to help with XLM/XLS transformations. The ActionForward extension is a block of transform tags that specify which xls to use. This gives you a chance to swap in another xls for a given user-agent. So, you have something like this forward name=success transform path=/login.xsl name=default/ transform path=/login_netscape.xsl name=Mozilla / transform path=/login_msie.xsl name=MSIE render=client / /forward It would be even neater, I think, if the transformation code in the stxx ActionServlet were moved to it's own servlet, that loaded the transformation tags from its own config. The ActionForward could then refer to an URI like login.stx. On the xls-servlet side, you would then have something like mappings url-pattern=*.stx/ mapping match=/login transform path=/login.xsl agent=default/ transform path=/login_netscape.xsl agent=Mozilla / transform path=/login_msie.xsl agent=MSIE render=client / /mapping /mappings Since Struts exposes its resources through the standard contexts, any servlet can gain access to them, the same way the custom tags do through the RequestUtils. While a lot of Struts developer use JSPs, they have no special preference within the core framework. Any servlet in the application has the same access to Struts as a JSP custom tag does. The stxx Action extension adds a function that you can use to save a XML document to the request, for later processing. But I believe you could do the same thing with a static class. The Struts website is written using XML and XLS. It would be neat to see more tools that would let us do XML/XLS transforamtions dynamically, instead of only using static HTML pages tranformed in an Ant build process. Another worthy XLS implementation for web apps is Maverick. http://mav.sourceforge.net/ -T. Andrew Hill wrote: Thanks for the response Ted :-) I ended up implementing it using a servlet which will call my renderers (helper classes that perform 'DOM surgery') and this rendering servlet takes care of the code to output the dom tree as xhtml to the browser. The action chooses which renderers to use (Im still rather uneasy about the amount of knowledge this implies the actions having about the view, but alas my tight schedule prohibits me from giving it too much more thought at this stage) and forwards them to the rendering servlet. Im glad to see I had chosen the option you recommend. :-) thanks Andrew -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 09, 2002 18:36 To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? The Action can render the response when convenient. The Struts reload Action in 1.0.x does this to print OK after its complete. It can also be convenient to have an Action do something like render XML for use by another system. It's just that using Actions to render the presentation is not resusable in an another environment. In most cases, it's just as easy and much cleaner to use another servlet to render the response. The coding effort is equivalent, and you then have the ability to use the servlet outside of Struts. This also corresponds to how Struts works with other presentation systems. JSPs are glorified servlets, and JSPs are not part of Struts. The framework just provides some tags that interact with framework. Likewise, Velocity provided a servlet and toolset that works with the framework but acts as an independently. If you are using your own presentation system with Struts, I'd recommend following the same approach and using your own servlet rather than tweaking-out an Action. But, again, it's a matter of degree. If you just need to pop out some text or XML, go for it. But if there is other processing to do be done on the stream before it is rendered, get it out where it can be reused. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Andrew Hill wrote: question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action
RE: Advice: how strutty should I be??
I had a bit of a look at a the javaworld example, and had also seen the stxx example. Alas as is too often the case I simply didnt have enough time to fully examine them (especially stxx - which is a pity as I rather liked the look of it.) :-( XSLT has many advantages but didnt seem intuitively suited to what I was doing, and perhaps more importantly I lacked sufficient time to learn the syntax of XSLT. Our project is a quite complex application as opposed to say a website and xslt and things such as velocity seemed better suited to more static content - though Im probably wrong about that right? ;-) I also wanted to make use of resource bundles as we will be targeting markets in languages other than English. Didnt immediately see how best to do that using xslt though Im sure its possible. btw I noticed a few posts a month or so ago about problems with certain characters in BIG5 causing problems when used in resource bundles. Any good places I should look !--other than the archive which Ill take a look at when I get to that stage-- for info on this? /btw !-- This project has been one big learning experience so far: j2ee, ant, struts, xml, dom, servlet api, side-effects of caffiene OD-- I ended up deciding to use xmlc (which Barracuda leverages to great effect) and ended up ditching it halfway through our second iteration due to a whole bunch of showstopping bugs I was unable to find a way to workaround !--probably my fault, but Im not so sure. The DOMs it produced were all nested 'wrong', like something out of an HP Lovecraft nightmare, and as it had a ton of (modified?) xerces1.2 classes I also didnt have the technical skill to make it play nice with the later version we are using. Very glad I was using struts for the controller and didnt go 100% barracuda!-- However, I found myself still rather enamoured of the idea of doing DOM manipulation !--being a typical programmer I like the idea of messing around with objects in a tree-- on the server end to insert dynamic content into the layout document and hence went and developed my own code to obtain the Documents from xhtml files. We are following a somewhat iterative approach of prototyping our look feel as we go along which is one of the reasons I didnt want my dynamic content rendering mixed in too much with the more static layout much of which is chrome. The ultimate goal of course is to have the dynamic rendering very independant of the structure of the layout xhtml, however in practice my rendering code still knows more than I would like about the structure of the document (ie: is something a table cell node or a span node etc...). As I go along Im factoring out wherever I can and so my rendering framework is starting to get quite a library of generic methods. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 09, 2002 20:34 To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? If you haven't seen them already, be sure to check out http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-strutsxslt.html and http://www.openroad.ca/opencode/ Right now, stxx extends ActionForward, ActionServlet, and Action to help with XLM/XLS transformations. The ActionForward extension is a block of transform tags that specify which xls to use. This gives you a chance to swap in another xls for a given user-agent. So, you have something like this forward name=success transform path=/login.xsl name=default/ transform path=/login_netscape.xsl name=Mozilla / transform path=/login_msie.xsl name=MSIE render=client / /forward It would be even neater, I think, if the transformation code in the stxx ActionServlet were moved to it's own servlet, that loaded the transformation tags from its own config. The ActionForward could then refer to an URI like login.stx. On the xls-servlet side, you would then have something like mappings url-pattern=*.stx/ mapping match=/login transform path=/login.xsl agent=default/ transform path=/login_netscape.xsl agent=Mozilla / transform path=/login_msie.xsl agent=MSIE render=client / /mapping /mappings Since Struts exposes its resources through the standard contexts, any servlet can gain access to them, the same way the custom tags do through the RequestUtils. While a lot of Struts developer use JSPs, they have no special preference within the core framework. Any servlet in the application has the same access to Struts as a JSP custom tag does. The stxx Action extension adds a function that you can use to save a XML document to the request, for later processing. But I believe you could do the same thing with a static class. The Struts website is written using XML and XLS. It would be neat to see more tools that would let us do XML/XLS transforamtions dynamically, instead of only using static HTML pages tranformed in an Ant build process. Another worthy XLS implementation for web apps is Maverick. http://mav.sourceforge.net/ -T. Andrew Hill wrote
RE: Advice: how strutty should I be??
Steve Jobs? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 02, 2002 11:22 PM What the heck! Ok. Who leaked our requirements document? -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 22:34 How about: public class WeirdBusinessObject implements IVague, IUncertain { ... } I feel that this reflects reality better and OO is all about accurately modelling the environment. :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:21 AM You got it! (not that I would know or anything) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:58 AM hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Damn! I told em we couldnt trust him to keep mum, but did they listen? sigh/ -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 20:56 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Steve Jobs? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 02, 2002 11:22 PM What the heck! Ok. Who leaked our requirements document? -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 22:34 How about: public class WeirdBusinessObject implements IVague, IUncertain { ... } I feel that this reflects reality better and OO is all about accurately modelling the environment. :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:21 AM You got it! (not that I would know or anything) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:58 AM hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- 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: Advice: how strutty should I be??
What the heck! Ok. Who leaked our requirements document? -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 22:34 To: Struts Users Mailing List Subject: RE: Advice: how strutty should I be?? How about: public class WeirdBusinessObject implements IVague, IUncertain { ... } I feel that this reflects reality better and OO is all about accurately modelling the environment. :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:21 AM To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? You got it! (not that I would know or anything) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:58 AM hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- 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: Advice: how strutty should I be??
Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
My only experience with doing COM was when I was playing round with directX about 3 years or so back after I finished uni trying to write the ultimate shoot-em-up game. Got as far as a single tiled scrolling background with several layers of cloud and a player ship that could shoot missiles before I got a job. Funny how I never got time to go look at it again since. hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
You got it! (not that I would know or anything) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:58 AM hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- 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: Advice: how strutty should I be??
How about: public class WeirdBusinessObject implements IVague, IUncertain { ... } I feel that this reflects reality better and OO is all about accurately modelling the environment. :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 9:21 AM To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? You got it! (not that I would know or anything) -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:58 AM hmm. I know! I think all my interfaces should be extending IUnknown yes? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:39 Hah! Open up any Visual Basic, Visual C++, or COM manual. Did you think you could hide behind the struts of your mother forever? -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 7:27 AM Uh oh. Tell me your kidding mate! I haven't gone and reused a nomenclature already used by M$ have I??? arrgh! I must be being influenced by evil spirits. Quick wheres an excorcist! panicNot too late to refactor! - hmm maybe I wont be going home early. :-(/panic -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 19:18 To: 'Struts Users Mailing List' Subject: RE: Advice: how strutty should I be?? Ah ha! Micro$oft background exposed! Burn him! Burn him! -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 1:24 AM I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'...and IRenderingPipeline ... IDocumentManager ... IDocumentFinder ... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Advice: how strutty should I be??
As we say in Boston - Wicked Cool! Rick Reumann [EMAIL PROTECTED] on 05/30/2002 12:34:29 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: Re: Advice: how strutty should I be?? On Thursday, May 30, 2002, 12:23:20 AM, Todd Pierce wrote: TP Hi, I've only been strutting for a couple of months and I often TP break out into standard JSP to do familiar things, eg: Here is the TP way I have been alternating bgcolor in tables using struts. Check out this tag, you'll love it http://edhill.its.uiowa.edu/display/ -- Rick mailto:[EMAIL PROTECTED] As the light changed from red to green to yellow and back to red again, I sat there thinking about life. Was it nothing more than a bunch of honking and yelling? Sometimes it seemed that way. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender and erase this e-mail message immediately. --- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Hi, http://edhill.its.uiowa.edu/display/ Is there a way to get the benefits of this tag, but by using a Servlet instead of a JSP. This is because although my project is using the struts framework, it is not using any JSPs. (We feel JSPs are 'evil'.) Regards, Daniel -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 12:34 PM To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? On Thursday, May 30, 2002, 12:23:20 AM, Todd Pierce wrote: TP Hi, I've only been strutting for a couple of months and I often TP break out into standard JSP to do familiar things, eg: Here is the TP way I have been alternating bgcolor in tables using struts. Check out this tag, you'll love it http://edhill.its.uiowa.edu/display/ -- Rick mailto:[EMAIL PROTECTED] As the light changed from red to green to yellow and back to red again, I sat there thinking about life. Was it nothing more than a bunch of honking and yelling? Sometimes it seemed that way. -Jack Handey -- 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: Advice: how strutty should I be??
Daniel, What are you using to display dynamic pages then? Have you looked at the Velocity template engine? What is so evil about JSP's? Perhaps you aren't using the technology correctly? Regards, Richard At 11:04 AM 5/31/2002 +0800, you wrote: Hi, http://edhill.its.uiowa.edu/display/ Is there a way to get the benefits of this tag, but by using a Servlet instead of a JSP. This is because although my project is using the struts framework, it is not using any JSPs. (We feel JSPs are 'evil'.) Regards, Daniel -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 12:34 PM To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? On Thursday, May 30, 2002, 12:23:20 AM, Todd Pierce wrote: TP Hi, I've only been strutting for a couple of months and I often TP break out into standard JSP to do familiar things, eg: Here is the TP way I have been alternating bgcolor in tables using struts. Check out this tag, you'll love it http://edhill.its.uiowa.edu/display/ -- Rick mailto:[EMAIL PROTECTED] As the light changed from red to green to yellow and back to red again, I sat there thinking about life. Was it nothing more than a bunch of honking and yelling? Sometimes it seemed that way. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
soapbox Nah. JSPs are definately evil. They arent real (x)html, and they arent real Java. (And of course as anything that isnt Java is by definition evil , so it follows that jsps... heheh) My main objection to JSPs is that they are inelegant (yes - I know thats strong language , but its true!). The struts taglibs make them a lot less inelegant and make developing apps with them a lot more straightforward, but they remain ugly. I have a strong distaste for the idea of mixing the code and layout like that. html, scriptlets, tags that you have to rtfm before you know what they do..., all very messy and most it definately offends my artistic appreciation of the code. I feel it is much better to have the dynamic rendering be done using proper clean java code, and the layout be done using good pure xhtml (with no non xhtml tags! (not that notepad really cares about tags anyhow hehe ;- )) /soapbox We were making use of XMLC to achieve this, however Ive had to ditch it as the DOMs it creates have a very dodgy structure and dont even maintain the original nesting of elements correctly (not to mention still being glued to a hacked version of xerces1.2 !). (I suppose this is what one gets for making use of stuff from Barracuda. At this point Im very glad I only decided to use the xmlc stuff, and stuck to good ol' struts for my controller framework!) Ive now written my own (well its not actually mine - the company owns everything we write) code which does lots of fun stuff to allow me to obtain an org.w3c.Document (without having to type too much code or for the user to wait forever for the parser to do its thing) and by manipulating this dom I can insert the dynamic content in much the same way as one does it using XMLC. Its actually quite a good way to learn the inner workings of struts, as since Im not using jsps, Im finding myself taking lots of looks at the way the taglib source is coded so I can get similar functionality in my code. ;-) question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view) or because its good design to do it this way or becuase of some other gotcha I havent noticed yet? /question -Original Message- From: Richard Yee [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 11:15 To: Struts Users Mailing List Subject: RE: Advice: how strutty should I be?? Daniel, What are you using to display dynamic pages then? Have you looked at the Velocity template engine? What is so evil about JSP's? Perhaps you aren't using the technology correctly? Regards, Richard At 11:04 AM 5/31/2002 +0800, you wrote: Hi, http://edhill.its.uiowa.edu/display/ Is there a way to get the benefits of this tag, but by using a Servlet instead of a JSP. This is because although my project is using the struts framework, it is not using any JSPs. (We feel JSPs are 'evil'.) Regards, Daniel -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 12:34 PM To: Struts Users Mailing List Subject: Re: Advice: how strutty should I be?? On Thursday, May 30, 2002, 12:23:20 AM, Todd Pierce wrote: TP Hi, I've only been strutting for a couple of months and I often TP break out into standard JSP to do familiar things, eg: Here is the TP way I have been alternating bgcolor in tables using struts. Check out this tag, you'll love it http://edhill.its.uiowa.edu/display/ -- Rick mailto:[EMAIL PROTECTED] As the light changed from red to green to yellow and back to red again, I sat there thinking about life. Was it nothing more than a bunch of honking and yelling? Sometimes it seemed that way. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Andrew, To address your question, question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view) or because its good design to do it this way or becuase of some other gotcha I havent noticed yet? /question it is because of both of the reasons you mentioned. The action classes shouldn't write the response b/c then they must rely on having access to the HttpServletResponse object. It is also good practice to cleanly separate the View from the Model code. Check out the Velocity template engine. Regards, Richard At 11:56 AM 5/31/2002 +0800, you wrote: soapbox Nah. JSPs are definately evil. They arent real (x)html, and they arent real Java. (And of course as anything that isnt Java is by definition evil , so it follows that jsps... heheh) My main objection to JSPs is that they are inelegant (yes - I know thats strong language , but its true!). The struts taglibs make them a lot less inelegant and make developing apps with them a lot more straightforward, but they remain ugly. I have a strong distaste for the idea of mixing the code and layout like that. html, scriptlets, tags that you have to rtfm before you know what they do..., all very messy and most it definately offends my artistic appreciation of the code. I feel it is much better to have the dynamic rendering be done using proper clean java code, and the layout be done using good pure xhtml (with no non xhtml tags! (not that notepad really cares about tags anyhow hehe ;- )) /soapbox We were making use of XMLC to achieve this, however Ive had to ditch it as the DOMs it creates have a very dodgy structure and dont even maintain the original nesting of elements correctly (not to mention still being glued to a hacked version of xerces1.2 !). (I suppose this is what one gets for making use of stuff from Barracuda. At this point Im very glad I only decided to use the xmlc stuff, and stuck to good ol' struts for my controller framework!) Ive now written my own (well its not actually mine - the company owns everything we write) code which does lots of fun stuff to allow me to obtain an org.w3c.Document (without having to type too much code or for the user to wait forever for the parser to do its thing) and by manipulating this dom I can insert the dynamic content in much the same way as one does it using XMLC. Its actually quite a good way to learn the inner workings of struts, as since Im not using jsps, Im finding myself taking lots of looks at the way the taglib source is coded so I can get similar functionality in my code. ;-) question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view) or because its good design to do it this way or becuase of some other gotcha I havent noticed yet? /question -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Advice: how strutty should I be??
Well thats the thing. The action already gets the request and response passed to its execute method. My actual rendering classes are _conceptually_ independent of the response and request. details I have a 'rendering pipeline' which is just a collection of 'IDocumentRenderer'. These each have a render() method that takes a Document as input and returns (usually the same but modified) Document. The pipeline is a collection of these which feed the output of one to the input of the next, and IRenderingPipeline has a method which implements this. Documents are obtained by some magic code in an object that implements IDocumentManager - this has the imaginatively named method 'getDocument()' (which takes a string key). The document manager makes use of an object that implements IDocumentFinder (I just love interfaces ;-) which will obtain an InputStream based on the key. In a web application this means making use of the servlet context getResourceStream() method. Some renderers , such as the template renderer need several other documents to do their thing. (The template renderer grabs node trees from several documents and inserts them into several places in the document._ - As the document being rendered to is usually the actual template document the template renderer is almost always first in the pipeline - since it gets the actual content out of another document and slaps it into the template. Once that content is there other renderers that follow can do their thing - ie: render field values, i18n text etc... /details but Now while I said the rendering classes were _conceptually_ independent of response and request, in practice its not always so (The interfaces know nothing of servlets but the implementing classes often have to). For example one of the renderers will set the href for the base tag. To do this it needs the request in order to get path information. Another class I have that is used by a lot of renderers is (an implementation of) IURLRewriter. This object needs the response in order to call the encodeURL() method... Now one of the duties of the controller (action classes) is to select which view to use, and in my case they do this by selecting which renderers to use. This involves instantiating the renderers and putting them into an IRenderingPipeline and then forwarding to THE view servlet. Instantiating these renderers also means instantiating quite a few objects they need that cache request or response. As the view servlet just calls the pipelines render() method and outputs the resulting document as xhtml to the output it seems like a bit of overkill to give it a whole servlet (I mean - hey its doubling the number of servlets in my app!) Furthermore, the rendering implementation is actually making use of requests and responses and contexts etc... that were cached by code in the action (and thus actionServlet) before forwarding to the view servlet, and Im not sure if thats ok or if its a naughty thing to do. Im thinking that instead of forwarding the request from my action, I pass the rendering pipepline to a class that outputs the xhtml to the response, and return null from the action. /but ohwaitaminute I wonder if my issue is that I instantiate the renderers in the action as my way of selecting the view. Perhaps I should instead have a renderParameters object (or something like that) that gathers the data model value objects and other such objects needed BY the renderers as well as a key identifying which renderer to use, and pass THAT instead of the actual renderer objects to the view servlet which would then use a factory to instantiate the appropriate renderers? /ohwaitaminute help any advice? /help -Original Message- From: Richard Yee [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 12:29 To: Struts Users Mailing List Subject: RE: Advice: how strutty should I be?? Andrew, To address your question, question While Im on the subject, Ive got a generic servlet that does 'rendering' (or more precicely invokes the render() method on a bunch of objects that the action selects and forwards to it). However in this case , having a servlet to do it seems a bit redundant, as an action already has access to all the goodies a servlet gets - the most important of course being the response object. Is there any particular reason I shouldnt simply invoke the rendering code that is in my rendering class straight from my action and write to the response there instead of forwarding to a servlet? Or to rephrase it, - do we forward to a jsp or servlet from our action because the action(s helper classes) are unable to execute the rendering code (such as in the case of a jsp implemented view) or because its good design to do it this way or becuase of some other gotcha I havent noticed yet? /question it is because of both of the reasons you mentioned. The action classes shouldn't write the response b/c then they must rely on having access to the HttpServletResponse object. It is also good
RE: Advice: how strutty should I be??
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg26590.html James Mitchell Software Engineer\Struts Evangelist Open-Tools.org Come and see what all the fuss is about... http://struts-atlanta.open-tools.org -Original Message- From: Todd Pierce [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 12:23 AM To: '[EMAIL PROTECTED]' Subject: Advice: how strutty should I be?? Hi, I've only been strutting for a couple of months and I often break out into standard JSP to do familiar things, eg: Here is the way I have been alternating bgcolor in tables using struts. Is there a more strutty way of doing this sort of thing, i.e. logic tags, or is this acceptable? % Collection theCollection = ...; boolean colorFlag = true ; % logic:iterate id=element name=theCollection % String colorString = (colorFlag) ? #FF : #CC; colorFlag = !colorFlag ; % tr td bgcolor=%= colorString % bean:write name=element property=someProperty//td td bgcolor=%= colorString % bean:write name=element property=anotherNumber//td /tr /logic:iterate -- 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]