RE: Form's property, String or not?
For actionforms you should make them all strings. Certainly anything that allows for text entry in the UI should be made a string even if it is intended for numeric input. (For checkboxes and such like its less important though Id still recommend using strings for them) This allows you to return the user to the form when validation fails with the input they entered preserved - so if they type One instead of 1 the bad value will be preserved for them to correct on return to the page. If they type text into a field whose actionform property is numeric you can have problems handling it. I cant remember if it causes an exception or is just converted implicitly to the value 0 - but either way its a problem... -Original Message- From: Xuemin Guan [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 March 2004 11:30 To: Struts Users Mailing List Subject: Form's property, String or not? Hi, dear all, very new to Struts. Just a simple question: As a best practice of Struts, should I declare formebeans' properties all as String, or the actual type (such as BigDecimal, int, float, and double etc.) Thanks, Xuemin - 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: [FRIDAY]:RE: calling ASP inside a JSP
snip What you won't be able to do easily is share any server side data such as session objects between the two servers /snip You could probably use a database to share most of the important info. -Original Message- From: Brendan Richards [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 March 2004 17:21 To: Struts Users Mailing List Subject: RE: [FRIDAY]:RE: calling ASP inside a JSP Shouldn't be a problem. I don't think there's anything in browsers that stop different frames being served from different servers. You'd have a framset page looking something like this. frameset cols=200,* frame src=http://myASPServer.com/page.asp; name=leftFrame frame src=http://myJSPServer.com/page.jsp; name=rightFrame /framsest This frameset page could be a HTML file on either of your servers or could even be an asp or jsp file to make it dynamic. What you won't be able to do easily is share any server side data such as session objects between the two servers -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 02:21 To: Struts Users Mailing List Subject: RE: [FRIDAY]:RE: calling ASP inside a JSP Whats the Ugly? PHP? hmmm. Friday seems to come very early in your part of the world ;-) -Original Message- From: Wiebe de Jong [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 March 2004 08:17 To: 'Struts Users Mailing List' Subject: [FRIDAY]:RE: calling ASP inside a JSP You have JSP, and ASP, and you want to mix them together?!? Reminds me of that Clint Eastwood movie: The Good, the Bad, and the Ugly ;-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 4:05 PM To: [EMAIL PROTECTED] Subject: calling ASP inside a JSP Hi All I have a webpage in which i have two Frames. In my left frame i want to display an ASP page. In the main frame i have a JSP page. Can i do this at all. I have a link to the ASP page, but i do not want to provide a link but only want to display the content of the ASP page. Please let me know if i can do this. Thanks --Mohan - 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: [FRIDAY]:RE: calling ASP inside a JSP
Whats the Ugly? PHP? hmmm. Friday seems to come very early in your part of the world ;-) -Original Message- From: Wiebe de Jong [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 March 2004 08:17 To: 'Struts Users Mailing List' Subject: [FRIDAY]:RE: calling ASP inside a JSP You have JSP, and ASP, and you want to mix them together?!? Reminds me of that Clint Eastwood movie: The Good, the Bad, and the Ugly ;-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 4:05 PM To: [EMAIL PROTECTED] Subject: calling ASP inside a JSP Hi All I have a webpage in which i have two Frames. In my left frame i want to display an ASP page. In the main frame i have a JSP page. Can i do this at all. I have a link to the ASP page, but i do not want to provide a link but only want to display the content of the ASP page. Please let me know if i can do this. Thanks --Mohan - 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: how to submit javascript variable of array type
I usually concatenate the array into a single string (using a delimiter such as a comma) and then put this value into a single field. In my actionform I have a getter (under different property name) that returns it as an array (using the delimiter to explode the string). -Original Message- From: Mu Mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 March 2004 10:24 To: [EMAIL PROTECTED] Subject: how to submit javascript variable of array type I now have a javascript array var, and I need to submit it by a form to an action class, how can I achieve this? ThanksRegards _ MSN Explorer: http://explorer.msn.com/lccn/ - 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: help in java script
Should not that be: html:text size=20 property=userId onchange=javascript:find('%=value%')//TD (note the ' around value) -Original Message- From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 17:27 To: Struts Users Mailing List Subject: help in java script Hi ! I'm getting a problem when i use java script in my struts application. My code runs as follows: SCRIPT funtion change(value) { alert(value); } /SCRIPT BODY ... ,,, % String value=hello;% html:text size=20 property=userId onchange=javascript:find(%=value%)//TD the problem is the onchange event is not being called. when i don't pass a scriplet variable the event gets called..say onchange=javascript:find('hello'); it gets callled.. could anyone suggest me how to pass a dynamic value to javascript function in struts? Thank you. Shobhana - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: help in java script
Remember the JSP script is evaluated server side and its result is what is rendered to the browser. Only the resulting html is what is evaluated by the browser which knows nothing of the original scriptlets. To check this out just do 'view source' in your browser on the page so you can see what is actually being rendered to the response and seen by the browser! % String value=hello;% html:text size=20 property=userId onchange=javascript:find(%=value%)//TD Will cause (something like) this to be rendered: input type=text size=20 name=userId onchange=javascript:find(hello)/ BTW: Should have spotted earlier the javascript: which also is not wanted - you only use that for hrefs! Take that out you get: input type=text size=20 name=userId onchange=find(hello)/ As you can see you are trying to pass a javascript variable named hello to your method. Surely you want to pass a javascript string containing the text hello? ie: input type=text size=20 name=userId onchange=find('hello')/ Hence my suggestion to add in the quotes. And lose that javascript: prefix! (And shove a semicolon on the end though I think its optional in this case!) hth Andrew -Original Message- From: Andreas Solarik [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 17:57 To: 'Struts Users Mailing List' Subject: AW: help in java script Hi Andrew and Shobhana, As far as I know, you cant mix static text and dynamic text within a JSP. If I remember correctly, something like the following code should work. % String tempString=javascript:find( + value + \;; // Not sure about the semicolon... % and then: html:text size=20 property=userId onchange=%= tempString %//TD I'll make sure to try the single quotes (') around the dynamic text some time, cause it's really annoying to use the method im describing here. Regards, Andreas -Ursprngliche Nachricht- Von: Andrew Hill [mailto:[EMAIL PROTECTED] Gesendet: Montag, 15. M?rz 2004 10:30 An: Struts Users Mailing List Betreff: RE: help in java script Should not that be: html:text size=20 property=userId onchange=javascript:find('%=value%')//TD (note the ' around value) -Original Message- From: Shobhana.S, ASDC Chennai [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 17:27 To: Struts Users Mailing List Subject: help in java script Hi ! I'm getting a problem when i use java script in my struts application. My code runs as follows: SCRIPT funtion change(value) { alert(value); } /SCRIPT BODY ... ,,, % String value=hello;% html:text size=20 property=userId onchange=javascript:find(%=value%)//TD the problem is the onchange event is not being called. when i don't pass a scriplet variable the event gets called..say onchange=javascript:find('hello'); it gets callled.. could anyone suggest me how to pass a dynamic value to javascript function in struts? Thank you. Shobhana - 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: Help on struts
I guess the first thing to consider is what you mean by come back to the previous page. Do you just mean have the user redirected back to that url when they have finished playing with the search? or is it more complex. For example the previous page is a form, and they are halfway through filling it in when they need to search, and on completion need to take up where they left off with filling it in? In the first case the easiest way (Im assuming there are multiple places that send you to the search page) might be to have the link to the search page add a parameter to the url containing the name of an ActionForward that will take the user back to this page. The search page can make note of this forward name, and when the user is finished searching can look it up and return it as the forward from the searchs action. -Original Message- From: Shoaib [mailto:[EMAIL PROTECTED] Sent: Saturday, 13 March 2004 14:01 To: 'Struts Users Mailing List' Subject: Help on struts We are using struts 1.1. We have some pages where user is going to have some search icon and if user clicks on that then he will move to search page where he can search the value and then come back to the previous page. Can somebody please give some idea how to do it. Regards Shoaib - 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: can anyone help me address this issue
I sometimes have to do things like this. You can only submit strings in the request, so what you want is a method of representing your information as a string in a simple way. In this case it should be quite easy as its just an array of a simple structure of two ints so Id probably just have two delimiters, one for the values in the structure, and one for the structures, so for example I might submit the lot in a hidden field as something like: 1,32;2,48;3,10;4,50 Where I use a comma to delimit between the colIndex and newWidth values, and a semicolon to seperate each instance of the structure. You can use any old char as a delimiter so long as it wont be confused with the values. Since these are ints and not strings life is easy in this case! Over on the server side you have some code that parses this string to reconstitute the values into some kind of java classes. You may even want to do it in your action forms setter or getter - where you pass the string when it is set and have a (differently named) getter that can return it as the equivelent Structure[] -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, 12 March 2004 10:24 To: Struts Users Mailing List Subject: RE: can anyone help me address this issue You can't send data structures over HTTP you can only send strings. You could set those values as hidden form elements with a naming convention that would enable your server side code to recognize the elements in the request and create the appropriate server side data structure. This is essentially what Chris has suggested. robert -Original Message- From: Mu Mike [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 8:25 PM To: [EMAIL PROTECTED] Subject: RE: can anyone help me address this issue Sorry,maybe I didnt make my question clear my question is: the java script variable is supposed to be an array of such a strutcture(although java doesnt have a struture, I just use it here to describe my idea,maybe I should use a class instead) ,I d like to know how I can submit such a value? Structure[] javascriptvalue; Structure{ int colIndex int newWidth } ThanksRegards From: McCormack, Chris [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: can anyone help me address this issue Date: Thu, 11 Mar 2004 12:24:43 - use onResize on the html element that is clicked to report its new value to a form variable. use an onChange for the form to auto submit itself. If you need to hide the submission of the form use an IFrame. messy eugh, javascript is the pits. Chris -Original Message- From: Mu Mike [mailto:[EMAIL PROTECTED] Sent: 11 March 2004 12:16 To: [EMAIL PROTECTED] Subject: RE: can anyone help me address this issue I really need to get some idea about this issue, any suggestions? ThanksRegards From: Mu Mike [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: can anyone help me address this issue Date: Thu, 11 Mar 2004 05:12:16 + I m using javascript doing dhtml, now I have a table, every time a user changes the width of a specific column(by draging the border line), I will save the column index and the new width to variables in javascript.Now ,after doing many such changes, I need to submit those values saved in the vairables to the server side program by submiting a form, which has an action path designing what action should be called after it get the submitted value. Now, I m wondering how I should define such javasript variables and how I can submit these values by submiting a form? I m using struts, is there any possibility to implement this idea in struts? ThanksRegards _ MSN Hotmail http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Messenger: http://messenger.msn.com/cn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This e-mail and its attachments are confidential and are intended for the above named recipient only. If this has come to you in error, please notify the sender immediately and delete this e-mail from your system. You must take no action based on this, nor must you copy or disclose it or any part of its contents to any person or organisation. Statements and opinions contained in this email may not necessarily represent those of Littlewoods. Please note that e-mail communications may be monitored. The
RE: people using action form field
Hehe. I remember when I first encountered this. Took me ages to figure out why the heck my form didnt work. I ended up chopping bits out of the form one at a time till suddenly it worked, and seeing it was an input field named 'action' the penny dropped! lol. Like Wendy says, the best way to deal with this issue is quite simple. Dont stuff around trying to name a field 'action' - just call it something else. (Ditto for any other fields whose names will cause them to shadow javascript form properties). -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, 10 March 2004 03:35 To: Struts Users Mailing List Subject: RE: people using action form field From: Julio Cesar De Salvo [mailto:[EMAIL PROTECTED] I know this is a javascript question but is related with struts. If you use a field called action in the form, how can you change the form action with javascript. When I try to set the document.form.action it tries to set the field instead of the action for the form. Is there any other way to change the action for the form? There is, and Tim gave you that answer. I solved the problem by changing the form property to 'userAction' which makes the whole thing clearer. Think about the next person who has to maintain your project-- if you leave it as 'action' at least document this issue clearly. I know I spent a while trying to figure it out! -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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: Suggestion needed on good Struts book
+1 -Original Message- From: Paul-J Woodward [mailto:[EMAIL PROTECTED] Sent: Monday, 8 March 2004 16:31 To: Struts Users Mailing List Subject: Re: Suggestion needed on good Struts book Struts in Action - Manning Excellent book. Paul Global Equity Derivatives Technology Deutsche Bank [/] Janarthan Sathiamurthy [EMAIL PROTECTED] 08/03/2004 08:23 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: Suggestion needed on good Struts book Programming Jakarta Struts - OReilly [EMAIL PROTECTED] wrote:Hi, I am a newbie to Struts. I have been looking for books on Struts and found these on Amazon Programming Jakarta Struts - OReilly Struts in Action - Manning Struts Framework - Morgan Kaufmann Struts Survival Guide - ObjectSource Professional Jakarta Struts - Wrox Struts Kick Start - Sams Can anybody suggest which is good? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Search - Find what you're looking for faster. - 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: JSF RI Final is out!
snip No books have been published about JavaServer Faces yet (to my knowledge), although I know of at least five that are nearing completion, and should be published very soon. /snip Funny you say that, as I could have sworn I saw one a month or so ago over at the Clementi bookshop. I recall not looking closely at it as the RI wasnt out yet afaik so I figured the book would have to be based on a beta or something and I did already have my arms full of more books than I could rightly afford to buy at the time. (Im like a kid in a candy store at that shop!). Of course I could just have been blur that day and mistaken the letters JSP for JSF... but hmmm, I dunno mate - I reckon I saw one. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Saturday, 6 March 2004 02:15 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Quoting Janarthan Sathiamurthy [EMAIL PROTECTED]: Hi, How do i get started wiith JSF ?. Any books ? Please advice JavaServer Faces Home Page: http://java.sun.com/j2ee/javaserverfaces/ Download Page: http://java.sun.com/j2ee/javaserverfaces/download.html Support Forum (free registration required): http://forums.java.sun.com/forum.jsp?forum=427 The download includes some example applications that illustrate its use. An update to the JavaServer Faces Tutorial is in progress, and will be posted shortly. No books have been published about JavaServer Faces yet (to my knowledge), although I know of at least five that are nearing completion, and should be published very soon. Nightly builds of an integation library for using JavaServer Faces and Struts together are available, but it's still based on the beta version. I'm debugging the updates as I type, and will post messages here when the nightly builds have been updated to work with the final version. Regards, Janarthan S Craig McClanahan - 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: JSF RI Final is out!
Thanks James, Im hoping I'll get a chance to take a look at it all as soon as I finish the project Im on right now (which is keeping me rather busy!) I had a look at a much earlier version of the JSF spec quite a while back and remember getting all excited about the component tree stuff and rendering kits and all that. Hoping to get a chance to download the RI sometime and play with it. Maybe even try and whack together some code to make the DOM based rendering library I wrote play nice with JSF. Andrew -Original Message- From: James Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, 6 March 2004 02:30 To: [EMAIL PROTECTED] Subject: RE: JSF RI Final is out! There are books available today. The McGraw Hill book came out weeks ago and I believe the APress book is out too. However, these books are probably out of date due to the fact that the spec wasn't finalized when the books were published. Also, there are a total of 10 or so books in progress or done. You can find the list on my website at: http://www.jamesholmes.com/JavaServerFaces/ -James snip No books have been published about JavaServer Faces yet (to my knowledge), although I know of at least five that are nearing completion, and should be published very soon. /snip Funny you say that, as I could have sworn I saw one a month or so ago over at the Clementi bookshop. I recall not looking closely at it as the RI wasnt out yet afaik so I figured the book would have to be based on a beta or something and I did already have my arms full of more books than I could rightly afford to buy at the time. (Im like a kid in a candy store at that shop!). Of course I could just have been blur that day and mistaken the letters JSP for JSF... but hmmm, I dunno mate - I reckon I saw one. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Saturday, 6 March 2004 02:15 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Quoting Janarthan Sathiamurthy [EMAIL PROTECTED]: Hi, How do i get started wiith JSF ?. Any books ? Please advice JavaServer Faces Home Page: http://java.sun.com/j2ee/javaserverfaces/ Download Page: http://java.sun.com/j2ee/javaserverfaces/download.html Support Forum (free registration required): http://forums.java.sun.com/forum.jsp?forum=427 The download includes some example applications that illustrate its use. An update to the JavaServer Faces Tutorial is in progress, and will be posted shortly. No books have been published about JavaServer Faces yet (to my knowledge), although I know of at least five that are nearing completion, and should be published very soon. Nightly builds of an integation library for using JavaServer Faces and Struts together are available, but it's still based on the beta version. I'm debugging the updates as I type, and will post messages here when the nightly builds have been updated to work with the final version. Regards, Janarthan S Craig McClanahan - 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: JSF RI Final is out!
Well its great to know the word is spreading... ...soon JSF will conquer all! muahahahaha ...I need some sleep :-( -Original Message- From: Dietmar Krause [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 22:18 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Return Receipt Your document:RE: JSF RI Final is out! was received by: Dietmar Krause/NRL/DE/Draeger at: 04.03.2004 15:14:56 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help on mapping multiple records with formbean.
Do not cross-post to the developer list like that. http://www.catb.org/~esr/faqs/smart-questions.html The developer list is not the place to post user questions. Have you looked at the keyboard monkey tutorial yet? http://www.k [LINK CENSORED FOR CROSSPOSTING.] ;- oh all right... here it is: http://www.keyboardmonkey.com/next/index.jsp -Original Message- From: Venkata Aleti [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 23:44 To: 'Struts Developers List'; Venkata Aleti Cc: '[EMAIL PROTECTED]' Subject: Help on mapping multiple records with formbean. Hi I have a view that include multiple editable rows , each row represents Employee information. Here view contains any number of rows, its dynamic. Now I want map this view to form bean so that I can Validate the user inputs and display error messages if any errors exist . Right now I have one solution providing index properties in the view. Please can you help me with the examples. View |name | age |empno| deptno |Description | |scott| 23 |100 | 10 || |peter| 33 |200 | 10 || |sunny| 34 |300 | 40 || |reddy| 24 |400 | 30 || |tom | 56 |500 | 10 || - - | Submit | - Thank you. Regards Venkata Aleti - 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: JSF RI Final is out!
Will it be OpenSource? (Banten) -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 00:18 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! I've come to the conclusion that I'm disappointed with JSF. Yes, I see what it's trying to accomplish, but it puts too much overhead in the JSP designer, you can't easily create dependencies in the controller, no exception handling, etc. http://forum.java.sun.com/thread.jsp?forum=427thread=490234 Based on what I've learned from JSF, I'm working on a framework called Banten which is an attempt to remove the need for Actions/Forms, etc (yes, I've jumped on the bandwagon). So then your actions can be chained on a single request as: #{orderController.order.addLineItem(param.id} #{orderController.order:validate()} I've finished the expression parser (it actually benchmarks a good deal faster than the current EL implementations). Now to finish the Controller :-) -Nerdy -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 8:14 AM To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Well its great to know the word is spreading... ...soon JSF will conquer all! muahahahaha ...I need some sleep :-( -Original Message- From: Dietmar Krause [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 22:18 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Return Receipt Your document:RE: JSF RI Final is out! was received by: Dietmar Krause/NRL/DE/Draeger at: 04.03.2004 15:14:56 - 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: JSF RI Final is out!
Another EL parser eh? Does it need a JSPContext? or can be used in servlets too? If so I would be very very interested in seeing you release it :-) -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 00:36 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Yeah, package is org.apache.banten.* I just ran some benchmarks for bean properties and method invocation through EL, and my version of the EL parser is running about 5 times faster, for bean property invocation. For straight method invocation (a replacement of the MethodUtils in Commons Bean Utils) it executes about 10-20 times faster and handles fuzzy best method lookup. I should almost release the expression parser separately. -Jake -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:25 AM To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Will it be OpenSource? (Banten) -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, 5 March 2004 00:18 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! I've come to the conclusion that I'm disappointed with JSF. Yes, I see what it's trying to accomplish, but it puts too much overhead in the JSP designer, you can't easily create dependencies in the controller, no exception handling, etc. http://forum.java.sun.com/thread.jsp?forum=427thread=490234 Based on what I've learned from JSF, I'm working on a framework called Banten which is an attempt to remove the need for Actions/Forms, etc (yes, I've jumped on the bandwagon). So then your actions can be chained on a single request as: #{orderController.order.addLineItem(param.id} #{orderController.order:validate()} I've finished the expression parser (it actually benchmarks a good deal faster than the current EL implementations). Now to finish the Controller :-) -Nerdy -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 8:14 AM To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Well its great to know the word is spreading... ...soon JSF will conquer all! muahahahaha ...I need some sleep :-( -Original Message- From: Dietmar Krause [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 22:18 To: Struts Users Mailing List Subject: RE: JSF RI Final is out! Return Receipt Your document:RE: JSF RI Final is out! was received by: Dietmar Krause/NRL/DE/Draeger at: 04.03.2004 15:14:56 - 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: Viewing .pdf files usign struts frames work..
Since you are writing the response from your action you should return null from execute() to indicate to struts that the response has been handled and that it should not forward. -Original Message- From: Vasudevrao Gupta [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 22:58 To: 'Struts Users Mailing List'; 'Satya Narayan Dash' Subject: Viewing .pdf files usign struts frames work.. Hi All, I am trying to view a pdf file using struts frame work.. I am able to view the file ,but it throws an illegalStateException as struts forward the request after I send the output stream. Below is the action mapping: action name=enquiryFormBean path=/viewScannedFile scope=request type=com.rwe.thameswater.els.enquiry.action.ViewScannedFileRefActioninput= /screens/enquiry/jsp/ADS_ELS_CreateEnquiry.jsp validate=true forward name=SUCCESS path=/screens/enquiry/jsp/ADS_ELS_ScannedFile.jsp /forward /action below is the action class execute() method: try { MessageResources resource = this.getResources(request); String scannedFileFolder = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_LOCATN); System.out.println(scannedFileFolder+scannedFileFolder); String scannedFileExtn = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_EXTN); System.out.println(scannedFileExtn+scannedFileExtn); String scannedFileLocation = scannedFileFolder + request.getParameter(scannedFileReference) + scannedFileExtn; System.out.println(scannedFileLocation+scannedFileLocation); String contentType = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_CONTENT); System.out.println(contentType+contentType); response.setContentType(contentType); File pdfFile = new File(scannedFileLocation); response.setContentLength((int) pdfFile.length()); FileInputStream in = new FileInputStream(pdfFile); request.setAttribute(FILE,in); OutputStream out = response.getOutputStream(); byte[] buf = new byte[4096]; int count = 0; while ((count = in.read(buf)) = 0) { out.write(buf, 0, count); } out.flush(); in.close(); out.close(); } catch (Exception e) { // Report the error using the appropriate name and ID. System.out.println(Exception found while viewing+e); errors.add(name, new ActionError(id)); } return (mapping.findForward(SUCCESS)); } Please suggest me anyother alternative using the struts framework Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Viewing .pdf files usign struts frames work..
Well thats a browser/pdf plugin issue. Nothing to do with struts. -Original Message- From: Vasudevrao Gupta [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 23:14 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Viewing .pdf files usign struts frames work.. I tried that..It does not give an error but when I close the browser window in which the .pdf is displayed, it gives a microsoft error and closes all other browsers -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 8:23 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Viewing .pdf files usign struts frames work.. return null from the action instead of returnign a forward. -Original Message- From: Vasudevrao Gupta [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 3:58 PM To: 'Struts Users Mailing List'; 'Satya Narayan Dash' Subject: Viewing .pdf files usign struts frames work.. Hi All, I am trying to view a pdf file using struts frame work.. I am able to view the file ,but it throws an illegalStateException as struts forward the request after I send the output stream. Below is the action mapping: action name=enquiryFormBean path=/viewScannedFile scope=request type=com.rwe.thameswater.els.enquiry.action.ViewScannedFileRefActioninput= /screens/enquiry/jsp/ADS_ELS_CreateEnquiry.jsp validate=true forward name=SUCCESS path=/screens/enquiry/jsp/ADS_ELS_ScannedFile.jsp /forward /action below is the action class execute() method: try { MessageResources resource = this.getResources(request); String scannedFileFolder = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_LOCATN); System.out.println(scannedFileFolder+scannedFileFolder); String scannedFileExtn = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_EXTN); System.out.println(scannedFileExtn+scannedFileExtn); String scannedFileLocation = scannedFileFolder + request.getParameter(scannedFileReference) + scannedFileExtn; System.out.println(scannedFileLocation+scannedFileLocation); String contentType = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_CONTENT); System.out.println(contentType+contentType); response.setContentType(contentType); File pdfFile = new File(scannedFileLocation); response.setContentLength((int) pdfFile.length()); FileInputStream in = new FileInputStream(pdfFile); request.setAttribute(FILE,in); OutputStream out = response.getOutputStream(); byte[] buf = new byte[4096]; int count = 0; while ((count = in.read(buf)) = 0) { out.write(buf, 0, count); } out.flush(); in.close(); out.close(); } catch (Exception e) { // Report the error using the appropriate name and ID. System.out.println(Exception found while viewing+e); errors.add(name, new ActionError(id)); } return (mapping.findForward(SUCCESS)); } Please suggest me anyother alternative using the struts framework Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Viewing .pdf files usign struts frames work..
A workaround may be found here: www.mozilla.org hehe ;- (Actually if your doing any javascript stuff its worth downloading for the javascript debugger alone... save hours of time!) -Original Message- From: Paul-J Woodward [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 March 2004 23:05 To: Struts Users Mailing List Subject: RE: Viewing .pdf files usign struts frames work.. That would most likely be Microsoft incompetence... and the struts solution is much cleaner. Paul Vasudevrao Gupta [EMAIL PROTECTED] 03/03/2004 15:13 Please respond to Struts Users Mailing List To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject:RE: Viewing .pdf files usign struts frames work.. I tried that..It does not give an error but when I close the browser window in which the .pdf is displayed, it gives a microsoft error and closes all other browsers -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 8:23 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Viewing .pdf files usign struts frames work.. return null from the action instead of returnign a forward. -Original Message- From: Vasudevrao Gupta [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 3:58 PM To: 'Struts Users Mailing List'; 'Satya Narayan Dash' Subject: Viewing .pdf files usign struts frames work.. Hi All, I am trying to view a pdf file using struts frame work.. I am able to view the file ,but it throws an illegalStateException as struts forward the request after I send the output stream. Below is the action mapping: action name=enquiryFormBean path=/viewScannedFile scope=request type=com.rwe.thameswater.els.enquiry.action.ViewScannedFileRefActioninput= /screens/enquiry/jsp/ADS_ELS_CreateEnquiry.jsp validate=true forward name=SUCCESS path=/screens/enquiry/jsp/ADS_ELS_ScannedFile.jsp /forward /action below is the action class execute() method: try { MessageResources resource = this.getResources(request); String scannedFileFolder = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_LOCATN); System.out.println(scannedFileFolder+scannedFileFolder); String scannedFileExtn = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_EXTN); System.out.println(scannedFileExtn+scannedFileExtn); String scannedFileLocation = scannedFileFolder + request.getParameter(scannedFileReference) + scannedFileExtn; System.out.println(scannedFileLocation+scannedFileLocation); String contentType = (String) resource.getMessage(ELSEnquiryConstantsIF.SCANNED_FILE_CONTENT); System.out.println(contentType+contentType); response.setContentType(contentType); File pdfFile = new File(scannedFileLocation); response.setContentLength((int) pdfFile.length()); FileInputStream in = new FileInputStream(pdfFile); request.setAttribute(FILE,in); OutputStream out = response.getOutputStream(); byte[] buf = new byte[4096]; int count = 0; while ((count = in.read(buf)) = 0) { out.write(buf, 0, count); } out.flush(); in.close(); out.close(); } catch (Exception e) { // Report the error using the appropriate name and ID. System.out.println(Exception found while viewing+e); errors.add(name, new ActionError(id)); } return (mapping.findForward(SUCCESS)); } Please suggest me anyother alternative using the struts framework Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this
RE: Question
If you want to get better answers quicker Id suggest you learn the concept of 'meaningful subjects' for emails. Question is not a meaningful subject line. http://www.catb.org/~esr/faqs/smart-questions.html Ok now on to your Question. Having been kind enough to take the time to read it to see if its something I can help with I have found you are in luck. So here is an answer: For 'complex' stuff like this you could make full use nested beans as demonstrated in this tutorial: http://www.keyboardmonkey.com/next/index.jsp In this case as its just one column of text fields you could also get away with just using a collection property in your actionform, and you could back it with a lazy list from commons collections: http://jakarta.apache.org/commons/collections/api/index.html Your view rendering code could iterate through the collection rendering out fields for each: ie renders the html: input name=condition[3] value=foo/ (I think the nested tags can do the indexing for you if your using JSP? not sure. Dont use jsp myself) Your 'add' button or 'conditions link' or whatever would submit and on the server side you try to get the next three items from the lazylist causing them to be instatntiated by the factory you specify. On return to the view the extra fields are rendered ready for input. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 4 March 2004 06:03 To: [EMAIL PROTECTED] Subject: Question Hello All, I have a requirement, where on page we have 3 fields named condition1, condition2, and condition3. These three fields are text fields. No problem in doing that. Now the requirement is that if the user wants to add more conditions they can click on the more conditions link and then we are suppose to show next three conditions.. and this process in not finite it can be any number of conditions. How can i handle that ? Any solution. I heard something like indexed property in ActionForm. Can someone please explain what is the best to do in such scineario. Thanks in advance, Vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)
When I was fresh out of uni - back before the turn of the century, I interviewed for a position like that. Didnt get it, but one of the things they tested me was for typing speed (I scored 60wpm as I recall. Reckon I could better that nowdays though!) It was one of those small seceratial outsourcing companies (who needed someone to manage their network and software and such like) so I guess the idea of interviewing anyone without giving them a typing test was simply heretical. Pity, I reckon that could have been a fun job. -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 22:08 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage) Of course, it's possible to take that to the extreme. The first place where I worked when I moved to America, was so small that I was the IS department! :-) Simon -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 9:47 PM To: Struts Users Mailing List Subject: RE: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage) Ive found the best way to avoid those kind of morons is to work at small companies where any deadwood has nowhere to hide and is quickly pruned :-) Our tech leads really know their stuff here. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Your Message to struts-user@jakarta.apache.org is Blocked
Im suddenly getting these emails to me stating that my post to struts-user was blocked for containing a virus (nonsense!). These messages contain a fancy html page with the text: snip CxProtect™: Virus Found Notification Your Message is Blocked since It contained virus/Spam Mail send by local user or Contained virus which Neutralized and option set as Delete Infected Mail Message was addreessed to: [EMAIL PROTECTED] /snip They do not appear to be from Jakarta (nor is my message to the user list blocked), which would seem to indicate that they are autoresponses probably from someone subscribed to the list. I like this not. Getting autoresponses everytime I post to struts-user is most declasse. There ought to be some policy against subscribing to the list with an address that has autoresponders hooked up to it. Its just not cricket. snip Return-Path: [EMAIL PROTECTED] X-Sieve: cmu-sieve 2.0 Received: from mail.s2lmail.com (mail.s2lmail.com [207.36.47.126]) by gridnode.com (8.12.9/8.12.4) with SMTP id i22EXpVm027236 for [EMAIL PROTECTED]; Tue, 2 Mar 2004 22:33:54 +0800 Date: Tue, 2 Mar 2004 22:33:51 +0800 Message-Id: [EMAIL PROTECTED] Received: (qmail 17175 invoked by uid 0); 2 Mar 2004 14:20:13 - From: CxProtect [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Your Message to [EMAIL PROTECTED] is Blocked X-Mailer: Calibre - eCourier 3 X-AVNotify: CxProtect Notification Message X-Priority: 1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=_NextPart_93A4-2189-002F26C1-054B /snip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Grid..........
Hang on one cotton pickin minute... snip We are developing a web application where in we are using the MVC architecture..Hence we are using the Jsp for the view. /snip Since when did MVC imply JSP? -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Monday, 1 March 2004 16:39 To: Struts Users Mailing List Subject: Re: Grid.. Sounds great.. On 1 Mar 2004, at 06:05, Milind P wrote: Hi All! Iam a new developer using the struts framework... We are developing a web application where in we are using the MVC architecture..Hence we are using the Jsp for the view. Now the problem is our project demands to dsiplay the data and read the same from a grid. So how do I do this . - 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]
Using commons-collections lazylist for nested actionforms
Im about to have a go using the lazylist stuff in commons-collections 2.1 to implement some nested actionforms stuff (previously Ive always been initialising the lists the hard way in my reset method!). http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect ions/ListUtils.html Anyhow , one thing that struck me from reading the description was the bit about... snip Object obj = lazy.get(3); After the above code is executed, obj will contain a new Date instance. Furthermore, that Date instance is the fourth element in the list. The first, second, and third element are all set to null. /snip ...how the elements before the requested one are initialised to null. Does this mean that Im going to encounter problems if the browser decides to submit my parameters in the wrong order for example: foo[2].bob=blah foo[2].baz=yada foo[1].bob=blah foo[1].baz=yada foo[0].bob=blah foo[0].baz=yada My html will have the items in the correct order - but does that necessarily mean the browser has to submit in that order - and if it doesnt will my use of the lazylist stuff be broken? (And I do already know that some broswers submit fields in different orders if you happen to have been messing round with that html on the clientside using javascript to modify the dom synamically though I wont be doing that here) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using commons-collections lazylist for nested actionforms
Cheers mate! Exactly what I was hoping to hear :-) -Original Message- From: Arron Bates [mailto:[EMAIL PROTECTED] Sent: Monday, 1 March 2004 17:57 To: [EMAIL PROTECTED] Subject: Re: Using commons-collections lazylist for nested actionforms No worries about the order of the submit. The nulls are just place holders. Whenever an oject for a given index is requested, it looks to see if it's out of bounds, or null. In both those cases it will use the factory to make an object and populate the index. The other scenario is that there's already a non-null object for that index, in which case it's already solved. Cheers, Arron. Im about to have a go using the lazylist stuff in commons- collections 2.1 to implement some nested actionforms stuff (previously Ive always been initialising the lists the hard way in my reset method!). http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect ions/ListUtils.html Anyhow , one thing that struck me from reading the description was the bit about... snip Object obj = lazy.get(3); After the above code is executed, obj will contain a new Date instance. Furthermore, that Date instance is the fourth element in the list. The first, second, and third element are all set to null. /snip ...how the elements before the requested one are initialised to null. Does this mean that Im going to encounter problems if the browser decides to submit my parameters in the wrong order for example: foo[2].bob=blah foo[2].baz=yada foo[1].bob=blah foo[1].baz=yada foo[0].bob=blah foo[0].baz=yada My html will have the items in the correct order - but does that necessarily mean the browser has to submit in that order - and if it doesnt will my use of the lazylist stuff be broken? (And I do already know that some broswers submit fields in different orders if you happen to have been messing round with that html on the clientside using javascript to modify the dom synamically though I wont be doing that here) - 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: Parameters to an Action in struts-config.xml
Yes. Here is an example: action path=/blah type=com.example.MyAction className=com.example.MyActionMapping name=blah scope=request set-property property=foo value=hamlet/ set-property property=bar value=othello/ set-property property=baz value=romeo / /action You set the className attribute of the actionmapping to your ActionMapping subclass that has setters (and usually getters) for the properties you want. You have to set those properties using the set-property element (darn nuisance) to get around the dtd. And remember that the properties belong not to the action instance but to the mapping so in your action you could use mapping.getFoo() to get the value... hth Andrew -Original Message- From: Boaz Barkai [mailto:[EMAIL PROTECTED] Sent: Monday, 1 March 2004 18:05 To: 'Struts Users Mailing List' Subject: Parameters to an Action in struts-config.xml Hi Is there a why to give config parameters to an Action entry in the struts-config.xml (I mean several parameters - the parameter attribute isn't enuff) Thanks Boaz - 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: java.lang.NullPointerException struts form is null
Well... doublecheck your mapping in struts config. If you misspelled the class name or got the wrong form name struts can be rather silent about it and just give you a null form! -Original Message- From: as as [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 00:29 To: [EMAIL PROTECTED] Subject: java.lang.NullPointerException struts form is null Hi, Struts form is giving null in my action class .execute().Below are my files.Hep appreciated.Thanks import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; /** * * @struts.action * path=/addTeacher * name=teacherAddForm * scope=request * validate=false * * @struts.action-forward * name=success * path=/teachers.jsp * * @struts.action-forward * name=failure * path=/error.jsp */ public final class TeacherAddAction extends Action { /** * @param actionmapping The ActionMapping * @param actionform The ActionForm object * @param httpservletrequest The httpservletrequest of the incoming request * @param httpservletresponse The httpservletresponse corresponding to the request * @param ActionForward The return path */ public ActionForward execute( ActionMapping mapping, ActionForm actionform, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println(In TeacherAddAction:); TeacherAddForm teacherAddForm = (TeacherAddForm) actionform; if (teacherAddForm == null) teacherAddForm = new TeacherAddForm(); else System.out.println(teacherAddForm is not null); try { Teacher teacher= null; teacher.setLast(teacherAddForm.getLast()); ** Thanks! - Do you Yahoo!? Get better spam protection with Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] MacOS X Java/Struts development (was RE: [OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available))
snip Feeling Like I Just Started Another OS Shouting Match /snip Yeh, cos windows is like really really g00d. Yeh. All us 133t [EMAIL PROTECTED] d00ds use it n' stuff. So dont be like putting it down cos its totally 133t and like .net will [EMAIL PROTECTED] owns linux and mac soon. Yeh. Ye gods! Mother warned me about staying up past bedtime. Looks like its all true. (Im outta here. Night all!) ;- -Original Message- From: Andy Engle [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 00:24 To: Struts Users Mailing List Subject: RE: [OT] MacOS X Java/Struts development (was RE: [OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available)) Nguyen, Hien [EMAIL PROTECTED] wrote: I'm using Panther (OS X 10.3) with Eclipse, tomcat, mySQL and things are working perfectly fine. The latest JDK on OS X is 1.4.2. Same here. I like it all pretty well, but the only minor drawback is that sometimes I think the Eclipse interface in OS X is a little clunky. But that's just with Eclipse -- you might find that other IDEs aren't that way. All the other great features of OS X definitely make up for it though. I don't see how you could go wrong with getting rid of your Windoze setup. And after how many hours I spent in a failed effort yesterday trying to simply *install* XP on my in-laws computer, I'd encourage you to! I have no plans of ever going back to the Windoze world -- enough of that pathetic junk is enough. Feeling Like I Just Started Another OS Shouting Match, Andy - 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: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)
Ive found the best way to avoid those kind of morons is to work at small companies where any deadwood has nowhere to hide and is quickly pruned :-) Our tech leads really know their stuff here. -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Tuesday, 2 March 2004 06:28 To: Struts Users Mailing List Subject: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage) While the original flame war was less helpful, the question that has emerged from it's ashes is a good one. I don't claim to have all the answers, but I can offer some personal observations. Feel free to disagree. 1. You can do nothing about those who choose not to learn. I've tried changing them and it doesn't work. I consider this a basic fact. 2. You have a great deal of control over your ability to learn. If you aren't big time into learning, then I recommend catching some enthusiasm for it. 3. There will be always be good and bad tech leads. I am a tech lead; I try to be a good one. I can put a String to standard out or standard error! ;-) 4. I had the same frustrations that you have. I made the decision that the best way to restore the balance of good in the universe, was to try to become the kind of tech lead that I would have wanted when I was a newbie/humble grunt. I teach a class on learning Java one lunchtime a week and try to bestow a little wisdom and encouragement whenever I can. I am a Java mentor here and I lead a study group of us that are seeking our Java Certification. 5. No one reads documentation. This is a fact. Learn what is drop dead fired and escorted from the building important and then try to auto-generate it. :-) 6. Leadership is a rare commodity. There's a lot of management out there, but precious little leadership. Again, deal with it. Become a leader and just do what needs to be done. This is what I have tended to do. The ol' saying about it's easier to ask forgiveness than permission is very true (except I sometimes forget to ask for forgiveness! :-) 7. Black team? How 90's, Our team wears Hawaiian shirts! (Honest. :-) Simon -Original Message- From: P K [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 3:58 PM To: [EMAIL PROTECTED] Subject: RE: [OT] RE: Memory usage Sorry to continue on this topic. I've learnt a great deal of non struts stuff on this list and this only adds to it. I've been bothered (mostly in my mind) with questions about peoples capabilities and desires when it comes to work. Viru, this original poster of the question on Memory Usage clearly has a desire to learn, but what about people who don't? How do you deal with them? I currently work with a Tech Lead who wouldn't be able to output a String to standard out if asked to write a program. I don't care about her taking credit for the work that we do. She doesn't provide any leadership whatsoever to the project except produce paper that no one bothers to read. Have you guys come across situations like this? What have you done about it? Don't get me wrong - I am not prone to complaining nor do I think I am a member of the elite 'Black Team'. Quoting Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED]: +1 I agree with everyone who has responded. We should not clutter this very friendly mailing list with things that don't belong here, that includes not so nice responses. I haven't been on many, but this is by far my favorite list, even though I am mainly a spectator. I lashed out because this question clearly didn't belong here. If the person had followed anything in http://www.catb.org/~esr/faqs/smart-questions.html, it must that they were polite. They certainly didn't do much investigation outside on the internet. The little bit of unfriendliness, I dunno why it came out. Unprofessional, it shouldn't have came out. Even questions that don't belong here deserve to be treated with respect. That is the single most obvious characteristic of STRUTS-USER that is distinctive (even though it has lots of other good qualities). Unfortunately, you decided to unload on a poster in a manner that is decidedly out of the norm for STRUTS-USER. Your response is the kind of behavior that creates problems for the perception of open source projects as being friendly to users or not. If you think the topic is totally out of scope for STRUTS-USER, then you should either (a) answer the question anyway but point people to where they should really be asking; (b) *gently* encourage the user to explore the other resources that are available (the archives are full of examples of folks who have done this), or (c) shut your yap and press DELETE instead of SUBMIT on your replies :-). The culture of the STRUTS-USER list has always been *deliberately* different from the you idiot, how could you be so stupid as to ask that question in that way sort of attitude that far too many open source projects have. Fortunately, despite the fact that this is the
[OT] Applet communication with web app
Quick question: Given an applet that is part of a web app, what is the usual (best/easiest?) technique for said applet to communicate with the server and vice-versa: 1. Handle the socket stuff itself and open a connection with the server 2. Use RMI 3. Other? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JSP or Velocity
Hehe, I love this programmers vs designer concept. Every place Ive worked its always the same poor sod (ie: yours truly) who has to do both roles. ...and why is it Im always the only one who sees the advantages of monospaced green text on a black background. Darn users always wanting their proportional fonts, and yucky pastel colours. Garrrgh! -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 06:07 To: Struts Users Mailing List Subject: RE: [OT] JSP or Velocity Navjot, Though I haven't tried Velocity, I like the idea that my stub-pages can be easily edited in HTML editors. How do your manage letting your designers alter the JSP layouts? Do you have them use some (and if so, what is it) HTML editor which is (Stuts JSP EL) aware? Regards, David -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 9:31 AM To: Struts Users Mailing List Subject: RE: [OT] JSP or Velocity Basically, i use velocity only for email templates and sometimes to generate other kind of templates from one template where the use of XSLT is not appropriate. For web templates, that have more complex requirements, i prefer to use taglibs. besides el makes life as easy as we may talk in velocity. In velocity, to comprehend taglibs, you may have have to write lots of velocimacro. you may ask for another opinion on velocity-user list as well. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 21:26 To: [EMAIL PROTECTED] Subject: Re: [OT] JSP or Velocity [EMAIL PROTECTED] 02/27/04 5:44 AM I am starting to develop an application using struts and have been looking round the rest of the Jakarta project and came across the Velocity project. I was interested to see which which people recommended for a relative newbie After looking at velocity, I am certainly of the opinion that it adds no value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination does not. The only difference is that velocity is a bit more terse (if/else/end instead of c:choose/c:when/c:otherwise) and that it uses # instead of the . It is important to note that I am talking about jsp2 and tomcat 5, not the jsp1 in tomcat 4. A while back I looked in detail at the jsp/velocity comparison on the velocity site. There are several issues with the comparison. The person writing the case study was cleary biased towards velocity and had never even considered JSTL (which in all fairness may not have been available at that time). Looking at the code (both the velocity and jstl versions are below) I think that velocity clearly had an influence on the jsp2/jstl constructs. The first thing I noticed was that the two pages do not do the same thing. The jsp turns off the session (the vm does not). The jsp stores variables that are never used which were factored out in the vm version. The vm version is missing required code (for example, the repCode and urlEvent variables are never defined). The jsp page is also *very* poorly written using scriptlets. You should rarely need to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you will not ever *need* to. With struts, you do not need to use jsp:useBean tags either because the controller does that for you. The jsp2/jstl version is a bit more verbose because it is based on xml so you cannot have things like if/else/end because they are unbalanced, but other than that, there are no significant differences. After converting the page to use JSTL and eliminating ALL of the % % stuff, we get something more like this: === The JSP version: === table width=600 border=0 cellspacing=0 cellpadding=4 bgcolor=white tr td ibTopic: ${meeting.topic}/b/i c:forEach list=${meeting.storedEventsIterator} var=event c:set var=yapper value=${meeting.participation[event.fromId]} / c:choose c:when test=${event.class.name eq 'fqcn.URLPushedEvent'} c:choose c:when test=${yapper.role eq 'R'} c:set var=repId value=${yapper.participantId} / font color=#00b${yapper.name}:/b/font /c:when c:otherwise font color=#f0b${yapper.name}:/b/font /c:otherwise /c:choose a href=${event.storedData}${event.storedData}/a br /c:when c:when test=${event.class.name eq 'fqcn.ChatEvent'} c:choose c:when test=${yapper.role eq 'R'} font color=#00b${yapper.name}:/b/font c:set var=repId value=${yapper.participantId} / /c:when
RE: Problem with loss form (session scope)
Ah! So the form is there! Just not the values? hehe , ok I better explain about reset(). The reset() method is always called (by the request processor) before it populates the form from the request. (As you noticed this occurs regardless of validation results). The reason for this is due to the (primary) purpose of the reset() method, which is not so much to reset the form to default values, but rather to act as a workaround for the issue that browsers do not submit values for certain types of fields when they are empty - for example multiple select fields, and unticked checkboxes. With a request scoped form you get a fresh form everytime anyway so this issue isnt often an issue, but with a session scoped form it can be. Now if a user were to untick a checkbox on a form or deselect all items in a multiple select box, or clear out all the text from a textarea, _nothing_ (not even an empty string) is submitted in the request for that field. (Remember at its heart the submitted request is just a bunch of name=value lines, and this is converted to a map by the servlet api, struts (or rather beanutils) iterates the parameter names in said map and calls the appropriate setters in the actionform with the value) As a result the setter is not going to be invoked as there is _no_ parameter in the request for that field. Thus the value in the actionform will not be cleared, and the unticking of the checkbox will not be seen on the server side. By clearing the value for the field in reset() before populate is called the value is cleared. If the value submitted was not empty, then the setter will be called and the correct value replaced, if not then the cleared value remains in the form as the setter is not called so either way the form reflects what the user entered in the UI. This is all well and good if all the fields are present in the UI, but if not - such as in the case of a multiple page wizard - then we are going to be clearing values in the actionform that should not be cleared. The answer to this is to keep track of which page the user was submitting from and only clear values in reset() for fields that are on that page - leaving the others untouched. (You can submit the page id in a hidden field and check its value with request.getParameter() if needs be). hth Andrew -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 06:03 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) One thing I found out that the reset method was getting called everytime if there is no error return from validation. This could cause the form to be reset to the original state. -betty -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 12:07 AM To: Struts Subject: RE: Problem with loss form (session scope) Hmm. That does sound rather odd! Like you say, should not be like that. :-( Only thing I can thing of here is: Is it the same session? (grasping at straws now!) Try println/logging the sessionId from the action and see if its still the same as first time through. -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:39 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) I am sorry. I only have 1 action map to this form. So, I guess the name doesn't matter in this case. Basically, what I am saying is the first time I hit this action, the form constrctor will get called but the 2nd time the action get called, this shouldn't happen, but it does. Yes, that's what I am planning to do next, download the source code and stepped through it. -Betty -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 11:18 PM To: Struts Subject: RE: Problem with loss form (session scope) Ah, but you didnt actually answer my question. Is it the same name for the form in both actions mappings, and do both these action mappings specify the scope to be session? My suspicion is that the problem is that struts is trying to find the form under a different key in the second action - but is this second action actually the same action as the first or different as I am assuming? btw: have you gone and looked at the struts source code for the request processor and request utils class to see what it is actually doing? (Tracing through with a debugger can be quite enlightening). One of the common attitudes in open source is that the source is the best reference and I certainly found this the case when I was first learning struts :-) -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:10 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) I specify my own name in the struts config. In my action, I just grabbed the action form from
RE: servlet.getDebug
umm... if I recall this was to do with the logging output level right? Yeh. 1.1 deprecates that. Instead it expects this all to be configured in your logging impl. 1.1 uses commons-logging (a logging api wrapper) that allows the actual logger used to be pluggable. Unfortunately configartion of the logging level is now implementation dependent, and afaik I dont believe struts provides a convienient way to get at it anymore as its no longer something managed by struts but rather left to the implementation in question. -Original Message- From: Dean A. Hoover [mailto:[EMAIL PROTECTED] Sent: Saturday, 28 February 2004 08:03 To: [EMAIL PROTECTED] Subject: servlet.getDebug I am a newbie reading Struts in action and am attempting to build the logon example in chapter 3. I am using Struts 1.1 and unfortunately the book is written primarily to Struts 1.0, which was the stable version at time of writing. Anyway, I get this when I build a couple of the java files: warning: getDebug() in org.apache.struts.action.ActionServlet has been deprecated [javac] if (servlet.getDebug() = Constants.DEBUG) Is there some recommended replacement for that construct? Thanks. Dean Hoover - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with loss form (session scope)
Hmm. That does sound rather odd! Like you say, should not be like that. :-( Only thing I can thing of here is: Is it the same session? (grasping at straws now!) Try println/logging the sessionId from the action and see if its still the same as first time through. -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:39 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) I am sorry. I only have 1 action map to this form. So, I guess the name doesn't matter in this case. Basically, what I am saying is the first time I hit this action, the form constrctor will get called but the 2nd time the action get called, this shouldn't happen, but it does. Yes, that's what I am planning to do next, download the source code and stepped through it. -Betty -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 11:18 PM To: Struts Subject: RE: Problem with loss form (session scope) Ah, but you didnt actually answer my question. Is it the same name for the form in both actions mappings, and do both these action mappings specify the scope to be session? My suspicion is that the problem is that struts is trying to find the form under a different key in the second action - but is this second action actually the same action as the first or different as I am assuming? btw: have you gone and looked at the struts source code for the request processor and request utils class to see what it is actually doing? (Tracing through with a debugger can be quite enlightening). One of the common attitudes in open source is that the source is the best reference and I certainly found this the case when I was first learning struts :-) -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:10 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) I specify my own name in the struts config. In my action, I just grabbed the action form from the execute method. And I am assumming struts fw get that from session for me in this case, rather than creating a new one for this request since my form is in session scope. Is this right assumption? -Betty -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 10:59 PM To: Struts Users Mailing List Subject: RE: Problem with loss form (session scope) What attribute did you set the form to be stored under? If none will default to form name. You are storing under same attribute key yes? Both actions mapping also defined the scope to be session? -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 14:51 To: 'Struts Users Mailing List' Subject: RE: Problem with loss form (session scope) In struts config's action definition, I set up the action to use a form in session scope. What I found out was, somehow the form constructor get called the 2nd time the action get called. To my understanding, if you set up the form in session, the form will only get created once. Any idea? -Betty -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 9:06 PM To: Struts Users Mailing List Subject: Re: Problem with loss form (session scope) Without seeing your jsp/struts-config.xml/action its a bit of a guessing game. I'm a bit confused by you saying ...at this point, I set up this form bean as session scope. To me this implies your getting a form not in session scope (i.e. request) and saving it yourself in session scope. If that is the case - then maybe thats your problem - if the struts-config.xml says its request, thats where struts will look for it and, if it doesn't exist, it'll set a new one up in request scope (even if you already have one under the same name in session). If I've got it wrong, then maybe you could explain further. I'm also not clear whether your finding out your form has been 'wiped' as soon as you get into your action and before you set it up as session scope or after that when you get to your detail screen. Could you clarify that as well please. Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 27, 2004 3:41 AM Subject: RE: Problem with loss form (session scope) Well, sorry for being vague. It's a very vague problem, that's why it's very difficult to explain the details. This only happen to one of my action. I had a list inside a form. And one of the column render a link to the detail page. But I need to do some processing before I redirect to the detail. So I wrote the link to do a form post it back to the caller action. In that case, I can collect some information, at this point, I set up this form bean as session scope. But everytime the post
RE: [OT] JSP or Velocity
Havent used velocity myself , but from what Ive seen it is very good. (Theres also a very good introduction for newbies in Teds Struts in Action book where hes given a chapter to using velocity with Struts) That said, if you learn JSP its probably a much more portable skillset that will stand you in good stead for future projects and jobs, and theres a lot of freely available taglibs out there you can utilise. Much more support on the list too for any problems you may come across, and of course theres the Tiles stuff which (again Ive not used!) is really very very cool and powerful! My own personal opinion of JSP otoh is rather low. I just dont like the whole 'vibe' of it! Suffice it to say Im not a big fan of serial rendering mechanisms - especially where the page layout and rendering instructions are combined in the same file - and also much prefer a mechanism where I can render to any part of the view at any part of my rendering process (Im using a homebrew library for this that revolves around using a tree of decorator classes to modify xhtml DOM templates - there are some open source libraries for DOM based rendering available too such as XMLC which you might want to look at if you have time). Of course that power comes at a cost in terms of performance and memory usage, but for the type of apps Im working on its not really an issue. But weighing up the arguments for your case, Id say the best advice I can give is that nobody got sacked for choosing JSP and its the one with the most mindshare despite its flaws, so you wont go wrong going with it for your project even if it can be a pain to work with sometimes! -Original Message- From: A.White [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 20:45 To: [EMAIL PROTECTED] Subject: [OT] JSP or Velocity Howdy I am starting to develop an application using struts and have been looking round the rest of the Jakarta project and came across the Velocity project. I was interested to see which which people recommended for a relative newbie Cheers Andrew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JSP or Velocity
Yes, Velocity has been around for quite awhile now, and it was intended to address many of the problems inherent in (older versions of) JSP. Nowdays JSP (especially JSP2) coding techniques and technologies have rather caught up with velocity. Your assesment that it doesnt add much value over the EL capabilities in JSP2 is pretty much on the mark. Of course it wasnt always this way and for a long time velocity was much nicer. (Still looks nicer ;-) I reckon you are also correct in believing that velocity design provided a lot of the inspiration for the jstl stuff. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 21:26 To: [EMAIL PROTECTED] Subject: Re: [OT] JSP or Velocity [EMAIL PROTECTED] 02/27/04 5:44 AM I am starting to develop an application using struts and have been looking round the rest of the Jakarta project and came across the Velocity project. I was interested to see which which people recommended for a relative newbie After looking at velocity, I am certainly of the opinion that it adds no value over jsp2/jstl. It offers absolutely nothing that the jsp2/jstl combination does not. The only difference is that velocity is a bit more terse (if/else/end instead of c:choose/c:when/c:otherwise) and that it uses # instead of the . It is important to note that I am talking about jsp2 and tomcat 5, not the jsp1 in tomcat 4. A while back I looked in detail at the jsp/velocity comparison on the velocity site. There are several issues with the comparison. The person writing the case study was cleary biased towards velocity and had never even considered JSTL (which in all fairness may not have been available at that time). Looking at the code (both the velocity and jstl versions are below) I think that velocity clearly had an influence on the jsp2/jstl constructs. The first thing I noticed was that the two pages do not do the same thing. The jsp turns off the session (the vm does not). The jsp stores variables that are never used which were factored out in the vm version. The vm version is missing required code (for example, the repCode and urlEvent variables are never defined). The jsp page is also *very* poorly written using scriptlets. You should rarely need to use scriptlets in jsp1/jstl pages, and I suspect with jsp2/jstl, you will not ever *need* to. With struts, you do not need to use jsp:useBean tags either because the controller does that for you. The jsp2/jstl version is a bit more verbose because it is based on xml so you cannot have things like if/else/end because they are unbalanced, but other than that, there are no significant differences. After converting the page to use JSTL and eliminating ALL of the % % stuff, we get something more like this: === The JSP version: === table width=600 border=0 cellspacing=0 cellpadding=4 bgcolor=white tr td ibTopic: ${meeting.topic}/b/i c:forEach list=${meeting.storedEventsIterator} var=event c:set var=yapper value=${meeting.participation[event.fromId]} / c:choose c:when test=${event.class.name eq 'fqcn.URLPushedEvent'} c:choose c:when test=${yapper.role eq 'R'} c:set var=repId value=${yapper.participantId} / font color=#00b${yapper.name}:/b/font /c:when c:otherwise font color=#f0b${yapper.name}:/b/font /c:otherwise /c:choose a href=${event.storedData}${event.storedData}/a br /c:when c:when test=${event.class.name eq 'fqcn.ChatEvent'} c:choose c:when test=${yapper.role eq 'R'} font color=#00b${yapper.name}:/b/font c:set var=repId value=${yapper.participantId} / /c:when c:otherwise font color=#f0b${yapper.name}:/b/font /c:otherwise /c:choose a href=${event.storedData}${event.storedData}/a br /c:when /c:choose /c:forEach hr br${meeting.meetingId}:${repId}br /td /tr /table === The velocity version: === table width=600 border=0 cellspacing=0 cellpadding=4 bgcolor=white tr td ibTopic: $meeting.getTopic()/b/ip #foreach( $event in $meeting.getStoredEventsIterator() ) #set( $yapper = $meeting.getParticipation($event.getFromId()) ) #if( $event.getClass().getName().equals($urlEvent) ) #if( $repRole.equals($yapper.getRole()) ) #set( $repId =
RE: JavaScript Parameter
Mozilla has a JavaScript debugger that is very very useful for stepping through the code to see where the error crops up. Worth downloading and learning to use. Has saved many hours time for me I can say! (alerts() are still very useful though. Espcially for bugs that only come up in IE!) -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, 26 February 2004 18:58 To: Struts Users Mailing List Subject: Re: JavaScript Parameter First when debuging javascript alert boxes are handy. alert(this.form,'%= val %') or alert(this.form,'c:out value=${val} /') or on tc 5 alert(this.form,'${val}') if that does what you want start debuging the functions by using alert boxes. function myfunction(form,val) { alert(form.name); alert(val); } onclick=myfunction(this.form,'%= val %') if you use double quotes like you seem to be you may have to escape them, generally easier to use ' rather than when calling functions in the html (in the actual script I prefer to stick to as more readable). and so on. You should get to the bottom of your problem soon enough. On 26 Feb 2004, at 05:32, Anirudh Jayanth wrote: Hi, I have a scriptlet % String val=obj.getValue(Key); % I need to use this value to be passed as a javascript parameter inorder to set a property value. html:image pageKey=.. altKey=.. onclick=jsFunction(form,%=val%) / The parameter value is not being passed to jsFunction This works when I use a hardcoded value html:image pageKey=.. altKey=.. onclick=jsFunction(form,1234) / I have tried these variations aswell html:image pageKey=.. altKey=.. onclick=jsFunction(form,%=val%) / html:image pageKey=.. altKey=.. onclick=jsFunction(form,'%=val%') / Cud somebody please tell me the correct way to do this. Regards, Anirudh - 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: FormBeans: A question of Style
Im with camp 3 then I guess. Way I see it , forms are view components, there to provide an object for both action and JSP to be able to access the state of the screen. (Fields values and other bits of information that are needed to recreate the html, and a place to hold the state of the view (ie: submitted field values) on the server side for the controller (action) to read from) Maybe we should raise an issue in bugzilla against the userguide? Forms have no business transfering stuff from view to model. The model should never have to see an actionForm and should be blissfuly unaware of their very existence. Thats the job of an action to do, taking data from the form, and providing it to the model and vice versa (preferably with some kind of helper classes and perhaps also non-form DTOs involved) -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 12:12 To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style Dam - I was in Camp 3: Form beans are View components...but looking in the user guide... Note: While ActionForm beans often have properties that correspond to properties in your Model beans, the form beans themselves should be considered a Controller component. As such, they are able to transfer data between the Model and View layers. Niall - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 27, 2004 1:57 AM Subject: FormBeans: A question of Style We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: [ANNOUNCE] Struts 1.2.0 Test Build available
Ah I see. Its just the jars, tlds, dtds necessary for a struts app, sans docs. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 13:52 To: Struts Users Mailing List Subject: RE: [ANNOUNCE] Struts 1.2.0 Test Build available Cool bananas! Many thanks to the struts team for all the work they have put into this build. :-) Whats the lib archive for? -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 13:48 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [ANNOUNCE] Struts 1.2.0 Test Build available The Struts 1.2.0 Test Build is now available here: http://www.apache.org/~martinc/struts/v1.2.0/ This is the first Struts build being made available following the same test-and-release process that has been used successfully by the Tomcat team for some time. It is *not* an official Apache release. Once feedback has been collected on the stability and general quality of this build, a determination will be made as to whether it should be promoted to Alpha status. -- Martin Cooper - 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: [ANNOUNCE] Struts 1.2.0 Test Build available
Cool bananas! Many thanks to the struts team for all the work they have put into this build. :-) Whats the lib archive for? -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 13:48 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [ANNOUNCE] Struts 1.2.0 Test Build available The Struts 1.2.0 Test Build is now available here: http://www.apache.org/~martinc/struts/v1.2.0/ This is the first Struts build being made available following the same test-and-release process that has been used successfully by the Tomcat team for some time. It is *not* an official Apache release. Once feedback has been collected on the stability and general quality of this build, a determination will be made as to whether it should be promoted to Alpha status. -- Martin Cooper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with loss form (session scope)
friday Yeh. I like had one, and like I went out to lunch, and it was like a long lunch, and like when I came back my form was like you know totally like gone. In fact like, I couldnt even like you know find my whole session, and I was like whoa! dude - wheres my session?. /friday ;- Perhaps you could be a bit more specific about the problem you encountered? -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 10:09 To: 'Struts Users Mailing List' Subject: Problem with loss form (session scope) Anyone has experience lost of form that are scoped in session? Thanks -Betty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with loss form (session scope)
What attribute did you set the form to be stored under? If none will default to form name. You are storing under same attribute key yes? Both actions mapping also defined the scope to be session? -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 14:51 To: 'Struts Users Mailing List' Subject: RE: Problem with loss form (session scope) In struts config's action definition, I set up the action to use a form in session scope. What I found out was, somehow the form constructor get called the 2nd time the action get called. To my understanding, if you set up the form in session, the form will only get created once. Any idea? -Betty -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 9:06 PM To: Struts Users Mailing List Subject: Re: Problem with loss form (session scope) Without seeing your jsp/struts-config.xml/action its a bit of a guessing game. I'm a bit confused by you saying ...at this point, I set up this form bean as session scope. To me this implies your getting a form not in session scope (i.e. request) and saving it yourself in session scope. If that is the case - then maybe thats your problem - if the struts-config.xml says its request, thats where struts will look for it and, if it doesn't exist, it'll set a new one up in request scope (even if you already have one under the same name in session). If I've got it wrong, then maybe you could explain further. I'm also not clear whether your finding out your form has been 'wiped' as soon as you get into your action and before you set it up as session scope or after that when you get to your detail screen. Could you clarify that as well please. Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 27, 2004 3:41 AM Subject: RE: Problem with loss form (session scope) Well, sorry for being vague. It's a very vague problem, that's why it's very difficult to explain the details. This only happen to one of my action. I had a list inside a form. And one of the column render a link to the detail page. But I need to do some processing before I redirect to the detail. So I wrote the link to do a form post it back to the caller action. In that case, I can collect some information, at this point, I set up this form bean as session scope. But everytime the post happened, it seems like the form content got wiped out. -Betty - 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: FormBeans: A question of Style
snip I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. /snip True snip How one can populate resultset in action form which will automatically get populated in html table.. /snip Shouldnt be passing a resultset to the JSP. Better to extract the info you need from it so you can free up the connection before forwarding to the JSP. Take a look at: http://jakarta.apache.org/commons/beanutils/api/ -Original Message- From: Pradeep, PK [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:02 To: Struts Users Mailing List Subject: RE: FormBeans: A question of Style I think whatever you do you can't make JSP and Action Class independent. Where are you populating ActionForm Object from the results from service layer? In Action class only right? Which you know very well for which JSP page it will be applicable. Also is it easy to populate all what you need in ActionForm? How one can populate resultset in action form which will automatically get populated in html table.. -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:41 AM To: Struts Users Mailing List Subject: Re: FormBeans: A question of Style I consider the ActionForms to be part of the view primarily. They should both collect submitted data and provide the JSP (or other view components) with most or all the data they need to render the page (camp 2). I say 'most' only because sometimes custom tags can be useful for getting data for list boxes, etc. All the data that the Action collects, however, should be carried to the JSP in the ActionForm. The alternatives for carrying data from Actions to JSPs for the camp 1 gang are not attractive, in my opinion. Having an Action put a bunch of stuff into the request or session scope creates a lot of coupling between the Action and JSP. The Action must know where to put it and the JSP must know where to find it with that scenario. I prefer to keep the Actions and JSPs loosely coupled by having them both depend on the ActionForm, rather than depending on each other. The Action populates the ActionForm, and the JSP renders it. For complex pages, the ActionForm can be the root of an object graph that contains all the data you need to render the page. Stashing additional info all over the session and request is sloppy by comparison, in my opinion. I think the ActionForm is the root of all view data approach promotes more concentrated thought about the structure of the data, which is a good thing. It provides a more concrete interface between the controller (Action) and view (JSP) components. Maintaining JSPs that get their data from one place is much easier than maintaining JSPs that have to collect, organize, and display data from multiple sources. JSPs that pull data from the ActionForm, stuff stashed in the session, and/or stuff stashed in the request are harder to maintain. Where do I find it? How does it all relate? Yuk! -Max On Thu, 2004-02-26 at 17:57, [EMAIL PROTECTED] wrote: We have 2 camps of thought on the subject of the appropriate use of Struts form beans. Here are the thoughts: Camp 1: Form beans are controller components and should be used only to transport user input data between JSP forms (or across JSP forms) and Action classes. Camp 2: Form beans should be use for what Camp 1 thinks, plus they should also contain all the data a JSP uses to render a page (i.e. All the model data is inserted into the form bean as well as the form data.) Any thoughts? Scott - 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: Problem with loss form (session scope)
Ah, but you didnt actually answer my question. Is it the same name for the form in both actions mappings, and do both these action mappings specify the scope to be session? My suspicion is that the problem is that struts is trying to find the form under a different key in the second action - but is this second action actually the same action as the first or different as I am assuming? btw: have you gone and looked at the struts source code for the request processor and request utils class to see what it is actually doing? (Tracing through with a debugger can be quite enlightening). One of the common attitudes in open source is that the source is the best reference and I certainly found this the case when I was first learning struts :-) -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 15:10 To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Problem with loss form (session scope) I specify my own name in the struts config. In my action, I just grabbed the action form from the execute method. And I am assumming struts fw get that from session for me in this case, rather than creating a new one for this request since my form is in session scope. Is this right assumption? -Betty -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 10:59 PM To: Struts Users Mailing List Subject: RE: Problem with loss form (session scope) What attribute did you set the form to be stored under? If none will default to form name. You are storing under same attribute key yes? Both actions mapping also defined the scope to be session? -Original Message- From: Betty Koon [mailto:[EMAIL PROTECTED] Sent: Friday, 27 February 2004 14:51 To: 'Struts Users Mailing List' Subject: RE: Problem with loss form (session scope) In struts config's action definition, I set up the action to use a form in session scope. What I found out was, somehow the form constructor get called the 2nd time the action get called. To my understanding, if you set up the form in session, the form will only get created once. Any idea? -Betty -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, February 26, 2004 9:06 PM To: Struts Users Mailing List Subject: Re: Problem with loss form (session scope) Without seeing your jsp/struts-config.xml/action its a bit of a guessing game. I'm a bit confused by you saying ...at this point, I set up this form bean as session scope. To me this implies your getting a form not in session scope (i.e. request) and saving it yourself in session scope. If that is the case - then maybe thats your problem - if the struts-config.xml says its request, thats where struts will look for it and, if it doesn't exist, it'll set a new one up in request scope (even if you already have one under the same name in session). If I've got it wrong, then maybe you could explain further. I'm also not clear whether your finding out your form has been 'wiped' as soon as you get into your action and before you set it up as session scope or after that when you get to your detail screen. Could you clarify that as well please. Niall - Original Message - From: Betty Koon [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 27, 2004 3:41 AM Subject: RE: Problem with loss form (session scope) Well, sorry for being vague. It's a very vague problem, that's why it's very difficult to explain the details. This only happen to one of my action. I had a list inside a form. And one of the column render a link to the detail page. But I need to do some processing before I redirect to the detail. So I wrote the link to do a form post it back to the caller action. In that case, I can collect some information, at this point, I set up this form bean as session scope. But everytime the post happened, it seems like the form content got wiped out. -Betty - 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: Problem updating bean from multi-select box
Are you making sure that the MyBean instance exists when the form is submitted? -Original Message- From: Andrew Bate [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 18:47 To: '[EMAIL PROTECTED]' Subject: Problem updating bean from multi-select box Hi, I am having a problem with the internals of BeanUtils/RequestUtils when my posting changes of a form to an action where the page contains a multi-select box. Can anyone spot what I am doing wrong from the code snippets below..? [MyBean] (inside the Form Bean) public void setMyFieldList(Collection myFieldList) (list containing the options to choose from) public Collection getMyFieldList() public void setMyField (Collection myField) (the field in question, multi-option) public Collection getMyField() [JSP] html:select property=myBean.myField multiple=true size=7 html:options name=myFormBean property=myBean.myFieldList/ /html:select The page renders fine and automatically selects the right items in the list but when the page is updated things blow up trying to update the data back into the bean inside RequestUtils. Do I need to do anything else to tell the posted data to go back into the main field (which is a collection)? Thanks, Andrew -- Andrew Bate Serco Justice Direct Line: (01452) 880433 Email: [EMAIL PROTECTED] This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. Serco cannot guarantee that the e-mail or any attachments are free from viruses. The views expressed in this e-mail are those of the originator and do not necessarily represent the views of Serco. Nothing in this e-mail shall bind Serco in any contract or obligation. Serco Group plc. Registered in England and Wales. No: 2048608 Registered Office: Serco House, 16 Bartley Wood Business Park, Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem updating bean from multi-select box
ok. Seems to rule out that possibility then. Whats the error your getting? -Original Message- From: Andrew Bate [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 19:09 To: 'Struts Users Mailing List' Subject: RE: Problem updating bean from multi-select box The form bean is in session and other fields work when hitting the action - just not this collection field with the multi-select date. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 10:54 To: Struts Users Mailing List Subject: RE: Problem updating bean from multi-select box Are you making sure that the MyBean instance exists when the form is submitted? -Original Message- From: Andrew Bate [mailto:[EMAIL PROTECTED] Sent: Monday, 23 February 2004 18:47 To: '[EMAIL PROTECTED]' Subject: Problem updating bean from multi-select box Hi, I am having a problem with the internals of BeanUtils/RequestUtils when my posting changes of a form to an action where the page contains a multi-select box. Can anyone spot what I am doing wrong from the code snippets below..? [MyBean] (inside the Form Bean) public void setMyFieldList(Collection myFieldList) (list containing the options to choose from) public Collection getMyFieldList() public void setMyField (Collection myField) (the field in question, multi-option) public Collection getMyField() [JSP] html:select property=myBean.myField multiple=true size=7 html:options name=myFormBean property=myBean.myFieldList/ /html:select The page renders fine and automatically selects the right items in the list but when the page is updated things blow up trying to update the data back into the bean inside RequestUtils. Do I need to do anything else to tell the posted data to go back into the main field (which is a collection)? Thanks, Andrew -- Andrew Bate Serco Justice Direct Line: (01452) 880433 Email: [EMAIL PROTECTED] This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. Serco cannot guarantee that the e-mail or any attachments are free from viruses. The views expressed in this e-mail are those of the originator and do not necessarily represent the views of Serco. Nothing in this e-mail shall bind Serco in any contract or obligation. Serco Group plc. Registered in England and Wales. No: 2048608 Registered Office: Serco House, 16 Bartley Wood Business Park, Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom. - 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] This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. Serco cannot guarantee that the e-mail or any attachments are free from viruses. The views expressed in this e-mail are those of the originator and do not necessarily represent the views of Serco. Nothing in this e-mail shall bind Serco in any contract or obligation. Serco Group plc. Registered in England and Wales. No: 2048608 Registered Office: Serco House, 16 Bartley Wood Business Park, Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom. - 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: ActionForms Thread Safe
snip If this is case then ActionForm are not thread-safe. Because Two request from different client can simultaneous come in and use the same ActionForm instance? I know this is not the case, but I cannot figure out how is it thread safe? /snip Actually it is the case! - but only in certain cases when you have a session scoped actionform. Under these conditions it is possible for more than one thread to be playing with that actionform at the same time. Where this could occur is when the user has multiple windows open (or does a very rapid double submit) and fires requests in both windows that map to the same action mapping. You will note that it only affects that particular session. Other sessions running at the same time will have their own actionforms of course, and different actionmappings can use different attribute keys to store the form under. So you only have a problem where you need to support multiple windows/frames (and thus potentially threads) for the same actionmapping for the same http session and you use session scoped forms. (Ive been there. Its a pain) We had a wee bit of a discussion about this last week in the context of 'workflow scopes': http://marc.theaimsgroup.com/?l=struts-userw=2r=1s=Request+against+Sessio nq=b And the moral of the story? Always keep your action forms REQUEST scoped if possible. (Sometimes it isnt , but 95% of the time it IS possible with a bit of thought and extra effort) (Request scoped forms only exist while a single thread is processing an action so they are always thread safe) -Original Message- From: Amish Patel [mailto:[EMAIL PROTECTED] Sent: Sunday, 22 February 2004 02:18 To: [EMAIL PROTECTED] Subject: ActionForms Thread Safe Hello All, I am new to struts. I have been reading about it and they way I understand the framework instantiate ActionForm is as follows. .. 1) Check to see if an instance of the ActionForm already has been created. 2) If an ActionForm instance is present in the appropriate scope and it's the same type as needed for the new request, reuse it. Otherwise, create a new instance of the required ActionForm and store it in the appropriate scope (set by the scope attribute for the action element). If this is case then ActionForm are not thread-safe. Because Two request from different client can simultaneous come in and use the same ActionForm instance? I know this is not the case, but I cannot figure out how is it thread safe? Please help! Thanks -Semplice _ Get a FREE online computer virus scan from McAfee when you click here. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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: multiple records in one form
Nested beans are your friend. Follow the monkey http://www.keyboardmonkey.com/next/index.jsp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, 21 February 2004 22:16 To: [EMAIL PROTECTED] Subject: multiple records in one form Hi List, I would like to create a form, with which the user fills in a number of say 10 records, in one and the same form. When clicking submit, all of the 10 records (with each 4 fields) should be updated to the database simulataneously. I found an item in the archives about this, but the answer, a single phrase use indexed properties was too cryptic for me as a newby to struts. I know I have to use String array properties (String[]) in stead of normal String properties, and use a logic:iteratetag, but I cannot seem to get it to work. I am not sure how to set the exact attributes of the logic:iterate tag, and how to point them to which Collection, and I seem to have problems too with the id attribute of logic:iterate: though I set it, the following bean:write name=... does not seem to connect to this id attribute - which it should if I understand it well. I get an error that the bean with this name is unknown. Does somebody have a working example for me available, which I could try out? I am real new to this, so I am afraid that short cryptic answers won't do for me :-( but working examples will help a lot more... :-) thanks, Rinke - 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: Eclipse + Tomcat plugin question
Maybe its a working directory thing? I know when I use sysdeo 2.2.1 (2.2 is buggy) with Eclipse 2.1 the working directory will be c:\eclipse (cos thats where my eclipse is), so any code in the webapp that makes the assumption that its working directory is the tomcat bin folder has problems. (In some cases I have sidestepped the issue by copying the things its looking for from bin to my eclipse folder. Yucky but it lets me run under eclipse and debug at least!... sigh/) -Original Message- From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 February 2004 19:05 To: [EMAIL PROTECTED] Subject: Eclipse + Tomcat plugin question Hi , sorry if this is not the right forum for this question: I am using Eclipse 3.0M6, Tomcat 5.0.18 and Sysdeo plugin for Tomcat 2.2.1, and Struts 1.1. everything works fine until I wanted to use Log4J in my code. When I start Tomcat from within Eclipse, it reports missing log4j.jar in Tomcat\bin; but after adding log4j-1.2.8.jar, new error msg saying that missing log4j-core.jar. I do not know why I need this as I thought there is only one log4j jar file. but googled and there is a log4j-core.jar but again, a new error came out saying that somethign to do with tomcat\conf\server.xml. lost now. appreciate your help ! li xin __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.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]
RE: overlapping cells in table with firebird
Have you tried 'dipping' the window? That is - dragging the window by its title bar partially off the bottom of the screen and back again to see if the forced re-rendering fixes the problem in the dipped part. Ive noticed the latest firebird sometimes stuffs up its rendering when it loads a page and needs to be forced to rerender (but not reload) the page sometimes. Ie - by dipping or hiding and reshowing thr window. If dipping corrects the problem then its a browser error rather than an error of yours. (Ive seen similar problems in IE in places also - especially where css and table cells backgrounds are involved) -Original Message- From: Frédéric Dreier [mailto:[EMAIL PROTECTED] Sent: Monday, 16 February 2004 16:39 To: Struts Users Mailing List Subject: overlapping cells in table with firebird Hi, When displaying struts page in firebird or mozilla for the first time (increased load time due to jsp compilation) I got some strange effect: Some table's cells overllaps themself. Redisplaying the page using F5 corrects the problem. It's non-dynamical HTML with an external CSS. I'm curious to know if someone else got this problem before asking mozilla guru. Regards, Frederic - 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: Java / J2EE Developer
Mate, if you wanted a sheltered workshop then you should have become a b***y sugar farmer. -Original Message- From: Andy Engle [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 February 2004 03:40 To: Struts Users Mailing List Subject: RE: Java / J2EE Developer James Mitchell [EMAIL PROTECTED] wrote: Looks like the only way to compete is to improve yourself. That works for me, what about you? I can improve myself all I want to, but if/when our CEO says that workers in India, China, or whatever other country work for pennies on my salary's dollar, then there goes my job. Our division leader has already said as much, and with that in mind I suspect that I'll be moving on within a few years. But the self-improvement comment is somewhat irrelevent, although to some degree I saw what you were getting at. The issue at hand is excessive corporate greed, and making the bottom line look as sweet to shareholders as possible. Even at the detrimental expense of the livelihood of a large number of highly-skilled American workers who have families, mortgages and lives to live. With that in mind, I find the act of outsourcing to be extremely disgusting. 'Nuff said. Back to the Struts discussions. And I apologize for further contributing to the off-topicness of this thread. Andy - 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: FileUploading Error
Hmmm. Sounds rather like a browser issue to me. You might want to see what is actually being passed in that request - if its actually a valid multipart request or not! I had a try in IE, but IE's file selector is too smart to allow selection of a folder as the upload file. Which browser are you using? -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: Tuesday, 17 February 2004 00:13 To: Struts Users Mailing List Subject: Re: FileUploading Error At 9:35 AM -0500 2/16/04, Mark Shifman wrote: In trying to bulletproof file uploading I noticed something odd. If I type some junk in the field for the file name and hit Submit, I get a file of size 0. I can deal with that. If I type in a directory name in my home directory (admittedly a dumb thing to type) nothing seems to happen and I get this error in my log file. ERROR 2004-02-13 14:09:18,679 handleRequest(CommonsMultipartRequestHandler.java:241) Failed to parse multipart request org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly ... This error seems to be thrown before it even gets to my UploadAction. How do I catch this and tell the user the file typed in is invalid? In Javascript, the value of the form field is the path to the file; you might be able to apply a mask validation testing for a reasonable filename -- this is far from perfect, but may help. I use this as a cheap way to get around the lack of support for the accepts attribute -- I test to see if the file has a right extension using the mask validator. Just one thought... Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining. -- Jef Raskin - 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] - Request against Session
snip My recommendation is to *always* use request scope form beans if you can. /snip Yes. Having done it both ways and experiencing the various tortures that session scoping inflicts apon us I would definately agree that if one can use the request scope (and with a little thought this should be possible in most situations) then do so. It eliminates so many hassles. That said, I do have a small minority of forms in one of the apps I did that could be in request but arent - the reason being most of the forms need session scope (see below) and they all share a ton of common code in the actions and renderers superclasses - and being able to make the same assumptions and reuse the same code makes life simpler rather than making special exceptions for those forms. snip The only reason a form bean should ever be in session scope is if you want it to preserve values across requests that are not included in the form on the current page. /snip There are two things I am doing with session scope that would be quite hard to do with request scope and they meet this criteria. (Well three if you include tab-panes, but if one drops support for netscrap6 then they can be done with css hiding now) The first is supporting multi-file fields. (Fields that allow uploading of n files). In this case we need somewhere to put those files or at least info about them (ie: session) until such time as the user has both finished adding files to the file fields on the form, and has also passed form validation. At which point we can finally process these files (for our apps this usually involves just persisting them somewhere.) It is imho (and more importantly in potential customers opinions too) quite unacceptable to force the user to re-upload all fifty billion huge files (a slight exageration) every time they make a typo or forget to fill in some other field on the form. I would think however that this wont play well with clustering (though one could write the files temporarily to a db instead of directly in the session I suppose). (Actually one can code this so that the form is request scoped and one only needs to keep the file manager object thingy in session (and pass its key in the request), but often the form only has a few other fields and its just easier to do it this way) The second thing that I use the session to support is what I call 'diversion'. The app I use this technique in is rather complex. There are several dozen different types of records that can be configured from the UI and most of them have references to other records of other types (foreign keys). Often times one is halfway through configuring one of these records when one realises that one has yet to configure the record it depends on (and the record the record it depends on depends on, etc... ad infinitum). The 'diversion' technique allows the user to divert off to create/edit the associated record without having to either abandon the record they are currently editing (its incomplete so they cant 'save/commit' it as it wont pass validation) or go back to the main window and navigate through the various views to the other records list to popup an edit form for the other record. Instead they simply click a diversion link ( a wee little arrow icon ) next to the select box and are whisked straight off to the edit form for the other record in the current window (either in create or edit mode depending on whether an instance was selected in the select box on the previous screen). They can create or edit the required record (including further diversions for its own dependencies) and once they save it (or cancel) they are returned back to the previous form in the operation stack with all values already input and files uploaded preserved as it was when they diverted. (I actually first came up with this in a vain attempt to try and avoid the need for popups but they were added to the requirements anyway, and in hindsight have made the app a lot more user friendly with both popups and diversions (which are rather like wizards in their ability to guide the user to things that need doing) being supported. Have had a fair bit of positive feedback about it when compared with an earlier swing based version of the app that didnt have this feature - so while its a nuisance to code the payoff is in higher user satisfaction) Since configuring a new installation of the app can involve setting up a lot of records (this aint no 3 form shopping cart) and remembering what needs to be set up in what order and how it all relates can be hard, this diversion mechanism has proved quite popular, and has made it a lot quicker to setup a new installation of the application, or to reconfigure an existing installation. Now I wouldnt recomend this technique for a high traffic public website that gets huge hitcounts, but for an _application_ that is (usually) accessed by intranet by a relatively small number of simultaneous users, and where the complexity of the application is high (and a
RE: Session Validation
Main problem with CMA is that its configuration is container dependent. If your writing an app that needs to be deployed straight to many different containers CMA can be troublesome. btw: if you are doing your own session based security - dont - put check tags in the JSP. Follow Niall's suggestion and hide them under WEB-INF and go through actions to get to them. You can put security checks for the session object in a filter, or if under servlet 2.2 you could override the request processor to do it. If you only need to run on one particular appserver at any moment, then CMA is the way to go unless your requirements are really wierd. Struts ActionMappings support specifying roles required for actions, and (unless you override the RP) this only works with CMA. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, 16 February 2004 12:06 To: Struts Users Mailing List; hhlow Subject: Re: Session Validation I'm not an expert on security but as I understand you have two choices. You can either implement container managed security - where the servlet container controls logging on and ensures that only authenticated users can have access to the resources you specify OR you can control it yourself within your application. It sounds to me like your asking about the second. Typically when your application controls security, you place something in the User's Session when the user logs on to indicate that they have done so. Then in your Action classes you check the session to see if they have logged on - if not you forward them to the logon screen. If your jsp's are available you also need to protect them - the struts sample used to have a tag (haven't looked at it recently) which did the same kind of check. Alternatively you could hide your jsps in the WEB-INF folder so that the user can't access them directly and you don't need to do the jsp check. The generally accepted view though is that it is better to choose the first option - container managed security. If you use Tomcat, have a look at the web.xml file for the Tomcat admin application (In Tomcat 4.1 its in the \server\webapps\admin\WEB-INF folder). The admin app is actually a Struts application. The security-constraint, login-config and security-role sections are what controls container managed security for that app. Tomcat Admin app web.xml: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/webapps/admin/WEB- INF/web.xml?rev=1.8view=auto Niall - Original Message - From: hhlow [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 16, 2004 2:45 AM Subject: Session Validation Hi, I am sorry if this question have been asked before. How can i check session validation? to check whether if the user is authenticated on each page. I read somewhere about Filters but i still do not know how to implement it. Currently I use a LoginAction to check the user details against the database and then do the appropriate forwarding. Thank you Clement - 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] - Request against Session
snip How it is implemented is not important. /snip Well except in that the abstraction cannot be total due to the underlying technology limitations imposed by working with http and browsers over which one has very little control. My example of multiple windows and not knowing when windows are closed illustrates this. Even with a framework in place a developer really needs to be aware of what is going on below his code to support this extra context and sometimes has to add code to supplement this. The session provided by the servlet api has similar difficulties as can be seen with the need for the developer to ensure that they invoke url rewriting on links to cover the case where cookies are disabled. Limiting to one window (and using tokens and other such techniques to ensure that the user sticks to one window) can simplify matters immensely. (The customers desire for multiple windows often rules out this possibility though. Having to suddenly change to support multiple windows when one had been developing all along with a one window restriction can be especially annoying (been there)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, 13 February 2004 16:46 To: [EMAIL PROTECTED] Subject: RE: [OT] - Request against Session But what we are talking about is the concept functionality.And what you are saying is the implementation. Agreed the workflow container is in session scope .But for the user(The developer), it gives the choice of an additional scope definition.How it is implemented is not important. Any how, when we are talking about any such implementation/Concept, we have to implement it in the context of available APIs. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 11:53 PM To: Struts Users Mailing List Subject: RE: [OT] - Request against Session At 07:50 AM 2/12/2004, you wrote: If user has different windows in different windows, then only the latest windows workflow is honoured.SO all other window will have lost thier workflow state if any...Which is desired behaviour in workflow like situations...Where you dont want user to have multiple windows open and accidently submit an old window with stale data thinking he was working with the latest data... But you are right in the sense that all such stuff should go in framework... This, I think, is a misunderstanding of what happens. There STILL is a workflow container in session scope, and what is MORE, even where you don't need a workflow container, you still have one in session scope. - 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] - Request against Session
snip To maintain functionality across a standard scope (request, session, application) something in the work flow application will have to go into that scope or into some other equivalent persistence mechanism such as a database. If the work flow application maintains the persistence, then it is merely using the regular scopes. And, it does not provide any new scope. /snip Yes, the WorkflowScope can never be any more than a way of abstracting some of the tiresome details of managing such session scoped stuff across requests. The code that makes use of the so-called WOrkflowScope can treat it conceptually as a new scope that has many characteristics in common with the session, but underneath it really is just a part of the session or maybe stuff put in a db. That 'stuff' will obviously use storage space (RAM or DB), and knowing when it is ok to discard it is the tricky bit (whether your implementing a workflow framework or doing a one off thing for a particular use case). The worst case scenario is that everything added remains until the session is expired. The best scenario is that everything is removed as soon as it is no longer needed. Depending on the nature of the app, the reality is likely to be somewhere between the two as there are some cases of abandoning a workflow that simply cannot be reliably detected (ie: window closure). -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, 13 February 2004 16:57 To: Struts Users Mailing List Subject: RE: [OT] - Request against Session At 12:45 AM 2/13/2004, you wrote: But what we are talking about is the concept functionality.And what you are saying is the implementation. Agreed the workflow container is in session scope .But for the user(The developer), it gives the choice of an additional scope definition.How it is implemented is not important. Any how, when we are talking about any such implementation/Concept, we have to implement it in the context of available APIs. I too am talking about the concept and not an implementation. Nothing in what I said is implementation specific. There simply is no such thing as work flow scope. That is fiction. Whatever is retained in the work flow environment is retained in regular old scopes: request, session, application. The talk of workflow scope sounds good and fancy, but it means nothing. To maintain functionality across a standard scope (request, session, application) something in the work flow application will have to go into that scope or into some other equivalent persistence mechanism such as a database. If the work flow application maintains the persistence, then it is merely using the regular scopes. And, it does not provide any new scope. That is not a correct description of what is going on. That is all I am saying. Anyway, I am saying nothing that is implementation specific. That reading of my point is just wrong. - 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] - Request against Session
Your not thinking very hard about it obviously. Have a think about this scenario then (which is a common problem I and others have had to deal with before): User is presented with a table of records containing links to edit individual records. Clicking on the link opens the form for that record in a new window (or maybe it doesnt and the user chooses 'open in new window' themself from the context menu). This is because the user often needs to be working on lots of such records at the same time. Now let us assume that the ActionForm for the record editing form needs to go in session scope (nb: in request scope there is not a problem so if the design can be done practically with request scope that is much better). During the course of working with these records the browser is going to be making several trips back to the server to refresh that record. (Maybe it has several select boxes depending on each others value, or it pretends to do tabpanes or is some kind of wizard or whatever). Remember now that the user has several different such records open in different windows. Different record instances but same type of record - and record form - and record action (we are talking about the same ActionMapping here obviously). Have a think about whats going to be happening with that session scoped action form... -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Saturday, 14 February 2004 07:25 To: Struts Users Mailing List Subject: RE: [OT] - Request against Session That is correct, but these situations do not, so far as I can see, cause problems. At 01:50 PM 2/13/2004, you wrote: Actually, it's not two different sessions if the second window was opened from the first with a popup or a crtl-n or open in new window. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 2:30 PM To: Struts Users Mailing List Subject: RE: [OT] - Request against Session At 08:41 AM 2/13/2004, you wrote: My interpretation of that comment was that if a user has two windows open and are going back and forth between the windows, the system may use information from one window to update the information in the session that actually relates to the old window. This would be a pretty poor design, but it's the only interpretation I can guess. If there are two windows, there should be two sessions, and that should be okay. Right? - 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: [OT] - Request against Session
snip If there are two windows, there should be two sessions /snip No. Usually not. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Saturday, 14 February 2004 03:30 To: Struts Users Mailing List Subject: RE: [OT] - Request against Session At 08:41 AM 2/13/2004, you wrote: My interpretation of that comment was that if a user has two windows open and are going back and forth between the windows, the system may use information from one window to update the information in the session that actually relates to the old window. This would be a pretty poor design, but it's the only interpretation I can guess. If there are two windows, there should be two sessions, and that should be okay. Right? - 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] - Request against Session
hehe. +1 Also in UAT mode here :-( -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Saturday, 14 February 2004 01:18 To: Struts Users Mailing List Subject: Re: [OT] - Request against Session Thats okay. I should be doing be work too. :o) On 13 Feb 2004, at 17:26, [EMAIL PROTECTED] wrote: Hi Mark, Sorry for not responding to your mail. Just got bogged down with work today.Having a lot of issues with the UAT right now.I had started the mail for you.But could not write a satisfactory (Understandable)explanation in short time.So the mail is incomplete till now :-((. I will try to explain it now..(Hopefully there will be no more bugs to eb fixed till end of day...) BTW, I am HE :-)) and not SHE -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 5:22 PM To: Struts Users Mailing List Subject: Re: [OT] - Request against Session Am i to assume that there's no issue then ? or am i being too stupid to warrant a response? On 13 Feb 2004, at 09:55, Mark Lowe wrote: hi shirish You said something yesterday about never being sure what data is being displayed when using a session scoped action form, have you any references or can you elaborate? Sounds interesting, and I think its something I should know about. Cheers Mark On 13 Feb 2004, at 09:49, [EMAIL PROTECTED] wrote: ??? -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 11:56 PM To: Struts Users Mailing List Subject: RE: [OT] - Request against Session The work flow solution being talked about actually is the worst bloat for the session. It uses the work flow for all sessions. Indeed, it is used with every request processing. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: An off-road Question --- How to configure Eclipse for this feature.
Works for me. Can it resolve that particular class (ie: youve imported it without error?). Sometimes ive noticed that the hyperlink doesnt come up quickly and you sometimes have to move the mouse around a bit too! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 15:34 To: [EMAIL PROTECTED] Subject: An off-road Question --- How to configure Eclipse for this feature. hi guys, When you usually move the mouse pointer with ctrl key pressed, over a class name (B), the class name would turn as a hyperlink (blue color), and on click of the word (B), it will open the class in question. Example -- class A extends B{...} However, I am able to achieve this feature by blocking B and on right clicking it. I would like to know how to configure Eclipse for the 1st para feature (i mean, to see a hyperlink sort of feature, when mouse pointer is moved over (B)). TIA, S Srikanth Satyam Computer Services Limited 12 C P Ramaswamy Road Alwarpet Chennai 600018 Office +(91)-(44)-24983221 Extn 2767 - 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: An off-road Question --- How to configure Eclipse for this feature.
Which eclipse version are you using? Afaik, the class opening hyperlink was only introduced in 2.1, but in 2.0 you had to do it from the right click menu. Hmmm. Under preferences screen - javaeditors 'hovers' tab theres a 'source' option that seems to be it with a chackbox for enable disable, though when I tried disabling it just now to test it had no effect so maybe thats not the one. Sorry I cant be more help! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 17:50 To: Struts Users Mailing List Subject: RE: An off-road Question --- How to configure Eclipse for this feature. hi andrew, The hyperlink itself does not show up for me. Otherwise, the alternative way opens up the class file without errors. My need is how to configure Eclipse to achieve this hyperlink (on ctrl + mouse over) functionality. Regards S Srikanth Satyam Computer Services Limited 12 C P Ramaswamy Road Alwarpet Chennai 600018 Office +(91)-(44)-24983221 Extn 2767 Andrew Hill [EMAIL PROTECTED] To: Struts Users idnode.com Mailing List [EMAIL PROTECTED] cc: 02/12/2004 03:11 PM Subject: RE: An off-road Question --- How to configure Please respond to Eclipse for this feature. Struts Users Mailing List Works for me. Can it resolve that particular class (ie: youve imported it without error?). Sometimes ive noticed that the hyperlink doesnt come up quickly and you sometimes have to move the mouse around a bit too! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 15:34 To: [EMAIL PROTECTED] Subject: An off-road Question --- How to configure Eclipse for this feature. hi guys, When you usually move the mouse pointer with ctrl key pressed, over a class name (B), the class name would turn as a hyperlink (blue color), and on click of the word (B), it will open the class in question. Example -- class A extends B{...} However, I am able to achieve this feature by blocking B and on right clicking it. I would like to know how to configure Eclipse for the 1st para feature (i mean, to see a hyperlink sort of feature, when mouse pointer is moved over (B)). TIA, S Srikanth Satyam Computer Services Limited 12 C P Ramaswamy Road Alwarpet Chennai 600018 Office +(91)-(44)-24983221 Extn 2767 - 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: what is wrong with this code
I presume Konstanten.CONTINUE is continue and I see that forward will default to a non-redirecting forward looking at your config, so thats not the problem. Whats in the JSP? You sure you got the attribute key correct there? -Original Message- From: Mlinar, Mario [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 18:07 To: [EMAIL PROTECTED] Subject: what is wrong with this code putting an attribute in my request ... the jsp cant´t find it in there request.setAttribute(Konstanten.ADRESSEN_RESULT_START_INDEX_KEY, indexListWert); return mapping.findForward(Konstanten.CONTINUE); struts-config: action path=/adressenExtDetail type=de.shs.partnerportal.adb.ui.web.actions.AdressExtDetailAction parameter=/gp_detail_adressen.jsp name=adressenExtDetail scope=session validate=false input=/gp_detail_adressen.jsp forward name=continue path=/gp_detail_adressen.jsp / /action Any idea??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: what is wrong with this code
snip Using the solution with the Action shows no parameters /snip Attributes and Parameters are *not* the same thing. Attributes are server side only (and can be any type of object), while parameters are taken from the request itself and must be Strings. If you want this value as a parameter this can be achieved by modifying the request URL you return in the ActionForward. Since the ActionForward you lookup isnt modifiable (as its a shared instance) you could create a new ActionForward instance with the appropriate path and return that from the action. ie: ActionForward continue = mapping.findForward(Konstanten.CONTINUE); String continuePath = continue.getPath(); continuePath = addParam(continuePath, Konstanten.ADRESSEN_RESULT_START_INDEX_KEY, indexListWert); //assuming indexListWert is a string (you could concat it with one if its not ie: +indexListWert) return new ActionForward(continuePath, continue.getRedirect()); and where addParam is just a simple method to return a path with the parameter appended. Heres a very simple impl: protected String addParam(String url, String parameter, String value) { //Append parameter and value to url using ? if its the first param or if its not return url + ( (url.indexOf(?)==-1) ? ? : ) + parameter + = + value; } -Alternatively you can recode your JSP to look for it in the attributes instead of the params, though then you will lose the ability to specify it in the url. (Or you could have it check both) -Original Message- From: Mlinar, Mario [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 18:27 To: Struts Users Mailing List Subject: AW: what is wrong with this code Just to be sure what is in the request my code at the beginning of the jsp is: % java.util.Enumeration e2 = request.getAttributeNames(); while (e.hasMoreElements()) { String tempString = (String) e2.nextElement(); % %= tempString %=%= request.getAttribute(tempString) %br % } % And % java.util.Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String tempString = (String) e.nextElement(); % %= tempString %=%= request.getParameter(tempString) %br % } % Using this kind of link 'adressenView.do?adrStartIndex=5' shows an 'adrStartIndex=5' at the beginning of the jsp Using the solution with the Action shows no parameters ... where Konstanten.ADRESSEN_RESULT_START_INDEX_KEY = adrStartIndex Putting into the session works perfect :-( -Ursprüngliche Nachricht- Von: Andrew Hill [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Februar 2004 11:09 An: Struts Users Mailing List Betreff: RE: what is wrong with this code I presume Konstanten.CONTINUE is continue and I see that forward will default to a non-redirecting forward looking at your config, so thats not the problem. Whats in the JSP? You sure you got the attribute key correct there? -Original Message- From: Mlinar, Mario [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 18:07 To: [EMAIL PROTECTED] Subject: what is wrong with this code putting an attribute in my request ... the jsp cant´t find it in there request.setAttribute(Konstanten.ADRESSEN_RESULT_START_INDEX_KEY, indexListWert); return mapping.findForward(Konstanten.CONTINUE); struts-config: action path=/adressenExtDetail type=de.shs.partnerportal.adb.ui.web.actions.AdressExtDetailAction parameter=/gp_detail_adressen.jsp name=adressenExtDetail scope=session validate=false input=/gp_detail_adressen.jsp forward name=continue path=/gp_detail_adressen.jsp / /action Any idea??? - 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: what is wrong with this code
Not sure how tiles works internally, but I think like most JSP templating solutions its does a lot of inclusions (similar to forwards). These are server side so should preserve the request parameters. The included stuff could modify attributes but I doubt they would modify the ones you set (unless you included something that you had specifically coded to do so.) Anyhow I reckon your problem is the attribute vs parameter issue (see my other reply) so best check that out first. hth Andrew -Original Message- From: Mlinar, Mario [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 18:42 To: Struts Users Mailing List Subject: AW: what is wrong with this code Here is a snippet of my log org.apache.struts.action.mapping.instance=ActionConfig[path=/adressenView,pa rameter=/gp_detail_adressen.jsp,scope=session,type=de.shs.partnerportal.adb. ui.web.actions.AdressDetailActionorg.apache.struts.action.MODULE=org.apache. [EMAIL PROTECTED] [EMAIL PROTECTED] 12 Feb 2004 11:36:14,408 DEBUG - org.apache.struts.tiles.TilesRequestProcessor - processForwardConfig(/gp_detail_adressen.jsp, false) 12 Feb 2004 11:36:14,408 DEBUG - org.apache.struts.tiles.TilesRequestProcessor - '/gp_detail_adressen.jsp' - processed as uri 12 Feb 2004 11:36:14,408 DEBUG - org.apache.struts.action.RequestProcessor - processForwardConfig(ForwardConfig[name=continue,path=/gp_detail_adressen.js p,redirect=false,contextRelative=false]) Not sure wether I am interpreting this rigth, but it seems to me as there are 2 forwards?? -Ursprüngliche Nachricht- Von: Mlinar, Mario [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Februar 2004 11:27 An: Struts Users Mailing List Betreff: AW: what is wrong with this code Just to be sure what is in the request my code at the beginning of the jsp is: % java.util.Enumeration e2 = request.getAttributeNames(); while (e.hasMoreElements()) { String tempString = (String) e2.nextElement(); % %= tempString %=%= request.getAttribute(tempString) %br % } % And % java.util.Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String tempString = (String) e.nextElement(); % %= tempString %=%= request.getParameter(tempString) %br % } % Using this kind of link 'adressenView.do?adrStartIndex=5' shows an 'adrStartIndex=5' at the beginning of the jsp Using the solution with the Action shows no parameters ... where Konstanten.ADRESSEN_RESULT_START_INDEX_KEY = adrStartIndex Putting into the session works perfect :-( -Ursprüngliche Nachricht- Von: Andrew Hill [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Februar 2004 11:09 An: Struts Users Mailing List Betreff: RE: what is wrong with this code I presume Konstanten.CONTINUE is continue and I see that forward will default to a non-redirecting forward looking at your config, so thats not the problem. Whats in the JSP? You sure you got the attribute key correct there? -Original Message- From: Mlinar, Mario [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 18:07 To: [EMAIL PROTECTED] Subject: what is wrong with this code putting an attribute in my request ... the jsp cant´t find it in there request.setAttribute(Konstanten.ADRESSEN_RESULT_START_INDEX_KEY, indexListWert); return mapping.findForward(Konstanten.CONTINUE); struts-config: action path=/adressenExtDetail type=de.shs.partnerportal.adb.ui.web.actions.AdressExtDetailAction parameter=/gp_detail_adressen.jsp name=adressenExtDetail scope=session validate=false input=/gp_detail_adressen.jsp forward name=continue path=/gp_detail_adressen.jsp / /action Any idea??? - 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: struts actions and content/type responses
Your ImageAction could stream the result in the appropriate format itself. When done, return null instead of an ActionForward to indicate to struts that the Action has already handled writing the response. Not sure what headers etc... need to be set though. If you search the archive you can probably find some examples. hth Andrew -Original Message- From: Turner Benjamin [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 19:31 To: Struts-User (E-mail) Subject: struts actions and content/type responses hello, i am looking for a solution for the following problem: in my database i have various BLOB items which represent images (gif or jpg). i would like to create a struts action which returns this (by passing along a request parameter to the action which is the imageid in the database. is it possible to set the response content/type in an action and then return the image itself somehow? maybe with a requestdispatcher? any ideas/pointers to this would be welcome. ty, Ben - 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: struts actions and content/type responses
http://www.catb.org/~esr/faqs/smart-questions.html -Original Message- From: Jignesh Patel [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 19:42 To: Struts Users Mailing List Subject: Re: struts actions and content/type responses Hi Friend's I am trying to upload strut1.1 on the weblogic8.1 Any body guide me for the same? -jignesh - 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: Getting data from a disabled form field
Yep. The browser doesnt submit a value for the field if its disabled. If your using a request scoped actionform then you will either need to reload its value from wherever or add an additional hidden field on the form to submit the value. If its a session scoped form, just make sure that you dont clear it in reset. btw: if this is a security thing then you must make sure that your setters (or something else server side) dont accept different values for these fields when the user hasnt got appropriate rights as a user can easily play silly buggers with the url and script kiddies can easily spoof POST requests - both bypassing any kind of client side validation or 'security'. -Original Message- From: Arne Brutschy [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 21:32 To: Struts Users Mailing List Subject: Getting data from a disabled form field Hi, I have a problem with disabled form fields. I'm using a user entry form, which fields can be edited by the current user based on his group memberships. So a normal user without admin status cannot change the uid, as this field is disabled. My problem is, that after submitting the form, validation fails because of the validator which cannot read the uids field context (I assume because it's disabled). Trying to get the form data returns an empty string. Anyone encountered this type of problem? Is there any way around it? Regards, Arne - 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: Getting data from a disabled form field
They dont submit any parameter in the posted request. As a result, when struts populates the form, iterating the list of request parameters and calling the setters with the values it wont call the setter for that one. The value in the actionform thus depends upon the logic in the forms reset method - and if that field is not reset, upon the pre-existing value in the actionform which will remain unchanged. In the case of a request scoped form, this will of course be a new actionform instance so will give whatever the forms initial value is when the form is created. (Usually null) -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 21:46 To: Struts Users Mailing List Subject: Re: Getting data from a disabled form field i believe that disabled form elements return null. I hate to say it, but you could have the uid stored as a hidden variable in the case of the non admin user but still display a text field with the value displayed. On 12 Feb 2004, at 14:31, Arne Brutschy wrote: Hi, I have a problem with disabled form fields. I'm using a user entry form, which fields can be edited by the current user based on his group memberships. So a normal user without admin status cannot change the uid, as this field is disabled. My problem is, that after submitting the form, validation fails because of the validator which cannot read the uids field context (I assume because it's disabled). Trying to get the form data returns an empty string. Anyone encountered this type of problem? Is there any way around it? Regards, Arne - 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] - Request against Session
snip And then he has no more worries as to getting a bloated session, as the session gets trimmed of workflow objects as soon as user goes to any screen which is not part of work flow. /snip Unless of course the user simply closes the window. :-( If the user has multiple windows open all sharing a session and does different things in different windows things get really fun. Im not sure if the livinglogic workflow extension has anything to handle this as I havent used it, but I have some familiarity with some of the issues involved. But in my app I had to essentially manage mini-sessions within sessions (I call them Operation Contexts) and that involved using url rewriting to pass around the id of the OperationContexts so that Actions could identify which OperationContext a request was associated with. (The OperationContexts themselves being essentially an object with Map and some other info. (Or in fact a stack of Maps (to support some other requirements such as nav stacks), but thats starting to get off topic...)) I had overridden the RequestProcessor to allow ActionForms to be scoped to OperationContexts as well which was quite useful. Due to the nature of many of the forms in the app (things like any number of file uploads to a single field and slow access to persistence, and tab paney type stuff that had to work in Netscrap6) we really needed to use session scoped forms, but we also needed to support multiple windows open on html forms for different instances of the same record type (and thus same action and form mapping). Doing this in a frameworky way allows managing this to be abstracted away and so the code in the Actions ( form) can concentrate on the task at hand rather than on session management. As for the session management for this ... what a nightmare (bucket loads of javascript, popups submitting to the server to let it know a window closed, some filters, vast amounts of url rewriting). There are so many edge cases... (and its not actually possible to catch them all) - nasty stuff. If you can find a framework to manage this chaos for you then use it! Its not something you want to do yourself unless you really have to... btw: Ive posted about this Operation Context stuff before a few times so you can search the archive if you want more info. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 21:49 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [OT] - Request against Session The whole point is there is no concept of a Workflow scope in Servlet API and if you want to share objects , you have to put them in session.And then clearing them is not always easy, as you will never be clear when user may leave the workflow scope.And you have to code for it in every action. What this extension does is to leave all those details to framwrork, and the programmer just has to COnfigure the actions ,saying that they belong to a workflow.And then he has no more worries as to getting a bloated session, as the session gets trimmed of workflow objects as soon as user goes to any screen which is not part of work flow. HTH. regards, Shirish -Original Message- From: Robert Nocera [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 2:36 PM To: 'Struts Users Mailing List' Subject: RE: [OT] - Request against Session This is probably even more off topic, but I've seen this mentioned before. From what I can tell of their description of this workflow scope, it looks like it may be helpful as far as ease of use goes, but it doesn't offer any real technical benefit over the use of hidden form fields or sessions, in fact, the underlying implementation has to be something passing parameters of using the session, there just isn't any alternative in any compliant application servers. As far as the objects being cleared when the user leaves the workflow, how is that any different the using the session correctly? If the user goes on to another page that is not part of your current workflow you can clear those objects or you wait until the user's session times out -- those are really the only two options. -Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 4:21 AM To: [EMAIL PROTECTED] Subject: RE: [OT] - Request against Session Hi Guys, I think the issue over here is, in such cases we need a new scope(workflow scope).The existing scopes(request/session) do not suffice in such cases. ... The session scope can be used but it may not be cleared.So there has to be a solution at architecture level.And the struts workflow extension http://www.livinglogic.de/Struts/introduction.html ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
RE: [OT] - Request against Session
snip Surely if performance is that much of an issue then java would be the last technology you'd use. /snip What would you suggest for a high performing web application? snip If there are performance issue with this and you haven't abused the use of session then IMO this is a matter for the container developers. /snip Not much help when you have to fix a performance issue for a customer within 24 hours or lose a huge contract. That said, if you havent abused the session your very unlikely to get such performance issues unless it really is a container bug (time to switch containers). Of course what counts as abuse very much depends on your expected load (and things like whether you need to cluster). Whats abuse for a public portal with 1000 hits per second is just fine for an intranet app thats unlikely to have more than a dozen simultaneous hits... -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 February 2004 22:14 To: Struts Users Mailing List Subject: Re: [OT] - Request against Session While I found your solution interesting. But whether the session is bloated or not is other folk's problem. The javadoc for HttpSession says what its for, the other way is to persist out-side of the web tier which is another subject. Sure you don't want to use session for everything that would be silly, but its also there to be used. Its simply a matter of mind-set, if you want to get down to the metal then I'm not sure java is an ideal technology. From a web developer's pov you read the docs you see that httpsession is for certain situations and thus you use it. If there are performance issue with this and you haven't abused the use of session then IMO this is a matter for the container developers. Surely if performance is that much of an issue then java would be the last technology you'd use. On 12 Feb 2004, at 14:49, [EMAIL PROTECTED] wrote: The whole point is there is no concept of a Workflow scope in Servlet API and if you want to share objects , you have to put them in session.And then clearing them is not always easy, as you will never be clear when user may leave the workflow scope.And you have to code for it in every action. What this extension does is to leave all those details to framwrork, and the programmer just has to COnfigure the actions ,saying that they belong to a workflow.And then he has no more worries as to getting a bloated session, as the session gets trimmed of workflow objects as soon as user goes to any screen which is not part of work flow. HTH. regards, Shirish -Original Message- From: Robert Nocera [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 2:36 PM To: 'Struts Users Mailing List' Subject: RE: [OT] - Request against Session This is probably even more off topic, but I've seen this mentioned before. From what I can tell of their description of this workflow scope, it looks like it may be helpful as far as ease of use goes, but it doesn't offer any real technical benefit over the use of hidden form fields or sessions, in fact, the underlying implementation has to be something passing parameters of using the session, there just isn't any alternative in any compliant application servers. As far as the objects being cleared when the user leaves the workflow, how is that any different the using the session correctly? If the user goes on to another page that is not part of your current workflow you can clear those objects or you wait until the user's session times out -- those are really the only two options. -Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 4:21 AM To: [EMAIL PROTECTED] Subject: RE: [OT] - Request against Session Hi Guys, I think the issue over here is, in such cases we need a new scope(workflow scope).The existing scopes(request/session) do not suffice in such cases. ... The session scope can be used but it may not be cleared.So there has to be a solution at architecture level.And the struts workflow extension http://www.livinglogic.de/Struts/introduction.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP Include Vs. Struts Template Include
Not sure, but if you after a really good templating mechanism forget those two and take a look at the struts Tiles extension. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 17:04 To: [EMAIL PROTECTED] Subject: JSP Include Vs. Struts Template Include Hi guys, Can anyone help me understand the diff. between the JSP include (say including 2 to 3 .jsp pages in the main jsp) and Struts Template include tags. My main doubt is Why Struts template include tag is preferred over its counterpart? Confused with the pros. and cons. of both the approach. Awaiting your powerful replies. Friendly, S.Srikanth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need to modify the URL path of the forward dynamically
Need to modify the URL path of the forward dynamicallyGet the Forward instance as usual. Obtain its url string using getPath(). Add your additional parameter to end of string and create a new ActionForward instance that uses the decorated path (and copies the redirect property from the original action forward), and return this new actionforward instance. -Original Message- From: Swaminathan Rajagopalan [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 16:34 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Kamal_Poddar Subject: Need to modify the URL path of the forward dynamically Hi, We have a URL in the path attribute of a forward for an action. We need to dynamically append some request variables to this URL in the action class, for they are available only at execution time. How can this be achieved? E.g actionpath=/additionalAccountInfoScreen type=xxx.yyy.zzz.web.control.action.AdditionalAccountInfoScreenAction name=additionalAccountInfoForm validate=false input=previousPage parameter=populateStmt scope=session forward name=url path=http://www.xyz.com/checks/; To the URL path here e.g http://www.xyz.com/checks we need to add accessId=xxx at run time in the action class(http://www.xyz.com/checks?accessId=xxx). Please let us know how this can be done? Regards, Swaminathan Rajagopalan, Ph : (8520261) Extn: 55955 Mail : [EMAIL PROTECTED]
RE: Checkboxes inside a list
Was that for all the checkboxes - or just the ones that were not ticked? Can you show us a snippet of the actionform and the generated html? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 16:55 To: [EMAIL PROTECTED] Subject: Checkboxes inside a list Hi, Is it possible to have checkboxes inside a list? I tried this and the table in the JSP was rendered fine and the getters of the list elements were called correctly. However, after pressing submit the setters were not called, and thus the checkbox values were not transmitted into the bean. --markus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need to modify the URL path of the forward dynamically
From what Ive seen on the list, the way we are using seems to be pretty much standard practice. I did see some activity on the dev list regarding enhancing forwards to make doing this sort of thing easier, though I wasnt following closely so cant tell you what the outcome was. If its something you need to do a lot you may wish to create a method in your base action class that will take the name of a forward, some parameters to tack on, and go look up the forward and return a new instance with the parameters added to the path. I dont bother with that myself though. I do have some methods to deal with the ? vs when tacking on the url. Heres the code (2 methods) I use to do the appending (they live in a static class where I dump lots of odds and ends like this!): ummm... the encoder bit... hmmm. You could live without that if you dont try to append funny chars. :-) hehe. The original version of the method was a one-liner. public static String addParameterToURL(String url, String parameter, String value) { try { if(value != null) value = URLEncoder.encode(value, UTF-8); } catch(UnsupportedEncodingException e) { throw new NestableRuntimeException(Error encoding value + quotedString(value),e); } if(url == null) { return parameter + = + value; } else { return url + ( (url.indexOf(?)==-1) ? ? : ) + parameter + = + value; } } /** * Uses propertyutils to read parameters from source. Empty/null parameters are NOT appended. */ public static String addParametersToURL(String url, Object source, String[] parameters) { if( source == null ) return url; if( parameters == null || parameters.length == 0 ) return url; StringBuffer buffer = new StringBuffer(url == null ? : url); for( int i = 0; i parameters.length; i++ ) { String parameter = parameters[i]; if( stringNotEmpty(parameter) ) { String value = null; try { value = stringValue( PropertyUtils.getProperty(source, parameter) ); } catch(Throwable t) { value = null; } if( StaticUtils.stringNotEmpty(value) ) { buffer.append( buffer.indexOf(?)==-1 ? ? : ); buffer.append(parameter); buffer.append(=); try { buffer.append(URLEncoder.encode(value, UTF-8)); } catch(UnsupportedEncodingException e) { throw new NestableRuntimeException(Error encoding value + quotedString(value),e); } } } } return buffer.toString(); } -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 17:24 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Need to modify the URL path of the forward dynamically Andrew's procedure is what my team has done on one project, too. Originally, we tried getting the ActionForward and changing it directly, but it turns out that is a shared instance and changing the original was messing up other requests. After we discovered this problem, we switched to Andrew's scheme of creating a new ActionForward to return from the Action. I posted a message today with a note about dynamically adding a query string to an ActionForward in the URL does not change even after changing action thread. This thread has the details about how to do that. I am interested to hear from other folks if they have a novel way to do this (i.e. add a query string to an ActionForward). Anybody got a better way? -Max - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:36 AM Subject: RE: Need to modify the URL path of the forward dynamically Need to modify the URL path of the forward dynamicallyGet the Forward instance as usual. Obtain its url string using getPath(). Add your additional parameter to end of string and create a new ActionForward instance that uses the decorated path (and copies the redirect property from the original action forward), and return this new actionforward instance. -Original Message- From: Swaminathan Rajagopalan [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 16:34 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Kamal_Poddar Subject: Need to modify the URL path of the forward dynamically Hi, We have a URL in the path attribute of a forward for an action. We need to dynamically append some request variables to this URL in the action class, for they are available only at execution time. How can this be achieved? E.g actionpath=/additionalAccountInfoScreen type=xxx.yyy.zzz.web.control.action.AdditionalAccountInfoScreenAction name=additionalAccountInfoForm validate=false
RE: Need to modify the URL path of the forward dynamically
btw: stringNotEmpty(parameter) just does a check to see that the parameter isnt null or -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 17:25 To: Struts Subject: RE: Need to modify the URL path of the forward dynamically From what Ive seen on the list, the way we are using seems to be pretty much standard practice. I did see some activity on the dev list regarding enhancing forwards to make doing this sort of thing easier, though I wasnt following closely so cant tell you what the outcome was. If its something you need to do a lot you may wish to create a method in your base action class that will take the name of a forward, some parameters to tack on, and go look up the forward and return a new instance with the parameters added to the path. I dont bother with that myself though. I do have some methods to deal with the ? vs when tacking on the url. Heres the code (2 methods) I use to do the appending (they live in a static class where I dump lots of odds and ends like this!): ummm... the encoder bit... hmmm. You could live without that if you dont try to append funny chars. :-) hehe. The original version of the method was a one-liner. public static String addParameterToURL(String url, String parameter, String value) { try { if(value != null) value = URLEncoder.encode(value, UTF-8); } catch(UnsupportedEncodingException e) { throw new NestableRuntimeException(Error encoding value + quotedString(value),e); } if(url == null) { return parameter + = + value; } else { return url + ( (url.indexOf(?)==-1) ? ? : ) + parameter + = + value; } } /** * Uses propertyutils to read parameters from source. Empty/null parameters are NOT appended. */ public static String addParametersToURL(String url, Object source, String[] parameters) { if( source == null ) return url; if( parameters == null || parameters.length == 0 ) return url; StringBuffer buffer = new StringBuffer(url == null ? : url); for( int i = 0; i parameters.length; i++ ) { String parameter = parameters[i]; if( stringNotEmpty(parameter) ) { String value = null; try { value = stringValue( PropertyUtils.getProperty(source, parameter) ); } catch(Throwable t) { value = null; } if( StaticUtils.stringNotEmpty(value) ) { buffer.append( buffer.indexOf(?)==-1 ? ? : ); buffer.append(parameter); buffer.append(=); try { buffer.append(URLEncoder.encode(value, UTF-8)); } catch(UnsupportedEncodingException e) { throw new NestableRuntimeException(Error encoding value + quotedString(value),e); } } } } return buffer.toString(); } -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 17:24 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Need to modify the URL path of the forward dynamically Andrew's procedure is what my team has done on one project, too. Originally, we tried getting the ActionForward and changing it directly, but it turns out that is a shared instance and changing the original was messing up other requests. After we discovered this problem, we switched to Andrew's scheme of creating a new ActionForward to return from the Action. I posted a message today with a note about dynamically adding a query string to an ActionForward in the URL does not change even after changing action thread. This thread has the details about how to do that. I am interested to hear from other folks if they have a novel way to do this (i.e. add a query string to an ActionForward). Anybody got a better way? -Max - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:36 AM Subject: RE: Need to modify the URL path of the forward dynamically Need to modify the URL path of the forward dynamicallyGet the Forward instance as usual. Obtain its url string using getPath(). Add your additional parameter to end of string and create a new ActionForward instance that uses the decorated path (and copies the redirect property from the original action forward), and return this new actionforward instance. -Original Message- From: Swaminathan Rajagopalan [mailto:[EMAIL PROTECTED] Sent: Monday, 9 February 2004 16:34 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Kamal_Poddar Subject: Need to modify the URL path of the forward dynamically Hi, We have a URL in the path attribute of a forward for an action. We need to dynamically append some request variables to this URL in the action class
RE: [OT] RE: Orkut (read what the original message said)
Actually the message just said to mail Vic. Since mailing Vic and mailing the list are not mutually exclusive activities, your assertion that the message said not to mail the list is incorrect. Indeed since Vic reads messages posted to the list, a message to the list is a message to Vic. (and also a msg to a few thousand others who dont care - or in my case havent a clue what the message is even about!). ;- -Original Message- From: Peter Abbot [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 09:29 To: Struts Users Mailing List Subject: [OT] RE: Orkut (read what the original message said) Cant people read, it said email Vic NOT the email list! -Original Message- From: Dirk Manske (Service Respond) [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 2:27 p.m. To: 'Struts Users Mailing List' Subject: AW: Orkut add me please. thx. -Ursprüngliche Nachricht- Von: Oliver Thiel [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 10. Februar 2004 00:41 An: 'Struts Users Mailing List' Betreff: AW: Orkut ... me too ... thanks! -Ursprüngliche Nachricht- Von: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 10. Februar 2004 00:22 An: Struts Users Mailing List Betreff: RE: Orkut add me too :-) -R -Original Message- From: Babu, Bharathi [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 6:21 PM To: 'Struts Users Mailing List' Subject: RE: Orkut Please add me. -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 3:47 PM To: [EMAIL PROTECTED] Subject: RE: Orkut Can some one add me to the list please?? Thanks, Sree [EMAIL PROTECTED] 02/09/04 02:11PM Hi, Can someone please add me to Orkut Thanks in advance Cheers, Matthias -Original Message- From: Wiebe de Jong [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 6:33 PM To: 'Struts Users Mailing List' Subject: RE: Orkut Hello, Please add me to Orkut. Thanks -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Vic Cekvenich Sent: Sunday, February 08, 2004 8:16 PM To: [EMAIL PROTECTED] Subject: Orkut If you want to join Struts in Orkut Social Network send me an e-mail saying so. .V (if you do not know what it is don't worry) - 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] - 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: Include a .do in a page
Not sure about tiles, but under normal cicumstances probably not a good idea as it would result in the request taking another trip through the request processor and overwrite the original actions mapping and form in the request etc... -Original Message- From: Edgar Silva [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 07:06 To: Struts Users Mailing List Subject: Include a .do in a page Hi Folks... Are there a way to include a .do in a page? for example: jsp:include page=orders.do?action-list/ Maybe tiles can solve, but it is the only way? Any Idea to solve it? Thanks Edgar - 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: Passing an ArrayList
+1 snip I'm betting that this could be resolved by stashing the ArrayList into the request as an attribute or something similar, but would like some commentary on this issue. /snip Dont take that bet. You will lose. Once the response is written out to the browser its gone. Dead. Extinct. Nailed to its perch and pining for the fjiords. And any attributes and parameters it had are gone too. You should to put it in the session. This is what the session is there for. No session. No store. End of story. (ok you could put it in the db (ok) or servlet context (dont), but... have fun managing it. ;- ). If you really must share the session with other users, you would need to store it in the session under a unique id and have that unique id written to the html and submitted back in a hidden field so you can find it again! (That technique incedentally is also good if you need to support multiple browser windows for the same user too - something thet doesnt work too well with a constant session key.) Dont forget to clean it up (in session or db or wherever) after you have finished with it. Can you explain why you have multiple users with the same sessionId? That seems rather odd. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Tuesday, 10 February 2004 04:06 To: Struts Users Mailing List Subject: RE: Passing an ArrayList You have to store the information somewhere. So, choose your poison and store it. Store the object in a database, if you like. At 10:57 AM 2/9/2004, you wrote: This application will be hosted within an enterprise portal. Because many users will be sharing the same session I am prevented from using the session object. -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 1:20 PM To: [EMAIL PROTECTED] Subject: RE: Passing an ArrayList project this application is for mandates only request scope be used Can I ask why? It would make things much easier to set the ArrayList in session scope. However, I guess you can do this using struts ActionForms. You'll just need to make sure that every page you are navigating to includes your ArrayList in it its entirity (it can be hidden). As soon as you navigate away from one of these pages, then all your info will be lost. -Ben From: Brian Ivey [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts - List [EMAIL PROTECTED] Subject: Passing an ArrayList Date: Mon, 9 Feb 2004 12:44:08 -0500 I'm working on an application that prompts a user to enter data into 4 text fields. The user then clicks on a button to submit these to an Action. These 4 values are used to create an object that is added to an ArrayList. The page used for data entry is refreshed with the just entered values appearing as a row in a table. The user may do this as many times as they wish. My problem is that the ArrayList is recreated every time the Action is called. I understand that this a characteristic of the transient nature of Actions. Can anyone make any recommendations on possible ways to preserve this ArrayList between calls to the Action. I'm betting that this could be resolved by stashing the ArrayList into the request as an attribute or something similar, but would like some commentary on this issue. BTW, the project this application is for mandates only request scope be used. Thanks, Brian Ivey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Let the advanced features services of MSN Internet Software maximize your online time. http://click.atdmt.com/AVE/go/onm00200363ave/direct/01/ - 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: REPOST: newbie - How to generate form controls dynamically in struts
Have you looked at the tutorials on the Keyboard Monkey site? It may prove helpful. (Concerns nested form beans. You may be able to make use of these techniques to implement it?) http://www.keyboardmonkey.com/next/index.jsp Although in this case based on your sample output you could probably manage using simple iteration and a collection in the form field. Worth taking a look at the nested tutorials though. -Original Message- From: Sudip Kumar Bhattacharya [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 19:50 To: Struts Users Mailing List Subject: REPOST: newbie - How to generate form controls dynamically in struts Reposting my query since nobody answered it... -Original Message- From: Sudip Kumar Bhattacharya [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 4:45 PM To: Struts Users Mailing List Subject: newbie - How to generate form controls dynamically in struts Hi friends, I need to create some controls dynamically which should be struts enabled. Sample output code is as follows. How can I use some collection/array to store the information, and then render the html:fields, so that they are handled by struts like normal hardcoded controls? I have seen some logic:iterator samples using bean:message tags in them, but I could not find any sample that demonstrates outputting struts html controls using an iterator. --- TR TDEnglish taken for 9th grade credit/TD TDhtml:radio value=1 property=eng9//TD TDhtml:radio value=2 property=eng9//TD TDhtml:radio value=1 property=eng9_grade//TD TDhtml:radio value=2 property=eng9_grade//TD TDhtml:radio value=3 property=eng9_grade//TD TDhtml:radio value=4 property=eng9_grade//TD TDhtml:radio value=5 property=eng9_grade//TD TDhtml:radio value=1 property=eng9a//TD TDhtml:radio value=2 property=eng9a//TD TDhtml:checkbox value=3 property=eng9h//TD /TR TR TDEnglish taken for 10th grade credit/TD TDhtml:radio value=1 property=eng10//TD TDhtml:radio value=2 property=eng10//TD TDhtml:radio value=1 property=eng10_grade//TD TDhtml:radio value=2 property=eng10_grade//TD TDhtml:radio value=3 property=eng10_grade//TD TDhtml:radio value=4 property=eng10_grade//TD TDhtml:radio value=5 property=eng10_grade//TD TDhtml:radio value=1 property=eng10a//TD TDhtml:radio value=2 property=eng10a//TD TDhtml:checkbox value=3 property=eng10h//TD /TR - Thanks in advance Sudip - 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: Hi
G'day -Original Message- From: A Umesh [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 20:01 To: Struts Users Mailing List Subject: RE: Hi Hi Umesh A - 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: Struts and Pajes
Hmm. Interesting, saw pajes mentioned on the barracuda list as well. Flavour of the week? ;-) Struts doesnt force you to use JSPs, but it does provide a bunch of JSP tags that make it a very nice fit to use JSP with struts, and of course the majority of strutters are using JSP. The Tiles library is a very big argument in favour of JSPs too. Ok. Enough of the balanced reporting... I have a 'distinct dislike' of JSP, and personally prefer a DOM based approach such as used in XMLC etc... (Im actually using my own home grown method for managing the pages and their DOMs and rendering the dynamic content and doing templating and the like. vanityIts pretty cool/vanity). I havent played with pajes so dont know all that much about it. Looks rather like XMLC at first glance. As you mentioned, it can be annoying getting hold of the the various struts 'things' when doing a non-JSP approach - but they are all there and can be got at, and its not hard. btw: When working with beans (incl actionform) you will find that the stuff in BeanUtils is really useful for playing with properties whose name you only have at runtime. Heres some code that may help you get a handle on the essential struts objects: (I pasted straight from my StrutsHelper code and ripped out the irrelavent lines in case your wondering why everything has 'return' in front of it!) As you can see, pretty much everything has a key in the struts Globals interface. Chack the javadocs for this interface for more info. (The examples below are not fully module sensitive I think. (ie I havent tested it using modules)) ActionServlet: return (ActionServlet) servletContext.getAttribute(Globals.ACTION_SERVLET_KEY); ActionErrors: return (ActionErrors) request.getAttribute(Globals.ERROR_KEY); Locale: (hmmm. Not sure if using the default like that is std struts!) Locale locale = (Locale) session.getAttribute(Globals.LOCALE_KEY); return locale == null ? Locale.getDefault() : locale; ActionMapping: return (ActionMapping) request.getAttribute(Globals.MAPPING_KEY); ActionMessages: return (ActionMessages) request.getAttribute(Globals.MESSAGE_KEY); MessageResources: return (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); ModuleConfig: return (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); ActionForm: String scope = mapping.getScope(); //you need to get the mapping (see above) String attribute = mapping.getAttribute(); attribute = attribute == null ? mapping.getName() : attribute; return (ActionForm) viewContext.lookup(attribute, scope); hth Andrew -Original Message- From: Villalba Arias, Fredy [BILBOMATICA] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 20:40 To: Struts Users Mailing List Subject: RE: Struts and Pajes Ok. I'll try to be more clear: - I don't want to use JSPs when working with Struts, neither the Taglibs. Instead, I want to be able to delegate the presentation on an external component. - In order to do that, I must be able to access the data to be presented (i.e. access the appropriate ActionForm) from that external component, in consistency with Struts handlign of scope and other concepts. - It seems like Struts would expect you to (finally surrender and) use JSP + JSP tags, although it does not formally obliges you to do so. I've been checking both the source code for the tag libs and the .java-s generated by them and I get this strong impression that there is happening a lot more behind the scenes that one would suppose (and Struts would recognize). This would not worry me if there were Java classes that, not being JSP-oriented, still allowed me to do everything (or even 50%) Struts' JSP-tags do. I dont say they don't exist. I just have not found them. - I don't see why you say I'm conflating those 2 issues (please, explain it to me :) ). I'm not introducing anything new inside the framework, nor am I changing its normal behaviour. I'm respecting the roles assigned to each component. I believe what I'm doing is - precisely - prevent (or, at least, make it more difficult to) the developer from mixing control and presentation (on a JSP); moreover, I'm allowing the TOTAL separation of HTML and Java by encapsulating the dynamic generation of the view in a Java object especially designed for that purpose (for good). Anyway, I'm absolutely open to any comments / opinnions you can provide in this regard. IMPORTANTE NOTICE: I don't want start a discussion here about how good or bad Struts is: - I don't have time for that, - I don't have yet the required level of knowledge and expertise (on Struts, that is) to make such judgement, - That's not the point for this posting. This said, I'll be really looking forward to anything anybody is willing to collaborate with. Thanx again! Freddy. -Mensaje original- De: Michael McGrady [mailto:[EMAIL PROTECTED] Enviado el: martes, 03 de febrero de 2004 19:41 Para: Struts Users Mailing List; [EMAIL PROTECTED] Asunto: Re: Struts and Pajes Struts is
RE: what is controller servlet in struts framework
The controller servlet is the struts ActionServlet class. You configure this in your web.xml file so that it sends all requests whose path ends in .do (or whatever extension/path mapping you choose for your actions) to this servlet. The ActionServlet will actually make use of another class to do the bulk of its work when a request comes in (in struts1.1). This is the RequestProcessor. It examines the path and looks up the appropriate ActionMapping for that path that you have defined in struts-config.xml. From the information in the ActionMapping it determines which ActionForm class you want to use and in which scope it should be, creates an instance if necessary and populates it from the parameters in the request. Then the RequestProcessor will pass the ActionForm, and references to the request, response, and ActionMapping to the execute method of your Action class. (The first time this Action is used it will instantiate the action object. All subsequent requests in all threads will reuse the same instance that it created the first time). Your Action will (usually) return an instance of ActionForward, and the RequestProcessor will then forward the request to the path specified in the ActionForward (doing a client side redirect if the redirect property is true). In the event that an exception is thrown by your Actions execute method, and you defined an ExceptionHandler in struts-config.xml for it, the RequestProcessor will instead pass control to this ExceptionHandler. Basically the ActionServlet is the controller, but it delegates the processing of requests to the RequestProcessor. The RequestProcessor determines which Action should handle that request and calls it, so your Actions fit into the controller part of the MVC architecture along with the ActionServlet and RequestProcessor. (Other tasks of the ActionServlet include parsing the struts-config.xml file at application startup, and calling at startup any PlugIns you have configured). You may subclass the ActionServlet to customise its behaviour, but under struts1.1 this is less useful to do - in 1.1 if you need to customise that behaviour you would usually subclass the RequestProcessor. You can specify which RequestProcessor class to use in your struts-config.xml file. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 22:58 To: [EMAIL PROTECTED] Subject: what is controller servlet in struts framework Hi guys I have been having a question. I do not understand what is the controller servlet in the struts framewrok. Is it the Action classes or struts-config.xml that is the controller servlet for struts framework. Please let me know Thanx --Mohan - 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: generic component
Simple things you could just write a taglib for. Many of the more complex widgets are possible using Tiles, though Im not familiar with the details of Tiles myself so cant provide much info beyond pointing you at it... -Original Message- From: Michael Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 23:13 To: Struts Users Mailing List Subject: generic component How do I create a generic component to do a particular job and enable it to be called from anywhere? Take for example a colour chooser... A Colour chooser is something I'd want to use often and from anywhere on my web site. I would like it to be decoupled from the rest of the system and be able to invoke it from anywhere. It needs its own action class/jsp framework. Any ideas? -- Michael Wiles [EMAIL PROTECTED] Pick 'n Pay IS - 1665 Read our disclaimer at: http://www.picknpay.co.za/email-disclaimer.htm If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to [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: Looking for junior Java/Struts developers
Least you can afford a car in Herdon VA. Over here even a simple Toyota Camry will set you back $110k (about $64k US). grumblemuttercurse sigh -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 00:38 To: Jiin-Her Lu Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Looking for junior Java/Struts developers Jiin-Her hits the nail on the head I certainly wouldn't want to make 50K while living in Boston or New York City... Here's the cost of living for Herndon VA http://realestate.yahoo.com/re/neighborhood/search.html?sa=c=Herndons=VAz = Cost of living (taxes, expenses, insurance, etc...) can change from town to town even. As the add says you need to move to Herndon VA to live on that 50K. ;) -R^3 On Wed, 4 Feb 2004, Jiin-Her Lu wrote: Depends on when, where, and what is your citizenship. It can be up to $ 85000+ in US. Jiin-Her Lu (816) 926-2145 - 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]Looking for junior Java/Struts developers
IMHO contributing code to open source projects should also count for something in terms of experience - especially if its a well known project like struts. (If your still a student you should have a fair bit of spare time you could do that in too!). So why not take a look at the open defects and see if there is anything you can help with. :-) As for the experience vs no-experience problem, thats confronted graduates in all disciplines since time immemorial! Just got to keep trying till you can get your foot in the door somewhere (dont be surprised if you end up in a completely different area of IT than what you studied!). Once you have some experience under your belt the number of options available to you expands tremendously. As for overseas markets, can't give any advice on the States, but the job market for programmers here in S'Pore is dead as a dodo (supply exceeds demand and starting salaries are dropping dramatically). Your probably better off staying in Sydney. Tax is much lower here though, top marginal rate is something like 26% when your earning 400k. Pretty good compared to back in Australia where the top rate is almost 50% and kicks in at about 60k per year (and they wonder why graduates leave the country and dont come back). Paid as much tax in a month in Aus as I do in a year here! -Original Message- From: ajay [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 09:53 To: Struts Users Mailing List Subject: RE:[OT]Looking for junior Java/Struts developers hi! thanks for the suggestion. that is pretty much what i had decided to do ie write something and try and market it. however i'd beg to differ on the weather. i dont think cold, grey, wet, clammy, uncertain weather qualifies as good weather esp compared to the sunny predictable weather down here. Quoting [EMAIL PROTECTED]: ajay, The best way to demonstrate you skills is to look for an idea and write something and sell it, you end up as your own boss and you gain the experience. You seem to think the no-experience vs employeers want experience issue is new, but it was the same 15 years or so ago when I started out. You can sit around and frett about it or just get on with it yourself. If you want to work for someone else, that is fine, you just need to work hard and you'll do fine, there are so many lazy programmers out in the market these days that there is a shortage of dedicated professional graduates. Thirdly, move down to Melbourne, the weather is nicer down here:) Chris On Thu, 5 Feb 2004, ajay wrote: when: 2004 where: sydney citizenship: australian the problem though is that most people here thesedays want some level of experience before they are willing to hire you, the trend is a lot towards contract/temp jobs. the problem ofcourse is where to get that elusive experience, and uni project experience doesn't count for anything. so you have this cycle where you are looking to get some experience and most companies want only experienced personnel. and when it comes to tax i believe australia has one of the world's highest tax rate, and sydney is way too pricey. but what i would like to know is whats the scenario outside, like int he states, singapore, UK etc. is there a good demand for qualified but inexperienced IT graduates. would a move abroad be good? Quoting [EMAIL PROTECTED]: Jiin-Her hits the nail on the head I certainly wouldn't want to make 50K while living in Boston or New York City... Here's the cost of living for Herndon VA http://realestate.yahoo.com/re/neighborhood/search.html?sa=c=Herndons=VAz = Cost of living (taxes, expenses, insurance, etc...) can change from town to town even. As the add says you need to move to Herndon VA to live on that 50K. ;) -R^3 On Wed, 4 Feb 2004, Jiin-Her Lu wrote: Depends on when, where, and what is your citizenship. It can be up to $ 85000+ in US. Jiin-Her Lu (816) 926-2145 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- ajay --- Who Dares Wins - This mail sent through IMP: www-mail.usyd.edu.au - 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] -- ajay --- Who Dares Wins - This mail sent through IMP: www-mail.usyd.edu.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
RE: Action without ActionForm
+1 I too am finding that it is quite convienient to treat the actionform as the pages UI State rather than merely an input buffer. -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 13:42 To: Struts Users Mailing List Subject: Re: Action without ActionForm My two cents worth is that I am with Max on this one. I have discovered that when I use patterned solutions I get benefits I did not think of at the time. This is particularly true of the HTTP version of the MVC framework. At 09:35 PM 2/4/2004, you wrote: My perspective is that there is still value in having an ActionForm for that example. I generally think it is best for your Actions to pass information to the JSPs that render them through an ActionForm rather than putting things in the request or session directly. For this reason, I think it would be better to put the current time into an ActionForm than to stuff it into the session. Struts will put your ActionForm in the request or session for you; your Action need only populate it with data, and then the JSP can expect to find your well-defined ActionForm in the scope specified in the struts-config.xml file. It doesn't matter if there is no data coming in on the request for Struts to pre-populate the ActionForm. Using an ActionForm still has value in that it defines what the JSP can expect to find, and where. Opinions on this topic surely vary (i.e. I am sure some people will disagree with my recommendation here), and I have seen a lot of Actions and JSPs that communicate via request and session attributes that aren't defined in the struts-config file. But I prefer to limit the communication between the Action and the JSP to a well-defined ActionForm in a well-defined scope to the extent that it is possible. I view the Action/JSP coupling that comes with passing otherwise undefined request and session attributes to be undesireable. I think it is better to keep the interface between these components (a specific ActionForm in a specific scope) well defined (by specifying it in the struts-config.xml file). -Max - Original Message - From: Masashi Nakane [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 5:00 PM Subject: Action without ActionForm Hi ,all I am new to Struts and learning it. And I am wondering how the strtus-config.xml and JSP look like when a JSP doesn't submit any info( dont need ActionForm) . The JSP just display the current time and has one button refresh. CurrentTime.jsp ( user push refresh button) - CurrentTimeAction(get current time and put it to Session Attribute) - CurrentTime.jsp ( get time from Session and render) I have made the JSP without Struts framework . it works . but I have no idea how I can make this with action mapping in struts-config.xml. I made the mapping below and I got error when I try to open the JSP . JSP is using html:form tag to make form. javax.servlet.jsp.JspException: Cannot retrieve definition for form bean null but i dont need any ActionForm - action-mappings action path=/currenttime type=com.somecompany.CurrentTimeAction forward name=success path=/CurrentTime.jsp / /action /action-mappings - I have already checked the which attribute of action tag is mandatory or optional . Should I make dummy ActionForm ? Any comments are appriciated. Masashi Nakane - 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: Basic Tiles question!
Hmm... Looks like you got yourself a null pointer mate! ;-) -Original Message- From: Anand Stephen [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 February 2004 13:48 To: Struts-User Subject: Basic Tiles question! Any idea what would cause this exception? 500 Servlet Exception java.lang.NullPointerException at org.apache.struts.taglib.tiles.InsertTag.processName(InsertTag.java:528) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java :487) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:445) thank you, -- a -tiles-def.xml ?xml version=1.0 encoding=UTF-8? !-- -- !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd; tiles-definitions definition name=mainlayout page=/site/search/tiles/text_1.jsp put name=content value=/site/search/tiles/text.jsp/ /definition /tiles-definitions --- end tiles-def.xml -- --- Struts-config.xml - plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-def.xml l / set-property property=moduleAware value=true / set-property property=definitions-debug value=1/ set-property property=definitions-parser-validate value=true / /plug-in --- end struts config -- the jsp %@ taglib uri=/WEB-INF/tlds/tiles.tld prefix=tiles % html head title testing. /title /head body tiles:get name=content/ /body /html -- end jsp --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Looking for junior Java/Struts developers
50k US??? Thats like 85k over here - which is a *lot* more than even a very senior programmer is worth nevermind a junior. 85k for a JUNIOR programmer. Wow! You could buy a car with that! (Which unlike junior programmers are distinctly not cheap over here. sigh/) so... whats the tax rate like over in the States these days? ;-) -Original Message- From: Yibing Li [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 06:05 To: 'Struts Users Mailing List' Subject: Looking for junior Java/Struts developers Folks, We are actively looking for java/struts/jboss developers here at GNX (www.gnx.com). If you have one year of experience using java/struts or jboss and are willing to relocate to Herndon, VA, please send me your resume to [EMAIL PROTECTED], The salary is around $50k. Thanks, Yibing - 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: Need to pass data to JSP in ActionForm
If the list doesnt change during the course of a users session then the best thing to do is to create it on first demand and store it in the session. This saves you from looking it up from the db repeatedly when unnecessary and is thus more efficient. If the list is the same for all users and doesnt change at all then you could store it in the servlet (application) context. If it does change (for example when new records are added) then you will still need to look it up each time. In this case your best bet might be to extend Rick's suggestion about having a seperate helper class that assembles the list (always a good idea). This helper/manager/thing is part of your business process layer. Above that you could have an aditional (very simple) adaptor class that is passed a request, calls this helper to obtain the list, and stores said list under the appropriate request attribute. Your validate method could thus call this adapter to setup the list when it is validating the entered data. Your setup action, likewise would call the adaptor class rather than directly calling the business layer and storing the result. One thing to beware of when you do such non-trivial things in the actionform, is that if memory serves me correctly (someone please correct me if Im wrong on this!), exceptions thrown here wont be handled by the exception handler you configured in struts config as the try/catch that invokes that handler is merely around the invocation of the actual action execute and not the form reset / validate stuff. These are some of the reasons I personally prefer to do my validation in the action itself and dont make use of the forms validate method. (Of course if your using struts validator that becomes problematic too) hth Andrew -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 12:26 To: Struts Users Mailing List Subject: Re: Need to pass data to JSP in ActionForm Pat Young wrote: 6. The problem I am having is that if the ActionForm failes validation, then the sales.jsp page gets an error becaue it can not find the bean in the Request for the products list. Should I build this bean in my validate and place it in the request at the beginning of validate? If validate fails, there is no other opportunity to build the products list and get it into the Request. Personally I often opt for the easy solution and put the List in Session scope, but there are other alternatives that have been discussed on this list before. 7. I typically uses Actions to retrieves and build beans and then add them to the request for the jsp to access. Is this an acceptable practice also? Depends what you mean by build beans. Nothing wrong wtih setting stuff into Request scope from your Actions, but make sure you are calling some business process that does the actual building. For example... //in your Action: List someList = someBusinessClass.getMyList(); request.setAttribute(listWhatever, someList); -- Rick - 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: Looking for junior Java/Struts developers
Yeah. More chance of getting it back in Australia though (esp Sydney), but yeah, Ive been slaving away in the IT field for 4+ years now and still no closer to that pot of gold at the end of the rainbow... (In fact with CPF cuts and inflation, and GST etc... salary just goes down over time and never up) sigh/ Once you get a bit of experience you could go it alone as a contractor billing by the hour, at which point 50k++ should be feasible (in Sydney, not here (Singapore) though. No contracting mentality here. Wierd) but as a salaried slave... wait long long Of course back in Australia it hardly seems worth the effort. So much as sneeze and it moves you up a tax bracket or two and Mr Costello has his hand in your pocket again... -Original Message- From: ajay [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 12:34 To: [EMAIL PROTECTED] Subject: RE: Looking for junior Java/Struts developers whats a graduate programmer worth? i'm told to accept 45k, which i believe in the states would be 30k or roundabouts. *sniff* US 50k *sniff* i wonder how many years i'll have to slave for before i see money like that. 50k US??? Thats like 85k over here - which is a *lot* more than even a very senior programmer is worth nevermind a junior. 85k for a JUNIOR programmer. Wow! You could buy a car with that! (Which unlike junior programmers are distinctly not cheap over here. sigh/) so... whats the tax rate like over in the States these days? ;-) -- ajay --- Who Dares Wins - This mail sent through IMP: www-mail.usyd.edu.au - 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: Looking for junior Java/Struts developers
snip Did anyone actually go to the website for this company and look for the supposed job posting on their careers site? coz it isn't there. /snip Id say sending the info to the struts list was very well targeted on their part. If they post it on the site they are just inviting resume spam from a million unqualified people whos uncle's friends pet monkey once saw a JSP and thus think that makes them a struts expert... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 4 February 2004 13:12 To: Struts Users Mailing List Subject: RE: Looking for junior Java/Struts developers I looked up client/server programmer on Monster.com and got the average for Vermont: Client/Server Programmer I Burlington, VT 25th%ileMedian 75th%ile $42,973 $48,589 $55,303 Programmer I Burlington, VT 25th%ile Median 75th%ile $40,892$45,231$51,272 So there you go. I am a grad myself (Australian) but I can't tell you what I earn. I can probably get away with saying that it is a lot less that that... mind you that is an average and not for a graduate. I would say that about 50k for one year experience is probably only slightly higher than the median. Did anyone actually go to the website for this company and look for the supposed job posting on their careers site? coz it isn't there. Heya Gosper CSC Australia 212 Northbourne Ave, Braddon ACT 2612 Ph: +61 (0) 2 6246 8155 Fax: +61 (0) 2 62468100 MOB: 0401 611779 This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ajay [EMAIL PROTECTED] 04/02/2004 03:34 PM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:RE: Looking for junior Java/Struts developers whats a graduate programmer worth? i'm told to accept 45k, which i believe in the states would be 30k or roundabouts. *sniff* US 50k *sniff* i wonder how many years i'll have to slave for before i see money like that. 50k US??? Thats like 85k over here - which is a *lot* more than even a very senior programmer is worth nevermind a junior. 85k for a JUNIOR programmer. Wow! You could buy a car with that! (Which unlike junior programmers are distinctly not cheap over here. sigh/) so... whats the tax rate like over in the States these days? ;-) -- ajay --- Who Dares Wins - This mail sent through IMP: www-mail.usyd.edu.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop user from clicking the submit button twice
Havent used it yet myself so dont have any code to show, but struts provides a token based mechanism which can be used to detect when the same page has been submitted twice and thus take appropriate action (such as showing an error message). Have a look under 'tokens' in the struts documentation, and the archive and you should find that which you seek. hth Andrew -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED] Sent: Friday, 30 January 2004 06:30 To: [EMAIL PROTECTED] Subject: stop user from clicking the submit button twice Hi I have a process which takes about 30 seconds, i want to show some kind of image or disable the submit button untill the process is complete and tell user that the process is running How can i do it, i m using struts1.1 any code example or article will greatly help Ashish (Some thing like the webspher5.0 web admin console, where it brings up a image when the user clicks button) = A$HI$H __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - 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: Please unsubscribe yxchen2@qwest.com
pak chooie unf Im sorry Dave. I cant do that. /unf /chooie /pak -Original Message- From: Chen, Yuan [mailto:[EMAIL PROTECTED] Sent: Friday, 30 January 2004 08:01 To: [EMAIL PROTECTED] Subject: Please unsubscribe [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Email with file created on the fly
1. Create the file 2. Email it (duh!) Struts is a web ui framework. It's not about email and all that, so its not really a question of how to do it 'with struts', but more a case of *where* to do it in a struts app - and that depends on when your sending the mail (interactive or batch). Go take a look at the JavaMail api if you want to know how to send an email. If you have any issues with sending this mail that are related to struts then come back and ask questions, but you will need to make more effort posing your question than you have so far. I mean you havent even stated what the scenario is. How do expect to get an intelligent response like that? Is the email sent as a result of a form that has been submitted or is it a batch email sent at a set time or some kind of alert email that gets sent when something happens in the system? I suggest you read this before posting again: http://www.catb.org/~esr/faqs/smart-questions.html Now run along, or I shall scold you some more! --- DISCLAIMER: The author of this email has recently reduced his nicotine intake and disavows responsibility for any resultant irritability. If you have received this scolding by mistake then I guess that just too bad. The contents of this email are the authors own personal opinions and do not necessarily reflect the opinions of his employer, nation, the entire human race or sentient life throughout the known universe, though no doubt they will all agree with the author if they ever happen to read his message. -Original Message- From: hhlow [mailto:[EMAIL PROTECTED] Sent: Friday, 30 January 2004 10:41 To: Struts Users Mailing List Subject: Email with file created on the fly How can I send email with a file created on the fly using Struts? Thank you Clement - 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]caching XML object
Im not familiar with JDOM, but Ive had to do some DOM caching for standard DOMs (with Xerces DOM impl) which proved to be a pain, as xerces DOM objects arent thread-safe - even for reading apparently - which meant I had to clone it from a synchronized block (thus eliminating most of the benefit of caching it). Not sure if JDOM suffers such a constraint though. What is the XML object being used for? There may be better ways around your problem that dont necessarily involve directly caching and comparing the XML. -Original Message- From: Prashanth.S [mailto:[EMAIL PROTECTED] Sent: Friday, 30 January 2004 10:45 To: [EMAIL PROTECTED] Subject: [OT]caching XML object Hi all, How can i cache XML object in my web application?I dont want to always read the xml file for constructing XML objecti also need a way to check weather there has been any changes between the existing object in cache and xml file???Iam using jdom Thanks Prashanth - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: constant url
Yep. Basically while your html UI is there to 'help' the user send the right parameters in the request you cant ever rely on it to do so. It is quite technically possible for the data to be sent to you some other way (and this could be legitimate - for example someone using HttpClient to write an tool to automate something that is normally done through your html ui), so basically you have to be prepared to validate any requests and associated parameters that come in, and not rely on the form or html to have done this for you (except as a convienience in terms of useability). You need to check any data sent to your app before using it to make sure it isnt going to break the app. In terms of security and hacking you need to make use of traditional methods. Sessions and url hiding alone dont ensure security (someone with a packet sniffer could sniff the sessionId and hijack the session with spoofed packets), etc... For proper security you need SSL of course - which means that the contents of the request are encrypted between server and browser. -Original Message- From: shankarr [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 18:32 To: Struts Users Mailing List Subject: Re: constant url Hi! I guess, I have to agree with you on this. Thanks to all for the help. Richie At 10:03 AM 1/27/2004 +0100, you wrote: Hi Shankarr Your best choice will be frames...that way you can hide the details of your navigation to the end user. But frames has some disadvantages, tooIt is somehow a pro/con situation where you have to decide if you can live with request parameters or not... Regarding the hacker-threat...hmm manu sites use request parameters...and there are other ways to make the site secure... Hope that did help - Original Message - From: shankarr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 9:47 AM Subject: RE: constant url Hi! Thanks for the response. http://localhost:8081/log4jdemo/loginScreen.do is what I see in my url. I would like to keep this a constant at http://localhost:8081/log4jdemo only. I am using both a href and html:link. But, even in cases where i use direct action like /loginScreen.do, on invoking the action, i.e clicking a button, i get the full path in the url. This exposes the data to the hackers and will be a big issue in deployment. Any help will be appreciated. Richie At 04:14 PM 1/27/2004 +0800, you wrote: If you want to stop the 'ugly' urls showing in the address bar of the browser, you can have all the contents of the site show in a frame, whose frameset is found at the url you want to show. -Original Message- From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 15:53 To: Struts Users Mailing List Subject: SV: constant url Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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 achieve all that is possible, one must attempt the impossible - 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 achieve all that is possible, one must attempt the impossible - 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: resultset data not obtained
In your action have you remembered to put this object into the scope (ie: request scope) before you forward to the view? request.setAttribute(accountsList,accountsList); -Original Message- From: shankarr [mailto:[EMAIL PROTECTED] Sent: Wednesday, 28 January 2004 15:44 To: [EMAIL PROTECTED] Subject: resultset data not obtained Hi! I am making my db queries in a helper class(AccountService) and sending the storing the data in an arraylist. I send the arraylist back to the action file. Snippet from helper file ArrayList accountsList = new ArrayList(); while( rs.next() ) { acc = new AccountDO(); acc.setAccountname(rs.getString(1)); acc.setAccountowner(rs.getString(2)); accountsList.add(acc); } Snippet from the action file ArrayList accountsList = null; try { ServletContext servletContext = servlet.getServletContext(); DataSource dataSource = (DataSource)servletContext.getAttribute(Action.DATA_SOURCE_KEY); Connection conn = dataSource.getConnection(); Statement stmt = conn.createStatement(); AccountService account = new AccountService(conn, stmt, session, dataBaseName); accountsList = account.retreiveAccount(); } But , when I try to retrieve the data in my jsp, I always get the Cannot find bean accountsList in any scope exception. This is what I have in my jsp code logic:iterate id=acc name=accountsList tr align=left td bean:write name=acc property=accountname / /td td bean:write name=acc property=accountowner / /td /tr /logic:iterate Any help appreciated. TIA Richie To achieve all that is possible, one must attempt the impossible - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: constant url
If you want to stop the 'ugly' urls showing in the address bar of the browser, you can have all the contents of the site show in a frame, whose frameset is found at the url you want to show. -Original Message- From: Claus Weng Madsen - TELMORE [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 15:53 To: Struts Users Mailing List Subject: SV: constant url Hi If you are using a a href or html:link you cannot hide the parameters. The url you'r using should be the path configured in the struts-config. Med venlig hilsen Claus Weng Madsen, Teamleder TELMORE A/S Carl Gustavsgade 3, 2630 Taastrup Telefon 70218700, Mobil 30242875 www.telmore.dk -Oprindelig meddelelse- Fra: shankarr [mailto:[EMAIL PROTECTED] Sendt: 27. januar 2004 07:53 Til: [EMAIL PROTECTED] Emne: constant url hi! whenever i click on any link, my url shows the action name and the parameters being passed. i want to avoid showing this. how to do it? Richie To achieve all that is possible, one must attempt the impossible - 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: WebGroups css
Try using an html:base tag in your jsp. (See the docs for details , I forget the syntax) -Original Message- From: Manuel Lenz [mailto:[EMAIL PROTECTED] Sent: Tuesday, 27 January 2004 16:15 To: Struts Users Mailing List Subject: WebGroups css Hi you, I do have a silly problem with style sheets-linking. I have a css-File in the folder /theme/formats.css. I access this file from a jsp-page of the folder /help/info.jsp with this link: LINK href=../theme/formats.css rel=stylesheet type=text/css This works, if I call the jsp-Page directly. There is another jsp-page in the folder called /help/infoTest.jsp. This page is called from struts-config with a forward. The page has exactly the same code for linking the css-File. But when the jsp-Page is called, the css-File is not found and the server is showing this message: Web group /theme/formats.css is not defined (Die Webgruppe /theme/formats.css wurde nicht definiert.) Does anybody have an idea how to solve this problem? Manuel - 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: ActionForm boolean properties - Newbie question
If its a primitive , it will look for 'is' , but for the Boolean object it will look for 'get' (same as any other object). -Original Message- From: Renato Romano [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 January 2004 23:00 To: 'Struts Users Mailing List' Subject: ActionForm boolean properties - Newbie question I have some trouble using a boolean (the primitive type) property inside an ActionForm. What I'd like to know is if Struts looks for a getProperty method or isProperty method... It seems Struts always calls the getProperty, but as I know it should call the isProperty!! Is the behavior with a Boolean (Object type) property the same ? Thanks everyone Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]