RE: How fast is bean:message?
Yes, Jakarta's JSTL implementation makes use of MessageFormat for both the EL and RT tag flavors. See org.apache.taglibs.standard.tag.common.fmt.MessageSupport. -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 10:39 AM To: [EMAIL PROTECTED] Subject: Re: How fast is bean:message? Do we have an idea if same is true of the JSTL FMT tag? (bean tags are now redundant to JSTL). .V David Graham wrote: That's not all that surprising because the java.text.* classes have always been rather slow. I think they create a lot of objects while processing text which slows them down. I've found that I don't use paramterized messages very often anyway. David The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds.// Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds.// {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jstl and collection sizes
Unfortunately it doesn't. That was the point of the link I posted earlier. If you read the whole thread you'll see that java.util.Collection is not supported. http://shorl.com/dapofrypragragu Try a HashSet for example. jsp:useBean class=java.util.LinkedList id=list/ List size %= list.size() %br/ List isEmpty %= list.isEmpty() %br/ c:if test=${empty list} JSTL-EL says: empty listbr/ /c:ifbr/ jsp:useBean class=java.util.HashSet id=set/ Set size %= set.size() %br/ Set isEmpty %= set.isEmpty() %br/ c:if test=${empty set} JSTL-EL says: empty setbr/ /c:if Output: List size 0 List isEmpty true JSTL-EL says: empty list Set size 0 Set isEmpty true This is the jakarta implementation. Shawn Bayern, the person whose posting I refer you to, is one of the designers and a member of the JSTL spec expert group. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:58 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: jstl and collection sizes The spec doesn't require empty to work for Collections but the jakarta implementation seems to work with them. David From: Jerome Jacobsen [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: jstl and collection sizes Date: Wed, 26 Feb 2003 16:25:12 -0500 Woops. In addition to java.util.List it works on java.util.Map and arrays and java.lang.String. But still not on other java.util.Collection types :( -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:21 PM To: Struts Users Mailing List Subject: RE: jstl and collection sizes That only works if the Collection is a List. If it isn't a List you can do ${myCollection[empty]}. Not allowing ${empty myCollection} for non-Lists is odd, but that's what the spec says. There's a thread about this oddity in taglibs-user. http://shorl.com/dapofrypragragu -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:08 PM To: [EMAIL PROTECTED] Subject: Re: jstl and collection sizes I've created a simple wrapper to get the exact size but if you just want to know if the collection has an item in it you can do this: c:if test=${empty myCollection}... David From: John Thorhauer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: jstl and collection sizes Date: 26 Feb 2003 15:50:52 -0500 I am trying to figure out how to get the size of a collection using the JSTL Expression Language. Is this possible? I have read the lists and it appears that you can not do it without some kind of collection wrapper. Is this correct. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: websites that use Struts..
I get the same thing with IE 6.0 with 128 bit encryption. -Original Message- From: Raible, Matt [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 12:29 PM To: 'Struts Users Mailing List' Subject: RE: websites that use Struts.. Baahhh, they don't like modern browsers eh? Using Mozilla, I get the following page. No response needed, just thought maybe the developers are listening ;-) You cannot access Online Account Services with your current Web browser. Possible reasons for this could be one of the following: * You are using Netscape 4.0 through 4.07, which we cannot support for online account transactions due to security reasons. * You are using a browser that is incompatible with our Online Account Services system. We suggest Netscape version 4.08 or higher or Internet Explorer version 4.0 or higher. For Macintosh users, we suggest Internet Explorer version 4.5 or higher. * Your browser does not support 128-bit encryption. We regret any inconvenience this may cause but, with these policies, we strive to keep your account information as secure as possible. -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 10:01 AM To: Struts Users Mailing List Subject: RE: websites that use Struts.. Found this one too. https://service.capitalone.com/oas/login.do?objectclicked=LoginSplash Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 9:56 AM To: Struts Users Mailing List Subject: RE: websites that use Struts.. Opps... One of my links was bad. :-o http://www.bearmountainmercantile.com Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 9:53 AM To: Struts Users Mailing List Subject: RE: websites that use Struts.. Here is a collection of sites that use struts: http://www.bearmountainmercantilec.com http://www.joebasirico.com http://www.whitefishre.com http://www.eisenhartbuilders.com http://www.parkersvilllecollection.com - contact page only. Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: James Prance [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 8:42 AM To: [EMAIL PROTECTED] Subject: websites that use Struts.. The list on the Apache website, half the links dont work... does anyone know of some websites out there on the old 'interweb' that are currently live using struts.. I need to find some good examples to convince our PM's that this is our way forward.. James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jstl and collection sizes
You can't AFAIK. Some people do this: c_rt:set var=colsize value=%= myCol.size() %/ Or this: bean:size id=colsize name=myCol/ If you want to set a scoped variable to the size of the collection I'd recommend the bean:size approach. -Original Message- From: John Thorhauer [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 3:51 PM To: Struts Users Mailing List Subject: jstl and collection sizes I am trying to figure out how to get the size of a collection using the JSTL Expression Language. Is this possible? I have read the lists and it appears that you can not do it without some kind of collection wrapper. Is this correct. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jstl and collection sizes
That only works if the Collection is a List. If it isn't a List you can do ${myCollection[empty]}. Not allowing ${empty myCollection} for non-Lists is odd, but that's what the spec says. There's a thread about this oddity in taglibs-user. http://shorl.com/dapofrypragragu -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:08 PM To: [EMAIL PROTECTED] Subject: Re: jstl and collection sizes I've created a simple wrapper to get the exact size but if you just want to know if the collection has an item in it you can do this: c:if test=${empty myCollection}... David From: John Thorhauer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: jstl and collection sizes Date: 26 Feb 2003 15:50:52 -0500 I am trying to figure out how to get the size of a collection using the JSTL Expression Language. Is this possible? I have read the lists and it appears that you can not do it without some kind of collection wrapper. Is this correct. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jstl and collection sizes
Woops. In addition to java.util.List it works on java.util.Map and arrays and java.lang.String. But still not on other java.util.Collection types :( -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:21 PM To: Struts Users Mailing List Subject: RE: jstl and collection sizes That only works if the Collection is a List. If it isn't a List you can do ${myCollection[empty]}. Not allowing ${empty myCollection} for non-Lists is odd, but that's what the spec says. There's a thread about this oddity in taglibs-user. http://shorl.com/dapofrypragragu -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:08 PM To: [EMAIL PROTECTED] Subject: Re: jstl and collection sizes I've created a simple wrapper to get the exact size but if you just want to know if the collection has an item in it you can do this: c:if test=${empty myCollection}... David From: John Thorhauer [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: jstl and collection sizes Date: 26 Feb 2003 15:50:52 -0500 I am trying to figure out how to get the size of a collection using the JSTL Expression Language. Is this possible? I have read the lists and it appears that you can not do it without some kind of collection wrapper. Is this correct. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] convert printf formatted strings to MessageFormat?
Is there a utility that will take strings formatted according to printf and convert them to MessageFormat in a Locale friendly way? If not, is there a good website with guidelines on converting printf formatted strings to MessageFormat strings? TIA Jerome - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [TILES] Foxy Tiles Problem
Not sure if this will help, but here goes. I have Form based JSPs that can be used across multiple actions. Therefore these JSPs have dynamic form action attributes. I didn't want to set the form action in the Action class. Instead I define it in struts-config.xml on a per action mapping basis. To accomplish this I could've used the parameter attribute of the action mapping and then in my JSP do something like this: bean:define id=mapping name=%= org.apache.struts.Globals.MAPPING_KEY %/ html:form action=%= mapping.getParameter() % ... And in struts-config.xml have something like this: action path=/actionA type=com.blah.FirstAction name=myForm parameter=/actionX forward name=success path=/myReusableFormPage.jsp/ /action action path=/actionB type=com.blah.SecondAction name=myForm parameter=/actionY forward name=success path=/myReusableFormPage.jsp/ /action However I also wanted the ability to apply other properties to action mappings so the JSP could be generic. Therefore instead of using the parameter attribute I defined my own ActionMapping subclass and make use of the set-property element of the action mapping. My subclass has a single Map property called property. public class PropertiesActionMapping extends ActionMapping { private Map property = new Hashtable(); public PropertiesActionMapping() { } public Map getProperty() { return property; } public void setProperty(Map value) { property = value; } } Now in struts-config.xml I can do this: action path=/actionA type=com.blah.FirstAction name=myForm className=com.blah.PropertiesActionMapping set-property property=property(titleKey) value=actionX.title/ set-property property=property(formAction) value=/actionX/ forward name=success path=/myReusableFormPage.jsp/ /action action path=/actionB type=com.blah.SecondAction name=myForm className=com.blah.PropertiesActionMapping set-property property=property(titleKey) value=actionY.title/ set-property property=property(formAction) value=/actionY/ forward name=success path=/myReusableFormPage.jsp/ /action And now the JSP looks like this: bean:define id=mapping name=%= org.apache.struts.Globals.MAPPING_KEY %/ titlebean:message name=mapping property=property(titleKey)//title ... html:form action='%= mapping.getProperty(formAction) %' ... The code I've shown above isn't actually how I do it since I'm using the JSTL-EL. HTH Jerome -Original Message- From: PILGRIM, Peter, FM [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 10:44 AM To: 'Struts Users Mailing List' Subject: RE: [TILES] Foxy Tiles Problem -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] One thing that might help you is this, Tiles 201, that basicaly has a controler for each tile, with it's own setup, it should give you good ideas, else repost. http://blogs.browsermedia.com/patrick/index.do?date=20030211#130200 ---- Actually I do not see how Tiles Controller can help me here. I think what I need to is pass an JSP request parameter to the html:form in some form or the other. If this is my tiles layout file, which I reference from Tile definitions or tiles:insert page=... /, then I want the action attribute to be set dynamically. // file: /tiles/layout.jsp html:form action=%= pageContext.findAttribute(actionToLaunch) % tiles:insert attribute=form-header / tiles:insert attribute=tab-navigation / ... /html:form In a JSP I can refer to Tiles Layout tiles:insert page=/tiles/layout.jsp tiles:put name=form-header value=form-header.jsp / tiles:put name=tab-navigation value=navbar.jsp / %-- // Some how set the request parameter `actionToLaunch' here --% ... /tiles:insert I think a Tiles Controller is a overkill for such a simple request. PILGRIM, Peter, FM wrote: Hi I got a Tiles template design question. I have a web site like Amazon.com that using Tabs to navigate around a set of HTML Form elements. Each Page has a HTML Form that contain lots of HTML Input elements. I have written the JSP in the first phase to be monolithic and now I want to break down the layout to use Tiles. I want to take advantage of the fact, that certain areas of the layout design are shared. Unfortunately I have run in to difficulty because they want a specific design that forces me to run an html:form outside all the shareable and non-shareable tiles. Ideally, I would like to dynamically set the name of the `action' tag of html:form below. I would like to say action=/Main.do and then action=/Shipping.do for a single template layout. How can I do this, using TILES? Otherwise I will have to create template layouts for each tab page. (Yuck) Also is it good practice to have template layout within templates layout? // This is a template layout.jsp !-- Search form --
RE: ActionMapping enhancement?
Hi Brandon, I just posted something on a different topic that may solve your problem. Basically it is like your Solution #2, except it doesn't use a comma delimited value getter/setter. Not sure why you need that. Anyway, here's the posting URL. http://shorl.com/dutydapedroho -Jerome -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 12:35 PM To: Struts User List Subject: ActionMapping enhancement? Do any of you face this issue? and how do you deal with it? SCENARIO: I have a set of classes that handle event calendars. The same classes can be used within one site to maintain multiple event calendars. The event calendar contains multiple categories. I want to utilize the event calendar from various urls to display specific event calendars: /do/ec/city - shows event calendar for city events /do/ec/elksclub - shows event calendar for elks club etc... But I want to provide default parameters to each of the mappings so that the event calendar action knows which event calendar to display without having to pass it in through a query parameter. In other words I want to handle the default parameters in the struts-config.xml. The only solutions both include extending the ActionMapping class and using the set-property in the action-mapping of the struts-config.xml: SOLUTIONS 1) Create a new module (Event Calendar module). Provide a custom extended ActionMapping to handle properties that may be passed in for the classes used under the module. 2) Extend the ActionMapping class and provide a setter/getter that receives a comma delimited value ([0],[1];0=key 1=value) and stores it into a HashMap in the extended ActionMapping class. I could then provide an accessor method to retrieve a particular property in the hashmap (i.e. getValue(String key)). I could then retrieve the value from the action mapping reference within my action class to initialize default values based on the mapping of the url. Thoughts? Corrections? REASONS: Default parameters that are contained in a url querystring get difficult to handle. It is nice to be able to change them in one place when needed. This avoids having to pillage through every page that may contain a reference to a partical url/querystring combo and adjust the parameters rather that just one. Also, if the action mapping could contain a hashmap of properties... one could provide runtime configuration info to an Action class in order to affect it's behavior a certain way. This promotes reusability of code. Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamic Forwards Offsite
The javadoc for ActionForward state you can use an absolute URI for the path parameter. I've never tried it though. -Original Message- From: Micael [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 3:47 PM To: [EMAIL PROTECTED] Subject: Dynamic Forwards Offsite How does one do a dynamic forward offsite, e.g. http://www.somewhere.com/index.htm;, within the context of the struts framework? This does not work with ActionForward, apparently, because the forwards there have a context of the application root in the container. I know how to do these with html, of course. I know, for example, how to use an action forward to a jsp page which will then forward to another website. I need to know, if possible, how to do this within the struts framework. Also, if we get by that aspect, the address to forward to must be dynamic. Thanks for any assistance. I have tried four books and the struts user archives without being able to find the answer to this. Thanks. LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How stable is struts 1.1 beta 3
I'm using it in production. Also JDeveloper 9i ships with Struts 1.1b2. From reviewing the struts-dev list it appears that 1.1-b3 will be the release candidate. -Original Message- From: Stillwell, Chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 9:30 AM To: 'Struts Users Mailing List' Subject: RE: How stable is struts 1.1 beta 3 We would like to know the answer to this question as well. We are just in the design phase of a new project and are trying to decide between 1.0.2 and 1.1-b3. I would prefer to go with 1.1-b3 since it appears from the project plan on the Struts web site that it is intended to be the release candidate. I am also hoping that there will be a 1.1 release prior to our going into production in early summer. Is that a realistic expectation? Is anybody using 1.1 in production? Our management team gets shaky knees when you mention things like building a product on beta software and would most likely just say no. Cheers, Chris -Original Message- From: Jagannayakam [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 7:23 AM To: Struts-User Mailing List Subject: How stable is struts 1.1 beta 3 Hi , We already developed a J2EE product . Now we think of implementing the struts framework for better navigation , exception framework . Any sugesstions on - how stable is this release of struts 1.1 beta 3 . Are there any major known issues in this ? Regards, Jagan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Flow with Transaction Tokens?
I just checked the book. His approach is to just throw a servlet exception when a sensitive form is resubmitted. I believe what Greg wants is a way to display the results just as if the second submition did not occur. -Original Message- From: DUBCHAK, JOHN (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 3:54 PM To: 'Struts Users Mailing List' Subject: RE: Application Flow with Transaction Tokens? David Geary presented something similar to this in his Advanced JavaServer Pages book. It was implemented on top of his custom Model-2 implementation but in truth could be easily adapted for use within your own environment. I don't have the book here with me at work, otherwise I would provide greater detail and a page reference. HTH, John -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 2:45 PM To: [EMAIL PROTECTED] Subject: Re: Application Flow with Transaction Tokens? Greg Hess writes: I would like to ignore the fact that the double submit happened and just display the proper receipt. Should I forward the user to a transaction already processed page they will loose their proper receipt and never visually receive the receipt as I also send it by e-mail. I don't really have any practical advice, but I did want to mention that I've always wondered about the best way to resolve this sort of thing. So far my own double-submit cases have not involved a long-running process, and have been easy to resolve with an message page. If you come up with a solution for the long-processing scenario that you like, be sure to let us know. I'd like to see a how-to regarding this in documentation area. It's definately a thorny problem. -Ted. -- Ted Husted, Struts in Action http://husted.com/struts/book.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Flow with Transaction Tokens?
I posted an idea on how to handle this a while back. http://marc.theaimsgroup.com/?l=struts-userm=104404655411300w=2 Like I said in that post, I've never tried it. If you can restrict clients to have Javascript enabled then I think John's solution is the easiest. Since I have the luxury of enforcing Javascript to be enabled John's solution is what I've been using. -Original Message- From: John Espey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 3:50 PM To: Struts Users Mailing List Subject: RE: Application Flow with Transaction Tokens? Nobody will like this solution, but I've had to resort to it (as recommended by a coworker). Create a page scope javascript variable, and increment it when the user clicks the button, if it's equal to one , return true, otherwise false. I am fully aware of the shortcomings of javascript (for all the smarties out there who want to shoot it down ;-), but I'm just not smart enough to come up with a better way to force the user to wait until processing is done after clicking a button -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 18, 2003 3:45 PM To: [EMAIL PROTECTED] Subject: Re: Application Flow with Transaction Tokens? Greg Hess writes: I would like to ignore the fact that the double submit happened and just display the proper receipt. Should I forward the user to a transaction already processed page they will loose their proper receipt and never visually receive the receipt as I also send it by e-mail. I don't really have any practical advice, but I did want to mention that I've always wondered about the best way to resolve this sort of thing. So far my own double-submit cases have not involved a long-running process, and have been easy to resolve with an message page. If you come up with a solution for the long-processing scenario that you like, be sure to let us know. I'd like to see a how-to regarding this in documentation area. It's definately a thorny problem. -Ted. -- Ted Husted, Struts in Action http://husted.com/struts/book.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Struts and Design Patterns
This has already been done by Ted in his book, I think. At least in the downloadable draft version there is a Patterns chapter. Actually it is Appendix D. -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Monday, February 17, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: [OT] Struts and Design Patterns I'm writing a chapter on Struts for a book, Professional JSP 2.0, from Wrox (http://www.wrox.com/books/1861008325.htm). The reason I'm sending this post is to verify my belief of the different design patterns that Struts implements. From the Core J2EE Design Patterns book (by Alur, Crupi, and Malks), there are 6 patterns discussed: Intercepting Filter Front Controller View Helper Composite View Service to Worker Dispatcher View In Struts, I'm assuming the following: Front Controller (ActionServlet) View Helper (ActionForm) Composite View (Tiles) Service to Worker (ActionServlet to your Actions) Dispatcher View (RequestProcessor) Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Struts and Design Patterns
It appears I was wrong. You can only download the Tiles and Validator chapters (these are the final versions). http://www.manning.com/getpage.html?project=hustedfilename=chapters.html Ted had sent me the draft of the entire book at one point but it looks like you can't download these chapters from anywhere. Sorry, I won't email these out to anyone as I don't have Teds permission to do so. -Original Message- From: Thorsten Schäfer [mailto:[EMAIL PROTECTED]] Sent: Monday, February 17, 2003 3:30 PM To: 'Struts Users Mailing List' Subject: RE: [OT] Struts and Design Patterns Hi, This has already been done by Ted in his book, I think. At least in the downloadable draft version there is a Patterns chapter. Actually it is Appendix D. Wow, that's exactly what I'm searching! Can you tell me where it's possible to download this draft version? Thanks in advance, Thorsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Struts and Design Patterns
The table of contents is available online. It is listed there as Appendix A. http://www.manning.com/getpage.html?project=hustedfilename=contents.html -Original Message- From: Matt Raible [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 17, 2003 3:54 PM To: [EMAIL PROTECTED] Subject: Re: [OT] Struts and Design Patterns Figures... I own the book and left it at work. Anyone care to save me a trip into the office to verify this? Thanks, Matt --- In [EMAIL PROTECTED], Jerome Jacobsen [EMAIL PROTECTED] wrote: This has already been done by Ted in his book, I think. At least in the downloadable draft version there is a Patterns chapter. Actually it is Appendix D. -Original Message- From: Matt Raible [mailto:matt@r...] Sent: Monday, February 17, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: [OT] Struts and Design Patterns I'm writing a chapter on Struts for a book, Professional JSP 2.0, from Wrox (http://www.wrox.com/books/1861008325.htm). The reason I'm sending this post is to verify my belief of the different design patterns that Struts implements. From the Core J2EE Design Patterns book (by Alur, Crupi, and Malks), there are 6 patterns discussed: Intercepting Filter Front Controller View Helper Composite View Service to Worker Dispatcher View In Struts, I'm assuming the following: Front Controller (ActionServlet) View Helper (ActionForm) Composite View (Tiles) Service to Worker (ActionServlet to your Actions) Dispatcher View (RequestProcessor) Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Highlighting fields that failed in validation
Here's something from the archives you might find useful. - Since this is essentially error text you are talking about, I think the easiest way to handle this is through Struts's error tags: html:text property=username ... / html:errors property=username/ Where there is an error on username, you add a new ActionError with a message key like error.field.icon or something, and the value of that key is just HTML that generates the icon. So you would have this in your ApplicationResources.properties file: error.field.icon=img src=error_icon.gif / The drawback then is that you really can't add any other errors on username or else the display would mess up. We used this approach on a project and it worked well. Sean - -Original Message- From: Michael Hanisch [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 9:05 AM To: Struts Users Mailing List Subject: Re: Highlighting fields that failed in validation On Fri, 2003-02-14 at 13:37, O'Hara, Jean wrote: Hi there A requirement for the application I'm working on is to highlight fields that cause validation errors in red and also display an asterisk after the offending field. This is as well as giving a list of the errors in a box to the side. Listing the errors in the box is fine but does anyone know of a good way of highlighting each field. I'm using the Struts Validator framework and using the DynaValidatorForm. I think I might need to write some custom tags but am not very familiar with custom JSP tags. Any advice would be welcome! Umm... not sure what you mean by highlight. What I usually do is to render every form widget in a table cell of its own; if there is an error for a widget, highlight this table cell in yellow (or whatever). You don't necessarily need a custom tag for that, though it would make things easier. Otherwise, just use one of the logic tags to check if an error for the widget is present (logic:present or something like that). HTH, Michael. -- Michael Hanisch [EMAIL PROTECTED] Red Hat - RH Interchange Inc., Orleansstrasse 4, D-81669 Munich/Germany phone: +49 (0)89 206058-53 fax: +49 (0)89 206058-88 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using the html:message tag
Try this: html:messages id=success message=true / If you omit message=true then the tag only looks for error messages under Action.ERROR_KEY. With the message=true it will look for messages under Action.MESSAGE_KEY. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:26 PM To: Struts Users Mailing List Subject: Using the html:message tag I want to display messages in my html when the action completes successfully (think Query successfully processed type messages.) I'm guessing I use the html:messages tag but it doesn't seem to be working. In my code I have: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); And in my html I have: html:messages id=success/ What am I doing wrong? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using the html:message tag
Sorry. It should be this: html:messages name=success/ -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:09 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Using the html:message tag Jerome, I tried it but it didn't work. Here is what I have in my HTML: html:messages id=success message=true / And here is what is in my action file: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); where mxdquery.success in a value in my ApplicationResources.properties file.. I'm not sure about the id attribute. The API for ActionMessages.add says the first string is the property while the docs on the id attribute say it is the name scope of the JSP bean(??)... Idea's? -- Sloan - Original Message - From: Jerome Jacobsen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 1:47 PM Subject: RE: Using the html:message tag Try this: html:messages id=success message=true / If you omit message=true then the tag only looks for error messages under Action.ERROR_KEY. With the message=true it will look for messages under Action.MESSAGE_KEY. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:26 PM To: Struts Users Mailing List Subject: Using the html:message tag I want to display messages in my html when the action completes successfully (think Query successfully processed type messages.) I'm guessing I use the html:messages tag but it doesn't seem to be working. In my code I have: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); And in my html I have: html:messages id=success/ What am I doing wrong? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate does not iterate more than once, although collection definitely contains more elements
My guess is that you aren't really using the logic:iterate tag because you forgot the taglib directive at the top of your JSP. If you do a view source from your browser I'm guessing you'll still see the logic:iterate tags in the output HTML. -Original Message- From: mech [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: logic:iterate does not iterate more than once, although collection definitely contains more elements Hi, I have been using logic:iterate for quite a while, but now I'm stuck. Using Struts 1.1b2 on Tomcat 4.1.18. This code makes me crazy: bean:size id=test name=EditAccountForm property=roles/ bean:write name=test/ logic:iterate id=userRoles name=EditAccountForm property=roles/got one/logic:iterate I have a form bean named EditAccountForm with a collection (ArrayList behind) named roles. I've checked it with bean:size... The collection contains for example four items. I've checked it with editAccountForm.getRoles().size() in my business logic and Action class before putting the Collection into my form bean. But I only receive the first element... Why not all four??? I think I'm using logic:iterate as usual...?! Strangly if I do this: logic:iterate id=userRoles name=EditAccountForm property=roles/ offset=0 length=1 bean:write name=userRoles property=roleName/ /logic:iterate logic:iterate id=userRoles name=EditAccountForm property=roles/ offset=1 length=1 bean:write name=userRoles property=roleName/ /logic:iterate logic:iterate id=userRoles name=EditAccountForm property=roles/ offset=2 length=1 bean:write name=userRoles property=roleName/ /logic:iterate logic:iterate id=userRoles name=EditAccountForm property=roles/ offset=3 length=1 bean:write name=userRoles property=roleName/ /logic:iterate I correctly get all four different values. But I have to iterate step-by-step by increasing the offset! Actually the tag should do that for me ;-( Whatever I do, I get only one element, although there are more in my collection as I proved in several ways... Any hints? What did I do wrong this time? Where's the bug? I believe I did everything as usual... 100 times it worked, but not this time... Thx. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best tag to display table
AFAIK the display tag is the best choice. With JSTL you'd have to build in the paging and sorting yourself. If you can wait until the next release of display taglib (now at sourceforge) I would strongly recommend that. There are some key bug fixes in the next release. -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 13, 2003 11:05 AM To: '[EMAIL PROTECTED]' Subject: Best tag to display table Importance: High I must display a table in a JSP page with the following features: - paging; - sort on the column header; - multi check-box; - rendering conditional color rows; - internationalization (column header); Can somebody indicate the best choice to me? I began with logic:iterate (struts tag) but I think now use the display:* tag. Is the last version of the display.jar/display.tld available on the link http://edhill.its.uiowa.edu/display-0.8/? What can we say about display:* vs JSTL/JSTL-EL iterate tags (c:forEach...) ? Is the display tag the best choice ? --- As of February 12, 2003 Thomson unifies its email addresses on a worldwide basis.Please note my new email address: [EMAIL PROTECTED] Thomson is the leader in solutions and technologies for the entertainment and media industries and serves its customers under its four strategic brands: Technicolor, Grass Valley, RCA and THOMSON. More about Thomson: http://www.thomson.net/videochain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Server detection of Javascript enabled?
Without using Javascript on the client, can the server detect if the client has Javascript enabled? Is there something in the HTTP request header that indicates this? [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Generating microsoft word documents
Have you looked at OpenOffice (http://www.openoffice.org/)? They may have Java APIs for doing this sort of thing. -Original Message- From: John Cavacas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 10:29 AM To: 'Struts Users Mailing List' Subject: [OT] Generating microsoft word documents I'm currently doing some initial research on the possibility of generating Microsoft word documents (yuk) from a web application for a project that I am working on. The web app portion of course would use struts. However, as I suspected, I'm finding that creating word documents from Java is, well for a lack of better words, a pain in the ass. I've looked at POI and their HDF classes, but it seems to be in very very early state. I've also looked at some Java COM wrappers which seem that would work, however it forces you to use COM. I was wondering if anyone in the list has had some experience with something like this and would care to share their experiences. Any suggestions would be appreciated as well. Regards, John This communication is intended for the use of the individual(s) or entity it was addressed to and may contain confidential and/or privileged information. If the reader of this transmission is not the intended recipient, you are hereby notified that any review, dissemination, distribution or copying of this communication is prohibited. If you receive this communication in error, please notify the sender immediately and delete this communication from your system(s) to which it was sent and/or replicated to. (c) 2002 Sapiens Americas Corp. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: still wondering Re: Where to repopulate dynamic lists ?
I'd like to hear Craig and/or Ted respond to this topic. I think the solutions presented this far are interesting, but would like to hear what the Struts masters say. I haven't seen anything about this very common problem in the two Struts books I have or in the online docs. Come on Craig or Ted we await your pearls of wisdom. -Original Message- From: Theodas, Jacques [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 11:30 AM To: [EMAIL PROTECTED] Subject: RE: still wondering Re: Where to repopulate dynamic lists ? Rick, I just read your post on this question and wanted to share how I handle this. Whenever I have a page with a dynamic dropdown list, I set validate to false for the action that I am submitting to in struts-config.xml. Then in my action, I call the validate method on the ActionForm that I get. AddEmployeeForm myForm = (AddEmployeeForm)form; ActionErrors errors = myForm.validate(mapping, request); if (errors.empty()) { //work with the submitted data } else { //recreate dynamic lists as collections and put them in the request. saveErrors(request,errors); // so html:errors/ can display them return new ActionForward(mapping.getInput()); //forward back to the submitting jsp page } Jacques -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 10:48 AM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: still wondering Re: Where to repopulate dynamic lists ? Sorry Craig to e-mail you directly but this topic has been up for a while and I'd really be curious on your take on this. (I'm working on struts demo and I don't mislead others by doing something 'wrong'). To recap I'm wondering what is the best practice for repopulating a dynamic list that a user would need on a form. For example possibly it's a form where a user has to select from a list ofOrder Numbers(which could frequently change and could be based on the user logged in). The way I currently tackle this is in the setUpForm type of action a business object is called which returns to me this list and puts the list into request scope to be used on the form. The problem is when the user submits the form and validation returns false. Somewhere this list needs to be repopulated. I could of course put this list (or even the form bean) into session scope, but I thought that was to be avoided since the only thing this list is used for is this one page. To solve this problem I've been calling this business object to get my list in the reset() method and putting it back into scope. I've heard others say this is a bad idea(although I'm not sure why) and yet I haven't really heard any other'much better' solutions. Some comments below on Mitchell's last post.. On Tue, 11 Feb 2003 10:20:52 -0500 Mitchell Morris [EMAIL PROTECTED] wrote: #1) Create a custom tag library to share an application-wide cached value of the order list, and populate the list into scope: [snip] This is probably a pretty good solution, although doesn't this go against the thought of all the objects to display should be set up before you even reach the JSP page? Basically now your JSP page is doing business logic. Ooooh ... philosophical purity! I seen some of that once! I'm not entirely sure where the objection lies here, because the view object (JSP) isn't directly manipulating the model object (order list), but rather is intermediated by a controller object (tag library). Seems to me the MVC purity is being maintained. On the other hand, I might be wrong. At least it isn't a scriptlet. Trust me I'm not against using a tag to do it in the JSP page, I'm just wondering how this is any more pure/better than just setting the list back up in the reset method? One solution I thought might work is every time the list was updated to the db I'd make sure to get a new cached copy and put that into application scope which all the user's cold have. This would be a great option except this list could be very specific to a particular user- it wouldn't work well in application scope because of this since the lists could vary depending on the user logged in. Well, you could certainly go with this scheme even in a user-specific case. The tag library would need to interact with the other model objects in session scope to coordinate the user's identity and thus to extract/cache the correct order list. It's starting to look icky, though, so you might now like choice #2 better. Yes, very icky I think. Better would be for each user's session to hold this list data or repopulate this list (where/when?) before getting back to the form upon validation errors. #2) Have an Action populate the list into
RE: [JSTL] How can I use c:if to check the size of a list?
If you are iterating with c:forEach then use the iteration status which has a count property. See this example: c:forEach var=customer items=${customers} varStatus=status tr tdc:out value=${status.index}//td tdc:out value=${status.count}//td tdc:out value=${status.current.lastName}//td tdc:out value=${status.current.firstName}//td tdc:out value=${status.first}//td tdc:out value=${status.last}//td /tr c:if test=${status.last} c:set var=count value=${status.count}/ /c:if /c:forEach /table pThere are c:out value=${count}/ customers in the list. -Original Message- From: Peter S. Hamlen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 1:09 PM To: [EMAIL PROTECTED] Subject: [JSTL] How can I use c:if to check the size of a list? I'm a bright new convert to the beautiful world of JSTL,and I'm struggling over one tricky issue. We're paging over a resultset using the c:forEach tag and specifying the start and end parameters. I would like to be able to create a previous and next button. Obviously, if we're at the end of the list, we don't want to display the next button. So I'd like to do something like: c:if test=${param.page*pagesize results.size} a href=results.jsp?page=c:out value=${param.page+1}Next/a /c:if But since size isn't a property, I can't do it. Does anyone else have a way of getting the size of a List via a property? -Peter PS (Yes, to those JSTL'ers out there, the c:url tag would be better to use!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Tell VM to use a different java.security file other than the one in default location
java -Djava.security.manager -Djava.security.policy=%APP_HOME%\java.security -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 12, 2003 8:05 AM To: [EMAIL PROTECTED] Subject: [OT] Tell VM to use a different java.security file other than the one in default location Apologies in advance for the OT post. I have some background processes that run as NT services. Each process will run in its own VM. I would like each process to use its own java.security file. I know there must be a way to tell the VM to use a different java.security file other than the default (for each process). I have search for this on the web but seem to only find information on how to set up different java.security.policy files. I'm not interested in the policy files though. I have looked through the various Java security tutorials, JSSE and JAAS APIs and must be missing something simple. I'm thinking there must be a way to pass that information to the VM in my startup script like (just guessing) java -Djava.security=%APP_HOME%\java.security Any ideas? Once again, sorry for the OT post, but I have searched the web for a couple days, posted to the Java Programming forum on Sun's site and asked other collegues but the answer eludes me. robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] concurrent updates
Very good question on a very difficult topic. This is one of the hardest things in a transactional application. The a-d choices you listed are all possibilities and the one you select depends on your situation/requirements. What does the customer want to happen in this case? This topic is discussed in Martin Fowler's new book Patterns of Enterprise Application Architecture. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 6:41 AM To: [EMAIL PROTECTED] Subject: [OT] concurrent updates pls excuse my struts-[OT] question, but I would appreciate to learn how you handle the situation of concurrent data update within your web applications. think about the following situation: 1. user A fetches customer 007 and displays 007 within his browser 2. user B fetches customer 007 as well and displays 007 within his browser 3. user A updates customer 007 4. user B updates customer 007 as well... How do your systems react? a) the last update wins? b) trying to merge updates of user A and B? c) sending a message to user B that customer 007 was changed since loading, and that user B has to re-enter his update or d) do you have a locking mechanism which prevents this situation - user B has no update button if customer 007 is already in somebody else's update screen or e) ??? thanks for sharing your solutions to this common problem rene - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hashmaps and hash tables in JSPs
logic:notEmpty name=session property=permissionsHashMap(Manage Countries) ... User has the Manage Countries permission /logic:notEmpty Or with JSTL c:if test=${permissionsHashMap['Manage Countries']} ... User has the Manage Countries permission /c:if -Original Message- From: Jordan Thomas [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:02 AM To: Struts User List Subject: hashmaps and hash tables in JSPs HI, I have a hastable or Hashmap of permissions that I want to use in my JSP pages to determine what info is displayed to the user. For instance I want to have the following logic if permissionsHashMap has key Manage Countires then display this if permissionsHashMap has key Manage Logins then display this etc Is there a way to do this with the struts logic tags? thanks Jordan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: hashmaps and hash tables in JSPs
Woops, that logic:notEmpty example isn't right! Not sure how you'd do it with logic:notEmpty without the permissionsHashMap being a property of another bean, say permissionsBean. In that case it would look like this: logic:notEmpty name=permissionsBean property=permissionsHashMap(Manage Countries) ... User has the Manage Countries permission /logic:notEmpty -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:19 AM To: Struts Users Mailing List Subject: RE: hashmaps and hash tables in JSPs logic:notEmpty name=session property=permissionsHashMap(Manage Countries) ... User has the Manage Countries permission /logic:notEmpty Or with JSTL c:if test=${permissionsHashMap['Manage Countries']} ... User has the Manage Countries permission /c:if -Original Message- From: Jordan Thomas [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 9:02 AM To: Struts User List Subject: hashmaps and hash tables in JSPs HI, I have a hastable or Hashmap of permissions that I want to use in my JSP pages to determine what info is displayed to the user. For instance I want to have the following logic if permissionsHashMap has key Manage Countires then display this if permissionsHashMap has key Manage Logins then display this etc Is there a way to do this with the struts logic tags? thanks Jordan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Override DispatchAction but keep the existing funcationallity
Your CommonCode solution is the way I went (I called mine BaseActionHelper). Your subclass of DispatchAction would look something like this below. public abstract class MyDispatchAction extends DispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception { //common code for all action classes CommonClass cc = new CommonClass(); // just sample method cc.doValid(); return super.execute(mapping, form, request, response); } } -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 11:17 AM To: [EMAIL PROTECTED] Subject: Override DispatchAction but keep the existing funcationallity Hi, I want to extend functions of dispatchAction class, like i want a class which extends DispatchAction and overrides the execute method, But keep all the existing functions, But if i override the execute method, then i will have to code the same function available in origianl DispatchAction, and add my extra functions, ( like cut and paste the code) but then if in future DispatchAction is modified i will need to modify my class. or have one class which will have all the functions of DispatchAction , but also want to add more functions. What i have done in MyActionClass is public abstract class MyAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception { //common code for all action classes CommonClass cc = new CommonClass(); // just sample method cc.doValid(); return performTask(mapping, form, request, response); } // this is the method which will be implemented by each overriding class and add the necessary logic protected abstract ActionForward performTask(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception; } I have a CommonClass for doing all the common function, How can i do it DispatchAction Ashish = A$HI$H __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Override DispatchAction but keep the existing funcationallity
Correction. Your MyDispatchAction would not be abstract. -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 11:29 AM To: Struts Users Mailing List Subject: RE: Override DispatchAction but keep the existing funcationallity Your CommonCode solution is the way I went (I called mine BaseActionHelper). Your subclass of DispatchAction would look something like this below. public abstract class MyDispatchAction extends DispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception { //common code for all action classes CommonClass cc = new CommonClass(); // just sample method cc.doValid(); return super.execute(mapping, form, request, response); } } -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 11:17 AM To: [EMAIL PROTECTED] Subject: Override DispatchAction but keep the existing funcationallity Hi, I want to extend functions of dispatchAction class, like i want a class which extends DispatchAction and overrides the execute method, But keep all the existing functions, But if i override the execute method, then i will have to code the same function available in origianl DispatchAction, and add my extra functions, ( like cut and paste the code) but then if in future DispatchAction is modified i will need to modify my class. or have one class which will have all the functions of DispatchAction , but also want to add more functions. What i have done in MyActionClass is public abstract class MyAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception { //common code for all action classes CommonClass cc = new CommonClass(); // just sample method cc.doValid(); return performTask(mapping, form, request, response); } // this is the method which will be implemented by each overriding class and add the necessary logic protected abstract ActionForward performTask(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception; } I have a CommonClass for doing all the common function, How can i do it DispatchAction Ashish = A$HI$H __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: proper use of back button -- design patterns
The framework could be extended to support this on a per-action basis. In struts-config.xml we could have an additional element or attribute of the 'action' attribute to indicate the desired ActionForm populate/validate behavior on invalid token. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 6:18 PM To: Struts Users Mailing List Subject: RE: proper use of back button -- design patterns On Fri, 31 Jan 2003 [EMAIL PROTECTED] wrote: Date: Fri, 31 Jan 2003 16:11:21 -0500 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: proper use of back button -- design patterns I want to bring up another issue. The default behavior of RequestProcessor is to save everything into a new ActionForm then do the validation. If token is invalid, why should we bother populating the ActionForm at all? How is the framework supposed to decide whether the app actually cares about an invalid token or not? It's possible for the app to decide to do something specific, but different -- like maybe say did you really mean to submit this twice? and accept it if they say OK. Regards, PQ Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: set-property in the struts-config file
It applies to the ActionMapping, not the Action. Subclass org.apache.struts.action.ActionMapping. Define your property in the subclass. The in struts-config.xml add the className attribute to your action elements like this: action className=com.blah.MyActionMapping ... set-property name=foo value=bar/ ... -Original Message- From: Smith, Johnathan M. [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 11:47 AM To: '[EMAIL PROTECTED]' Subject: set-property in the struts-config file Can someone please tell me how to use the set-property in the struts-config file? I am trying to pass a propert to one of my actions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: proper use of back button -- design patterns
Seems to me you could save a TransactionStatus token in the Session. Check for this token in the Action that starts the Transaction. There are two double-submit cases. Case 1: Transaction Complete (with or without error). If the Action determines that it is a double-submit and the transaction is finished, then forward to an Action capable of showing the results just as if a single-submit were done. Now in order to show the results you may have to know what the inputs were (Form state) on the first submit, not the second. If the Form was in request scope then the first submit's data is gone. If the Form was in session scope then the Form's data would be that of the second submit which could be different than the first. Therefore when creating the TransactionStatus token you can deep copy the Form data to it. Still having the Form inputs may not be enough to know how to show the results as if only the first submit were done. In these cases you could put the results in the TransactionStatus token too. This is also how you could place Error information if an error occurred during the transaction. Case 2: Transaction In Progress Forward the user to a page saying the transaction is in progress and that their second submit was ignored. If the page is javascript enabled then load an Action automatically which can display the original Transaction's results. The above could be extended to even implement allowing a user to cancel an ongoing Transaction if it happens to be in a cancelable state. I haven't implemented anything like this. Maybe there is a problem with it that I haven't thought of. Maybe its just crazy. Gives me a headache 4:00 pm on a friday. -Original Message- From: Espey, John [mailto:[EMAIL PROTECTED]] Sent: Friday, January 31, 2003 3:25 PM To: Struts Users Mailing List Subject: RE: proper use of back button -- design patterns The javascript would be there as the first line of defense because the action will only be called once, and the submission will go through (assuming they do not have jscript turned off of course). If an error occurs in that submission, the appropriate error handling will occur. Contrast this to the situation where I check the token and forward somewhere else. I don't know what happened in the first action submission. It could have been successful, it could have caused errors, the user will have no idea. All they will know is that they double submitted. They could have kicked off a long asynchronous process, but because they were forwarded to badToken, they decide to go kick it off again. Do you see now my issue with the token checking? It seems like it really doesn't buy you a whole lot because you can't cancel the fact that the first submission cause an action to execute. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Fri 1/31/2003 3:07 PM To: [EMAIL PROTECTED] Cc: Subject: RE: proper use of back button -- design patterns - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing parameter in a pop up window
Not sure, but maybe this: bean:define id=popUpURLhtml:rewrite page=AgreementList.do paramName=customerDetails paramProperty=customerId//bean:define a href= onClick=MM_openBrWindow('%= popUpURL %','popup','scrollbars=yes,widt h=1000,height=500,left=10,top=100')Click Me/a -Original Message- From: Ritesh Singhal [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 10:03 AM To: Struts Users Mailing List Subject: Passing parameter in a pop up window I want to have a link like this: html:link href= paramId=id paramName=customerDetails paramProperty=customerId onClick=MM_openBrWindow('AgreementList.do','popup','scrollbars=yes,widt h=1000,height=500,left=10,top=100') /html:link Where my javascript function is: function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); } Now the problem is how should I pass the parameter id in the popup window. Also on clicking on the link, parent window should not get refreshed. Please help me if you know the solution. Regards Ritesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Display Tag Library - Sorting Dates
Couldn't you subclass Date and override toString? -Original Message- From: Raible, Matt [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:41 AM To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: [OT] Display Tag Library - Sorting Dates Since there seems to be a lot of display:* users on this list, I thought I'd ask this question here - hope you don't mind. I have a string in my form that is a date. In order to get the display tag library to sort this column (date) correctly, I have added the following method in a Decorator: public Date getDate() { MyForm form = (MyForm) this.getObject(); Date d = null; try { d = DateUtil.convertStringToDate(DateUtil.getUIDatePattern(), form.getDate); } catch (ParseException pe) { pe.printStackTrace(); log.error(Error converting String date to real Date: + pe); } return d; } The problem is that the display tag just calls toString() on the date, so I end up with the following in my column: Thu Feb 06 00:00:00 MST 2003 When I want, something like Feb 6, 2003. However, to do this, I need to return a String, and then it doesn't sort correctly. I can hack the code in the display tag library to try to parse all columns, and if it succeeds then it assumes it is a date, and uses a format. But I'm hoping that someone has a more elegant solution. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tokens and set-property
The set-property applies to the ActionMapping, not the Action. You can subclass ActionMapping and add a useToken property to it. Then the action entity will need the className attribute set to your ActionMapping subclass. action className=com.blah.MyActionMapping path=blah... set-property property=useToken value=true/ /action -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 12:19 PM To: [EMAIL PROTECTED] Subject: tokens and set-property I'd like to use the set-property element of struts-config to tell my action whether to expect a token. For example, I have an action like this: action path=blah... set-property property=useToken value=true/ /action I'm using an abstract action subclass that itself is a superclass to my real actions. It contains a boolean useToken property. I also tries a String but it didn't matter. That property never gets set to what I specify in the struts-config file. Any suggestions? thanks john john gregg Wells Fargo Services Company Minneapolis, MN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts and JSTL fmt:setBundle
Perhaps an Adapter could be created to do this (e.g. MessageResourcesLocaleContext or StrutsLocaleContext). You could set it up to be your default LocaleContext in the web.xml or via a Struts PlugIn. I haven't actually looked to see if a Struts MessageResources could be adapted to a JSTL LocaleContext. The APIs may be too different. But maybe not. Anyway the advantage would be that the Adapter is a light-weight object so you don't have the problem of loading all the resources into memory twice as you do with both loading the MessageResources and the ResourceBundle. Such an Adapter could live in the Struts 1.1 contrib along with Struts-EL. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, January 27, 2003 3:53 PM To: Struts Users Mailing List Subject: Re: Struts and JSTL fmt:setBundle On Mon, 27 Jan 2003, PILGRIM, Peter, FM wrote: Struts has a i18n implementation that predates JSTL version. I was wondering how to use the Struts application properties with the JSTL fmt:bundle? The obvious answer is point JSTL bundle to load the Struts message bundle. In other have two resource bundles in memory. However, is there any plans to make MessageResources implement the `javax.servlet.jsp.jstl.fmt.LocaleContext' directly? Short answer - no. Reason - that would introduce a dependency on JSTL, which in turn would introduce a dependency on JSP 1.2 and Servlet 2.3, which would be a problem for more than a few users who are using JSP 1.1 / Servlet 2.2 containers. We cannot introduce dependencies like this without updating the baseline version dependency as well. Craig -- 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: [OT] Re: Struts officially supported by Fred
My friend Fred officially supports Struts. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] JSF JSTL EL [WAS: RE: DynaBeans, Struts, OR mapping tools and code generators]
JSTL-EL source code is under Jakarta Taglibs. See class org.apache.taglibs.standard.lang.support.ExpressionEvaluator. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 1:10 AM To: Struts Users Mailing List Subject: [OT] JSF JSTL EL [WAS: RE: DynaBeans, Struts, OR mapping tools and code generators] o... I do wish you'd stop talking about JSF. It sounds so cool that I feel like a kid on Christmas eve who cant wait for Santa to come down the chimney and fill the stocking with presents... ;-) Where could one get a copy of the source for the JSTL expression language evaluator stuff? Is there something in struts EL I can rip? -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, 23 January 2003 13:59 To: Struts Users Mailing List Subject: Re: DynaBeans, Struts, OR mapping tools and code generators On Wed, 22 Jan 2003, Tony Baity wrote: I am looking forward to see what the SUN Faces product will do and how Struts and JSTL relates to or is incorporated into that but I do not know easy it will be to map database fields to a face. If you've seen the early access version of JavaServer Faces that is currently available, you know that the linkage between UI components and model tier JavaBeans is expressed via a model reference expression that is associated with each component. In the next EA release, you'll see that the syntax used for model reference expressions has been enhanced to be exactly like a variable reference in the expression language (EL) used by the JSP Standard Tag Library (JSTL) -- indeed, the reference implementation of JavaServer Faces uses the exact same expression evaluator code. So, anything you can address through a JSTL expression today can be the source or destination of model tier data for a JavaServer Faces component. -Tony Craig -- 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: The display:* tag library
To be clear I was just outlining what I thought would be an improved display-like taglib. I wish I actually had the time to implement it, but I don't. The behavior of the current taglib's sorting feature is non-intuitive when there are multiple pages. Also, there is no need to go to the database every time if you implement the first alternative I listed. That is, the user links the sortable column(s) to an Action which sorts the Collection stored in the session. I did consider the sorting plus paging problem and thought that maybe if there were multiple pages and the user clicked a sortable column while on page 5 they would just be taken back to page 1 after the Collection was sorted. However once you add the sorting capability then I'd bet there'd be an expectation that you should be able to provide a Comparator class name to the display2:column tag. I don't like having Java classnames in JSP attributes (another reason to get rid of the Decorator). And it is fairly simple to let the Action do the sorting of the Collection and it can use whatever Comparator it wants. -Jerome -Original Message- From: Ka-Wai Chan [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: The display:* tag library Please keep the sorting feature! It is used lots and helps performance as there isn't a need to hit the database everytime Ka-Wai Dave Hodson wrote: I disagree on the sorting feature -- I'd vote to keep it, as we use it heavily Dave -- Dave Hodson MessageCast, inc. Email: [EMAIL PROTECTED] http://www.messagecast.net -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 8:07 AM To: Struts Users Mailing List Subject: RE: The display:* tag library I think a complete rewrite is needed AND a new API (same tags but different tag attributes). Thus I would say an entirely new tag library. I'll call the new version display2 and the current one display1 for clarity below. - Follow JSTL conventions for attribute names and support JSTL-EL. (Actually make use of the JSTL Tag support classes). This means JSP 1.2 is baseline. Assuming JSTL-EL capable attributes allows us to make a simpler tag API. Less attributes are needed. For example we don't need the Struts-like bean-name and bean-property attributes. - Drop the sorting feature. The user can provide this functionality by making their column names links to actions which resort their list. Or their query form can have order by criteria. The display1 taglib only provides resort of contents in current page which I think is confusing to users if there are multiple pages. - The display2:table tag should work as an IterationTag. The display1 doesn't therefore you cannot access a scripting variable for the current row of the iteration. You are forced to use Decorators. This is non-standard as per Struts or JSTL. I vote for removing the Decorator functionality. - The display2:column should allow optional body content. If present its output is used in the table cell. A first stab at the API might look like this. Table - display2:table [var=varName] items=collection [varStatus=varStatusName] [begin=begin] [end=end] [step=step] [pageSize=pageSize] [pageUrl=pageUrl] [cssClassPrefix=cssClassPrefix] body content /display2:table Where var, items, varStatus, begin, end, and step have the same meaning as JSTL's c:forEach tag. And pageSize and pageUrl have same meaning as in display1 taglib. The display1 taglib generates HTML tags using CSS class names. You can't define what these names will be so in display2 the cssClassPrefix can be used to prefix the auto generated CSS names. A div tag around the entire table works too so maybe this attribute isn't necessary? Column -- display2:column title=title [value=value] body content /display2:column Title has the same meaning as in display1, except that it is mandatory. Value is optional, but must be present if there is no body content. The evaluation of value goes in the contents of the cell. The optional body content is used in the cell if there is no value attribute or if the value attribute results in null. That's a first stab and it probably is missing stuff. Maybe an escapeXml attribute should be added to both tags? Any thoughts on this? -Original Message- From: Charles Brault [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 10:09 AM To: [EMAIL PROTECTED] Subject: Re: The display:* tag library +1 I've added support for Struts messages in column titles, glad to contribute it. Since I really depend on this library for a product I've developed, and need to fix some problems, make some additions, I'd be pleased to work with others on improving this great piece of code, perhaps
RE: The display:* tag library
That depends on the complexity of the query (number of joins, etc.) and the size of the result set. I'll bet the JVM can sort a ten item List faster than a database call. It also depends on how your application is tiered. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 3:56 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: The display:* tag library Your database should *always* sort a result faster than any code you write. So there is usually no reason to sort it yourself unless your db connection is terribly slow. David From: Jerome Jacobsen [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: The display:* tag library Date: Fri, 24 Jan 2003 15:50:01 -0500 To be clear I was just outlining what I thought would be an improved display-like taglib. I wish I actually had the time to implement it, but I don't. The behavior of the current taglib's sorting feature is non-intuitive when there are multiple pages. Also, there is no need to go to the database every time if you implement the first alternative I listed. That is, the user links the sortable column(s) to an Action which sorts the Collection stored in the session. I did consider the sorting plus paging problem and thought that maybe if there were multiple pages and the user clicked a sortable column while on page 5 they would just be taken back to page 1 after the Collection was sorted. However once you add the sorting capability then I'd bet there'd be an expectation that you should be able to provide a Comparator class name to the display2:column tag. I don't like having Java classnames in JSP attributes (another reason to get rid of the Decorator). And it is fairly simple to let the Action do the sorting of the Collection and it can use whatever Comparator it wants. -Jerome -Original Message- From: Ka-Wai Chan [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 3:14 PM To: Struts Users Mailing List Subject: Re: The display:* tag library Please keep the sorting feature! It is used lots and helps performance as there isn't a need to hit the database everytime Ka-Wai Dave Hodson wrote: I disagree on the sorting feature -- I'd vote to keep it, as we use it heavily Dave -- Dave Hodson MessageCast, inc. Email: [EMAIL PROTECTED] http://www.messagecast.net -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 8:07 AM To: Struts Users Mailing List Subject: RE: The display:* tag library I think a complete rewrite is needed AND a new API (same tags but different tag attributes). Thus I would say an entirely new tag library. I'll call the new version display2 and the current one display1 for clarity below. - Follow JSTL conventions for attribute names and support JSTL-EL. (Actually make use of the JSTL Tag support classes). This means JSP 1.2 is baseline. Assuming JSTL-EL capable attributes allows us to make a simpler tag API. Less attributes are needed. For example we don't need the Struts-like bean-name and bean-property attributes. - Drop the sorting feature. The user can provide this functionality by making their column names links to actions which resort their list. Or their query form can have order by criteria. The display1 taglib only provides resort of contents in current page which I think is confusing to users if there are multiple pages. - The display2:table tag should work as an IterationTag. The display1 doesn't therefore you cannot access a scripting variable for the current row of the iteration. You are forced to use Decorators. This is non-standard as per Struts or JSTL. I vote for removing the Decorator functionality. - The display2:column should allow optional body content. If present its output is used in the table cell. A first stab at the API might look like this. Table - display2:table [var=varName] items=collection [varStatus=varStatusName] [begin=begin] [end=end] [step=step] [pageSize=pageSize] [pageUrl=pageUrl] [cssClassPrefix=cssClassPrefix] body content /display2:table Where var, items, varStatus, begin, end, and step have the same meaning as JSTL's c:forEach tag. And pageSize and pageUrl have same meaning as in display1 taglib. The display1 taglib generates HTML tags using CSS class names. You can't define what these names will be so in display2 the cssClassPrefix can be used to prefix the auto generated CSS names. A div tag around the entire table works too so maybe this attribute isn't necessary? Column -- display2:column
RE: The display:* tag library
I think a complete rewrite is needed AND a new API (same tags but different tag attributes). Thus I would say an entirely new tag library. I'll call the new version display2 and the current one display1 for clarity below. - Follow JSTL conventions for attribute names and support JSTL-EL. (Actually make use of the JSTL Tag support classes). This means JSP 1.2 is baseline. Assuming JSTL-EL capable attributes allows us to make a simpler tag API. Less attributes are needed. For example we don't need the Struts-like bean-name and bean-property attributes. - Drop the sorting feature. The user can provide this functionality by making their column names links to actions which resort their list. Or their query form can have order by criteria. The display1 taglib only provides resort of contents in current page which I think is confusing to users if there are multiple pages. - The display2:table tag should work as an IterationTag. The display1 doesn't therefore you cannot access a scripting variable for the current row of the iteration. You are forced to use Decorators. This is non-standard as per Struts or JSTL. I vote for removing the Decorator functionality. - The display2:column should allow optional body content. If present its output is used in the table cell. A first stab at the API might look like this. Table - display2:table [var=varName] items=collection [varStatus=varStatusName] [begin=begin] [end=end] [step=step] [pageSize=pageSize] [pageUrl=pageUrl] [cssClassPrefix=cssClassPrefix] body content /display2:table Where var, items, varStatus, begin, end, and step have the same meaning as JSTL's c:forEach tag. And pageSize and pageUrl have same meaning as in display1 taglib. The display1 taglib generates HTML tags using CSS class names. You can't define what these names will be so in display2 the cssClassPrefix can be used to prefix the auto generated CSS names. A div tag around the entire table works too so maybe this attribute isn't necessary? Column -- display2:column title=title [value=value] body content /display2:column Title has the same meaning as in display1, except that it is mandatory. Value is optional, but must be present if there is no body content. The evaluation of value goes in the contents of the cell. The optional body content is used in the cell if there is no value attribute or if the value attribute results in null. That's a first stab and it probably is missing stuff. Maybe an escapeXml attribute should be added to both tags? Any thoughts on this? -Original Message- From: Charles Brault [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 10:09 AM To: [EMAIL PROTECTED] Subject: Re: The display:* tag library +1 I've added support for Struts messages in column titles, glad to contribute it. Since I really depend on this library for a product I've developed, and need to fix some problems, make some additions, I'd be pleased to work with others on improving this great piece of code, perhaps be the pumpkin keeper if no one else will do it (although I'm reluctant to volunteer, as I haven't performed that role before, except as a gardner ;-) chaz -- Charles E Brault [EMAIL PROTECTED] Where are we going, and why am I in this handbasket? -- 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: The display:* tag library
Good idea. Makes sense to me. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 11:50 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: The display:* tag library What do you think of two tag libs: pager:* table:* The pager:* uses the base paging API where the table:* builds on the paging API to incorporate HTML generation to provide the widget. I think this would provide a more flexible library for those developers that want to use the paging functionality but whose design constraints are not met by the HTML generation functionality. robert -- 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: Tag to print value of a parameter?
If you have a JSP 1.2 container then you can use JSTL like this: c:out value='${param[name]}'/ param is an implicit object in JSTL (it is a Map). -Original Message- From: Ben Starr [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 9:17 PM To: [EMAIL PROTECTED] Subject: Tag to print value of a parameter? Is there a tag to print the value of a parameter in Struts 1.1? I know you can base logic conditions on the value of a parameter and print values from beans but I can't find a way to print the value of a parameter to the page. Obviously it is just a short scriptlet such as: %= request.getParameter(name) % but it would be nicer to do it with a struts tag. If such a tag is not available then I suggest it should be added! Thanks, Ben Starr -- 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: To check if user is logged in
3. Have an abstract BaseAction class for your webapp. All of your concrete Actions subclass your BaseAction. Perform the login check in the BaseAction's execute method. Make the BaseAction's execute method final. BaseAction defines an abstract method called executeAction which the subclasses must implement to do their processing. BaseAction's execute method calls executeAction after performing the login check. The big downside to the above approach is that if you want to make use of other Struts Actions like ForwardAction or LookupDispatchAction then you can't. We'll you can but then you have to subclass each of these and add your login check which leads to a proliferation of classes. -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 7:58 AM To: 'Struts Users Mailing List' Subject: RE: To check if user is logged in Hi, I can think of the following 1. Write Request Filters according to the Servlet spec. 2. Extend the Struts1.1 RequestProcessor Mohan -Original Message- From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 6:21 PM To: 'Struts Users Mailing List' Subject: RE: To check if user is logged in Hi, Are you talking about CheckLoginTag.java in struts-example.war? This implements the check using a custom tag. But I need to forward to login page even before I forward my request to the JSP, in my controller itself. Suresh -Original Message- From: julian green [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 6:22 PM To: Struts Users Mailing List Subject: Re: To check if user is logged in have a look at the struts example that comes with struts. It has an example of what you are doing in there. -- To unsubscribe, e-mail: mailto:struts-user-[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: XML to PDF
I think you can name your action with a .pdf extension, something like http://localhost/xmltopdf.do.pdf. Not sure what you'd have to do with the action mappings to allow this to work. Some versions of IE seem to use the URL 'document' extension and the client systems extension to application mapping over using the content type set in the HTTP response header. -Original Message- From: Jarnot Voytek Contr AU HQ/SC [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 3:14 PM To: 'Struts Users Mailing List' Subject: RE: XML to PDF Speaking of FOP, has anyone successfully streamed PDF to IE using FOP? I keep getting a blank screen, but mozilla works fine. And yes, I have tried streaming to a ByteArrayOutputStream first, so that I could set response.contentLength, but that didn't help... -Original Message- From: Raible, Matt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 2:12 PM To: 'Struts Users Mailing List' Subject: RE: XML to PDF Check out FOP from Apache's XML project: http://xml.apache.org/fop/index.html -Original Message- From: Yan, Charlene [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 21, 2003 1:07 PM To: Struts Users Mailing List Subject: XML to PDF Hello all, I just got assigned to convert XML to pdf to do reports. Is any of you working on it? Any insights where I should get started my research? I am looking at xmlmil and aparche xml home right now. Thanks in advance for your help! Charlene -- 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: Value Object Size
You could Serialize it to a byte array and then output the size of the byte array. Or Serialize it to a file and look at the file size. -Original Message- From: Justin Ashworth [mailto:[EMAIL PROTECTED]] Sent: Monday, January 20, 2003 11:30 AM To: Struts Users Mailing List Subject: Re: Value Object Size If you're talking about the size of the object in memory, you will probably need a profiling tool such as OptimizeIt or JProbe. http://www.optimizeit.com http://www.jprobe.com - Original Message - From: Hari Venkatesan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 20, 2003 11:13 AM Subject: Value Object Size Is there a way to find out the size of a Value Object. (viz., I have a bean defined and have populated the bean with data from database.) I need to know the final size of this bean Hari -- 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: logic:equal and EdHill Display taglib
If you're trying to conditionally hyperlink the contents of a certain column of the current row then you'll have to use a Decorator. The current row of the list is not exposed in a scripting variable or scoped variable. For the reason why see http://edhill.its.uiowa.edu/display-examples-0.8/example-imp-objects.jsp -Jerome -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED]] Sent: Monday, January 20, 2003 12:01 PM To: [EMAIL PROTECTED] Subject: logic:equal and EdHill Display taglib Greetings, I'm currently using EdHills Display taglib to iterate over some search results and render them in a table. I would also like to hyper link the contents of a column if certain conditions apply. In short, I'm looking for a way to expose the iterator element so that I can use the /logic:equal .../. Looking at the the code in appears that TableTag publishes the iterator element to the pageContext as an attribute named smartRow (see getHTMLData()). This becomes the default name if a name is not supplied by ColumnTag. This implies that I should be able to gain data access to the smartRow. I tried logic:equal name=smartRow property=myProperty value=myValue scope=pagestuff/logic:equal and I keep getting an exception that says the following: javax.servlet.jsp.JspException: No bean found under attribute key smartRow I even tried a scriptlet to just print the contents of the element and I'm getting an NullPointerException (because I call toString() on the object, which apparently is null) Is there an easier way, or am I missing something? Any advice would be appreciated. robert -- 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: [OT][JavaScript][i18n] How to get a date with a user?
One pickup line I've heard is Excuse me, do you have the time?, but I've never used it myself as I make it a policy not to date my users. Seriously, another option is to have user Preferences that are supplied at registration time and can be edited later. Then they don't have to keep supplying their Timezone at each login and you don't have to muck with Javascript. But I would also be curious to see a stable cross-browser Javascript solution to this problem. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 6:35 AM To: Struts Subject: [OT][JavaScript][i18n] How to get a date with a user? Anyone know a good way of getting a java.util.TimeZone object corresponding to the users timezone (that doesnt involve having them manually specify it at login which is what Im looking at having to do now), so that I can display various dates to them in local time? I thought of getting the difference between the users local time and gmt(utc) based on the value of javascript's Date.getTimezoneOffset() function (using the current date) submitting this in a hidden field on the login page and then instantiating a 'custom' timezone based on this - but this wont take into account the daylight savings rules that apply to the users location - thus certain datetimes will end up being rendered incorrectly when I show them in the users local time... (For example if the date is for a time during dst and the user is currently not in dst or vice versa) I also thought of rendering the dates as javscript code that instantiates a javascript Date object based on the dates utc value and then renders itself into the appropriate location into the dom which would thus be making use of JavaScripts support for the users local daylight savings rules on a per-date basis, but following experimentation it seems that (in IE at least) this doesnt provide any language sensitive rendering - always using English, so Ive ruled this out (kind of a relief considering how much bother and how hack-ish it is!). Of course if I can just get the dratted TimeZone, then its a simple matter to convert the date in question into a suitable string for display to that user: TimeZone timeZone = supplied by magic - arrgh! Locale locale = supplied by struts :-) String formatString = EEE MMM dd HH:mm:ss zzz ; //Or some nicer looking format DateFormat df = new SimpleDateFormat(formatString,locale); df.setTimeZone(timeZone); String displayDateText = df.format(date); -- 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: QUESTIONS: Ed Hill's Display Custom Tag Library
I sent Ed an email yesterday asking him the status too. No reply yet. Instead of adding it to Struts I was hoping he'd add it to Jakarta Taglibs. He used the packaging names of Jakarta Taglibs for his classes so I am hopeful. I would like to see the JSTL-EL ability added to it as well. It is a fantastic taglib. It would be a pity if its support/maintenance fizzled out. -Original Message- From: Hohlen, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 2:08 PM To: Struts-User (E-mail) Subject: QUESTIONS: Ed Hill's Display Custom Tag Library I know a lot developers are using Ed Hill's Display custom tag library. About a week ago I sent Ed an e-mail asking him about the status of this very useful library. Unfortunately, I haven't received any type of response. I was wondering if anyone else might know the answers to my questions. Below is the e-mail I sent Ed. Thanks in advance, JOHN Hi Ed, I was wondering what the latest status was of your Display custom tag library was. I noticed there hasn't been any updates since version 0.8 in May 2002. More specifically: 1) Are you or anyone else working on any new features for a next release? 2) Do you think your library will get added to Struts? 3) Are you considering the support of the Expression Language found in JSTL? I've heard lots of good things about your tags. I'm just trying to get a status update as my team explores the possibility of using your library along side Struts JSTL custom tags. Thanks, JOHN HOHLEN -- 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: Passing parameters with requestURI of display:table tag
See Struts html:rewrite tag. It should make your life easier. Something like this: bean:define id='pagingRequestURI' html:rewrite page='/myAction.do' paramName='myField'/ /bean:define display:table requestURI='%= pagingRequestURI %' ... However in the rewrite you'll need myField to be a scoped variable (bean). -Original Message- From: Susan Bradeen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 3:11 PM To: [EMAIL PROTECTED] Subject: Passing parameters with requestURI of display:table tag And speaking of Ed Hill's Display tags (yes, very useful) ... I am having trouble figuring out how to pass parameters with the requestURI attribute of a display:table tag without breaking the paging functionality. I've got an Action path set to the requestURI, and the display:table tag automatically adds on the ?page=# parameter for each header page link. All is well. Now I am using the tags with an Action that requires an input parameter in order to rebuild the JSP. (As ugly as the following code is) I add my parameter to the requestURI, but then end up with two ? in the resolved url. I have in my JSP: snip display:table name=myform property=myList pagesize=15 requestURI='%=((String)request.getAttribute(modulePrefix)). concat(/myAction.do?field= + request.getParameter(myField) + ))%' decorator=com.myCompany.decorator.myDecorator /snip This resolves to http:/... /myAction.do?field=someValue?page=2 for the url of my list page 2. Within the display:column tag you can use the paramName and paramId properties, but they are not available for display:table. In scanning through the TableTag source code, it looks like there is a check for the presence of a ? in the url, which should cause the page parameter to get added on the end like page=2. However, this is not happening. Hopefully, I am missing something basic. Has anyone had experience with this? I hope my question is clear, I could really use some help! Thanks, Susan Bradeen SoftLanding Systems, Inc [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: Passing parameters with requestURI of display:table tag
Correction: need the paramId attribute too: html:rewrite page='/myAction.do' paramId='myField' paramName='myFieldBean'/ -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 3:30 PM To: Struts Users Mailing List Subject: RE: Passing parameters with requestURI of display:table tag See Struts html:rewrite tag. It should make your life easier. Something like this: bean:define id='pagingRequestURI' html:rewrite page='/myAction.do' paramName='myField'/ /bean:define display:table requestURI='%= pagingRequestURI %' ... However in the rewrite you'll need myField to be a scoped variable (bean). -Original Message- From: Susan Bradeen [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 3:11 PM To: [EMAIL PROTECTED] Subject: Passing parameters with requestURI of display:table tag And speaking of Ed Hill's Display tags (yes, very useful) ... I am having trouble figuring out how to pass parameters with the requestURI attribute of a display:table tag without breaking the paging functionality. I've got an Action path set to the requestURI, and the display:table tag automatically adds on the ?page=# parameter for each header page link. All is well. Now I am using the tags with an Action that requires an input parameter in order to rebuild the JSP. (As ugly as the following code is) I add my parameter to the requestURI, but then end up with two ? in the resolved url. I have in my JSP: snip display:table name=myform property=myList pagesize=15 requestURI='%=((String)request.getAttribute(modulePrefix)). concat(/myAction.do?field= + request.getParameter(myField) + ))%' decorator=com.myCompany.decorator.myDecorator /snip This resolves to http:/... /myAction.do?field=someValue?page=2 for the url of my list page 2. Within the display:column tag you can use the paramName and paramId properties, but they are not available for display:table. In scanning through the TableTag source code, it looks like there is a check for the presence of a ? in the url, which should cause the page parameter to get added on the end like page=2. However, this is not happening. Hopefully, I am missing something basic. Has anyone had experience with this? I hope my question is clear, I could really use some help! Thanks, Susan Bradeen SoftLanding Systems, Inc [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: cannot find bean error
Hi Tobias, What you are doing looks OK to me. You are correct in that you do NOT need to do the following in your action: I added this line: request.setAttribute(mitarbeiterAuswahlForm,mitarbeiterAuswahlForm); The bean is already stored in the session by the framework before your action is called. Without seeing the rest of your JSP it is difficult to tell why you are getting the error. Try adding the following near the beggining of your JSP: jsp:useBean id = mitarbeiterAuswahlForm class=de.adesso.aproda.forms.MitarbeiterAuswahlForm scope=session/ If that got rid of the problem then you may have been accessing the bean in the JSP via other standard JSP tags. -Jerome -Original Message- From: Tobias Flohre [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 22, 2002 9:09 AM To: [EMAIL PROTECTED] Subject: cannot find bean error Hello everybody, I have a serious problem, I already looked up all the list but didn't get any information helping me to solve it. I am new to struts, so maybe it is a simple thing, please take a look! I have an action mitarbeiterAuswahlShow filling a form bean MitarbeiterAuswahlForm, here the parts of the struts-config.xml: form-bean name=mitarbeiterAuswahlForm type=de.adesso.aproda.forms.MitarbeiterAuswahlForm/ actionpath=/mitarbeiterauswahlShow type=de.adesso.aproda.actions.MitarbeiterauswahlShowAction name=mitarbeiterAuswahlForm scope=session parameter=method forward name=show path=/mitarbeiterauswahl.jsp/ /action When the action is called, the code is processed (i have some system.out.println in the action class, it looks good there). The server tells me this: 2002-12-22 02:37:13 - path= :action: Storing instance under attribute 'mitarbeiterAuswahlForm' in scope 'session' which sounds pretty good to me, too. But when I want to access mitarbeiterauswahlForm in the jsp, I get this: javax.servlet.ServletException: Cannot find bean mitarbeiterAuswahlForm in scope session What are possible reasons for this?? For further information I add some snippets from the action class and the jsp: MitarbeiterAuswahlForm mitarbeiterAuswahlForm = (MitarbeiterAuswahlForm)form; ... mitarbeiterAuswahlForm.setMitarbeiter (mitarbeiter); mitarbeiterAuswahlForm.setStudenten (studenten); return mapping.findForward(show); I added this line: request.setAttribute(mitarbeiterAuswahlForm,mitarbeiterAuswahlForm); in the action class, but it is not necessary to do this by myself, right? struts should put in the scope, no? and the jsp: bean:define id=mitarbeiterListe name=mitarbeiterAuswahlForm property =mitarbeiter/ html:select styleClass=textbox size=1 tabindex=3 property =mitarbeiterID html:options collection=mitarbeiterListe property=id labelProperty =name / /html:select Thanks for any help!!! Tobias -- 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: [Book Review] Struts Kick Start
-Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] What's not so good? Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action. Now, I realise that example code is not the same thing as robust, production-ready code, but when people are first learning a language or framework, they tend to copy exactly what they see in the book they are learning from. Even though example code should be light on error checking, it should be heavy on correctness and good style. This is not a critique of your critique, but more of a question on design that has been bugging me recently. So you shouldn't use the business objects in the Actions. What should you do instead? Create a Service Layer as described in Fowlers new patterns book? If I remember correctly Fowler says he doesn't use this pattern very much. He accesses the Domain Model from the controller (in Struts the Action). Now it may be that what one designer puts in a Service Layer Fowler instead puts in the Domain Model. I dunno. I'm torn on whether to use the Service Layer approach. My current feeling is to leave it out unless it adds value initially. It would add value initially if you have multiple font-end frameworks whose controllers end up doing the same things to the Domain Model. If you leave it out and end up needing to support a non-Struts framework *whose controllers do nearly the same things as your Struts Actions* then refactor a Service Layer into your application. But I think front-ends can differ significantly in their Domain Model usage. A web front end for a palmpilot or cell phone would result in a lot of Actions being called relative to a desktop browser client. It would use the Domain Model differently than the desktop browser case. Therefore the Service Layer would provide little value. A Swing client may have very different usage patterns too because of the statefullness. I'm not speaking from experience here since I've only done Struts apps where the only clients were desktop browsers. I think that defining the service layer without having multiple clients *with similar usage patterns* may end up being a big waste of time and effort and you may get it wrong anyway. Any other thoughts? I'm happy to be proven wrong and to see the light. I just don't see it yet. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Where does the servlet.log(String) output go?
This is true for Tomcat, but not necessarily for other servlet containers. Check your servlet container documentation. -Original Message- From: Robert J. Lebowitz [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 6:20 PM To: Struts Users Mailing List Subject: Re: Where does the servlet.log(String) output go? I'm no expert, but usually you have specified Loggers in your server.xml configuration file. If you've specified a distinct Logger for a the Context in which your servlet operates, then it should appear in the log file specified there. Rob -- 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: Move to TilesRequestProcessor results in forwarding exception.
If I specify a Tiles definition file I must supply at least one definition. Otherwise I get this: org.xml.sax.SAXParseException: The content of element type tiles-definitions is incomplete, it must match (definition)+. So my Tiles definition file looks like: tiles-definitions definition name=dummy path=/layouts/dummyLayout.jsp/ /tiles-definitions The file layouts/dummyLayout.jsp does not actually exist. However I seem to get no errors at runtime. So I think I've got the right configuration now to proceed with a refactoring toward Tiles. Whew! -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 5:26 PM To: Struts Users Mailing List Subject: RE: Move to TilesRequestProcessor results in forwarding exception. With just the controller processorClass=org.apache.struts.tiles.TilesRequestProcessor/ I get the following error. 2002-12-13 17:07:57 action: Error - TilesRequestProcessor : Definition Factory not found for subapp ''. Do you have declared appropriate plugin in struts-config.xml ? If instead I use the plug-in element in struts-config I get the following log. 2002-12-13 17:19:05 action: Tiles definition factory loaded for processor ''. When accessing the webapp I get a runtime exception. 2002-12-13 17:20:26 ApplicationDispatcher[/StrutsLogTest] Servlet.service() for servlet action threw exception java.lang.NullPointerException at org.apache.struts.tiles.xmlDefinition.FactorySet.getDefinition(Fac torySet.ja va:156) It appears that a definitions file is required. But from reading both the package documentation, Husted's Tiles chapter, and Caverness' Tiles chapter they all indicate that the definitions file is optional. I wanted to refactor toward the use of a definitions file (following Husted's instructions in his Tiles chapter). I guess I can add a dummy definition and see if that appeases tiles. Any thoughts on this? -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 12:46 PM To: Struts Users Mailing List Subject: RE: Move to TilesRequestProcessor results in forwarding exception. Cedric, My webapp makes no use of Tiles yet. The first step in my refactoring was to add the tiles plug-in. That is where I'm stuck. I have no tiles definitions yet. So do I still need a tiles definitions file? For some reason I can't get Tiles logging to work. I see that it uses the servlet.log but I can't get that to work either. Tried setting debug to 99 in web.xml but it has no effect. I'll keep trying to get logging to work and let you know what I see. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 5:21 PM To: Struts Users Mailing List Subject: Re: Move to TilesRequestProcessor results in forwarding exception. Well, let start on good basis: to use Tiles, you should declare the tiles plugin and specify a tiles config file. You don't need to specify the TilesRequestProcessor yourself. The debug s properties of TilesRequestProcessor don't work anymore: they are replaced by a common logging mechanism. You should see some messages from the TilesPlugin, indicating what happens. Cedric Jerome Jacobsen wrote: OK. I added the following to my struts-config: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor debug=9/ plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ /plug-in And the following to my log4j.properties (in case Tiles uses Commons Logging): log4j.category.org.apache.struts.tiles=DEBUG The logging output shows no Tiles logs. It is: Target URL -- http://localhost:8080/Sandbox-FPRSAcceptanceClient-context-root/index.jsp 2002-12-12 16:38:08,073 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - BEGIN execute(ActionMapping,...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - BEGIN initialize(ActionMapping, ...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Unable to find localeForm in the session. 2002-12-12 16:38:08,203 [HttpRequestHandler-532] WARN com.metalsa.orator.fprs.ui.web.struts.ModelFacade - Get Locales from database. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Added localeForm to the session. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - END initialize
RE: Move to TilesRequestProcessor results in forwarding exception.
Cedric, My webapp makes no use of Tiles yet. The first step in my refactoring was to add the tiles plug-in. That is where I'm stuck. I have no tiles definitions yet. So do I still need a tiles definitions file? For some reason I can't get Tiles logging to work. I see that it uses the servlet.log but I can't get that to work either. Tried setting debug to 99 in web.xml but it has no effect. I'll keep trying to get logging to work and let you know what I see. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 5:21 PM To: Struts Users Mailing List Subject: Re: Move to TilesRequestProcessor results in forwarding exception. Well, let start on good basis: to use Tiles, you should declare the tiles plugin and specify a tiles config file. You don't need to specify the TilesRequestProcessor yourself. The debug s properties of TilesRequestProcessor don't work anymore: they are replaced by a common logging mechanism. You should see some messages from the TilesPlugin, indicating what happens. Cedric Jerome Jacobsen wrote: OK. I added the following to my struts-config: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor debug=9/ plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ /plug-in And the following to my log4j.properties (in case Tiles uses Commons Logging): log4j.category.org.apache.struts.tiles=DEBUG The logging output shows no Tiles logs. It is: Target URL -- http://localhost:8080/Sandbox-FPRSAcceptanceClient-context-root/index.jsp 2002-12-12 16:38:08,073 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - BEGIN execute(ActionMapping,...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - BEGIN initialize(ActionMapping, ...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Unable to find localeForm in the session. 2002-12-12 16:38:08,203 [HttpRequestHandler-532] WARN com.metalsa.orator.fprs.ui.web.struts.ModelFacade - Get Locales from database. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Added localeForm to the session. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - END initialize(ActionMapping, ...) 2002-12-12 16:38:08,433 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - END execute(ActionMapping,...) processActionForward(/getErrorSeverityLocs.do, false) I get the exception in the web browser, not in the logs. It is: 500 Internal Server Error javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 void _index._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) [/index.jsp] index.jsp:8 void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) HttpJsp.java:139 void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.Http ServletRequ est, javax.servlet.http.HttpServletResponse, java.lang.String) JspPageTable.java:317 void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.htt p.HttpServl etRequest, javax.servlet.http.HttpServletResponse) JspServlet.java:465 void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpSe rvletReques t, javax.servlet.http.HttpServletResponse) JspServlet.java:379 void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) HttpServlet.java:853 void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.S ervletReque st, javax.servlet.ServletResponse) ServletRequestDispatcher.java:721 void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax. servlet.Ser vletRequest, javax.servlet.http.HttpServletResponse) ServletRequestDispatcher.java:306 boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[ Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0
RE: Move to TilesRequestProcessor results in forwarding exception.
With just the controller processorClass=org.apache.struts.tiles.TilesRequestProcessor/ I get the following error. 2002-12-13 17:07:57 action: Error - TilesRequestProcessor : Definition Factory not found for subapp ''. Do you have declared appropriate plugin in struts-config.xml ? If instead I use the plug-in element in struts-config I get the following log. 2002-12-13 17:19:05 action: Tiles definition factory loaded for processor ''. When accessing the webapp I get a runtime exception. 2002-12-13 17:20:26 ApplicationDispatcher[/StrutsLogTest] Servlet.service() for servlet action threw exception java.lang.NullPointerException at org.apache.struts.tiles.xmlDefinition.FactorySet.getDefinition(FactorySet.ja va:156) It appears that a definitions file is required. But from reading both the package documentation, Husted's Tiles chapter, and Caverness' Tiles chapter they all indicate that the definitions file is optional. I wanted to refactor toward the use of a definitions file (following Husted's instructions in his Tiles chapter). I guess I can add a dummy definition and see if that appeases tiles. Any thoughts on this? -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 12:46 PM To: Struts Users Mailing List Subject: RE: Move to TilesRequestProcessor results in forwarding exception. Cedric, My webapp makes no use of Tiles yet. The first step in my refactoring was to add the tiles plug-in. That is where I'm stuck. I have no tiles definitions yet. So do I still need a tiles definitions file? For some reason I can't get Tiles logging to work. I see that it uses the servlet.log but I can't get that to work either. Tried setting debug to 99 in web.xml but it has no effect. I'll keep trying to get logging to work and let you know what I see. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 5:21 PM To: Struts Users Mailing List Subject: Re: Move to TilesRequestProcessor results in forwarding exception. Well, let start on good basis: to use Tiles, you should declare the tiles plugin and specify a tiles config file. You don't need to specify the TilesRequestProcessor yourself. The debug s properties of TilesRequestProcessor don't work anymore: they are replaced by a common logging mechanism. You should see some messages from the TilesPlugin, indicating what happens. Cedric Jerome Jacobsen wrote: OK. I added the following to my struts-config: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor debug=9/ plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ /plug-in And the following to my log4j.properties (in case Tiles uses Commons Logging): log4j.category.org.apache.struts.tiles=DEBUG The logging output shows no Tiles logs. It is: Target URL -- http://localhost:8080/Sandbox-FPRSAcceptanceClient-context-root/index.jsp 2002-12-12 16:38:08,073 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - BEGIN execute(ActionMapping,...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - BEGIN initialize(ActionMapping, ...) 2002-12-12 16:38:08,103 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Unable to find localeForm in the session. 2002-12-12 16:38:08,203 [HttpRequestHandler-532] WARN com.metalsa.orator.fprs.ui.web.struts.ModelFacade - Get Locales from database. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] INFO com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - Added localeForm to the session. 2002-12-12 16:38:08,223 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.InitializingAction - END initialize(ActionMapping, ...) 2002-12-12 16:38:08,433 [HttpRequestHandler-532] DEBUG com.metalsa.orator.fprs.ui.web.struts.actions.FprsBaseAction - END execute(ActionMapping,...) processActionForward(/getErrorSeverityLocs.do, false) I get the exception in the web browser, not in the logs. It is: 500 Internal Server Error javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 void _index._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) [/index.jsp] index.jsp:8 void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) HttpJsp.java:139 void oracle.jsp.runtimev2
Move to TilesRequestProcessor results in forwarding exception.
I just added the following to my *non-tiles* Struts 1.1b2 app configuration file: plug-in className=org.apache.struts.tiles.TilesPlugin/ As I understand it this should replace the RequestProcessor with the TilesRequestProcessor. Well something changed because now I get an exception when my Action forwards to another Action via a global forward. javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 If I remove the Tiles plug-in from struts-config it works again. I want to refactor to Tiles but step one has failed. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Move to TilesRequestProcessor results in forwarding exception.
Interesting. With the plug-in tag removed I added the following: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor/ Now it works! So what was wrong with the plug-in usage? Was I supposed to add some required set-property tags? -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 2:53 PM To: Struts User Subject: Move to TilesRequestProcessor results in forwarding exception. I just added the following to my *non-tiles* Struts 1.1b2 app configuration file: plug-in className=org.apache.struts.tiles.TilesPlugin/ As I understand it this should replace the RequestProcessor with the TilesRequestProcessor. Well something changed because now I get an exception when my Action forwards to another Action via a global forward. javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 If I remove the Tiles plug-in from struts-config it works again. I want to refactor to Tiles but step one has failed. -- 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: Move to TilesRequestProcessor results in forwarding exception.
The tiles documentation states: You don't need to specify a TilesRequestProcessor, this is automatically done by the plug-in. If, however, you want to specify your own RequestProcessor, this later should extends the TilesRequestProcessor. The plug-in checks check this constraint. So I didn't think I needed to add the controller as you say. However I tried it anyway and I still get the exception. If I remove the plug-in but keep the controller it works, however I want to use the plug-in to define tiles definitions. -Original Message- From: Bhamani, Nizar A TL56E [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 3:01 PM To: 'Struts Users Mailing List' Subject: RE: Move to TilesRequestProcessor results in forwarding exception. You need to also do the following in your struts-config : controller processorClass=org.apache.struts.tiles.TilesRequestProcessor debug=0 bufferSize=4096 contentType=text/html locale=false maxFileSize=250M multipartClass=org.apache.struts.upload.CommonsMultipartRequestHandler nocache=false inputForward=false / Nizar Bhamani -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 2:53 PM To: Struts User Subject: Move to TilesRequestProcessor results in forwarding exception. I just added the following to my *non-tiles* Struts 1.1b2 app configuration file: plug-in className=org.apache.struts.tiles.TilesPlugin/ As I understand it this should replace the RequestProcessor with the TilesRequestProcessor. Well something changed because now I get an exception when my Action forwards to another Action via a global forward. javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 If I remove the Tiles plug-in from struts-config it works again. I want to refactor to Tiles but step one has failed. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] CONFIDENTIALITY This e-mail and any attachments are confidential and also may be privileged. If you are not the named recipient, or have otherwise received this communication in error, please delete it from your inbox, notify the sender immediately, and do not disclose its contents to any other person, use them for any purpose, or store or copy them in any medium. Thank you for your cooperation. -- 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: Move to TilesRequestProcessor results in forwarding exception.
(maybe you need to enable the tiles logging) ? Cedric Jerome Jacobsen wrote: Interesting. With the plug-in tag removed I added the following: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor/ Now it works! So what was wrong with the plug-in usage? Was I supposed to add some required set-property tags? -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 2:53 PM To: Struts User Subject: Move to TilesRequestProcessor results in forwarding exception. I just added the following to my *non-tiles* Struts 1.1b2 app configuration file: plug-in className=org.apache.struts.tiles.TilesPlugin/ As I understand it this should replace the RequestProcessor with the TilesRequestProcessor. Well something changed because now I get an exception when my Action forwards to another Action via a global forward. javax.servlet.jsp.JspException: Exception forwarding for name displayErrorMaintSearch: javax.servlet.ServletException: Error in servlet int org.apache.struts.taglib.logic.ForwardTag.doEndTag() ForwardTag.java:180 If I remove the Tiles plug-in from struts-config it works again. I want to refactor to Tiles but step one has failed. -- 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: [Way-OT] Struts and Swing
If you aren't required to use Struts as the web framework you might consider one of the open-source frameworks that are Swing-like. There's Echo: http://www.nextapp.com/products/echo/ And Millstone: http://millstone.org/ -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 5:58 PM To: Struts Users Mailing List Subject: Re: [Way-OT] Struts and Swing http://javaboutique.internet.com/tutorials/Swing/ ... and now there's another one: http://javaboutique.internet.com/tutorials/Swing2/ hammett wrote: Hi (I could not search the archives, the message text not available for search appeared) We're developing a system that have a swing and a web interface. The swing interface should be used for offline use of the system. We would love to write once and only once a lot of thing, including the front ends. Of course, we know the big differences of one and other, but struts have a declarative way to conduct navigation that we like aggregate to our offline system. First, have anyone tried it before? Do you think that it is the best bet? Regards hammett -- Eddie Bush -- 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]
Can DynaActionForm contain DynaActionForm?
All of the DynaActionForm examples I've seen contain simple Java types or regular JavaBeans. Can a DynaActionForm contain another DynaActionForm? Something like this: form-beans form-bean name=com.blah.LocaleForm type=org.apache.struts.action.DynaActionForm dynamic=true form-property name=selectedLocale type=com.blah.LocaleBean/ form-property name=locales type=java.util.Collection/ /form-bean form-bean name=com.blah.LocaleBean type=org.apache.struts.action.DynaActionForm dynamic=true form-property name=localeString type=java.lang.String/ form-property name=flagSrc type=java.lang.String/ /form-bean /form-beans Where LocaleForm is a DynaActionForm having a property LocaleBean which is also a DynaActionForm. Is this possible? -Jerome -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DynaActionForm problem - IllegalArgumentException: No bean specified
Oh Struts masters, I get an exception when Struts populates my DynaActionForm from request parameters. With DEBUG logging on I see the following: INFO org.apache.struts.action.RequestProcessor - Processing a 'POST' for path '/changeLocale' DEBUG org.apache.struts.util.RequestUtils - Looking for ActionForm bean instance in scope 'session' under attribute key 'localeForm' DEBUG org.apache.struts.util.RequestUtils - Recycling existing DynaActionForm instance of type 'localeForm' DEBUG org.apache.struts.util.RequestUtils - -- DynaActionForm[dynaClass=localeForm,locales={en_US,es_MX},selectedLocale=en_ US] DEBUG org.apache.struts.action.RequestProcessor - Storing ActionForm bean instance in scope 'session' under attribute key 'localeForm' DEBUG org.apache.struts.action.RequestProcessor - Populating bean properties from this request DEBUG org.apache.commons.beanutils.BeanUtils - BeanUtils.populate(DynaActionForm[dynaClass=localeForm,locales=NULL,select edLocale=NULL], {selectedLocale.localeString=[Ljava.lang.String;@d0}) DEBUG org.apache.commons.beanutils.BeanUtils - setProperty(DynaActionForm[dynaClass=localeForm,locales=NULL,selectedLocal e=NULL], selectedLocale.localeString, [es_MX]) DEBUG org.apache.commons.beanutils.BeanUtils - Target bean = null DEBUG org.apache.commons.beanutils.BeanUtils - Target name = localeString Looks like RequestUtils is getting the correct DynaActionForm from the session (logs 2,3,4). But then I don't understand why the BeanUtils logs show the properties to be NULL (logs 7,8,9). My DynaActionForm contains two properties. One is a JavaBean and the other is a Collection of JavaBeans. form-bean name=localeForm type=org.apache.struts.action.DynaActionForm dynamic=true form-property name=selectedLocale type=com.blah.LocaleBean/ form-property name=locales type=java.util.Collection/ /form-bean The element type of property locales is also com.blah.LocaleBean. com.blah.LocaleBean is very simple. It contains only one property called localeString which is a java.lang.String. Am I doing something wrong??? Environment: Struts 1.1b2 BeanUtils 1.5 (also tried 1.3) Tomcat 4.0.6 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts 1.1b2 tags yielding 'Cannot find message resources...'
Hi, I've used Struts 1.0 tags in my non-struts web applications with no problems. I simply never used the message resources related properties of any of the tags. Now with Struts 1.1b2 I get the following exception for a simple bean:write name='mybean'/. javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE Why the change? Why not allow the tags to be used outside of a Struts application as was possible in the 1.0 tags? -Jerome -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Robustly handle double-submit?
Hi, I've seen the Struts 1.1b2 example's use of the Token for transaction control technique. This is in EditRegistrationAction and SaveRegistrationAction. However, I'd like to know if there is a more robost solution to this problem. I'd like the ability to ignore the second posting and still return the results from the first. That is, act as if the second posting never occurred. Is there a way to do this? Can you give me an example? The problem with the Struts example's approach is that the user doesn't really know what to do next after the error is displayed. They don't get their display results from the first posting. Jerome -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: where can caching help performance
If you use the typical singleton pattern (private static member of the class) then they won't go away until the JVM terminates. Another alternative is to place them into application scope. There are many ways of doing this. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 10:12 AM To: [EMAIL PROTECTED] Subject: RE: where can caching help performance This may be a dumn question, but since its friday what the heck... If I wanted to build a bunch of business objects when the server starts and keep them as singletons or factory objects how would I get them to start up and stay alive after that... if I did it on the first request once the request finished the object would be cleaned up... ? -Original Message- From: jamienz [mailto:[EMAIL PROTECTED]] Sent: Friday, July 12, 2002 10:01 AM To: struts-user Subject: RE: where can caching help performance Out of curiosity, how did you implement the in-memory cache? One big (1 gig!) hashmap :-) or something more exotic? -- jamie -Original Message- From: Simon.Chappell [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 4:07 PM To: struts-user Subject: RE: where can caching help performance? We have found that the biggest bang for the buck comes with pre-fetching data out of the database and building our business objects ahead of time and storing them in an in-memory cache. This means that we have a very large cache (we estimate at least a gig when we get fully ramped up for phase one and more after that), but we get phenominal throughput from it. Our reason for this was a maximum processing time of 3.6 seconds and we knew that we could not allow the database access to be the choke point in the system. __ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Wow
Can you give us some details on the nice display tag library? Is it something you came up with, found and modified, or just found? What does it do for you? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 02, 2002 10:45 AM To: [EMAIL PROTECTED] Subject: Wow I got Dynaforms, Validator, Tiles, DynaBeans, a nice display tag library for table display, a nice DAO layer and a few other things all working in Struts. It took awhile to get everything working right but I am amazed at how little code it is taking now to do each part and how robust the application is! I highly recommend to anyone starting out like myself to add these into your library and spend time looking in the beanutils, etc... Excellent stuff! Thanks to all who helped me on this path and to the struts team -- 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: Collection for ResultSet
In a Data Access Object (DAO). Keep your business object as persistence agnostic as possible. http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/ -Jerome -Original Message- From: Dan Cancro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 2:01 PM To: 'Struts Users Mailing List' Subject: RE: Collection for ResultSet Where do folks do this? In their business object classes or their Action classes? Or some other place? -Original Message- From: Susmita Pati [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 10:58 AM To: 'Struts Users Mailing List' Subject: RE: Collection for ResultSet Putting it into a Vector is the perfect bet... -Original Message- From: Daniel Jaffa [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 1:53 PM To: Struts Users Mailing List Subject: Re: Collection for ResultSet ArrayList of java beans works great. - Original Message - From: Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, June 26, 2002 1:46 PM Subject: RE: Collection for ResultSet I just learned how to do this sort of database work yesterday. Obviously I'm no expert, but it seems like you should just do exactly what you thought. A ResultSet is generally not scrollable, so you should probably put the retrieved info in a collection. Any of those database experts out there should correct me if I'm wrong. ~ Keith -Original Message- From: Struts Newsgroup [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 1:40 PM To: [EMAIL PROTECTED] Subject: Collection for ResultSet Subject: Collection for ResultSet From: David Chu [EMAIL PROTECTED] === What is the preferred method to iterate through the rows of a database query from a JSP under the Struts framework? Should I write a class that dumps the contents of a ResultSet into some Collection? It seems this is a reoccuring problem and would have been tackled before. Please advise on a preferred solution. Thanks. -- -david -- David C. Chu America Online Network Tools Intern -- -- 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: Reporting Solutions
If the piece that is slowing you down is writing the parsing (in Perl), you may want to look at xconvert. http://www.unidex.com/xflat.htm Maybe you could use it to do the text to XHTML conversion. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 3:37 PM To: [EMAIL PROTECTED] Subject: RE: Reporting Solutions On this topic... I have a slew of reports that get generated on our AS/400... If anyone knows a tool that would do a nice job of scrapping the text output into html it would be a great help. The 400 FTP's the reports over to an intranet server when it runs them. The server then parses them in perl to produce nicer HTML pages. If I had an easier solution I could move more of them over faster... If anyone has any ideas let me know! Thanks -Original Message- From: brhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 3:16 PM To: struts-user Subject: Reporting Solutions This is a summary of my research and testing of reporting solutions. I've gotten a lot of help here. So I hope this information will be useful. My requirements were to be able to run reports (ideally Crystal Reports) via JSP, ideally on a Linux box. If a Crystal Reports solution couldn't be found, I needed a cost effective alternative with similar ease of use and power as Crystal. First, the latest version of Crystal Enterprise will under Solaris (not Linux) but the license starts at 20-40K. Sometime ago, I made pretty good progress by building Java wrapper classes for the CR COM Object. It was pretty difficult to figure out a lot things and at some point I got stuck trying to retrieve set the report parms programmatically. The biggest problem with this was that I had to send the Oracle userid password as part of the query string. And of course I still needed the reports running on an NT server. If you're interested in a making wrappers for COM Objects, see http://www.infozoom.de. Another option that also requires an NT server is Parallel Crystal. It's also too expensive, but may be a good solution if you need scalability. Parallel Crystal Pricing: http://www.dynalivery.com/products/parallelcrystal/pricing.html Parallel Crystal Architecture: http://www.dynalivery.com/products/parallelcrystal/parallelcrystal2_6.html#a rchitecture I also looked at Actuate (http://www.actuate.com/products/server/index.asp). I can't find my pricing notes, but it was expensive. They did an email campaign saying Instantly Convert Crystal Reports. But they don't have a converter in their system, it's a manual conversion service. I considered http://sourceforge.net/projects/jasperreports/, but determined that's it's not mature enough to give to our clients. Looks promising though. I found two options that would require writing reports from scratch, as they don't support or convert Crystal. The first is JReports. It was quite a while ago that I look at JReports, so I don't remember a lot of details to pass on. But I do remember that I liked it and it would be option, if I abandoned Crystal. Tech support was very good. Corporate Background: http://www.jinfonet.com/corporate.htm JReport Overview: http://www.jinfonet.com/JReportOverviewWeb.ppt JReport Product Brochure: http://www.jinfonet.com/JReportFlyer.pdf JReport Product Overview: http://www.jinfonet.com/products.htm JReport Tutorial: http://www.jinfonet.com/help/tutorial.htm Free Download: http://www.jinfonet.com/download.htm Other Docs http://www.jinfonet.com/docs.htm Register for Evaluation: http://www.jinfonet.com/JReportRegister.htm JReport Enterprise Server 2 conc. users/reports 1 CPU $3,500 Annual Maintenance $700 JReport Enterprise Server, unlimited for 1 CPU $19,000 Annual Maintenance $3,800 You can also choose to license only a specific number of CPUs. For example, it is possible to purchase a 2 CPU license for a 4 CPU computer. Likewise, it is also possible to purchase a 4 CPU license for a 2 CPU computer to anticipate future expansion. The other alternative to Crystal that I found is FlexReports. It's basically a Java-based Crystal knock-off. If you know Crystal, you can use FlexReports. The only thing I found that wasn't completely intuitive is that parm fields have to be placed on the report, although they are invisible. The limitations I found with FlexReports are: 1. No way to programmatically get a list of parameters from a .flx. 2. No way to force a page break. 3. No way to use the viewer as an applet. 4. No PDF support. Tech support was 1st class. Pricing is done on a case by case basis. But here's what I found. (BTW - I didn't sign any non-disclosure on any of the info I'm providing.) Development License 1 developer license = 459 USD To avail discount on developer licenses, purchase our team licenses: 4 Team license (4 developer licenses) = 918 USD 8 Team license (8 developer licenses) = 1836 USD Maintenance License The Maintenance License fee is
RE: Please help clarify or confirm -- HttpSession
Huh? JBoss is FREE. -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:41 PM To: 'Struts Users Mailing List' Subject: RE: Please help clarify or confirm -- HttpSession Kevin, I actually thought about the EJB solution, but we are trying to do this on the cheap without having to buy an EJB container (i.e. JBOSS). Something I was wondering about though - is it possible to run an EAR structure under Tomcat? I'm not very familiar with EJB, so forgive me if I sound stupid here, but is it possible to create a pseudo-J2EE environment and create an Entity-Bean that can do this? The XML-Soap solution also is appealing, but we would like to be able to integrate these various app's with a minimum of re-write. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:18 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM 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: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to localhost. Escape character is 'off'. GET /webapp1/session.jsp HTTP/1.0 [ -- I type ] HTTP/1.1 200 OK Content-Type: text/html;charset=ISO-8859-1 Date: Wed, 12 Jun 2002 00:39:49
RE: Disbaling Back Button of Browser
You can't truly disable back and forward. You can open your site without the buttons, but there are still ways for the user to issue back and forward (ALT+LEFT ALT+RIGHT). Thus, you have to resort to javascript tricks. Do a google search in comp.lang.javascript. There are tons of postings there on this very topic. -Original Message- From: Daniel J. D'Cotta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 1:57 AM To: [EMAIL PROTECTED]; sanjeev_dutt Cc: Struts Users List Subject: RE: Disbaling Back Button of Browser body onload=javascript:history.forward(); Thanks, that works... ...but a new request is done; and I guess that the old request scope is lost. Is there any better way to disable back and forward (and also the history)? -Original Message- From: sanjeev_dutt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 12:11 PM To: Daniel J. D'Cotta; [EMAIL PROTECTED] Subject: RE: Disbaling Back Button of Browser you should try : body onload=javascript:history.forward(); -Original Message- From: Daniel J. D'Cotta [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:38 AM To: [EMAIL PROTECTED] Cc: sanjeev_dutt Subject: RE: Disbaling Back Button of Browser hi, I tried ... .. but it does not seem to do anything. What am I doing wrong? Regards, Daniel -Original Message- From: Narasimha Rao [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 6:55 PM To: Struts Users Mailing List Subject: RE: Disbaling Back Button of Browser hi, use history.forward()in the body of the page cheers narasimha -- 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: Value of using one action per use-case?
Use cases are highly variable between authors, projects, companies, etc. : My use case is not your use case.. Some are high-level, some medium-level, and some low-level. So the answer really depends on the level and domain of the use case. Some use cases will likely match Actions, others a combination of Actions. And some will have no relationship to Actions. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:56 AM To: Struts Users Mailing List Subject: Re: Value of using one action per use-case? My experience building Struts apps tells me that this could lead to some overly-complex Actions without adding significant value. If you consider a single Use Case such as Maintain User Information, the use case could easily span several pages. Managing the information on each page may lead to different exception paths (with each requiring individual views), Thus you could have potentially 2-3 views per step (over several steps) driven by one controller. In addition, if the use case changed significantly, it may be easier to maintain code that was segregated into independent controllers. If one part of the use case changed, controllers for the other parts may not require changing. If there was only a single controller then maintenance may be more complex than it need be. Incorporating all the logic required for managing each of the various pages submissions seems as if it could make the methods longer and more complex - without adding any real value. What value was it suggested might be added by taking this approach? Given my experience, I'd actually say it is more likely that a single Form Bean per use case would make sense - after all , sometimes data gathered in one step of a Use Case is useful in later steps. And validation in later steps may be dependent upon data gathered in earlier steps. But even this is a generalizationm that wouldn't always be true. Kevin Karim D. Saloojee [EMAIL PROTECTED] on 06/12/2002 09:49:54 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: Value of using one action per use-case? Hi At a Java Conference it was suggested that when building web applications with Struts it might be a good idea to use one action per use case. In the action we have a number of different methods that would would be executed depending on the parameters passed by the browser. The methods would be automatically invoked by reflection. Other than the slight performance hit due to reflection, would this be a good idea? Why or why not? TIA Karim -- 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: 2 forms on a single JSP
I believe your workaround is the recommended approach. That is, use one form bean for both forms. The form bean could implement two different Form interfaces (one per html:form) to make the seperation more obvious. -Original Message- From: Tim Sawyer [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 8:25 AM To: [EMAIL PROTECTED] Cc: Tim Sawyer Subject: 2 forms on a single JSP Hello. If I have two html:form's on a JSP page, that submit to two different actions, I have problems where those actions have different form beans. Either form works individually, but when put together I get an error when the page is displayed. The only way around this I have found is to create a single form bean, with the union of fields from both forms, and then to use that form for both the actions that are submitted to from that page. Is this a imitation? Is there a way around it? I'm using 1.0.2 not 1.1. ta, Tim. -- 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: Back button skip a page?
Location.replace worked perfectly. Thanks. -Original Message- From: Bartley, Chris P [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 6:22 PM To: 'Struts Users Mailing List' Subject: RE: Back button skip a page? Check out the javascript method location.replace()...i think that'll do exactly whatcha want. If i remember/understand correctly, i think your wait page could do a script location.replace(results.htm); /script So, then, on results.htm, clicking the back button should indeed go to the form page since the wait page was never added to the history. chris -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 4:26 PM To: [EMAIL PROTECTED] Subject: Back button skip a page? Jerome, This may have only limited usefulness, but you may be able use the document's history object to skip the wait page in the browser's history. Something like: (Javascript) window.history.go(-2) but I'm not exactly sure how to detect the event that the user clicks the back button. Jerome Jacobsen [EMAIL PROTECTED] wrote: This may not be possible, but I hope it is. I have a Your request is being processed, please wait.. page. Once the user gets to the results page and hit their browser's Back button I want to skip that Wait page. Here is the page flow: Form Page - Wait Page - Results Page -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: (newbie) WAR files and JDeveloper 3.2.3
The JDev 3.2.3 servlet container (Web-To-Go) does not recognize WAR files. You'll have to exctract the WAR files, however the web.xml file will be ignored. Any settings from web.xml will have to be added via the Web Object Manager Wizard and/or the webtogo.ora file and/or wtgapp.xml file. The best thing to do is to search the JDeveoper discussion archives at technet. There is a seperate PDF at http://technet.oracle.com that coverts Web-To-Go, called Oracle 8i Lite: Web-to-go Implementation Guide. This doc covers the properties in the webtogo.ora file. Not sure about JDev 9i support for WAR. -Original Message- From: Glen Mazza [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 12:11 AM To: [EMAIL PROTECTED] Subject: (newbie) WAR files and JDeveloper 3.2.3 Hello, I was able to run the sample .WAR (struts-blank.war, struts-example.war, etc.) files on Tomcat just by placing them under its webapps directory. However, I would like to use Oracle JDeveloper's default IDE servlet container. However, placing it under the JDeveloper 3.2.3\myhtml\webapp directory doesn't appear to work. I don't know if the JDeveloper IDE can work with .WAR files. Has anyone been able to get Struts' sample .WAR files to work with JDeveloper? Thanks, Glen _ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: struts and excel
Try adding out.clear() right before changing content type. Like this: % out.clear(); response.setContentType(application/vnd.ms-excel); % -Original Message- From: yanming lu [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 11:45 AM To: [EMAIL PROTECTED] Subject: Re: struts and excel Could you show me what is wrong in the following code? - % response.setContentType(application/vnd.ms-excel); % html headtitleExcel-Export/title/head body table tr td1997/td td2000/td td1999/td /tr tr td12.3/td td13.4/td td15.6/td /tr /table /body /html -- This displays the file as HTML page instead of opening an excel file. From: Roy Truelove [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: struts and excel Date: Thu, 6 Jun 2002 11:37:04 -0400 Struts has nothing builtin for this (as far as I know). Excel can read HTML tables however, so if your JSP's create a standard TABLE, and you set your content type : response.setContentType(application/vnd.ms-excel); the browser should know to open it with Excel. Take it easy, Roy - Original Message - From: yanming lu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 11:00 AM Subject: struts and excel How to display an excel file in struts? _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Back button skip a page?
This may not be possible, but I hope it is. I have a Your request is being processed, please wait.. page. Once the user gets to the results page and hit their browser's Back button I want to skip that Wait page. Here is the page flow: Form Page - Wait Page - Results Page -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: BeanUtils
I saw that too. They are in the 1.3 RELNOTES. But the problem shows up in 1.3. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 3:26 PM To: Struts Users Mailing List Subject: RE: BeanUtils In looking over the current release notes for the BeanUtils in the commons project, I can across the following bug report list: BUG REPORTS ADDRESSED: = 4895 Populate method doesn't work for an indexed setter for arrays 6125 Populate method has mistaken the judgement which uses indexed property 6465 Wrong method BeanUtils.populate(), so that in Struts indexed multiselects not work Jerome Jacobsen [EMAIL PROTECTED] on 05/30/2002 01:55:54 PM 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: BeanUtils I'm also having trouble concerning indexed properties with BeanUtils. If the type of the indexed property is String, then BeanUtils.populate throws IllegalArgumentException. Using your NameBean in an example: ... NameBean nameBean = new NameBean(); BeanUtils.populate(nameBean,new String[] {John, Paul, Jack}); // above throws IllegalArgumentException! ... If I take the same indexed property and change it to an int BeanUtils.populate works! I've posted this problem to both the jakarta-commons-dev and struts-user lists with no response. So I don't know if it is supported or not. Please, can someone give us an answer??? -Original Message- From: Filipe Mateus [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 1:30 PM To: [EMAIL PROTECTED] Subject: BeanUtils Do BeanUtils.describe and BeanUtils.populate supposed to handle indexed properties? Suppose I have this JavaBean: public class NameBean { private String[] name; public String[] getName() { return this.name; } public void setName(String[] name) { this.name = name; } public String getName(int index) { return this.name[index]; } public void setName(int index, String name) { this.name[index] = name; } } I would expect the following code to return a Map containing: name[0]=John, name[1]=Paul, name[2]=Jack but instead, I get name=John. Only the first element is considered. ... NameBean nameBean = new NameBean(); nameBean.setName(new String[] {John, Paul, Jack}); Map properties = BeanUtils.describe(nameBean); ... ** Financiere Banque Nationale et NBCN n'assument aucune responsabilite quant a la confidentialite et l'integrite du present courriel en raison des risques d'interception inherents a l'Internet. Pour cette raison, toute opinion exprimee au terme des presentes ne reflete pas necessairement celle de Financiere Banque Nationale et de NBCN. ** Due to the security risks involved in sending information over the Internet, National Bank Financial and NBCN cannot be held responsible for ensuring the confidentiality and integrity of the present e-mail. For this reason, the opinions expressed herein do not necessarily reflect those of National Bank Financial and NBCN. ** -- 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] --- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
BeanUtils.populate() throws IllegalArgumentException for indexed String properties.
Got no answer on this one from commons-dev mailing list. Can someone here can help? --- Maybe I'm misunderstanding BeanUtils.populate, but shouldn't this work! The exception says IllegalArgumentException: type mismatch Tried this with both BeanUtils 1.2 and 1.3 with same results. --- public class Company { private List m_locations = new ArrayList(); public String[] getLocation() { return (String[])m_locations.toArray(new String[0]); } public String getLocation( int index) { return (String)m_locations.get(index); } public void setLocation( String[] locations) { if (locations == null) { locations = new String[0]; } m_locations = Arrays.asList(locations); } public void setLocation( int index, String location) { m_locations.set(index, location); } public static void main(String[] args) throws Exception { Company gentoo = new Company(); Map properties = new HashMap(); properties.put(location, new String[] {Blacksburg, Richmond}); BeanUtils.populate(gentoo, properties); // throws IllegalArgumentException! } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Design Advice - Relational Databases Java Objects
Have you looked at these opensource projects? JBoss http://www.jboss.org/ OpenEJB http://www.openejb.org/ Castor JDO http://castor.exolab.org/ ObjectRelationalBridge http://objectbridge.sourceforge.net/ As for (1) I would have the business objects throw exceptions. I would have the Struts Action convert exceptions to ActionErrors or ActionMessages as appropriate. As for (2) the answer depends on the capabilities of the data-access layer you are using. -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 12:44 PM To: Struts Users Mailing List Subject: Design Advice - Relational Databases Java Objects Hi All, I saw this thread in the archives and I thought I'd pinch the title. I've spent this afternoon surfing the web looking at stuff on Sun, Jakarta and lots of smaller sites looking for a ready-made data access layer package but I take it there isn't an open-source one out there. Obviously I don't want to tie my data access layer to struts, so there are a few questions I've got. (1) Is it best for the data access layer to throw exceptions on error to be picked up by the business objects then struts actions, or would it be good to use a struts-type message object and use strings in the application resources file (I'm just worried my exceptions' text would not be multi-lingual) (2) How would I get the database connection info to the data access layer? Presuming I want to set it up in struts-config.xml or as in commons-dbcp, would I then pass it in from struts actions into the business object and then into the data access layer as a parameter on each call? I've seen quite a few patterns like www.martinfowler.com and code like in Sun's Pet Store, so I think I've got a fairly good idea of what I need. The data access layer I want has got to: - take as input and return as output Data Transport Objects - allow the business objects to control transactions - use a connection pool - possibly keep the SQL statements in an external XML file - have comprehensive error handling reporting -- 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: Use of custom convertors
The best practice for form beans is that all properties be Strings. Your Action can do the conversion both ways. For the request it converts the String to the type expected by the business object. For the response it converts the business object's type to the String to be set on the form bean. BeanUtils can be used by the Action to do both types of conversion. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:10 PM To: Struts Users Mailing List Subject: Re: Use of custom convertors Ok I may be missing something as I am brand new to struts. Why would we not want to use the same mechanism for getting properties as we do for setting properties? Why wouldn't the framework determine the type of the source and call the appropriate converter in order to create the appropriate string representation for display? Thanks. Keith Nielsen Ted Husted husted@apachTo: Struts Users Mailing List [EMAIL PROTECTED] e.org cc: Subject: Re: Use of custom convertors 05/28/2002 10:23 AM Please respond to Struts Users Mailing List Personally, I'd do the conversions in the JavaBean and leave the tags out of it. -- 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 [EMAIL PROTECTED] wrote: I am writing custom converters which BeanUtils will use to do conversions from request data to form bean. It appears however that on the return path that none of the tags actually use BeanUtils, and as such my converter is only used in one direction. Is my understanding of this correct? If so how do I avoid having to rip apart my nested beans in order to get right conversions on the subsequent generation of the next page. Thanks. Keith -- 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: Templates and i18n problem in struts
You can't use a JSP tag as the value of another JSP tag's attribute. You'd have to use a JSP expression instead. I'm not sure if a utility exists to get the message in the same way as the bean:message tag does. Let's assume there is one called msgUtil.getMessage. Then you would do this: template:put name='title' content='%= msgUtil.getMessage(myclient.title) %' direct='true'/ -Original Message- From: Yaman Kumar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 16, 2001 10:06 AM To: Struts Users Mailing List Subject: Templates and i18n problem in struts Hi, I am using templates in struts, In my jsp page I used the below statement. .. template:put name='title' content='bean:message key=myclient.title /' direct='true'/ .. the bean:message key=myclient.title / statment prints MYPRINTPAGE . but the output is not rendered in title location in runtime, but it is printing bean:message key=printPage.title / message without parsing the tag.. In short how can I use bean:message tag in templates. Just review the code to find out problem below. in MyTemplate.jsp %@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' % %@ taglib uri='/WEB-INF/struts-html.tld' prefix='html' % %@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean' % html:html locale='true' head title template:get name='title'/ /title //this is not parsed. /head body bean:message key=myclient.body.info / //This is parsed /body /html:html in MyClient.jsp %@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' % %@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean' % template:insert template='/HNCTemplate.jsp' template:put name='title' content='bean:message key=myclient.title /' direct='true'/ //this bean tag is not parsed and not input the value to MyTemplate.jsp /template:insert Many Thanx, rayaku -- 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: Generation and display of charts/graphs
http://chart2d.sourceforge.net/ http://gvf.sourceforge.net/ http://jcharts.sourceforge.net/ http://www.object-refinery.com/jfreechart/ http://openjgraph.sourceforge.net/ http://technet.oracle.com/tech/java/servlets/content.html I've only used the last one (Oracle Chart Builder). Haven't had problems with it. -Original Message- From: Hardee, Tony [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 12:39 PM To: 'Struts Users Mailing List' Subject: OT: Generation and display of charts/graphs ** *** Off Topic (i.e., not related to STRUTS) * ** Does anyone on this list have recommendations for Java software (preferably free) to facilitate generation and web display of charts and graphs (e.g., Highest weekly temperature in Hawaii for last year, etc.). -- 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: XMLC Article on the Serverside
The Wafer project on SourceForge is a project to compare 19 open source Java web frameworks (including Struts, of course). It is in it's alpha stage. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/wafer/www/feature- matrix2.html?rev=1.10 http://sourceforge.net/projects/wafer/ http://wafer.sourceforge.net/ -Original Message- From: Pedone, Tim [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 3:47 PM To: 'Struts Users Mailing List' Subject: RE: XMLC Article on the Serverside Here's an article comparing Velocity and XMLC. It points out some of the short comings of XMLC so it is somewhat relavent. Of course you can use Velocity with Struts too. http://jakarta.apache.org/velocity/casestudy2.html -Original Message- From: Dan Cancro [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 11:36 AM To: '[EMAIL PROTECTED]' Subject: FW: XMLC Article on the Serverside I thought the Struts users on this list might be interested in this article about XMLC vs. JSP. It's pretty pro-XMLC. I couldn't find any contrary opinions in the Struts archive. Does anyone know some disadvantages of XMLC compared to JSP? Thanks, Dan http://www.theserverside.com/resources/article.jsp?l=XMLCvsJSP -- 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: html:link with Map parameters generating amp; instead of
The kludgy workaround I'm using is: str:replace replace=amp; with= html:link href=index.jsp name=summaryLinkParms inventory summary /html:link /str:replace That is, wrapping the html:link in a str:replace. Found str: is from Jakarta Taglibs String. -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 3:28 PM To: Struts User Subject: RE: html:link with Map parameters generating amp; instead of I understand that is a special HTML character. However isn't it a bug that html:link generates amp; instead of ? I mean the whole idea of using the html:link with the java.util.Map is so it creates the anchor with parameters correctly. That means putting the special character '' as a parameter seperator instead of the escaped version. Or am I missing something? -Original Message- From: Alex Jones [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 3:22 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: html:link with Map parameters generating amp; instead of It's to do with being a reserved character in HTML. I had the same problem but got round it by writing a method a bit like the following: public String getParameter(HttpServletRequest request, String paramName) { String paramValue = request.getParameter(paramName); if (paramValue == null) return request.getParameter(amp; + paramName); else return paramValue; } -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: 24 April 2002 18:44 To: Struts User Subject: html:link with Map parameters generating amp; instead of Hi, I've tried this with Struts 1.0.1 and Struts 1.0.2 and both do the same thing. % HashMap summaryLinkParms = ... pageContext.setAttribute(summaryLinkParms, summaryLinkParms); % html:link href=index.jsp name=summaryLinkParms inventory summary /html:link The above creates a URL in which the parameter seperator is amp; instead of ! a href=index.jsp?param1=blahamp;param2=blehinventory summary/a I want a href=index.jsp?param1=blahparam2=blehinventory summary/a What's up? -- 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]
html:link with Map parameters generating amp; instead of
Hi, I've tried this with Struts 1.0.1 and Struts 1.0.2 and both do the same thing. % HashMap summaryLinkParms = ... pageContext.setAttribute(summaryLinkParms, summaryLinkParms); % html:link href=index.jsp name=summaryLinkParms inventory summary /html:link The above creates a URL in which the parameter seperator is amp; instead of ! a href=index.jsp?param1=blahamp;param2=blehinventory summary/a I want a href=index.jsp?param1=blahparam2=blehinventory summary/a What's up? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:link with Map parameters generating amp; instead of
I understand that is a special HTML character. However isn't it a bug that html:link generates amp; instead of ? I mean the whole idea of using the html:link with the java.util.Map is so it creates the anchor with parameters correctly. That means putting the special character '' as a parameter seperator instead of the escaped version. Or am I missing something? -Original Message- From: Alex Jones [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 3:22 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: html:link with Map parameters generating amp; instead of It's to do with being a reserved character in HTML. I had the same problem but got round it by writing a method a bit like the following: public String getParameter(HttpServletRequest request, String paramName) { String paramValue = request.getParameter(paramName); if (paramValue == null) return request.getParameter(amp; + paramName); else return paramValue; } -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: 24 April 2002 18:44 To: Struts User Subject: html:link with Map parameters generating amp; instead of Hi, I've tried this with Struts 1.0.1 and Struts 1.0.2 and both do the same thing. % HashMap summaryLinkParms = ... pageContext.setAttribute(summaryLinkParms, summaryLinkParms); % html:link href=index.jsp name=summaryLinkParms inventory summary /html:link The above creates a URL in which the parameter seperator is amp; instead of ! a href=index.jsp?param1=blahamp;param2=blehinventory summary/a I want a href=index.jsp?param1=blahparam2=blehinventory summary/a What's up? -- 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: Tab Libraries? Bah!
IMHO JSP and technologies like it are fundamentally flawed. However, I have not tried out other Java dynamic web presentation frameworks/technologies. Enhydra's (http://www.enhydra.org/) architecture sounds promising. As I understand it the HTML designer writes HTML. The Java web developer writes the code to add the dynamic content to the HTML by manipulating the HTML's DOM. The DOM manipulation code looks for class attributes agreed on between the HTML designer and Java web developer. That's all I know. Not sure if HTML 'includes' would be supported, which is something I'd like. I've also read about Echo (http://www.nextapp.com/products/echo/). It is NOT designed to seperate concerns between the HTML designer and the Java web developer. What it claims to do is make web development (targeted for HTML) like doing typical MVC, such as developing a Swing application. It looks too beta right now. No i18n support. WHAT I HATE ABOUT JSPS: You can't do JSPs for dynamic sites without including scriptlets unless you code tons of custom Tags. The design idea behind JSPs was that it look like XML and not include Java. That the JSP writer does not have to know Java. The solution to avoid scriptlets is custom tags. But to avoid scriptlets most custom Tags *must* include HTML. Thus your Java web developer is writing HTML in custom Tags which breaks the seperation of concerns between the Java web developer and the HTML designer (JSP writer). Let's say you can accept the fact that the JSP writer is the same person as the custom tag writer/Java web developer. Then the seperation of concerns problem with JSP is not an issue. But the JSP solution still results in a maintenance nightmare. Scriptlets in JSPs are ugly and the resulting JSPs are very difficult to maintain. On the other hand coding huge custom tag libraries to get around scriptlets is a maintenance nightmare and very tedious. In either case there is typically a huge amount of presentation Java Beans to code. Finally, because of stateless HTTP the amount of plumbing still required of the developer with Struts to do most dynamic webs is large: the Action classes. The coupling between the Java Beans, Action classes, JSPs, and custom Tags is typically tight. What we want in the case where seperation of concerns is not an issue is something like Echo (see above). That is, plain old MVC. Maybe Java Server Faces will provide an adequate solution? So why use Struts? - Because you get the benefits of a framework, despite the major shortcomings of JSP. The Struts framework already has support for Web development plumbing such as Security, i18n, and validation. You don't have to use the presentation layer of Struts to benefit from the framework. - There is a large user base. - Struts is covered in many articles and books. Sorry for the rant. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 3:24 PM To: Struts Users Mailing List Subject: Re: Tab Libraries? Bah! I've come to the following conclusions: - If Struts tries to take the programmer out of the equation completely, it will become an inferior solution. - Other page development languages (Cold Fusion, ASP, JSP even) provide actual scripting languages with: - Variable definition - String manipulation functions - Looping constructs that don't need to be tied to objects (or collections in objects) - Other things that give the page developer power to create dynamic pages I don't believe that Struts can (or should, really) provide all these things. Yet these things become very handy when building dynamic pages. If you tell a page developer (and I have) that they need to leave one of the more powerful development languages that I described to use Struts, there are problems: - The page developer has less flexibility than they used to have - The page developer can contribute less to the project - they are used to having a more powerful language. So the only answer I can practically think of is to still allow some mixture of scriptlets. I think eliminating them all is a mistake - I tried it. So then, the real question is how - or where - do you draw the line? Asking page designers to become Java programmers is a problem. Giving them only Struts is a problem. Where is the middle ground? FWIW - Kevin Joe Osowski [EMAIL PROTECTED] on 04/24/2002 03:14:50 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject: Tab Libraries? Bah! bitchSession This kind of thing has really bothered me about Tag libs. The whole point of them is to keep HTML code as simple and clean as possible right? But if you have to break down and use the %% snippets inline, does it not make the whole process self defeating? In my mind using %% snippets and tag libraries is more confusing then just using snippets alone, spaghetti code be
Best practices for implementing menuing?
I need to create a website that has menus in the header and sidebar. I see the following challenges in implementing menuing: 1) Maintaining correct menu state when user hits Back, Forward, or jumps in History. 2) Keeping the JSPs menu ignorant. Any best practices on menuing which solve the above challenges?? I'm new to Struts, is there a Struts recommended way of doing menuing? Regards, Jerome -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
bean:define for replacement
The docs on bean:define say that it will unconditionally create or replace the bean with specified id. However I get an error if I want to replace. For example: jsp:useBean id=b1 class=MyClass ... init stuff /jsp:useBean jsp:useBean id=b2 class=MyClass ... init stuff /jsp:useBean bean:define id=b name=b1 type=MyClass/ ... do stuff with b bean:define id=b name=b2 type=MyClass/ ... do stuff with b When compiling I get an error: Tag attempted to define a bean which already exists: b. What's wrong? -Jerome
Trouble submitting html:form without ActionServlet
How can I get html:form name=myform action=index.jsp to produce form name=myform action=index.jsp instead of form name=myform action=/index.jsp ??? I'm starting to use Struts in my project which has its own controller. All of my JSPs use relative URLs to this controller. I do not want to migrate to the ActionServlet yet. I have no struts-config.xml file (and I don't want one until I convert to ActionServlet). -Jerome
bean:define for replacement
The docs on bean:define say that it will unconditionally create or replace the bean with specified id. However I get an error if I want to replace. For example: jsp:useBean id=b1 class=MyClass ... init stuff /jsp:useBean jsp:useBean id=b2 class=MyClass ... init stuff /jsp:useBean bean:define id=b name=b1 type=MyClass/ ... do stuff with b bean:define id=b name=b2 type=MyClass/ ... do stuff with b When compiling I get an error: Tag attempted to define a bean which already exists: b. What's wrong? -Jerome
session form beans
Hi, In what cases does the Struts framework remove a Session Form bean from the Session? Is this supposed to be done explicitly by the JSP or Action object writer? Thanks, -Jerome