nested tags again - Q
Hi, Maybe this question was posted already. I am sorry for the repetition. Can somebody suggest what is the best case to resolve this expression (maybe nested tags are not working): html:hidden property="domainID" value='%= bean:message key="admin.domaindn"/'/ value of domainID is still %= bean:message key="admin.domaindn"/ Thank you all in advance. Maya
Re: nested tags again - Q
I have never been able to get that to work, I think it's an issue with either tomcat of the java spec. The way I have been able to get around this is to write my own tag and have the tag set page context attributes via a tag extra info class. scott. --- Maya Muchnik [EMAIL PROTECTED] wrote: Hi, Maybe this question was posted already. I am sorry for the repetition. Can somebody suggest what is the best case to resolve this expression (maybe nested tags are not working): html:hidden property="domainID" value='%= bean:message key="admin.domaindn"/'/ value of domainID is still %= bean:message key="admin.domaindn"/ Thank you all in advance. Maya = ~~~ Scott __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
RE: How can a Struts Action developer best document the system for a JSP developer?
Title: RE: How can a Struts Action developer best document the system for a JSP developer? Bryan, You might check out a recent article on JavaWorld called Doclet your Servlet (http://www.javaworld.com/javaworld/jw-03-2001/jw-0302-doclets.html) that describes a custom doclet that understands some custom doc tags. It would probably take some customization to work with Struts Actions, since it looks like it uses introspection to look for instances of true servlets. I've been thinking of the same problem, and think that you could get pretty good mileage out of a simple XSL template that transformed the struts-config.xml into a clearer HTML description of the actions, their navigation and form expectations. It could handle #2 and #3 below easily; #4 and #5 would be harder. You could even tie this into the JavaDoc of the ActionForms by creating links from the form names to the area where your JavaDoc lives. I'm not an XSL expert, but I've done some transforms before and figure this wouldn't take very long to create - the key for me is just finding the time now ;-). If I come up with something, I'll forward it to the group, unless someone beats me to it. John -Original Message- From: Bryan Field-Elliot [SMTP:[EMAIL PROTECTED]] Sent: Saturday, March 17, 2001 6:12 PM To: [EMAIL PROTECTED] Subject: How can a Struts Action developer best document the system for a JSP developer? I am struggling right now with how to properly and efficently document my Struts application for my JSP developer (who is by no means a Java expert). Specifically, I want to document each Action as well as each ActionForm that I code, including things like: 1. the pages I expect the user to have come from 2. the pages to which I might forward, or redirect, the user after completing the action 3. The beans I expect to be in place prior to submitting to my action 4. The beans I will set up with values for the resulting JSP page to work with 5. The errors (html:errors) I may set up And anything else that might be appropriate. I'd like to do so in a way that lets me rely on Javadoc, so that I can keep my documentation inside my code. Javadoc when used correctly will also let me do things like see also the Bean documentation (from the Action documentation). I am curious if anyone has developed a template action or bean, which makes best use of Javadoc and which I can cut-and-paste at the head of every one of my Action classes, etc? Thanks, Bryan
RE: ActionForm (DataObject) generator?
You might also check into another apache tool called Torque. I think its officially bundled with Turbine, but it could be a subproject for code generation in its own right. I'm not sure of its current status, but Iacquired a pre-release version from cvs and havehad very good results. Here's a useful starting point: http://jakarta.apache.org/turbine/torque.html Regards, Levi Levi Cook Greenbrier Russel Madison, Wisconsin www.gr.com [EMAIL PROTECTED] -Original Message-From: Kyle Robinson [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 14, 2001 5:35 PMTo: '[EMAIL PROTECTED]'Subject: ActionForm (DataObject) generator? We are using Struts with an Oracle database as the backend. We don'treally feel like handwriting 100's of java files (one for each table). Does anyone know of a good db table - java object generator? Preferably open source? Thanks Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
remembering selected option question
Maybe a newbie question here: If a request is sent to a JSP page that has a html:select tag but the request does not include a parameter with the same name as the property attribute of the html:select tag it is my understanding that an exception will be thrown saying that the request must contain the parameter. If this is the case how do you handle cases in which you want to remember the selected option when there might be other screens accessed in between the times when the screen with the html:select tag is accessed? Thanks, John
Re: How can a Struts Action developer best document the system for a JSP developer?
"Bryan" == Bryan Field-Elliot [EMAIL PROTECTED] writes: Bryan I am struggling right now with how to properly and efficently document Bryan my Struts application for my JSP developer (who is by no means a Java Bryan expert). Specifically, I want to document each Action as well as each Bryan ActionForm that I code, including things like: Bryan 1. the pages I expect the user to have come from Bryan 2. the pages to which I might forward, or redirect, the user after Bryan completing the action Bryan 3. The beans I expect to be in place prior to submitting to my action Bryan 4. The beans I will set up with values for the resulting JSP page to Bryan work with Bryan 5. The errors (html:errors) I may set up Bryan And anything else that might be appropriate. I'd like to do so in a Bryan way that lets me rely on Javadoc, so that I can keep my documentation Bryan inside my code. Javadoc when used correctly will also let me do things Bryan like "see also" the Bean documentation (from the Action documentation). Bryan I am curious if anyone has developed a "template" action or bean, Bryan which makes best use of Javadoc and which I can cut-and-paste at the Bryan head of every one of my Action classes, etc? It's not clear to me whether this will help you, but you might want to read a current article on JavaWorld titled "Doclet your servlet!", about writing a JavaDoc "doclet" to augment the generated documentation for servlet classes. -- === David M. Karr ; w:(425)487-8312 ; TCSI Best Consulting [EMAIL PROTECTED]; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)
display errors
Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya
html:link and ssl
Hallo, I have some problems with the struts html-tag link with the properties forward or page. I want to use this tag with ssl. It doesn't create the link, because the method in org.apache.struts.util.RequestUtils throws in the method absoluteURL a MalformedURLException because unknown protocol. Do I need some additional package for ssl? Or is there a other solution? Thanks for help Harald
Re: remembering selected option question
On Fri, 16 Mar 2001, John Wright wrote: Maybe a newbie question here: If a request is sent to a JSP page that has a html:select tag but the request does not include a parameter with the same name as the property attribute of the html:select tag it is my understanding that an exception will be thrown saying that the request must contain the parameter. If this is the case how do you handle cases in which you want to remember the selected option when there might be other screens accessed in between the times when the screen with the html:select tag is accessed? I'm not quite sure I understand your question completely, but the general philosophy in Struts works like this: * Requests are submitted to an Action (via the Controller servlet) rather than being submitted directly to a page. * The controller servlet can associate a form bean (an instance of ActionForm) with the request, in order to capture the input fields from that request. You would have a property to capture the current state of the property you are using html:select on, for example. * If you need to keep the information about what was selected for more than one request, the typical approach would be to store the corresponding form bean in the user's session. Thanks, John Craig McClanahan
Re: nested tags again - Q
On Mon, 19 Mar 2001, Maya Muchnik wrote: Hi, Maybe this question was posted already. I am sorry for the repetition. Can somebody suggest what is the best case to resolve this expression (maybe nested tags are not working): html:hidden property="domainID" value='%= bean:message key="admin.domaindn"/'/ This is not legal JSP syntax. You are not allowed to nest custom tag uses inside an attribute value. The closest you can come is to use JSP scriptlet expressions to go get the data you are looking for. value of domainID is still %= bean:message key="admin.domaindn"/ Thank you all in advance. Maya Craig McClanahan
RE: Mismatch Between html:options and logic:iterate
Hi Craig, Is this proposed change for html:options something we can expect to see in the near term in a nightly build, or is this a more long term proposal? Thanks, Vic I also think the current logic:iterate behavior is more useful, and suggest that we change html:options to match. As a nod towards backwards compatibility, how about if we make html:options smart enough, as a special case, so that if it receives a String it will still be treated as a bean name? This behavior would be deprecated, but would avoid instantly breaking old code. Craig
Re: html:link and ssl
On Mon, 19 Mar 2001 [EMAIL PROTECTED] wrote: Hallo, I have some problems with the struts html-tag link with the properties forward or page. I want to use this tag with ssl. It doesn't create the link, because the method in org.apache.struts.util.RequestUtils throws in the method absoluteURL a MalformedURLException because unknown protocol. Do I need some additional package for ssl? Or is there a other solution? Could you give an example of how you are trying to do this? Note that trying to use the "page" attribute only works within the current web application (the path you give it is context-relative beginning with a "/"). To go to a different web application, or to switch from SSL to non-SSL or back, you will need to make sure you generate a redirection, either by using the "href" attribute, or by referencing a forward element that has redirect="true" on it. Thanks for help Harald Craig
RE: Mismatch Between html:options and logic:iterate
On Mon, 19 Mar 2001, Fickes, Vic wrote: Hi Craig, Is this proposed change for html:options something we can expect to see in the near term in a nightly build, or is this a more long term proposal? It's short term. I'm finishing up my last presentation for ApacheCon (I've got three of them), and then I get to go back to coding for a while. Thanks, Vic Craig I also think the current logic:iterate behavior is more useful, and suggest that we change html:options to match. As a nod towards backwards compatibility, how about if we make html:options smart enough, as a special case, so that if it receives a String it will still be treated as a bean name? This behavior would be deprecated, but would avoid instantly breaking old code. Craig
RE: Locales and images
Put the path to the images in the properties files -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 12:36 PM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
500 lines of jsp is 10k lines of java
Hi everybody, I'm fighting a problem whereby the java code generated by a 500 line jsp file is so large (10,200) lines that a try/catch block contains so much code that the file won't compile, giving a msg saying something like 'jump target out of range'... Surely I'm not the first to deal with this (and it's a real show-stopper). Anybody know a way to deal with this (other that hand editing the source-code)? This isn't a struts problem per-se but it's being interpreted that way by the powers that be where I work. Not good! Later, Kurt -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:36 AM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Locales and images
On Mon, 19 Mar 2001, Kyle Robinson wrote: I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? There was a recent addition to the html:image and html:img tags to support internationalized images elegantly. Previously, you had to use the "src" attribute to specify the URI of your image. If you needed different images for each language, you had to use a scriptlet expression of some sort to calculate them. Now, you can specify a message key (to be looked up in your application resources) instead: html:image srcKey="message.key"/ where "message.key" identifies the path to this image from your application resources. If you want to use context-relative paths everywhere, use: html:image pageKey="message.key"/ instead. Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111 Craig
Re: 500 lines of jsp is 10k lines of java
It isn't a struts problem, it is a problem caused by using excessive custom jsp tags. One fix is to break your page up over several pages and use dynamic includes. This will fix he compilation problems, but introduces a few new challenges. The problem you are dealing with is the 64k limit in java methods. The entire jsp is compiled into a single _jspService method. James Birchfield Ironmax maximizing your construction equipment assets 5 Corporate Center 9960 Corporate Campus Drive, Suite 2000 Louisville, KY 40223 "Kurt Olsen" kolsen@get2hTo: [EMAIL PROTECTED] awaii.com cc: Subject: 500 lines of jsp is 10k lines of java 03/19/01 01:03 PM Please respond to struts-user Hi everybody, I'm fighting a problem whereby the java code generated by a 500 line jsp file is so large (10,200) lines that a try/catch block contains so much code that the file won't compile, giving a msg saying something like 'jump target out of range'... Surely I'm not the first to deal with this (and it's a real show-stopper). Anybody know a way to deal with this (other that hand editing the source-code)? This isn't a struts problem per-se but it's being interpreted that way by the powers that be where I work. Not good! Later, Kurt -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:36 AM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
When and where ApacheCon?
Craig, where and when is ApacheCon and O'Reily Java ... Con (if not too late) ? "Craig R. McClanahan" wrote: It's short term. I'm finishing up my last presentation for ApacheCon (I've got three of them), and then I get to go back to coding for a while. Craig
Re: 500 lines of jsp is 10k lines of java
There is a limit to the size of a compiled method in java, I think it's 64k, it's probably not specifically related to the try/catch block. Split it up into multiple jsp's and use includes to make it into one page. It seems to me that a good jsp compiler should generate multiple methods, but I don't know if any actually do that. - Original Message - From: "Kurt Olsen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 19, 2001 11:03 AM Subject: 500 lines of jsp is 10k lines of java Hi everybody, I'm fighting a problem whereby the java code generated by a 500 line jsp file is so large (10,200) lines that a try/catch block contains so much code that the file won't compile, giving a msg saying something like 'jump target out of range'... Surely I'm not the first to deal with this (and it's a real show-stopper). Anybody know a way to deal with this (other that hand editing the source-code)? This isn't a struts problem per-se but it's being interpreted that way by the powers that be where I work. Not good! Later, Kurt -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:36 AM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: display errors
I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Maya P.S. I know that we ask too much from several bright developers. Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya
Re: 500 lines of jsp is 10k lines of java
I experienced the same problem with Weblogic 5.1 sp8. To fix it, I increased the initial heap and maximum heap size arguments for the Java VM in the Weblogic server startup BAT file to: -ms256m -mx256m This may be overkill for your situation, but it should work. "Kurt Olsen" kolsen@get2hTo: [EMAIL PROTECTED] awaii.com cc: (bcc: Todd Malvoso/GRS/GRN) Subject: 500 lines of jsp is 10k lines of java 03/19/01 01:03 PM Please respond to struts-user Hi everybody, I'm fighting a problem whereby the java code generated by a 500 line jsp file is so large (10,200) lines that a try/catch block contains so much code that the file won't compile, giving a msg saying something like 'jump target out of range'... Surely I'm not the first to deal with this (and it's a real show-stopper). Anybody know a way to deal with this (other that hand editing the source-code)? This isn't a struts problem per-se but it's being interpreted that way by the powers that be where I work. Not good! Later, Kurt -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:36 AM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: display errors
I like when you are :-). I will try to be "active" helper, but later, when I will become more familiar with struts, and other a lot of things!!!. Good luck to you in your presentations in two conferences. I cannot go ( a project, and expenses). Can we get your presentation on-line? (:-)) Maya "Craig R. McClanahan" wrote: On Mon, 19 Mar 2001, Maya Muchnik wrote: I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Improvements are on the "nice to have this work better" list. Maya P.S. I know that we ask too much from several bright developers. Well, one way to fix that is to offer your own patches :-). It is open source, after all. Craig Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya
Re: display errors
On Mon, 19 Mar 2001, Maya Muchnik wrote: I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Improvements are on the "nice to have this work better" list. Maya P.S. I know that we ask too much from several bright developers. Well, one way to fix that is to offer your own patches :-). It is open source, after all. Craig Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya
Re: html:link and ssl
Hallo, here is my example: struts-config: global-forwards .. forward name="login"path="/2/login.jsp"/ .. /global-forwards an now I want to use in every page something like this: body .. html:link forward="login"login /html:link .. /body I don't want to switch from ssl to non-ssl. I am using the whole time ssl. But the link wouldn't be create. Example for testing page: html head /head body %=pageContext.getRequest().getScheme() %br %=pageContext.getRequest().getServerName() %br %=pageContext.getRequest().getServerPort() %br %=((HttpServletRequest)pageContext.getRequest()).getContextPath() %br %java.net.URL url = new java.net.URL(request.getScheme(), request.getServerName(), request.getServerPort(), request.getContextPath());% %=url.toString()% html:link forward="login"index/html:link /body /html When I request this page with: http://myserver/mycontext/index.jsp I get back: http myserver 80 /mycontext http://myserver/mycontext login (as link) When I request this page with: https://myserver/mycontext/index.jsp I get back: Exception: java.net.MalformedURLException: unknown protocol: https at java.net.URL.(URL.java:307) at java.net.URL.(URL.java:224) I hope this will explame my problem in more details. Harald On 19 Mar 2001, at 9:24, Craig R. McClanahan wrote: On Mon, 19 Mar 2001 [EMAIL PROTECTED] wrote: Hallo, I have some problems with the struts html-tag link with the properties forward or page. I want to use this tag with ssl. It doesn't create the link, because the method in org.apache.struts.util.RequestUtils throws in the method absoluteURL a MalformedURLException because unknown protocol. Do I need some additional package for ssl? Or is there a other solution? Could you give an example of how you are trying to do this? Note that trying to use the "page" attribute only works within the current web application (the path you give it is context-relative beginning with a "/"). To go to a different web application, or to switch from SSL to non-SSL or back, you will need to make sure you generate a redirection, either by using the "href" attribute, or by referencing a forward element that has redirect="true" on it. Thanks for help Harald Craig
Re: display errors
What do you mean by "not from the first column". Are you talking about formatting? What are you trying to do? David --- Maya Muchnik [EMAIL PROTECTED] wrote: I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Maya P.S. I know that we ask too much from several bright developers. Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Re: display errors
I think, you are correct to qualify this as a formatting. Take the struts-example. The tag html:errors/ at the beginning of each file will display error messages at top and left corner of a page. David Winterfeldt wrote: What do you mean by "not from the first column". Are you talking about formatting? What are you trying to do? David --- Maya Muchnik [EMAIL PROTECTED] wrote: I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Maya P.S. I know that we ask too much from several bright developers. Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
Performance of struts
Hi, I am sorry if I offend anyone. I am evaluating struts and notice that the performance is much lower that if I use string jsp and servlets. Has anyone have the same experience as I do? If so, is there any way to improve the performance? Thanks! keith
Re: display errors
I started working on an alternative version of the errors tag this weekend that iterates through the results so you can leave HTML out of the message resources. It doesn't do everything that the Struts tag does at this point. It also automatically includes errors.header and errors.footer. Maybe you could use this or modify the code to do what you want. Or you could always use a iterate tag to loop through your errors and format them the way you want to. validator:errors id="error" libean:write name="error"//li /validator:errors David http://home.earthlink.net/~dwinterfeldt --- Maya Muchnik [EMAIL PROTECTED] wrote: I think, you are correct to qualify this as a formatting. Take the struts-example. The tag html:errors/ at the beginning of each file will display error messages at top and left corner of a page. David Winterfeldt wrote: What do you mean by "not from the first column". Are you talking about formatting? What are you trying to do? David --- Maya Muchnik [EMAIL PROTECTED] wrote: I found a OLD way (with table, tr, td, ...). But maybe for a next release ... Can error tag to be improved ? Maya P.S. I know that we ask too much from several bright developers. Maya Muchnik wrote: Hi, Is it possible to display errors not from the first column (using html:errors/) ? Thanks in advance Maya __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
How do I really bypass the deficient of a HTM editor?
Hi; I am new to struts, and thought I would be great if I can completely separate the HTML and web design from the java code. So, I tried out the first few pages of a project with struts implementation, only to realize that the web designer will not be able to see his design because all the custom tags cannot be displayed. Consequently, I search in the mailing list archive, and notice that many people are having the same problem as I do. I came across a thread in which the author suggested embedding HTML code in the custom tags to enable the web designer to see the placement of the widgets. Everything seems to work except when I tried to use bean:message tag to display labels. Struts complains about not allowing content in this tag. Has anyone have the same problem? How do you let the web designer does his design without having to guess the position of the labels and boxes? Thanks keith
Re: Performance of struts
I think, it will be slower because you have one central servlet DISPATCHER that is sending a "job" to different Actions. When you have some JSP that are sending "job" themselves to other JSP, it is faster. Is it convenient? I think - no, because a creator JSP does not know java. And change flow, redesign difficult. Now, I have this "pie". Maya Keith wrote: Hi, I am sorry if I offend anyone. I am evaluating struts and notice that the performance is much lower that if I use string jsp and servlets. Has anyone have the same experience as I do? If so, is there any way to improve the performance? Thanks! keith
RE: Performance of struts
Keith, Can you gives some benchmark details and sample code that you ran in your tests? --Abraham -Original Message- From: Keith [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 11:56 AM To: [EMAIL PROTECTED] Subject: Performance of struts Hi, I am sorry if I offend anyone. I am evaluating struts and notice that the performance is much lower that if I use string jsp and servlets. Has anyone have the same experience as I do? If so, is there any way to improve the performance? Thanks! keith
Re: struts-template tag library vs. jsp:include/
Thank you for your reply, but this didn't really answer my question. Let me rephrase. I am talking about jsp:include/, which is a dynamic templating mechanism, as opposed to %@ include %, which is static. As I understand it: jsp:include/ and struts-template:*/ are both dynamic templating mechanisms -- they are re-evaluated at runtime whenever referenced. They allow you to create a template with placeholders for dynamic values which you will supply at runtime. This is where they are similar. What I'm interested in hearing is how they differ. I assume that struts-template offers some improvement over jsp:include, otherwise it serves no purpose. So my question is, what does struts-template offer as an improvement over jsp:include? The answer may be as simple as "it provides a consistent and readable syntax", or it may be more substantial. Thank you, Jim Newsham Robert Taylor wrote: Although it doesn't discuss struts template tag specifically, the J2EE BluePrint has a good section on the comparison of JSP includes and using templates. I believe it is in section 10.3 where it discuss the Sample Application: View. http://java.sun.com/j2ee/blueprints/sample_application/view/index.html HTH, Robert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Newsham Sent: Friday, March 16, 2001 9:20 PM To: [EMAIL PROTECTED] Subject: struts-template tag library vs. jsp:include/ Hi, What are the differences between using the struts template tag library and jsp's include action? What are the advantages and trade-offs of each? Thanks, Jim Newsham
RE: struts-template tag library vs. jsp:include/
the biggest thing for me is that you limit the potential layout bugs, and you make it possible to change the layout, site wide, with the editing of a single file. The alternative (just using jsp:include.../) forces you to replicate the layout framework (typically this includes a set of nested tables where you set the header, footer, sidebar, and etc...) on every single jsp page. Troy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Newsham Sent: Friday, March 16, 2001 7:20 PM To: [EMAIL PROTECTED] Subject: struts-template tag library vs. jsp:include/ Hi, What are the differences between using the struts template tag library and jsp's include action? What are the advantages and trade-offs of each? Thanks, Jim Newsham
REPOST: How to handle an extra button on login page
Hi, I want to add an extra button 'Change Password' on my logon screen, which should take me instead to the 'changePassword.jsp' screen where I would enter the username, password, new password fields . I want a suggestion on how to handle this. Should I have the same form bean for both logon.jsp and changePassword.jsp? If yes then the validate method of the form bean cannot do validations like,e.g. check for the new password and confirm new password fields to be non-blank because these fields are not on logon form. Also the validate() method of the form bean would get called when I click on 'Change Password' button and since username and password would be null at that time it would return errors. I would really appreciate if someone could tell me how they handled such a situation. Thanks in advance. -Nimmi
RE: Please Help
I have been prototyping an app using struts on my windows workstation for a week now and have never had a problem. Troy -Original Message- From: JOEL VOGT [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 17, 2001 4:48 AM To: [EMAIL PROTECTED] Subject: Re: Please Help Okay, After playing around a little, I am starting to get the impression that struts and windows together isn't going to go. Is this neccessarily the case? Anyone had problems and then worked it out? Thanks again, Joel
RE: REPOST: How to handle an extra button on login page
You can use the name-value parameter of your Change Passord button (Submit Button) in your Form bean to find out which button was pressed. Once you have that information you can write the logic based on it. Anshuman Nanda -Original Message- From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:02 PM To: '[EMAIL PROTECTED]' Subject: REPOST: How to handle an extra button on login page Hi, I want to add an extra button 'Change Password' on my logon screen, which should take me instead to the 'changePassword.jsp' screen where I would enter the username, password, new password fields . I want a suggestion on how to handle this. Should I have the same form bean for both logon.jsp and changePassword.jsp? If yes then the validate method of the form bean cannot do validations like,e.g. check for the new password and confirm new password fields to be non-blank because these fields are not on logon form. Also the validate() method of the form bean would get called when I click on 'Change Password' button and since username and password would be null at that time it would return errors. I would really appreciate if someone could tell me how they handled such a situation. Thanks in advance. -Nimmi
Re: How do I really bypass the deficient of a HTM editor?
Hi, Keith, I think, DreamWeaver has an implementation to display custom tags (UltraDev), and now they are working to embed a support for the struts. Can you give example you are talking about? Do you want, that tags will send additional HTML code? Maya Keith wrote: Hi; I am new to struts, and thought I would be great if I can completely separate the HTML and web design from the java code. So, I tried out the first few pages of a project with struts implementation, only to realize that the web designer will not be able to see his design because all the custom tags cannot be displayed. Consequently, I search in the mailing list archive, and notice that many people are having the same problem as I do. I came across a thread in which the author suggested embedding HTML code in the custom tags to enable the web designer to see the placement of the widgets. Everything seems to work except when I tried to use bean:message tag to display labels. Struts complains about not allowing content in this tag. Has anyone have the same problem? How do you let the web designer does his design without having to guess the position of the labels and boxes? Thanks keith
Re: Performance of struts
On Mon, 19 Mar 2001, Keith wrote: Hi, I am sorry if I offend anyone. I am evaluating struts and notice that the performance is much lower that if I use string jsp and servlets. Has anyone have the same experience as I do? If so, is there any way to improve the performance? Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan
RE: 500 lines of jsp is 10k lines of java
Thanks everybody for the advice. I'm on track again, using includes. Duh, why didn't I think of that? Kurt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 8:25 AM To: [EMAIL PROTECTED] Subject: Re: 500 lines of jsp is 10k lines of java I experienced the same problem with Weblogic 5.1 sp8. To fix it, I increased the initial heap and maximum heap size arguments for the Java VM in the Weblogic server startup BAT file to: -ms256m -mx256m This may be overkill for your situation, but it should work. "Kurt Olsen" kolsen@get2hTo: [EMAIL PROTECTED] awaii.com cc: (bcc: Todd Malvoso/GRS/GRN) Subject: 500 lines of jsp is 10k lines of java 03/19/01 01:03 PM Please respond to struts-user Hi everybody, I'm fighting a problem whereby the java code generated by a 500 line jsp file is so large (10,200) lines that a try/catch block contains so much code that the file won't compile, giving a msg saying something like 'jump target out of range'... Surely I'm not the first to deal with this (and it's a real show-stopper). Anybody know a way to deal with this (other that hand editing the source-code)? This isn't a struts problem per-se but it's being interpreted that way by the powers that be where I work. Not good! Later, Kurt -Original Message- From: Kyle Robinson [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:36 AM To: Struts (E-mail) Subject: Locales and images I understand Struts has support for makeing web apps available in different languages. Does this include images? If I have images with text on them in English can I make images with text in French as well? Do I name the image files differently or do I have to include the paths to the images in the property files? Has anyone done this? What's the best approach? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Performance of struts
On Mon, 19 Mar 2001, DONNIE HALE wrote: Craig, (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Could you elaborate on this, please? - is it awful for compiling, executing, both? I'm mostly concerned about the execution speed of the generated servlets. - is the generated servlet code the culprit since you don't say that servlet performance is bad? Yes. For example, Tomcat (more precisely, the Jasper component) does not currently recycle custom tag instances -- this is in the process of being addressed. Also, the code generator is very simplistic, does essentially no optimizations, and generates more code than it really needs to. This is not surprising, given Tomcat's heritage as being a "reference implementation" for the specs, rather than a high performance production environment. To the extent that people want to turn Tomcat into the latter, it will improve. - are there particular JSP elements that are particularly bad? Take a glance at the code that is generated for any custom tag, and you'll see what some of the issues are. - is this primarily directed at v3.2.1, or is it also true of v4.0b1? The Jasper in 4.0b1 is almost identical to the one in 3.2.1 right now, although improvements are being done on both of them. But Jasper really needs a fresh start, IMHO, to achieve substantial performance boosts. Thanks, Donnie Craig
RE: How can a Struts Action developer best document the system fo r a JSP developer?
Title: RE: How can a Struts Action developer best document the system fo r a JSP developer? Hi Bryan and John, I have created something like this with XSL that converts the (old) action.xml and (new) struts-config.xml files and produces a graph showing the various forwards, forms, actions, etc. I then use dot to convert the graph into a gif. It isn't quite as enlightening as I thought it would be, but certainly produces interesting pictures. :-) This is primarily due to the fact that the struts-config.xml doesn't hold all the information - I think to produce a better overview you would have to also parse the corresponding JSPs for their tags, and maybe even the action classes themselves. I was planning on refining it a little more before releasing it to the list, but I'll work on getting it up on a web page in the next couple of days for you. John, maybe you can take it and add what you think is missing. :-) Thanks, Derek. -Original Message- From: Brugge, John [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 9:56 AM To: '[EMAIL PROTECTED]' Subject: RE: How can a Struts Action developer best document the system fo r a JSP developer? Bryan, You might check out a recent article on JavaWorld called Doclet your Servlet (http://www.javaworld.com/javaworld/jw-03-2001/jw-0302-doclets.html) that describes a custom doclet that understands some custom doc tags. It would probably take some customization to work with Struts Actions, since it looks like it uses introspection to look for instances of true servlets. I've been thinking of the same problem, and think that you could get pretty good mileage out of a simple XSL template that transformed the struts-config.xml into a clearer HTML description of the actions, their navigation and form expectations. It could handle #2 and #3 below easily; #4 and #5 would be harder. You could even tie this into the JavaDoc of the ActionForms by creating links from the form names to the area where your JavaDoc lives. I'm not an XSL expert, but I've done some transforms before and figure this wouldn't take very long to create - the key for me is just finding the time now ;-). If I come up with something, I'll forward it to the group, unless someone beats me to it. John -Original Message- From: Bryan Field-Elliot [SMTP:[EMAIL PROTECTED]] Sent: Saturday, March 17, 2001 6:12 PM To: [EMAIL PROTECTED] Subject: How can a Struts Action developer best document the system for a JSP developer? I am struggling right now with how to properly and efficently document my Struts application for my JSP developer (who is by no means a Java expert). Specifically, I want to document each Action as well as each ActionForm that I code, including things like: 1. the pages I expect the user to have come from 2. the pages to which I might forward, or redirect, the user after completing the action 3. The beans I expect to be in place prior to submitting to my action 4. The beans I will set up with values for the resulting JSP page to work with 5. The errors (html:errors) I may set up And anything else that might be appropriate. I'd like to do so in a way that lets me rely on Javadoc, so that I can keep my documentation inside my code. Javadoc when used correctly will also let me do things like see also the Bean documentation (from the Action documentation). I am curious if anyone has developed a template action or bean, which makes best use of Javadoc and which I can cut-and-paste at the head of every one of my Action classes, etc? Thanks, Bryan
html:img tag cannot find image
Hello all, It seems that the html:img tag is able to find images in the context root, but not in subdirectories. When I specify an image with the html:img tag like this: html:img src="green-ball.gif"/ the images appear. But when I specify a subdirectory like this: html:img src="WEB-INF/images/orange-ball.gif"/ the images are missing when the page renders, i.e. little red X symbol in the browser. Here is a pared down JSP that illustrates the problem. It gives the same results whether I include the html:base/ tag or not. I'm using Struts 1.0b1 and Tomcat 3.2.1. TIA for any help. Tom -- %@ page language="java" % %@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" % html:html html:base/ head /head body Dot Onehtml:img src="green-ball.gif"/ % /* image shows in browser */ % p Dot Twohtml:img src="WEB-INF/images/orange-ball.gif"/ % /* image missing in browser */ % /body /html:html -- Tom Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 FAX
Re: html:img tag cannot find image
Can you try html:img src="/WEB-INF/images/orange-ball.gif"/ Maya Tom Miller wrote: Hello all, It seems that the html:img tag is able to find images in the context root, but not in subdirectories. When I specify an image with the html:img tag like this: html:img src="green-ball.gif"/ the images appear. But when I specify a subdirectory like this: html:img src="WEB-INF/images/orange-ball.gif"/ the images are missing when the page renders, i.e. little red X symbol in the browser. Here is a pared down JSP that illustrates the problem. It gives the same results whether I include the html:base/ tag or not. I'm using Struts 1.0b1 and Tomcat 3.2.1. TIA for any help. Tom -- %@ page language="java" % %@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" % html:html html:base/ head /head body Dot Onehtml:img src="green-ball.gif"/ % /* image shows in browser */ % p Dot Twohtml:img src="WEB-INF/images/orange-ball.gif"/ % /* image missing in browser */ % /body /html:html -- Tom Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 FAX
Re: ActionForm (DataObject) generator?
Try Town : http://www.working-dogs.com/town It has a built-in object-relational mapping utility named ormapmaker. Its documentation is very concise, but it works. - Original Message - From: Kyle Robinson To: '[EMAIL PROTECTED]' Sent: Thursday, March 15, 2001 12:34 AM Subject: ActionForm (DataObject) generator? We are using Struts with an Oracle database as the backend. We don'treally feel like handwriting 100's of java files (one for each table). Does anyone know of a good db table - java object generator? Preferably open source? Thanks Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
RE: html:img tag cannot find image
Title: RE: html:img tag cannot find image Hi Tom, In your example, you are directing your web browser to request an image file from within the WEB-INF directory. Per the servlet specification your servlet engine treats the WEB-INF directory as a private resource. This means none of the files it contains may be served directly to a client. Try moving your /images directory out to your applications document root and you should have more luck. For more info. on this, check section 9.4, Directory Structure, of the servlet spec at http://java.sun.com. Hope that helps, Levi Cook Greenbrier Russel Madison, Wisconsin www.gr.com [EMAIL PROTECTED] -Original Message- From: Tom Miller [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:53 PM To: struts-user Subject: html:img tag cannot find image Hello all, It seems that the html:img tag is able to find images in the context root, but not in subdirectories. When I specify an image with the html:img tag like this: html:img src=green-ball.gif/ the images appear. But when I specify a subdirectory like this: html:img src=WEB-INF/images/orange-ball.gif/ the images are missing when the page renders, i.e. little red X symbol in the browser. Here is a pared down JSP that illustrates the problem. It gives the same results whether I include the html:base/ tag or not. I'm using Struts 1.0b1 and Tomcat 3.2.1. TIA for any help. Tom -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % html:html html:base/ head /head body Dot Onehtml:img src=green-ball.gif/ % /* image shows in browser */ % p Dot Twohtml:img src=WEB-INF/images/orange-ball.gif/ % /* image missing in browser */ % /body /html:html -- Tom Miller Miller Associates, Inc. [EMAIL PROTECTED] 641.469.3535 Phone 413.581.6326 FAX
Re: html:img tag cannot find image
On Mon, 19 Mar 2001, Tom Miller wrote: Hello all, It seems that the html:img tag is able to find images in the context root, but not in subdirectories. When I specify an image with the html:img tag like this: html:img src="green-ball.gif"/ the images appear. But when I specify a subdirectory like this: html:img src="WEB-INF/images/orange-ball.gif"/ the images are missing when the page renders, i.e. little red X symbol in the browser. Here is a pared down JSP that illustrates the problem. It gives the same results whether I include the html:base/ tag or not. I'm using Struts 1.0b1 and Tomcat 3.2.1. TIA for any help. The issue is that a servlet container is prohibited (in the spec) from serving any file from the WEB-INF directory directly to a client. This is to prevent people from snooping sensitive information from your web.xml file, or other config files you might have stored here. If you want your image to be displayed, move it to some directory other than WEB-INF. Then, the URLs you use with the html:img tag will correspond to what you would use with a regular HTML img tag. Tom Craig McClanahan
Re: Performance of struts
If Tomcat's performance is pretty awful, what are some JSP implementations (commercial or otherwise) that are particularly good? At 12:10 PM 3/19/2001 -0800, you wrote: Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
RE: struts-template tag library vs. jsp:include/
The template custom actions (including "insert", "put", and "get") are absolutely distinct from the JSP "include" action. I would recommend that you review the code for the struts-template web application that comes with struts1.0 beta 1. In a nutshell, the template allows you to define a single template page that lays out a set of components by referencing the components by name. Let's say the following is the contents of a file called "/somePageLayoutSetup.jsp": --- %@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' % template:insert template="/myTemplate.jsp" template:put name="title" content="Some Page Title" direct="true"/ template:put name="header" content="/header.jsp" / template:put name="footer" content="/footer.jsp" / template:put name="main-body" content="/somePage.jsp" / /template:insert --- Now then, here is the template, "/myTemplate.jsp": --- %@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' % html head titletemplate:get name="title" //title /head body table trtdtemplate:get name="header" //td/tr trtdtemplate:get name="main-body" //td/tr trtdtemplate:get name="footer" //td/tr /table I can also put any static stuff that I desire directly on this layout template... /body --- This is obviously a simple example but it illustrates the point. Namely, you have a page that references a layout template and "put"s named components into a context such that the referenced template can "get" at them. Obviously, the power here is that for any given page on your site you only need to know what the components of the layout are, not how they are laid out. When you want to change the way they are laid out you only need to change the layout JSP (assuming components don't change). The mechanism that is used by the jsp:include.../ action is (as I understand) functionally equivalent to, if not exactly the same as, that used by the template:get name=.../ (when the named element was "put" with "direct='false'", which is the default). Like I said initially, a review of the "struts-template" web app. will clear this up for you. Good luck, Troy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Newsham Sent: Monday, March 19, 2001 12:59 PM To: [EMAIL PROTECTED] Subject: Re: struts-template tag library vs. jsp:include/ Thank you for your reply, but this didn't really answer my question. Let me rephrase. I am talking about jsp:include/, which is a dynamic templating mechanism, as opposed to %@ include %, which is static. As I understand it: jsp:include/ and struts-template:*/ are both dynamic templating mechanisms -- they are re-evaluated at runtime whenever referenced. They allow you to create a template with placeholders for dynamic values which you will supply at runtime. This is where they are similar. What I'm interested in hearing is how they differ. I assume that struts-template offers some improvement over jsp:include, otherwise it serves no purpose. So my question is, what does struts-template offer as an improvement over jsp:include? The answer may be as simple as "it provides a consistent and readable syntax", or it may be more substantial. Thank you, Jim Newsham Robert Taylor wrote: Although it doesn't discuss struts template tag specifically, the J2EE BluePrint has a good section on the comparison of JSP includes and using templates. I believe it is in section 10.3 where it discuss the Sample Application: View. http://java.sun.com/j2ee/blueprints/sample_application/view/index.html HTH, Robert -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jim Newsham Sent: Friday, March 16, 2001 9:20 PM To: [EMAIL PROTECTED] Subject: struts-template tag library vs. jsp:include/ Hi, What are the differences between using the struts template tag library and jsp's include action? What are the advantages and trade-offs of each? Thanks, Jim Newsham
Re: Performance of struts
In my opinion the performance of Tomcat is pretty good. However most j2ee apps servers have very good performance including weblogic, iplanet, silverstream, etc. scott. --- James Howe [EMAIL PROTECTED] wrote: If Tomcat's performance is pretty awful, what are some JSP implementations (commercial or otherwise) that are particularly good? At 12:10 PM 3/19/2001 -0800, you wrote: Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103 = ~~~ Scott __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
RE: Performance of struts
check orion out... (http://www.orionserver.com/) -Original Message- From: James Howe [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 3:16 PM To: [EMAIL PROTECTED] Subject: Re: Performance of struts If Tomcat's performance is pretty awful, what are some JSP implementations (commercial or otherwise) that are particularly good? At 12:10 PM 3/19/2001 -0800, you wrote: Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
RE: How can a Struts Action developer best document the system fo r a JSP developer?
Title: RE: How can a Struts Action developer best document the system fo r a JSP developer? Thanks Derek, I'd appreciate seeing your work. You're right, that struts-config.xml doesn't have enough to be completely useful, but I figure its a start. John -Original Message- From: Derek Longmuir [SMTP:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:43 PM To: '[EMAIL PROTECTED]' Subject: RE: How can a Struts Action developer best document the system fo r a JSP developer? Hi Bryan and John, I have created something like this with XSL that converts the (old) action.xml and (new) struts-config.xml files and produces a graph showing the various forwards, forms, actions, etc. I then use dot to convert the graph into a gif. It isn't quite as enlightening as I thought it would be, but certainly produces interesting pictures. :-) This is primarily due to the fact that the struts-config.xml doesn't hold all the information - I think to produce a better overview you would have to also parse the corresponding JSPs for their tags, and maybe even the action classes themselves. I was planning on refining it a little more before releasing it to the list, but I'll work on getting it up on a web page in the next couple of days for you. John, maybe you can take it and add what you think is missing. :-) Thanks, Derek. -Original Message- From: Brugge, John [ mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 9:56 AM To: '[EMAIL PROTECTED]' Subject: RE: How can a Struts Action developer best document the system fo r a JSP developer? Bryan, You might check out a recent article on JavaWorld called Doclet your Servlet ( http://www.javaworld.com/javaworld/jw-03-2001/jw-0302-doclets.html) that describes a custom doclet that understands some custom doc tags. It would probably take some customization to work with Struts Actions, since it looks like it uses introspection to look for instances of true servlets. I've been thinking of the same problem, and think that you could get pretty good mileage out of a simple XSL template that transformed the struts-config.xml into a clearer HTML description of the actions, their navigation and form expectations. It could handle #2 and #3 below easily; #4 and #5 would be harder. You could even tie this into the JavaDoc of the ActionForms by creating links from the form names to the area where your JavaDoc lives. I'm not an XSL expert, but I've done some transforms before and figure this wouldn't take very long to create - the key for me is just finding the time now ;-). If I come up with something, I'll forward it to the group, unless someone beats me to it. John -Original Message- From: Bryan Field-Elliot [SMTP:[EMAIL PROTECTED]] Sent: Saturday, March 17, 2001 6:12 PM To: [EMAIL PROTECTED] Subject: How can a Struts Action developer best document the system for a JSP developer? I am struggling right now with how to properly and efficently document my Struts application for my JSP developer (who is by no means a Java expert). Specifically, I want to document each Action as well as each ActionForm that I code, including things like: 1. the pages I expect the user to have come from 2. the pages to which I might forward, or redirect, the user after completing the action 3. The beans I expect to be in place prior to submitting to my action 4. The beans I will set up with values for the resulting JSP page to work with 5. The errors (html:errors) I may set up And anything else that might be appropriate. I'd like to do so in a way that lets me rely on Javadoc, so that I can keep my documentation inside my code. Javadoc when used correctly will also let me do things like see also the Bean documentation (from the Action documentation). I am curious if anyone has developed a template action or bean, which makes best use of Javadoc and which I can cut-and-paste at the head of every one of my Action classes, etc? Thanks, Bryan
JDBC tag library released, source code ?
Hi! I'm very interested to use this taglib. Is the source code also available ? where ? (the URL?) Thanks Joel --- Ted Husted [EMAIL PROTECTED] a crit : Note: These tags are very easy to use with the Struts connection pool. Simply give your datasource a "key" property in your Struts-config file, and use the same key with the JDBC connection tag. data-sources data-source driverClass="org.gjt.mm.mysql.Driver" maxCount="4" minCount="2" password="" url="jdbc:mysql://localhost/test" user="test" key="DATASOURCE" / /data-sources and in your JSP sql:connection id="cn1" dataSource="DATASOURCE"/sql:connection Viola! That's it! (Or, if you're a purist, omit the key property and use: sql:connection id="cn1" dataSource="%=org.apache.struts.action.Action.DATA_SOURCE_KEY%" /sql:connection whew!) Original Message From: Morgan Delagrange [EMAIL PROTECTED] Subject: [ANNOUNCE] JDBC tag library released To: taglibs-dev [EMAIL PROTECTED],taglibs-user [EMAIL PROTECTED] Taglibs is proud to announce the release of the JDBC tag library! For full details, visit the site: http://jakarta.apache.org/taglibs/doc/jdbc-doc/intro.html The JDBC tag library is designed for reading from and writing to databases. Features include: - Seamless support for multiple databases - Obtaining connections from Drivers, DataSources, and JNDI DataSources - Support for Statements and PreparedStatements - Automatic looping of ResultSets - And so much more! Thanks to Rich Catlett, Glenn Nielsen, and most especially Marius Scurtescu for their invaluable contributions. - Morgan Delagrange __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ ___ Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, Yahoo! Messenger : http://fr.messenger.yahoo.com
Re: JDBC tag library released, source code ?
Go to Taglib project of jakarta.apache.org Joel Cordonnier wrote: Hi! I'm very interested to use this taglib. Is the source code also available ? where ? (the URL?) Thanks Joel --- Ted Husted [EMAIL PROTECTED] a crit : Note: These tags are very easy to use with the Struts connection pool. Simply give your datasource a "key" property in your Struts-config file, and use the same key with the JDBC connection tag. data-sources data-source driverClass="org.gjt.mm.mysql.Driver" maxCount="4" minCount="2" password="" url="jdbc:mysql://localhost/test" user="test" key="DATASOURCE" / /data-sources and in your JSP sql:connection id="cn1" dataSource="DATASOURCE"/sql:connection Viola! That's it! (Or, if you're a purist, omit the key property and use: sql:connection id="cn1" dataSource="%=org.apache.struts.action.Action.DATA_SOURCE_KEY%" /sql:connection whew!) Original Message From: Morgan Delagrange [EMAIL PROTECTED] Subject: [ANNOUNCE] JDBC tag library released To: taglibs-dev [EMAIL PROTECTED],taglibs-user [EMAIL PROTECTED] Taglibs is proud to announce the release of the JDBC tag library! For full details, visit the site: http://jakarta.apache.org/taglibs/doc/jdbc-doc/intro.html The JDBC tag library is designed for reading from and writing to databases. Features include: - Seamless support for multiple databases - Obtaining connections from Drivers, DataSources, and JNDI DataSources - Support for Statements and PreparedStatements - Automatic looping of ResultSets - And so much more! Thanks to Rich Catlett, Glenn Nielsen, and most especially Marius Scurtescu for their invaluable contributions. - Morgan Delagrange __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ ___ Do You Yahoo!? -- Pour dialoguer en direct avec vos amis, Yahoo! Messenger : http://fr.messenger.yahoo.com
RE: Performance of struts
Currently I'm using ServletExec-AS (with Apache) on Win98 and it seems pretty easy to use and relatively fast. It also has a nice admin interface for deploying and defining web apps. You can download it from http://www.servletexec.com/download.jsp. I don't think you have to enter any information. I believe the only limitation is that an un-registered version gives you up to 3 concurrent connections. I've also been able to get Cocoon running pretty easily which I have never been able to do with Tomcat. I don't have any real metrics to offer though. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 3:11 PM To: [EMAIL PROTECTED] Subject: Re: Performance of struts On Mon, 19 Mar 2001, Keith wrote: Hi, I am sorry if I offend anyone. I am evaluating struts and notice that the performance is much lower that if I use string jsp and servlets. Has anyone have the same experience as I do? If so, is there any way to improve the performance? Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan
RE: ActionForm (DataObject) generator?
TryExpresso: http://www.jcorporate.com Ithas a built-in object-relational mapping utility http://www.jcorporate.com/html/products/expresso/dbobj.html -Original Message-From: Kyle Robinson [mailto:[EMAIL PROTECTED]]Sent: Wednesday, March 14, 2001 6:35 PMTo: '[EMAIL PROTECTED]'Subject: ActionForm (DataObject) generator? We are using Struts with an Oracle database as the backend. We don'treally feel like handwriting 100's of java files (one for each table). Does anyone know of a good db table - java object generator? Preferably open source? Thanks Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Pass all values from a listbox to the formbean
Hi, I have the following problem: I have 2 listboxes (select boxes) - Input and output. The input box is populated when the jsp is loaded. At this point the output listbox( select box) is empty. The user selects a value in the input box and clicks on the add button which puts the value in the output box. The user is able to choose the same value from the input box that was previously selected. It is designed that way so that the user can choose the same value and have different names. this is done for a good reason Now my question is how do I send the contents of the output listbox without using hidden form fields? Sharmila Pandith Software Engineer iXL Inc. phone: 212-500-5180 AIM: spandith Yahoo: spandith MSN: spandith This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately.
Parsing error
Hello everyone, I encountered a weird problem and got "javax.servlet.ServletException: Parsing error processing resource path /WEB-INF/struts-config.xml" error message. The tags that caused this error are as follow: data-sources data-source ... / /data-sources When I chenged the code to data-source ... / I didn't get that error message any more (I got another but it doesn't relate to parsing problem). So what is so special about data-sources tags? Thank you for your time. Best of luck. ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca
Re: Parsing error
Hello again. Sorry friends, false alarm. I was dumb enough to forget to put jar file with javax.sql.* classes in my web application classpath. Best of luck. ___ Do You Yahoo!? Get your free @yahoo.ca address at http://mail.yahoo.ca
Borland AppServer 4.5
I just installed the struts-example program and one of my own Struts apps to BAS 4.5 and everything worked fine right out of the box. No modifications were needed. If you want to add this to the Installation instructions, that would be great. -- Dan Miser http://www.distribucon.com
RE: Performance of struts
I haven't done any comparisons recently, but I think Resin from www.caucho.com is very reasonably priced and written specifically with performance in mind (from what I can tell). I've written a Java based http proxy server before and I can tell you that from looking at some of the things Resin has done, they know where Java's performance bottlenecks are. (For example, they translate all socket streams into byte arrays instead of using strings, etc.) They have some performance comparisons on their web site. Others are: Orion - Know nothing about BEA WebLogic - Very expensive, complex to deploy and performance is mediocre according to my sources ATG Dynamo - Expensive but good for commerce if needed. They are focused on commerce, so probably not focused on performance. Netscape/iPlanet - I've heard the performance is not impressive IBM WebSphere - This is an up-and-coming competitor to WebLogic and ATG. It used to be buggy and is still expensive. Performance is unknown, but I would favor Resin as it comes with source and is less expensive. Jrun - Priced reasonably. Nice integration with other Allaire products. No special commerce features. I think it has had some compatibility problems, but it seems a good engine these days. All the same, I don't think you can get source and I haven't done performance tests. Enhydra - This is just Tomcat. They have their own framework that is less comprehensive than struts called XMLC. Its big advantage is that it does a better job of separating UI from code. I think to some degree, it is equally important to look at the JVM you are running on. Consider looking at the Volano report at http://www.volano.com/report.html. My team is using Tomcat/Forte for development and will use Resin/Apache for deployment. Eric -Original Message- From: James Howe [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:16 PM To: [EMAIL PROTECTED] Subject: Re: Performance of struts If Tomcat's performance is pretty awful, what are some JSP implementations (commercial or otherwise) that are particularly good? At 12:10 PM 3/19/2001 -0800, you wrote: Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
RE: Performance of struts
Struts should suffer the same performance issues as WebWork. There are a handful of benchmarks here: http://sourceforge.net/docman/display_doc.php?docid=2243group_id=14797# Na96 The relative performance on a tag-heavy benchmark: Tomcat 3.2: ~380 milliseconds JRun 3.0: ~350 milliseconds Resin 1.2.1: ~250 milliseconds Orion 1.3.8: ~220 milliseconds WebLogic Server 6.0: ~140 milliseconds Jeff -Original Message- From: Eric Brown [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 7:58 PM To: '[EMAIL PROTECTED]' Subject: RE: Performance of struts I haven't done any comparisons recently, but I think Resin from www.caucho.com is very reasonably priced and written specifically with performance in mind (from what I can tell). I've written a Java based http proxy server before and I can tell you that from looking at some of the things Resin has done, they know where Java's performance bottlenecks are. (For example, they translate all socket streams into byte arrays instead of using strings, etc.) They have some performance comparisons on their web site. Others are: Orion - Know nothing about BEA WebLogic - Very expensive, complex to deploy and performance is mediocre according to my sources ATG Dynamo - Expensive but good for commerce if needed. They are focused on commerce, so probably not focused on performance. Netscape/iPlanet - I've heard the performance is not impressive IBM WebSphere - This is an up-and-coming competitor to WebLogic and ATG. It used to be buggy and is still expensive. Performance is unknown, but I would favor Resin as it comes with source and is less expensive. Jrun - Priced reasonably. Nice integration with other Allaire products. No special commerce features. I think it has had some compatibility problems, but it seems a good engine these days. All the same, I don't think you can get source and I haven't done performance tests. Enhydra - This is just Tomcat. They have their own framework that is less comprehensive than struts called XMLC. Its big advantage is that it does a better job of separating UI from code. I think to some degree, it is equally important to look at the JVM you are running on. Consider looking at the Volano report at http://www.volano.com/report.html. My team is using Tomcat/Forte for development and will use Resin/Apache for deployment. Eric -Original Message- From: James Howe [mailto:[EMAIL PROTECTED]] Sent: Monday, March 19, 2001 2:16 PM To: [EMAIL PROTECTED] Subject: Re: Performance of struts If Tomcat's performance is pretty awful, what are some JSP implementations (commercial or otherwise) that are particularly good? At 12:10 PM 3/19/2001 -0800, you wrote: Struts based apps (or any app that uses custom tags heavily) are going to be significantly impacted by the quality of the JSP implementation in your container. Which version are you using? (NOTE: Tomcat's performance w.r.t. JSP pages is pretty awful, for example). Thanks! keith Craig McClanahan James W. Howe mailto:[EMAIL PROTECTED] Allen Creek Software, Inc. pgpkey: http://ic.net/~jwh/pgpkey.html Ann Arbor, MI 48103
Object oriented question regarding ActionForms
I have an object oriented question related to how Struts instantiates an ActionForm. What I am trying to do is utilize a factory for creation of my ActionForms. In my application, I have a base (abstract) ActionForm class called Fermentation, and subclasses FermentationYeast, FermentationEcoli, etc... The factory is called from my Action servlet to create the appropriate instance of an ActionForm (a subtype of Fermentation). Then I save the newly created ActionForm in the session. The object type that gets saved in the session is the subtype, but in my Struts config I am specifying the base type. I want Struts to read this object from the session, but Struts always creates a new ActionForm of the base type. I want it to find and use the subtype! For example, the Action servlet calls the factory and the factory returns a FermentationYeast. This object is saved in the session, and then I forward to the EditFermentation page. The EditFermentation page is mapped in the Struts config to use a Fermentation form, so Struts does not recognize the FermentationYeast that is already in the session and it creates a new ActionForm. Even though a FermentationYeast *is a* Fermentation, Struts does not seem to support this. I think it would be helpful if Struts supported generalization... or if it does and I am missing something here please let me know :) Or, If you think I should change my design, please let me know this as well. I think I have a good reason to need to do this. The first page is where the user enters common information, then the next page is loaded based on the type of the Fermentation (ActionFrom). I could create 2 separate ActionForms (one for the common attributes and then another for the details) but I would like to use inheritance to model this relationship. In other words, I want to create a single ActionForm which will be used across multiple pages, but I want to share pages that ask for the same information. Thanks, Bob
reloading issue
Hi all, Im new in this list so please be patient. I looked into docs and mail archives, and deja but couldnt find a solution to the problem. Every time I make a chance in the formbean, action, jsp, or the strut-config.xml file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), if not how can I correct this (making every change not requiring restarting Tomcat)? Thanks --a
Re: reloading issue
As far as i know, you have to take the pain, except for the JSP changes - Original Message - From: Ali Ozoren To: [EMAIL PROTECTED] Sent: Tuesday, March 20, 2001 3:44 PM Subject: reloading issue Hi all, Im new in this list so please be patient. I looked into docs and mail archives, and deja but couldnt find a solution to the problem. Every time I make a chance in the formbean, action, jsp, or the strut-config.xml file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), if not how can I correct this (making every change not requiring restarting Tomcat)? Thanks --a
RE: reloading issue
hi Ali, A change in a jsp does not warrant a restart but the others do. Any change in struts-config or an action class is not reflected otherwise. A changed form bean will sometimes throw an exception too. Cheers, Sridhar S Real knowledge is to know the extent of one's ignorance. -Original Message-From: Ali Ozoren [mailto:[EMAIL PROTECTED]]Sent: Tuesday, March 20, 2001 3:44 PMTo: [EMAIL PROTECTED]Subject: reloading issue Hi all, Im new in this list so please be patient. I looked into docs and mail archives, and deja but couldnt find a solution to the problem. Every time I make a chance in the formbean, action, jsp, or the strut-config.xml file, I have to stop and restart Tomcat. Is this necessary (if yes, dang!), if not how can I correct this (making every change not requiring restarting Tomcat)? Thanks --a