Re: Handling Date objects in ActionForm gracefully
I think the way of going about converting is pretty open, either have some conversion utils between the web tier and the model. I tend to do it in the action and then when things get long or i need the code again move it out into a util class or like you're saying make my model util classes deal with strings (this makes a lot of sense as then other front ends can be plugged on). Talk of MVC aside (after all MVC is a broader issue than the particular pattern that struts is based on) why piss about dealing with all sorts of errors and exceptions being thrown in the place where its hardest to deal with them? You can and people do use different types for form beans, but I just don't see the point. Date comes up often and lets face it dates are more user friendly as dropdown menus rather than free text, so getDay() , getMonth() and getYear() IMO are a simpler way of going about things. Then have methods in you model that create a date based on that, or have a util class in the web tier as you can deal with validating the three values. Perhaps even have a date that's in you form bean but is set and got (passed participle of get) via string flavors day, month and year. Not sure if this works but I think the idea is valid (corrections welcome). public class SomeForm extends ActionForm { private Calendar aDate = Calender.instance(); public String getDay() { int d = aDate.get(Calendar. DAY_OF_MONTH); return Integer.toString(d); } public void setDay(String day) { aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day)); } ... protected Date getAdate() { return dDate.getTime(); } } This way come checking and comparing values before can be done, before passing anything up to you model. Many folk would say that this should be done in the model, but i'd say situations where you need to check if a user has entered a valid date (e.g. expire and from dates with a credit card). This functionality will want to be produced even if you change the model , if you wanted to demo your web tier on its own (without a model e.g acme ltd credit card form) and therefore doing it ONLY in the model would be limited. Very much IMO and I'm not MVC guru, but that's my understanding. On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote: As someone with good experience in MVC-based applications but a newbie to Struts, what I understand from this discussion is that the recommended implementation would have to comply, at least, with this guidelines: - The conversion code is encapsulated in a separate class (I suppose one converter class per each String, Target Data Type combination required, right?). - Passes all (String) parameters to a Business Object that encapsulates the use case (I mean, the logic) and, from within that BO, use the corresponding converter classes for getting the actual data object to flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs, bla bla bla...) I'm I right here or am I missing any other IMPORTANT aspect(s)? STILL, there is something I don't get: how would you implement / encapsulate then the opposite direction for data conversion; in other words: - Convert from original data types towards String (another method in the same converter class?) - Map (set) some (non-String) data object into the corresponding String property on the form bean. Thanks, Freddy. -Mensaje original- De: Mark Lowe [mailto:[EMAIL PROTECTED] Enviado el: viernes, 26 de marzo de 2004 0:59 Para: Sreenivasa Chadalavada; Struts Users Mailing List Asunto: Re: Handling Date objects in ActionForm gracefully You deal with the conversion else where but not in the form bean, you can argue about it or just believe me. The action form sits between the view and the action, the date conversion goes on between the action and the model. Your approach isn't that bad its just not to the MVC pattern that struts follows (not that its the only one). Create a date convertion util class or something. If you dont want to take my word for it here's what craig had to say albeit in response to a different question snippet As the original designer of Struts :-), I must point out that the design of ActionForm (and the recommendation that form bean properties be Strings) is ***very*** deliberate. The reason this is needed is obvious when you consider the following use case: * You have an input form that, say, accepts only integers. * Your form bean property is of type int. * The user types 1b3 instead of 123, by accident. * Based on experience with any garden variety GUI application, the user will expect that they receive an error message, plus a redisplay of the form ***WITH THE INCORRECT VALUES THAT WERE ENTERED DISPLAYED SO THE USER CAN CORRECT THEM***. * The current Struts environment will throw an exception due to the conversion failure. * The suggested solution
Re: Handling Date objects in ActionForm gracefully
Freddy. No, you misunderstood if you thought I was responding with any hostility whatsoever. There is a general problem where input would be better validated in the web tier so it can be decoupled from the model. So times comparing two dates would be useful and so on. But i think its also try to say that using anything but strings for user input will lead to problems. And my suggestion could well be incorrect, I was putting it out there to see what response it would provoke. Cheers Mark On 26 Mar 2004, at 10:51, Freddy Villalba Arias wrote: Mark, didn't mean to be pedantic... just wanted to prevent everybody from going through all the (obvious / basic / simple) details and just go to the important stuff. Neither am I an MVC guru. In any case, thanx everybody 4 your help. Regards, Freddy. -Mensaje original- De: Mark Lowe [mailto:[EMAIL PROTECTED] Enviado el: viernes, 26 de marzo de 2004 10:24 Para: Struts Users Mailing List Asunto: Re: Handling Date objects in ActionForm gracefully I think the way of going about converting is pretty open, either have some conversion utils between the web tier and the model. I tend to do it in the action and then when things get long or i need the code again move it out into a util class or like you're saying make my model util classes deal with strings (this makes a lot of sense as then other front ends can be plugged on). Talk of MVC aside (after all MVC is a broader issue than the particular pattern that struts is based on) why piss about dealing with all sorts of errors and exceptions being thrown in the place where its hardest to deal with them? You can and people do use different types for form beans, but I just don't see the point. Date comes up often and lets face it dates are more user friendly as dropdown menus rather than free text, so getDay() , getMonth() and getYear() IMO are a simpler way of going about things. Then have methods in you model that create a date based on that, or have a util class in the web tier as you can deal with validating the three values. Perhaps even have a date that's in you form bean but is set and got (passed participle of get) via string flavors day, month and year. Not sure if this works but I think the idea is valid (corrections welcome). public class SomeForm extends ActionForm { private Calendar aDate = Calender.instance(); public String getDay() { int d = aDate.get(Calendar. DAY_OF_MONTH); return Integer.toString(d); } public void setDay(String day) { aDate.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day)); } ... protected Date getAdate() { return dDate.getTime(); } } This way come checking and comparing values before can be done, before passing anything up to you model. Many folk would say that this should be done in the model, but i'd say situations where you need to check if a user has entered a valid date (e.g. expire and from dates with a credit card). This functionality will want to be produced even if you change the model , if you wanted to demo your web tier on its own (without a model e.g acme ltd credit card form) and therefore doing it ONLY in the model would be limited. Very much IMO and I'm not MVC guru, but that's my understanding. On 26 Mar 2004, at 09:43, Freddy Villalba Arias wrote: As someone with good experience in MVC-based applications but a newbie to Struts, what I understand from this discussion is that the recommended implementation would have to comply, at least, with this guidelines: - The conversion code is encapsulated in a separate class (I suppose one converter class per each String, Target Data Type combination required, right?). - Passes all (String) parameters to a Business Object that encapsulates the use case (I mean, the logic) and, from within that BO, use the corresponding converter classes for getting the actual data object to flow around (i.e. be eventually get-ed or set-ed from the DAOs/DTOs, bla bla bla...) I'm I right here or am I missing any other IMPORTANT aspect(s)? STILL, there is something I don't get: how would you implement / encapsulate then the opposite direction for data conversion; in other words: - Convert from original data types towards String (another method in the same converter class?) - Map (set) some (non-String) data object into the corresponding String property on the form bean. Thanks, Freddy. -Mensaje original- De: Mark Lowe [mailto:[EMAIL PROTECTED] Enviado el: viernes, 26 de marzo de 2004 0:59 Para: Sreenivasa Chadalavada; Struts Users Mailing List Asunto: Re: Handling Date objects in ActionForm gracefully You deal with the conversion else where but not in the form bean, you can argue about it or just believe me. The action form sits between the view and the action, the date conversion goes on between the action and the model. Your approach isn't that bad its just not to the MVC pattern that struts follows
Re: LookupDispatchAction default
/admin/list.do?method On 25 Mar 2004, at 14:02, Brian Sayatovic/AMIG wrote: Well, I tried overriding unspecified and I still get the following (mind you that I didn't change the parameter name yet) when I hit /admin/list.do: Error 500: Request[/admin/list] does not contain handler parameter named submit My unspecified method I simply overrode from DispatchAction to call my normal refresh list method: protected ActionForward unspecified( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { return this.refreshList(mapping, form, request, response); } While the JavaDocs do imply this should work, when I looked in the Struts 1.1 source, the execute method of LookupDispatchAction generates the erorr message I see as soon as request.getParameter(parameterName) returns null. In fact, I can find no reference to 'unspecified' anywhere in LookupDispatchAction. So I think there is a disconnect. Maybe LookupDispatchAction is broken and should be fixed to also use 'unspecified', or maybe its JavaDocs should explicitly state that it does not utilize the 'unspecified' behavior of its parent class. Or, maybe I missed something and didn't implement correctly? Regards, Brian. Mark Lowe [EMAIL PROTECTED] 03/24/2004 09:21 AM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: LookupDispatchAction default unspecified() is the method you want look at the javadoc. you do need the method name though /admin/list.do?method I saw that using submit as the parameter name causes problems so i wouldn't use that. On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote: I'd like to be able to have someone hit my action, /admin/list.do, without having to specify a submit paramater. However, the action is a subclass of LookupDispatchAction whci requires that the request parameter be supplied. Looking in the struts source code, it would be nice if the LookupDispatchAction could fall back to a default or not consider 'null' to be a bad value and just use 'null' as a key to the lookup Map. For now, any link or redirect to the page must specify what I consider to be the default action -- refresh -- on the URL: /admin/list/do?submit=Refresh. Is there another way to do this? Is it worth suggesting that LookupDispatchAction support a default or null mapping? Regards, Brian. - 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: html inside an action
I'd go n have a cup of tea.. On 25 Mar 2004, at 17:54, ruben wrote: hi Those are my requirements, i have to convert objects to html, in my action and get this html in a String, i thought that the jsp is a good way to do this, I want the code that jsp generate (that is sent to the browser) on my action , is it possible? thanks a lot , Regards. Qureshi, Affan wrote: So why cant you use simple JSTL or struts-EL tags to do it? Ideally you shouldn't be doing any client-side stuff in your Actions. A cleaner approach would be to use Custom Tags to have the HTML generation code and you can call them from your JSPs. (Remember that JSPs are not sent to the browser, it is the code they generate that is sent to the client browser). Or maybe I dont understand your requirements. Regards. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:19 AM To: Struts Users Mailing List Subject: Re: html inside an action Qureshi, Affan wrote: What part of JSP do you want to generate? Is it Java code in the JSP that you want to generate or static HTML/JavaScript? You might want to look at Tag Libraries as well. -Original Message- From: ruben [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 10:00 AM To: Struts Users Mailing List Subject: html inside an action hi! how can i get the output generate in a .jsp inside an action like it was a resource that i can process(a String or something else)??? thanks a lot in advance. PD: I need to call jasper compiler or something similar? what can i do that? thanks - 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] hi, thanks for the response, i want the code generated (HTML/javascript), it's like redirect the output to a resource that i can process in the action instead of send to the navigator, thanks a lot - 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: Handling Date objects in ActionForm gracefully
Have it as a string and convert it to a date or calendar when you pass it back to the model. On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote: All, We are facing a problem when we define java.util.Date field in ActionForm. Is there any way to override the default behavior provided by Struts? I very much appreciate your help!! Thanks and Regards, Sree/- --- - 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. --- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling Date objects in ActionForm gracefully
Ask yourself why are you trying to convert types for user input? On 25 Mar 2004, at 21:11, Sreenivasa Chadalavada wrote: Do you know if the behavior can be overridden? Thanks and Regards, Sree/- --- - 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. --- - Takhar, Sandeep Sandeep.Takhar @CIBC.ca 03/25/2004 02:53 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:RE: Handling Date objects in ActionForm gracefully yes it is. It should be done once per classloader. When struts populates the dyna form it is string array to string array conversion and uses populate method of BeanUtils which eventually calls the converters. sandeep -Original Message- From: Sreenivasa Chadalavada [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 2:47 PM To: Struts Users Mailing List Subject: Re: Handling Date objects in ActionForm gracefully I am thinking of overriding the struts default mechanism. Override the default behavior of org.apache.commons.beanutils.ConvertUtils by registering a valid converter... I want to know if the above is possible.. Thanks and Regards, Sree/- --- - 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. --- - Mark Lowe mark.lowe @boxstuff.com 03/25/2004 02:36 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: Handling Date objects in ActionForm gracefully Have it as a string and convert it to a date or calendar when you pass it back to the model. On 25 Mar 2004, at 20:28, Sreenivasa Chadalavada wrote: All, We are facing a problem when we define java.util.Date field in ActionForm. Is there any way to override the default behavior provided by Struts? I very much appreciate your help!! Thanks and Regards, Sree/- -- - - 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. -- - - - 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: Handling Date objects in ActionForm gracefully
You deal with the conversion else where but not in the form bean, you can argue about it or just believe me. The action form sits between the view and the action, the date conversion goes on between the action and the model. Your approach isn't that bad its just not to the MVC pattern that struts follows (not that its the only one). Create a date convertion util class or something. If you dont want to take my word for it here's what craig had to say albeit in response to a different question snippet As the original designer of Struts :-), I must point out that the design of ActionForm (and the recommendation that form bean properties be Strings) is ***very*** deliberate. The reason this is needed is obvious when you consider the following use case: * You have an input form that, say, accepts only integers. * Your form bean property is of type int. * The user types 1b3 instead of 123, by accident. * Based on experience with any garden variety GUI application, the user will expect that they receive an error message, plus a redisplay of the form ***WITH THE INCORRECT VALUES THAT WERE ENTERED DISPLAYED SO THE USER CAN CORRECT THEM***. * The current Struts environment will throw an exception due to the conversion failure. * The suggested solution will ***hopelessly*** confuse the nature of a form bean, which is part of the VIEW tier, with model beans that have native data types. Struts does not include any sort of user interface component model where the details of conversion are hidden inside the user interface component. If that is what you are after, you should look at a *real* user interface component model (such as using JavaServer Faces with a Struts application). Corrupting the functionality of a form bean to *pretend* that it is a user interface component is only going to create complications for the world. /snippet I hope this helps Mark On 25 Mar 2004, at 21:26, Sreenivasa Chadalavada wrote: Application Tier is strongly typed. So if the field is a java.util.Date in the database, then the data object will have the method public DataObject{ public java.util.Date getAsOfDate() public void setAsOfDate(java.util.Date asOfDate) methods. } My Action form is: public MyActionForm extends ActionForm{ public DataObject getDataObject(); public void setDataObject(DataObject dataObject); } My jsp contains html:text property=dataObject.asOfDate/ This will fail if the user does not enter any date. I want the (changed) struts framework to handle that. I did not want to create a new method with type String for every Date field Hope this explanation helps !! Thanks and Regards, Sree/- --- - 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. --- - Mark Lowe mark.lowe @boxstuff.com 03/25/2004 03:17 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: Re: Handling Date objects in ActionForm gracefully Ask yourself why are you trying to convert types for user input? On 25 Mar 2004, at 21:11, Sreenivasa Chadalavada wrote: Do you know if the behavior can be overridden? Thanks and Regards, Sree/- --- - 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. --- - Takhar, Sandeep Sandeep.Takhar @CIBC.ca 03/25/2004 02:53 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject: RE: Handling Date objects in ActionForm gracefully yes it is. It should be done once per classloader. When struts populates the dyna form it is string array to string array conversion and uses populate method of BeanUtils which eventually calls the converters. sandeep -Original Message- From: Sreenivasa Chadalavada [mailto:[EMAIL
Re: LookupDispatchAction default
unspecified() is the method you want look at the javadoc. you do need the method name though /admin/list.do?method I saw that using submit as the parameter name causes problems so i wouldn't use that. On 24 Mar 2004, at 15:16, Brian Sayatovic/AMIG wrote: I'd like to be able to have someone hit my action, /admin/list.do, without having to specify a submit paramater. However, the action is a subclass of LookupDispatchAction whci requires that the request parameter be supplied. Looking in the struts source code, it would be nice if the LookupDispatchAction could fall back to a default or not consider 'null' to be a bad value and just use 'null' as a key to the lookup Map. For now, any link or redirect to the page must specify what I consider to be the default action -- refresh -- on the URL: /admin/list/do?submit=Refresh. Is there another way to do this? Is it worth suggesting that LookupDispatchAction support a default or null mapping? Regards, Brian. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction default
I agree about not using submit, if you end up needing to use JavaScript to change the value, you run into problems since submit() is already function. Calling either document.forms[0].submit.value=something or document.forms[0].submit() gives an error, I can't remember which. Bad idea, avoid it. ;) It was you post on the thread last week where i pick it up. However, I have plenty of /admin/list.do links with no request parameters at all, and the unspecified method is called as described. (I use nightly builds, so I don't know when it started working that way...) Good to know that its been addressed, but I'm on whatever the stable release of 1.1 is. I'd like to be taking the source of 1.2 from cvs and helping to test it but i just cant be arsed with all that maven stuf. But i think i'd still stick to the stable release rather then get caught up in all that unknown territory stuff. On 24 Mar 2004, at 15:30, Wendy Smoak wrote: From: Mark Lowe [mailto:[EMAIL PROTECTED] unspecified() is the method you want look at the javadoc. you do need the method name though /admin/list.do?method I saw that using submit as the parameter name causes problems so i wouldn't use that. I agree about not using submit, if you end up needing to use JavaScript to change the value, you run into problems since submit() is already function. Calling either document.forms[0].submit.value=something or document.forms[0].submit() gives an error, I can't remember which. Bad idea, avoid it. ;) However, I have plenty of /admin/list.do links with no request parameters at all, and the unspecified method is called as described. (I use nightly builds, so I don't know when it started working that way...) -- 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: html:rewrite action problem
try page=/SomeAction.do On 24 Mar 2004, at 17:50, Ruben Pardo wrote: i've got the next tag html:rewrite action=/SomeAction?prefix=page=/SomePage and in the actionConfig action path=/SomeAction type=org.apache.type=org.apache.struts.actions.SwitchAction /action but i always get an error saying that attribute action does not defined in the tld? what could it be? thanks in advance. ___ Yahoo! Messenger - Nueva versión GRATIS Super Webcam, voz, caritas animadas, y más... http://messenger.yahoo.es - 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: LookupDispatchAction default
On 24 Mar 2004, at 16:13, Wendy Smoak wrote: From: Mark Lowe [mailto:[EMAIL PROTECTED] It was you post on the thread last week where i pick it up. Sorry, I'm apparently repeating myself! I can't remember last week this early in the morning. Good to know that its been addressed, but I'm on whatever the stable release of 1.1 is. I'd like to be taking the source of 1.2 from cvs and helping to test it but i just cant be arsed with all that maven stuf. But i think i'd still stick to the stable release rather then get caught up in all that unknown territory stuff. I've been using nightly builds since forever, and I've never once built it from source. There's always a compiled version available along with the source. I do download the source and occasionally look at it or use it with JSwat, but building it is definitely not a prerequisite for using the latest and greatest. I have an Ant task that copies the .jars over from where I download and unzip the nightly builds. If I were really clever, I could probably convince Ant to figure out the filename and go get and expand the .zip files, then copy the .jar files. ;) The only weirdness with 1.2.0 I've found is that ActionError is deprecated but there is no replacement, so you get a bunch of warnings if you use it. I don't think you'll have a big problem going from 1.1 to 1.2. Yeah .. I tried to make my 1.1 apps forward compatible with this by using ActionMessages but to no avail, which is really quite a pain. I was using html:errors tag to display but this is supposed to be okay but wasn't. -- 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: Using Tomcat declarative security for my app
If you're using a javax.servlet.Filter and you then filter-mapping filter-nameMyFilter/filter-name url-pattern/administrator/*.do/url-pattern /filter-mapping you can also map to a servlet name rather than a url pattern but this seems what you want. On 24 Mar 2004, at 18:10, Sipe Informática wrote: Thanks for your help, but it is not the problem... I deleted all about security in my web.xml to test only de filter mapping of the struts action servlet: servlet-mapping servlet-nameaction/servlet-name url-pattern/administrator/*.do/url-pattern /servlet-mapping With this mapping always returns to me a 400 error (Invalid Path)... I have tried also /app/administrator/*.do, but it returns the same error... any idea? Thanks ... Pady Srinivasan wrote: 1. Make sure you define a security-role element for 'administrator' in web.xml. Also the auth-constraint has role-name as 'administrador'. Maybe a spelling error ? 2. And the role should be defined in tomcat-users.xml also. And the users in this role would alone be allowed access. Thanks -- pady [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: Using Tomcat declarative security for my app
opps.. sorry for the dodgy info. in fact mine follow the /dir/* pattern. On 24 Mar 2004, at 18:45, Kris Schneider wrote: You can use either path or extension mapping, but not a combination of both. So /administrator/* is okay and *.do is okay but /administrator/*.do is not. Quoting Mark Lowe [EMAIL PROTECTED]: If you're using a javax.servlet.Filter and you then filter-mapping filter-nameMyFilter/filter-name url-pattern/administrator/*.do/url-pattern /filter-mapping you can also map to a servlet name rather than a url pattern but this seems what you want. On 24 Mar 2004, at 18:10, Sipe Informática wrote: Thanks for your help, but it is not the problem... I deleted all about security in my web.xml to test only de filter mapping of the struts action servlet: servlet-mapping servlet-nameaction/servlet-name url-pattern/administrator/*.do/url-pattern /servlet-mapping With this mapping always returns to me a 400 error (Invalid Path)... I have tried also /app/administrator/*.do, but it returns the same error... any idea? Thanks ... Pady Srinivasan wrote: 1. Make sure you define a security-role element for 'administrator' in web.xml. Also the auth-constraint has role-name as 'administrador'. Maybe a spelling error ? 2. And the role should be defined in tomcat-users.xml also. And the users in this role would alone be allowed access. Thanks -- pady [EMAIL PROTECTED] -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I refresh my jsp
forward name=succes path=/sampe2.jsp redirect=true / On 23 Mar 2004, at 03:38, Mu Mike wrote: sample1.jsp: form action=/action1.do .. /form this is my action definition action path=/action1 type=com.mycom.Action1 name=myForm scope=session forward name=success path=/sample2.jsp/ /action but when I finished the action in sample1, it opens sample2.jsp in the current window(not refresing the sample1.jsp window) and the sample2.jsp page remains the old(I modified some source files in the action in sample1 which are used by sample2.jsp) please, how can I solve this probelm,that is ,refreshing sample2.jsp in its own window ThanksRegards _ ~{Cb7QOBTX~} 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: html:select / html:options
session.setAttribute(myList, list); session.setAttribute(myList,list.toArray()); for some reason you need to cast to list to an array. On 24 Mar 2004, at 01:23, Lokanath wrote: hi , i think u have to get the bean from session to some Collection useing session.getAttribute(mylist) then assign it to some collection.then use that collection for populating the select lokee -Original Message- From: Christian Schlaefcke [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 2:45 AM To: Struts Users Mailing List Subject: html:select / html:options Hi Folks! for several days I mess around with html:select and html:options. I want to access a collection with names or numbers (just java.lang.String). This collection is available in the session. For testing I generated my own collection in the jsp % java.util.Collection list = new java.util.ArrayList(); teilnehmerListe.add(name1); teilnehmerListe.add(name2); teilnehmerListe.add(name3); session.setAttribute(myList, list); % html:form action=/myAction.do html:select property=selectedItem html:options collection=myList / /html:select html:submitOK/html:submit /html:form When I run this I get an IllegalArgumentException: no name specified I found out that both select and options have an argument name so I added some dummies test1 and test2 just to have it and get (as expected) another error: no bean found by that name test1. What am I doing wrong? Can someone point me to the right direction? Thanx and Regards, Chris - 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: AW: Re[2]: are you sure?
submitting to the server returning an action message with a checkbox (check to confirm). and then resubmitting I reckon would be nicer than a javascript dependency. html:form action=/save.do logic:messagesPresent bla bla (i hate this tag) Are you sure you want to do that or are you just being a punk?br html:checkbox property=confirmed value=true / /logic: messagesPresent html:submit / /html:form in the action something like .. boolean confirmed = theForm.getConfirmed().equals(true); if(!confirmed) { ActionMessages messages= blas bla saveMessages(bla bla); } On 23 Mar 2004, at 13:29, Dmitrii CRETU wrote: AS Wow, I'm confused. If javascript was disabled, the onSubmit trigger was AS ignored, but the button onClick trigger was honored? I'll have to try that AS out. If JavaScript is disabled neither of solutions work properly. But with button you avoid uncontrolled form submition, simply nothing happens. In submit-scenario the submition is taken place without JavaScript preprocessing (onSubmit event) wich could not be accepted sometimes, e.g. when you encrypt some fields. Dima. AS Andreas AS -Ursprungliche Nachricht- AS Von: Dmitrii CRETU [mailto:[EMAIL PROTECTED] AS Gesendet: Dienstag, 23. Marz 2004 11:09 AS An: Struts Users Mailing List AS Betreff: Re[2]: are you sure? AS we tried to use this (form.onsumbit=return f()) but encountered a problem: AS if JavaScript is disabled in browser the submiting goes on without AS confirmation dialogue and other stuff done by JS (wich in our case was AS more important). AS We solved this by setting input.type=button instead of submit and AS submitting the form from JacaScript. But this caused another problem AS (though less important): now user can not submit form pressing Enter AS being at text input, he must click the button. AS Dima. AS Tuesday, March 23, 2004, 11:43:54 AM, you wrote: JS Try with this - JS html:form action=/adddate JS name=dateForm JS type=nl.rinke.DateForm JS onsubmit=return areyousure() JS Should work JS -Original Message- JS From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] JS Sent: Tuesday, March 23, 2004 3:10 PM JS To: [EMAIL PROTECTED] JS Subject: are you sure? JS Hi list, JS Still a struts newbie, I try to write an are you sure javascript JS confirmation box for my submit button. JS The question is: how can I prevent the form from being submitted JS when the user clicks no? JS In the Jsp, I put the following code in the head: JS SCRIPT LANGUAGE=javascript JSfunction areyousure(){ JS var agree = false; JS agree = confirm(are you sure?); JS if(agree){ JS ... some code which is not important JS } JS return agree; JS} JS /SCRIPT JS And the form tag looks like this: JS html:form action=/adddate JS name=dateForm JS type=nl.rinke.DateForm JS onsubmit=areyousure() JS Whatever the user clicks, yes or no, the form JS gets submitted. I want to stop submitting the JS form when the user click no. JS thanks, Rinke JS - JS To unsubscribe, e-mail: [EMAIL PROTECTED] JS For additional commands, e-mail: [EMAIL PROTECTED] JS - JS To unsubscribe, e-mail: [EMAIL PROTECTED] JS For additional commands, e-mail: [EMAIL PROTECTED] AS -- AS Best regards, AS Dmitriimailto:[EMAIL PROTECTED] AS - AS To unsubscribe, e-mail: [EMAIL PROTECTED] AS For additional commands, e-mail: [EMAIL PROTECTED] AS - AS To unsubscribe, e-mail: [EMAIL PROTECTED] AS For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Dmitriimailto:[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: There *has* to be an easy way to do this...
Your using OM objects and stuffing them into your view but this should still work anyhow. CreditCost newCost = new CreditCost(); creditCostList.add(newCost); Have an add action do the above, I assume you're scoping to session as you're iterating through a scoped array/list and not a form property. IMO you want to have things looking more like this logic:iterate id=item name=costsForm property=creditCosts and in your actions CreditCostsForm theForm = (CreditCostsForm) form; List costList = theForm.getCreditCosts(); costList.setCrediCost(costList.size(),new CreditCostForm()); Notice CreditCostForm not CreditCost from you OM, although you could get away with using CreditCost as a form property it will make life harder if you ever want to decouple the web and model tiers. If you cant be arsed having webtier beans/forms then perhaps use a map or dynabean to do the same thing. On 22 Mar 2004, at 08:42, Joe Hertz wrote: I have a simple iterate in a piece of JSP (snippet follows) that provides an interface inside of an HTML table to modify items that came out of the database. What I want to do is provide an extra row or two for new items to be inserted into the database. Short of embeddeding scriptlet code to generate the property identifiers (which are in a List), is there a good way to do this? Basically the ideal answer would be to have a way to tell logic:iterate to go for an extra round, with the tag being smart enough to do the needful. tia -Joe table border=1 cellpadding=1 tr thMinimum Purchase/th thCost Per Credit/th thBegin Date/th thEnd Date/th /tr logic:iterate id=item name=creditCost indexId=index type=bb.hibernate.Creditprice trtdhtml:hidden name=item property=id indexed=true / html:text maxlength=5 name=item property=minPurchase size=5 indexed=true //td tdhtml:text maxlength=5 name=item property=creditCost size=5 indexed=true //td tdhtml:text maxlength=10 name=item property=beginDate size=10 indexed=true //td tdhtml:text maxlength=10 name=item property=endDate size=10 indexed=true //td/tr /logic:iterate - 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: There *has* to be an easy way to do this..
You could get what you're doing now running using ArrayList as a form property. and then nest your hibernate Beans in there until such a time as you have enough time to change things . form-bean name=creditCostsForm type=... form-property name=creditCosts type=java.util.ArrayList / DyanaActionForm theForm = (DynaActionForm) form; List costList = (List) theForm.get(creditCosts); .. add your beans into the list and a new one if you so wish. theForm.set(creditCosts,costList); .. html:form action=/save.do logic:iterate id=item name=creditCostsForm property=creditCosts On 22 Mar 2004, at 11:30, Joe Hertz wrote: In a word, Doh! I'm using a DynaForm, and frankly, wanted this as a form property, but well...Let's just say I was brainwashed by my previous paradigm. Rather than using a List in the dynaform, I'm going to create a bunch of String[] properties. Not even so much for the decoupling aspect (which isn't AS big of a deal as it usually is because this JSP by definition is going to be a maintenance screen for this particular Object regardless) but I'm going to need sic the validator onto the fields on the screen, so string arrays it is. JOC, is it kosher for me to be setting the form properties in the Action that leads into the JSP, or should I be doing it somewhere in the form's class. (This seems like a basic question, but in the home grown framework I was raised on, this concept was a bit of a no-no. Much like chaining actions is in Struts. Thanks for your help. -Joe -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 4:20 AM To: Struts Users Mailing List Subject: Re: There *has* to be an easy way to do this... Your using OM objects and stuffing them into your view but this should still work anyhow. CreditCost newCost = new CreditCost(); creditCostList.add(newCost); Have an add action do the above, I assume you're scoping to session as you're iterating through a scoped array/list and not a form property. IMO you want to have things looking more like this logic:iterate id=item name=costsForm property=creditCosts and in your actions CreditCostsForm theForm = (CreditCostsForm) form; List costList = theForm.getCreditCosts(); costList.setCrediCost(costList.size(),new CreditCostForm()); Notice CreditCostForm not CreditCost from you OM, although you could get away with using CreditCost as a form property it will make life harder if you ever want to decouple the web and model tiers. If you cant be arsed having webtier beans/forms then perhaps use a map or dynabean to do the same thing. On 22 Mar 2004, at 08:42, Joe Hertz wrote: I have a simple iterate in a piece of JSP (snippet follows) that provides an interface inside of an HTML table to modify items that came out of the database. What I want to do is provide an extra row or two for new items to be inserted into the database. Short of embeddeding scriptlet code to generate the property identifiers (which are in a List), is there a good way to do this? Basically the ideal answer would be to have a way to tell logic:iterate to go for an extra round, with the tag being smart enough to do the needful. tia -Joe table border=1 cellpadding=1 tr thMinimum Purchase/th thCost Per Credit/th thBegin Date/th thEnd Date/th /tr logic:iterate id=item name=creditCost indexId=index type=bb.hibernate.Creditprice trtdhtml:hidden name=item property=id indexed=true / html:text maxlength=5 name=item property=minPurchase size=5 indexed=true //td tdhtml:text maxlength=5 name=item property=creditCost size=5 indexed=true //td tdhtml:text maxlength=10 name=item property=beginDate size=10 indexed=true //td tdhtml:text maxlength=10 name=item property=endDate size=10 indexed=true //td/tr /logic:iterate - 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: Indexed Property
I don't know how helpful those examples are in reality as there are a few details missing.. So here's an example. Personally i like nesting forms although this isn't to everyone's taste. The example uses LazyList to allow you to scope the form to request and the example was provided by Paul Chip on the list a few weeks back. // action form import org.apache.struts.action.ActionMapping; import javax.servlet.http.*; import java.util.ArrayList; import java.util.List; import org.apache.struts.action.ActionForm; import org.apache.commons.collections.ListUtils; import org.apache.commons.collections.Factory; public class ItemsForm extends ActionForm { private List itemList; public ItemsForm() { initLists(); } private void initLists() { Factory factory = new Factory() { public Object create() { return new ProductForm(); } }; this.itemList = ListUtils.lazyList(new ArrayList(), factory); } public List getItems() { return itemList; } public void setItems(List itemList) { this.itemList = itemList; } public ItemForm getItem(int index) { return (ItemForm) itemList.get(index); } public void setItem(int index,ItemForm item) { this.itemList.add(index,item); } public void reset(ActionMapping mapping, HttpServletRequest request) { super.reset(mapping, request); initLists(); } } //ItemForm public class ItemForm extends ActionForm { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } //ItemsAction [i'd use LookupDispatchAction] ItemsForm theForm = (ItemsForm) form; ItemForm item = new ItemForm(); item.setName(First Item); ItemForm anotherItem = new ItemForm(); anotherItem.setName(Second Item); theForm.setItem(0,item); theForm.setItem(1,item); // struts config form-bean name=itemsForm type=ItemsForm / action path=/populate name=itemsForm scope=request ... action path=/save name=itemsForm scope=request.. //jsp html:form path=/save.do logic:iterate id=item name=itemsForm property=items html:text name=item property=item indexed=true / or c:forEach var=item items=${itemsForm.items} html:text name=item property=item indexed=true / Sorry I didn't think about the potential confusing of using item quite so much.. But this should help close a few gaps. On 22 Mar 2004, at 14:14, Robert Taylor wrote: http://jakarta.apache.org/struts/faqs/indexedprops.html -Original Message- From: Prakasan OK [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 6:18 AM To: Struts Users Mailing List Subject: Indexed Property Hi, can anyone give me a sample code for implementing indexed properties? how should the jsp page and the corresponding Action class look like? thanks, Prakasan - 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: Indexed Property
correction On 22 Mar 2004, at 14:42, Mark Lowe wrote: I don't know how helpful those examples are in reality as there are a few details missing.. So here's an example. Personally i like nesting forms although this isn't to everyone's taste. The example uses LazyList to allow you to scope the form to request and the example was provided by Paul Chip on the list a few weeks back. // action form import org.apache.struts.action.ActionMapping; import javax.servlet.http.*; import java.util.ArrayList; import java.util.List; import org.apache.struts.action.ActionForm; import org.apache.commons.collections.ListUtils; import org.apache.commons.collections.Factory; public class ItemsForm extends ActionForm { private List itemList; public ItemsForm() { initLists(); } private void initLists() { Factory factory = new Factory() { public Object create() { return new ItemForm(); return new ProductForm(); } }; this.itemList = ListUtils.lazyList(new ArrayList(), factory); } public List getItems() { return itemList; } public void setItems(List itemList) { this.itemList = itemList; } public ItemForm getItem(int index) { return (ItemForm) itemList.get(index); } public void setItem(int index,ItemForm item) { this.itemList.add(index,item); } public void reset(ActionMapping mapping, HttpServletRequest request) { super.reset(mapping, request); initLists(); } } //ItemForm public class ItemForm extends ActionForm { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } //ItemsAction [i'd use LookupDispatchAction] ItemsForm theForm = (ItemsForm) form; ItemForm item = new ItemForm(); item.setName(First Item); ItemForm anotherItem = new ItemForm(); anotherItem.setName(Second Item); theForm.setItem(0,item); theForm.setItem(1,item); // struts config form-bean name=itemsForm type=ItemsForm / action path=/populate name=itemsForm scope=request ... action path=/save name=itemsForm scope=request.. //jsp html:form path=/save.do logic:iterate id=item name=itemsForm property=items html:text name=item property=item indexed=true / or c:forEach var=item items=${itemsForm.items} html:text name=item property=item indexed=true / Sorry I didn't think about the potential confusing of using item quite so much.. But this should help close a few gaps. On 22 Mar 2004, at 14:14, Robert Taylor wrote: http://jakarta.apache.org/struts/faqs/indexedprops.html -Original Message- From: Prakasan OK [mailto:[EMAIL PROTECTED] Sent: Monday, March 22, 2004 6:18 AM To: Struts Users Mailing List Subject: Indexed Property Hi, can anyone give me a sample code for implementing indexed properties? how should the jsp page and the corresponding Action class look like? thanks, Prakasan - 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: html:Selectalternatives
You haven't even tried using the struts tag.. html:select property=teacher html:option value=--/html:option html:options collection=teachers property=ssn labelProperty=completeName / /html:select now if the value of teacher equals one of the ssn values it will be selected. On 22 Mar 2004, at 15:26, as as wrote: Hi I tried a lot but in vain, to show a certain default in a drop down as selected, using my select statement as follows: select name=completeName logic:iterate id=teacher name=teachers option value=bean:write name=teacher property =SSN/ bean:write name=teacher property =completeName/ /option /logic:iterate /select Looking for alternatives on how to implement the same: (probably using no struts tag) Any help appreciated. Thanks, Sam. Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:Selectalternatives
What does you form bean look like dyna or otherwise? The value of teacher.getSsn() (i.e. html:options collection=teachers property=ssn ) must match the value of html:select property=teacher or whatever you called it. The value of teacher must be set somewhere, it cant do things by magic. On 22 Mar 2004, at 15:57, as as wrote: MArk, Thanks for the quick reply. Yes, I did try that tooIt shows me correctly (in System.out.println), my form's default value of completeName of teacher but on the jsp page/form bean, it shows the drop down sorted and not the selected value. Really donno what could be wrong...? Thanks in advance... -Sam Mark Lowe [EMAIL PROTECTED] wrote: You haven't even tried using the struts tag.. -- labelProperty=completeName / now if the value of teacher equals one of the ssn values it will be selected. On 22 Mar 2004, at 15:26, as as wrote: Hi I tried a lot but in vain, to show a certain default in a drop down as selected, using my statement as follows: Looking for alternatives on how to implement the same: (probably using no struts tag) Any help appreciated. Thanks, Sam. Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: multiple lines in an ActionMessage object displayed via javascript alert
Whats actually in your properties file..? Paste the rendered source into the reply, i think its a javascript problem. On 22 Mar 2004, at 18:04, Just Fun 4 You wrote: hm. In my ActionClass I have something like this: ActionMessages messages = new ActionMessages(); String text = \n: + getCriticalDate.toString() + --; text = text + getTotalHours() + hours.\n; messages.add(critical.schedule.text, text); saveMessages(request, messages); In my jsp: logic:messagesPresent script language=javascript html:messages id=message message=true alert(c:out value=${message} /) /html:messages /script logic:messagesPresent This does not work: I get a javascript error (unterminated string constant). However everything works and the text is being displayed when I remove the \n from the text. the evaluated text string looks something like this if I print the text string to the console (seems ok): The following dates are critical: 20.03.2004: 5 hours. I want this format exactly being displayed using the alert function. I cannot see where the problem is. any idea? thx, Dirk -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 00:46 An: Struts Users Mailing List Betreff: Re: multiple lines in an ActionMessage object displayed via javascript alert What characters have you in your strings ? There must be something a quote or something give js a bad day. I assume you've something like this. msg1 = bean:message key=message1 /; msg2 = bean:message key=message2 /; msg3 = bean:message key=message3 /; msg = msg1 +\n+ msg2 +\n+ msg3; alert(msg); Paste the rendered source in to a reply and I'm sure one or more of you messages has a character that needs escaping or something like that. On 22 Mar 2004, at 00:17, Just Fun 4 You wrote: Hi, I create an ActionMessages object and store one ActionMessage in it. The ActionMessage is a string which contains the \n character to display the whole message in more than one line: message1\nmessage2\nmessage3... In my jsp I have defined the html:message for iteration within a javascript block as I would like to display the message by the javascript alert function. The problem is, that I always get a javascript error for the \n character (unterminated string constant). However, if I remove the \n character everything works. But then, the whole message is displayed in one line. Can someone help? thx, Dirk - 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-reports
On 22 Mar 2004, at 19:06, as as wrote: Hi, I have a struts page that needs to generate reports based on filtering criterion like (date from, date to, type of report, type of data to show). Make some util classes that return what you need with what you need from you model. List fooList = HibernateHelper.getFoos(from, to); The type of report might be more a web layer/struts thing. my back end database is hibernate. Well i doubt that but i see what you mean. Is there some sort of open source for such a purpose.basically looking for fast page response time-to fetch data from back end database using these queries.. Um yes, hibernate? Thanks in advance! Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: multiple lines in an ActionMessage object displayed via javascript alert
Weird .. I thought it might be the accented characters but safari, msie mac and firefox all work. And mise 6 on windoze. If the message gets to your page then its a javascript issue, but i certainly cant recreate it. I assume that logic:messagesPresent /logic:messagesPresent doesn't appear in your rendered html.. On 22 Mar 2004, at 20:45, Just Fun 4 You wrote: Hi Mark, the properties file holds for critical.schedule.text: critical.schedule.text=Folgende Termine sind wg zeitlicher Überlastung für The rendered jsp looks like this: ... logic:messagesPresent script language=javascript alert(Folgende Termine sind wg zeitlicher Überlastung für Schmidt (SCHM05) kritisch: 16.03.2004: 11 PS Tagesaufwand) /script /logic:messagesPresent ... the following shows the source from the ActionClass: ActionMessages messages = new ActionMessages(); String noteText = + person.getPersonDataShort() + kritisch:\n; Iterator it = scheduleReportList.iterator(); while(it.hasNext()){ Object object = it.next(); if(object instanceof ScheduleModel){ ScheduleModel scheduleOversized = (ScheduleModel)object; noteText = noteText + scheduleOversized.formatSqlDateToDate(scheduleOversized.getStartDate(). toStr ing()) + : + scheduleOversized.getIntDailyManHour() + PS Tagesaufwand\n; } } if(messages != null){ System.out.println(Note: + noteText); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(critical.schedule.text, noteText.trim())); saveMessages(request, messages); } thx, Dirk -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 18:25 An: Struts Users Mailing List Betreff: Re: AW: multiple lines in an ActionMessage object displayed via javascript alert Whats actually in your properties file..? Paste the rendered source into the reply, i think its a javascript problem. On 22 Mar 2004, at 18:04, Just Fun 4 You wrote: hm. In my ActionClass I have something like this: ActionMessages messages = new ActionMessages(); String text = \n: + getCriticalDate.toString() + --; text = text + getTotalHours() + hours.\n; messages.add(critical.schedule.text, text); saveMessages(request, messages); In my jsp: logic:messagesPresent script language=javascript html:messages id=message message=true alert(c:out value=${message} /) /html:messages /script logic:messagesPresent This does not work: I get a javascript error (unterminated string constant). However everything works and the text is being displayed when I remove the \n from the text. the evaluated text string looks something like this if I print the text string to the console (seems ok): The following dates are critical: 20.03.2004: 5 hours. I want this format exactly being displayed using the alert function. I cannot see where the problem is. any idea? thx, Dirk -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 00:46 An: Struts Users Mailing List Betreff: Re: multiple lines in an ActionMessage object displayed via javascript alert What characters have you in your strings ? There must be something a quote or something give js a bad day. I assume you've something like this. msg1 = bean:message key=message1 /; msg2 = bean:message key=message2 /; msg3 = bean:message key=message3 /; msg = msg1 +\n+ msg2 +\n+ msg3; alert(msg); Paste the rendered source in to a reply and I'm sure one or more of you messages has a character that needs escaping or something like that. On 22 Mar 2004, at 00:17, Just Fun 4 You wrote: Hi, I create an ActionMessages object and store one ActionMessage in it. The ActionMessage is a string which contains the \n character to display the whole message in more than one line: message1\nmessage2\nmessage3... In my jsp I have defined the html:message for iteration within a javascript block as I would like to display the message by the javascript alert function. The problem is, that I always get a javascript error for the \n character (unterminated string constant). However, if I remove the \n character everything works. But then, the whole message is displayed in one line. Can someone help? thx, Dirk - 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: AW: AW: AW: multiple lines in an ActionMessage object displayed via javascript alert
send the whole rendered code with the \n's .. On 22 Mar 2004, at 21:37, Just Fun 4 You wrote: I am pretty sure that this is a javascript issue. I am just wondering why it all works when I remove the \n character. What does it make the difference to javascript? Maybe others can jump in here. Again: having a string like \nsomeText\nAnotherText\n put in a ActionMessage object causes a javascript error (unterminated string constant). If I remove the \n character it works. When I code alert(\nsomeText\nAnotherText\n) directly into a html page, it also works. I am not sure what really goes on here. I cannot see any difference... -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 21:09 An: Struts Users Mailing List Betreff: Re: AW: AW: multiple lines in an ActionMessage object displayed via javascript alert Weird .. I thought it might be the accented characters but safari, msie mac and firefox all work. And mise 6 on windoze. If the message gets to your page then its a javascript issue, but i certainly cant recreate it. I assume that logic:messagesPresent /logic:messagesPresent doesn't appear in your rendered html.. On 22 Mar 2004, at 20:45, Just Fun 4 You wrote: Hi Mark, the properties file holds for critical.schedule.text: critical.schedule.text=Folgende Termine sind wg zeitlicher Überlastung für The rendered jsp looks like this: ... logic:messagesPresent script language=javascript alert(Folgende Termine sind wg zeitlicher Überlastung für Schmidt (SCHM05) kritisch: 16.03.2004: 11 PS Tagesaufwand) /script /logic:messagesPresent ... the following shows the source from the ActionClass: ActionMessages messages = new ActionMessages(); String noteText = + person.getPersonDataShort() + kritisch:\n; Iterator it = scheduleReportList.iterator(); while(it.hasNext()){ Object object = it.next(); if(object instanceof ScheduleModel){ ScheduleModel scheduleOversized = (ScheduleModel)object; noteText = noteText + scheduleOversized.formatSqlDateToDate(scheduleOversized.getStartDate() . toStr ing()) + : + scheduleOversized.getIntDailyManHour() + PS Tagesaufwand\n; } } if(messages != null){ System.out.println(Note: + noteText); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(critical.schedule.text, noteText.trim())); saveMessages(request, messages); } thx, Dirk -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 18:25 An: Struts Users Mailing List Betreff: Re: AW: multiple lines in an ActionMessage object displayed via javascript alert Whats actually in your properties file..? Paste the rendered source into the reply, i think its a javascript problem. On 22 Mar 2004, at 18:04, Just Fun 4 You wrote: hm. In my ActionClass I have something like this: ActionMessages messages = new ActionMessages(); String text = \n: + getCriticalDate.toString() + --; text = text + getTotalHours() + hours.\n; messages.add(critical.schedule.text, text); saveMessages(request, messages); In my jsp: logic:messagesPresent script language=javascript html:messages id=message message=true alert(c:out value=${message} /) /html:messages /script logic:messagesPresent This does not work: I get a javascript error (unterminated string constant). However everything works and the text is being displayed when I remove the \n from the text. the evaluated text string looks something like this if I print the text string to the console (seems ok): The following dates are critical: 20.03.2004: 5 hours. I want this format exactly being displayed using the alert function. I cannot see where the problem is. any idea? thx, Dirk -Ursprüngliche Nachricht- Von: Mark Lowe [mailto:[EMAIL PROTECTED] Gesendet: Montag, 22. März 2004 00:46 An: Struts Users Mailing List Betreff: Re: multiple lines in an ActionMessage object displayed via javascript alert What characters have you in your strings ? There must be something a quote or something give js a bad day. I assume you've something like this. msg1 = bean:message key=message1 /; msg2 = bean:message key=message2 /; msg3 = bean:message key=message3 /; msg = msg1 +\n+ msg2 +\n+ msg3; alert(msg); Paste the rendered source in to a reply and I'm sure one or more of you messages has a character that needs escaping or something like that. On 22 Mar 2004, at 00:17, Just Fun 4 You wrote: Hi, I create an ActionMessages object and store one ActionMessage in it. The ActionMessage is a string which contains the \n character to display the whole message in more than one line: message1\nmessage2\nmessage3... In my jsp I have defined the html:message for iteration within a javascript block as I would like to display
Re: multiple lines in an ActionMessage object displayed via javascript alert
What characters have you in your strings ? There must be something a quote or something give js a bad day. I assume you've something like this. msg1 = bean:message key=message1 /; msg2 = bean:message key=message2 /; msg3 = bean:message key=message3 /; msg = msg1 +\n+ msg2 +\n+ msg3; alert(msg); Paste the rendered source in to a reply and I'm sure one or more of you messages has a character that needs escaping or something like that. On 22 Mar 2004, at 00:17, Just Fun 4 You wrote: Hi, I create an ActionMessages object and store one ActionMessage in it. The ActionMessage is a string which contains the \n character to display the whole message in more than one line: message1\nmessage2\nmessage3... In my jsp I have defined the html:message for iteration within a javascript block as I would like to display the message by the javascript alert function. The problem is, that I always get a javascript error for the \n character (unterminated string constant). However, if I remove the \n character everything works. But then, the whole message is displayed in one line. Can someone help? thx, Dirk - 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: Pls help on shopping cart App
A little off topic .. but does weblogic actually cost money? Sounds worse then Jrun to me. Anyway if I understood the problem, if weblogic struts which I assume is struts 1.0 doesn't support indexed=true (as struts 1.0 doesn't) then you have to put the index in youself logic:iterate id=item name=basketForm property=items indexId=index % java.lang.String item = item[+ java.lang.Integer.toString(index) +]; pageScope.setAttribute(item,item); % html:text name=%= item % property=price / /logic:iterate Again, perhaps I didn't understand the question, or perhaps things look more like this. logic:iterate id=item name=basketForm property=items indexId=index % java.lang.String price = price[+ java.lang.Integer.toString(index) +]; pageScope.setAttribute(price, price); % html:text property=%= price % / /logic:iterate I assume this is how matey boy fixed his weblogic struts problem. On 20 Mar 2004, at 06:06, Prakasan OK wrote: Hi, I am also facing the same problem.. Can u explain how you have solved it? On Thu, 18 Mar 2004 sougata wrote : No it is not like that since I am using weblogic's struts .Anyway I solved that.Thanks for your reply Sougata -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 18, 2004 1:36 PM To: Struts Users Mailing List Subject: Re: Pls help on shopping cart App Do your html:text have the indexed=true attribute? On 18 Mar 2004, at 07:07, sougata wrote: Hi All, I have a shopping cart apps.When the user is buying items it is coming to mycart .In my mycart page I am showing all the products and the beside that I have a update button by which I can update the quantity of my each item which is in a textbox.I am follwing struts for that.My text box name is same in every row(say quantity).if its name is quantity in servlet I am getting a String array of quantity.But when I am coming to the same page its showing value=[Ljava.lang.String;@1765ae which is the reference of my string array.How to get the original value Pls let me know ASAP. Thanks Sougata - 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: Mapping Forward to new form
If you form is scoped to request you can also set redirect=true in the action forward. On 19 Mar 2004, at 20:03, Saul Q Yuan wrote: You can call ((UserForm) form).reset() before forwarding. Saul -Original Message- From: Ciaran Hanley [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 1:52 PM To: Struts User Mailing List Subject: Mapping Forward to new form Hey, I am adding user details to the DB through a form, on a successful insert I would like to map forward to the same form. The problem is when I use the action forward the form on the forwarded page is filled with the details from the user I just added. if(addUser((UserForm) form, request, response)) { return (mapping.findForward(adduser)); } I would like to map to a new blank form, how do I do this? Thanks - 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: DynaValidatorForm for java.lang.Integer
Use String. Anything else is asking of trouble. According to the party line (ref: struts dev list) action form properties should always be of type string. You can still validate whether a string is 1 for example or whether it looks like a date whatever, it doesn't have to be typed as such. On 19 Mar 2004, at 09:01, Duma Rolando wrote: Hi all, I have a problem using Validator with DynaBeans. In my struts-config if I declare java.lang.String props for a DynaValidatorForm a required validation works fine, but if I change the props to java.lang.Integer the required validation fails ( no ActionErrors returned ). Please hep me! I'm using struts 1.1, validator 1.0.2, commons-beanutils 1.6.1 ( maybe this is the problem? ) on tomcat 5.1.19. - 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: SessionTimeout handling
If your container supports it use a Filter. And I think (perhaps don't know) that session timeout is something you usually configure the container to do, but again i'm not sure of your requirement. On 19 Mar 2004, at 10:48, Sanoj, Antony (IE10) wrote: Hi, I am trying to handle session timeout by extending the ActionServlet. I am trying to use the request method isRequestedSessionIdValid() coupled with checking the session for my userbean. Please comment about this code. Advice if there is a better way to do session timeout trapping. / *** ***/ public boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { /* UserBean is a bean which represents the logged in user. */ if( request.isRequestedSessionIdValid() || request.getSession().getAttribute(UserBean) != null) return true; else { try { request.getRequestDispatcher(SessionTimeout.do).forward(request,r esponse); } catch(Exception e) { e.printStackTrace(); } return false; } } / *** ***/ Regards, Sanoj Antony - 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: Database backed forms
If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig represents the configuration information of a form-bean element in a Struts configuration file. So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms on the fly. I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Database backed forms
How would you suggest implementing view/edit functionality without pre-populating action forms? prepopulating is exactly what i would do, just in an action not in the action form. Sure you can shoe-horn checking your system state constantly but just seems complicated. Surely some transaction management when you come to insert/update/delete data should do the job. 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. If you've got that far then the question of dynamically generating fields shouldn't be a problem. On 19 Mar 2004, at 11:58, Brendan Richards wrote: I've seen many posts on Not pre-populating action forms. This seems to be a design decision as action forms are only for validating input. However, in most applications I write I don't want to only input data but to view and edit existing data as well. For me ActionForms seem to be the best way to code an input/output layer between the browser and the backend. In order to view and edit existing data, the action form needs to pre-populate its data from the backend before displaying the form. How would you suggest implementing view/edit functionality without pre-populating action forms? I've coded pre-populating action forms in the following way: 1) I've got session objects to maintain my current system state (whether I'm looking at an extisting object or creating a new one) 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 10:41 To: Struts Users Mailing List Subject: Re: Database backed forms If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig represents the configuration information of a form-bean element in a Struts configuration file. So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms on the fly. I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: Database backed forms
This is just my opinion but for editor style forms lookupdispatchaction is the dogs. Especially if you want to avoiding scoping forms to httpsession. The classes are longer but less. On 19 Mar 2004, at 12:55, Brendan Richards wrote: prepopulating is exactly what i would do, just in an action not in the action form. Ah! That makes perfect sense. Keep the action form only for temporarily holding the data we're input/outputting and do all work in the actions. If you want to edit have a 'viewEdit' action that populates the Action form and displays. Then to save, have a 'submitEdit' action. Sounds like a much better way of going about it... Thanks. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 11:41 To: Struts Users Mailing List Subject: Re: Database backed forms How would you suggest implementing view/edit functionality without pre-populating action forms? prepopulating is exactly what i would do, just in an action not in the action form. Sure you can shoe-horn checking your system state constantly but just seems complicated. Surely some transaction management when you come to insert/update/delete data should do the job. 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. If you've got that far then the question of dynamically generating fields shouldn't be a problem. On 19 Mar 2004, at 11:58, Brendan Richards wrote: I've seen many posts on Not pre-populating action forms. This seems to be a design decision as action forms are only for validating input. However, in most applications I write I don't want to only input data but to view and edit existing data as well. For me ActionForms seem to be the best way to code an input/output layer between the browser and the backend. In order to view and edit existing data, the action form needs to pre-populate its data from the backend before displaying the form. How would you suggest implementing view/edit functionality without pre-populating action forms? I've coded pre-populating action forms in the following way: 1) I've got session objects to maintain my current system state (whether I'm looking at an extisting object or creating a new one) 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 10:41 To: Struts Users Mailing List Subject: Re: Database backed forms If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig represents the configuration information of a form-bean element in a Struts configuration file. So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms on the fly. I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe
Re: Pls help on shopping cart App
Do your html:text have the indexed=true attribute? On 18 Mar 2004, at 07:07, sougata wrote: Hi All, I have a shopping cart apps.When the user is buying items it is coming to mycart .In my mycart page I am showing all the products and the beside that I have a update button by which I can update the quantity of my each item which is in a textbox.I am follwing struts for that.My text box name is same in every row(say quantity).if its name is quantity in servlet I am getting a String array of quantity.But when I am coming to the same page its showing value=[Ljava.lang.String;@1765ae which is the reference of my string array.How to get the original value Pls let me know ASAP. Thanks Sougata - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction with html:image?
Will this not work then? html:image property=method value=Save page=/image/buttons/en/save.gif / assuming the value is set by nesting bean:message html:image property=method page=/image/buttons/en/save.gif bean:message key=button.save / /html:image On 18 Mar 2004, at 10:36, Dixit, Shashank (Cognizant) wrote: Search for ImageButtonDispatchAction in struts previous messages. It is devoloped by somebody and have put it there. Shashank Dixit jpmc ib , cognizant technology solutions pvt. ltd. Tel: +91 20 2931100 Ext : 2354 Vnet : 22362 Mobile : 98904 25400 An Obstacle is something you see when you take your eyes off the goal. -Original Message- From: Stefan Burkard [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 March 2004 8:19 PM To: [EMAIL PROTECTED] Subject: LookupDispatchAction with html:image? hi struts-users is it possible to use the LookupDispatchAction with image-submit-buttons (html:image) instead of normal submit-buttons? thanks and greetings stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] InterScan_Disclaimer.txt- 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: Way tho highlight error form field
You could modify the client-side validation stuff to do this rather than just alerting. An easy way of layering this on is to define a compulsory array of fields and then loop through the form on validation. changing the borderColor style attribute when you have a match between the element name and your array. compulsary = [name,email]; function validate(form) { for(i = 0;i compulsary.length;i++) { field = compulsary[i]; value = form.elements[field].value; if(value == ) { form.elements[field].style.borderColor = #ff; } } } Then you can think about having your compulsary array populated in the same way as the struts validator client-side stuff. In fact you could use the array then it defines. On 18 Mar 2004, at 10:49, Joao Batistella wrote: Hello! Is there a way in Struts to highlight the HTML form field that has an error? I mean, changing the style class of the form field, for example. Is there some feature in Struts that can help me? Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: java.lang.VerifyErrror - Illegal stste of Jump or Branch
Why not populate an array and use that ? If doing it in the action seems a little tiresome then JSTL could help. It will be tidier than including a page with a bunch of options in. On 18 Mar 2004, at 13:00, Ramachandran wrote: Hi List, I am facing one problem in a jsp file. In this file, i am including lot of codes. While using html:select html:optionaa/html:option /html:select Here if i include, one extra line it is throwing such error. But if i remove one line option it is working fine. I searched in the netbut not yet solved. So i try to use the jsp:include inside the html:select. But it os throwing error, 'unable to flush between the custom tags If i use the [EMAIL PROTECTED] again it throws the same error. Please give me the solution regarding this Thanx and Regards, Ram - 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: EL buggy? this shouldn't happen
${testPrimKey[ctr]} or perhaps with the wrappers c:set var=key value=${testPrimKey[ctr]} / ${key} what does that do? On 18 Mar 2004, at 12:46, Axel Groß wrote: hi all! while trying to figure out how indexed/mapped properties work I get some strange behaviour - I'm pretty sure this doesn't conform to standard (hope I'm mistaken): logic:iterate id=foo indexId=ctr name=mappedTest property=testPrimKey tr td${foo}/td td${ctr}/td tdtestPrimKey[${ctr}]/td /tr /logic:iterate evaluates to: tr tdk1/td td0/td tdtestPrimKey[]/td /tr tr tdk2/td td1/td tdtestPrimKey[]/td /tr ... where the k1, k2.. are the expected values of key testPrimKey in the HashMap put under mappedTest in the PageContext BUT ${ctr} gets evaluated to different values I'm using struts1.1 and tomcat 5.0.19 so whose wrong? me or the result ??? thanks for enlightenment! Axel - 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: indexed property problem
try html-el:text name=mappedTest property=testPrimKey(${ctr}) / On 18 Mar 2004, at 14:49, Axel Groß wrote: Hi Mark! thanks for your answer tdtestPrimKey[${ctr}]/td evaluates to as it should to testPrimKey[0], testPrimKey[1].. ( i did a stupid mistake in my code ), On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote: ${testPrimKey[ctr]} that actually evaluates to nothing but ${mappedTest.testPrimKey[ctr]} gets the right result BUT my original intention (to use it with html:struts) still fails, because the tag doesnt populate the value for the indexed property: without using the indexed property: html:text name=mappedTest property='testPrimKey'/html:text - is as expected: input type=text name=testPrimKey value=[Ljava...{right object reference} / with using the indexed property html:text name=mappedTest property='testPrimKey[${ctr}]' / - doesnt put value attribute: input type=text name=testPrimKey[0] value= / input type=text name=testPrimKey[1] value= / ... if anybody could help me with that one, i'd be relieved thanks, axel or perhaps with the wrappers c:set var=key value=${testPrimKey[ctr]} / ${key} what does that do? On 18 Mar 2004, at 12:46, Axel Groß wrote: hi all! while trying to figure out how indexed/mapped properties work I get some strange behaviour - I'm pretty sure this doesn't conform to standard (hope I'm mistaken): logic:iterate id=foo indexId=ctr name=mappedTest property=testPrimKey tr td${foo}/td td${ctr}/td tdtestPrimKey[${ctr}]/td /tr /logic:iterate evaluates to: tr tdk1/td td0/td tdtestPrimKey[]/td /tr tr tdk2/td td1/td tdtestPrimKey[]/td /tr ... where the k1, k2.. are the expected values of key testPrimKey in the HashMap put under mappedTest in the PageContext BUT ${ctr} gets evaluated to different values I'm using struts1.1 and tomcat 5.0.19 so whose wrong? me or the result ??? thanks for enlightenment! Axel - 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: indexed property problem
I thought you were trying to get a mapped property. What does the structure look like? I cant see what you're drilling to. On 18 Mar 2004, at 15:23, Axel Groß wrote: On 2004-03-18 at 15:10:47 +0100, Mark Lowe wrote: try html-el:text name=mappedTest property=testPrimKey(${ctr}) / doesnt exist in struts 1.1,right? should be evaluated anyway... i tried now html:text name=mappedTest property='testPrimKey[0]' / - still input type=text name=testPrimKey[0] value= / should that version work? if so it doesnt seem to be the EL part which is amiss. On 18 Mar 2004, at 14:49, Axel Groß wrote: Hi Mark! thanks for your answer tdtestPrimKey[${ctr}]/td evaluates to as it should to testPrimKey[0], testPrimKey[1].. ( i did a stupid mistake in my code ), On 2004-03-18 at 13:25:22 +0100, Mark Lowe wrote: ${testPrimKey[ctr]} that actually evaluates to nothing but ${mappedTest.testPrimKey[ctr]} gets the right result BUT my original intention (to use it with html:struts) still fails, because the tag doesnt populate the value for the indexed property: without using the indexed property: html:text name=mappedTest property='testPrimKey'/html:text - is as expected: input type=text name=testPrimKey value=[Ljava...{right object reference} / with using the indexed property html:text name=mappedTest property='testPrimKey[${ctr}]' / - doesnt put value attribute: input type=text name=testPrimKey[0] value= / input type=text name=testPrimKey[1] value= / ... if anybody could help me with that one, i'd be relieved thanks, axel or perhaps with the wrappers c:set var=key value=${testPrimKey[ctr]} / ${key} what does that do? On 18 Mar 2004, at 12:46, Axel Groß wrote: hi all! while trying to figure out how indexed/mapped properties work I get some strange behaviour - I'm pretty sure this doesn't conform to standard (hope I'm mistaken): logic:iterate id=foo indexId=ctr name=mappedTest property=testPrimKey tr td${foo}/td td${ctr}/td tdtestPrimKey[${ctr}]/td /tr /logic:iterate evaluates to: tr tdk1/td td0/td tdtestPrimKey[]/td /tr tr tdk2/td td1/td tdtestPrimKey[]/td /tr ... where the k1, k2.. are the expected values of key testPrimKey in the HashMap put under mappedTest in the PageContext BUT ${ctr} gets evaluated to different values I'm using struts1.1 and tomcat 5.0.19 so whose wrong? me or the result ??? thanks for enlightenment! Axel --- -- 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: Context relative URL
looks like a basic javascript question to me but here goes anyway. Stop trying to put everything in the event context = c:url value=/ /; imgdir = context + /images/; //perhaps create an array to preload. images = [inico]; function mover(name) { document.images[name].src = imgdir + name +-over.gif; } function mout(name) { document.images[name].src = imgdir + name +.gif; } html:link page=/foo.do linkName=inicio onmouseover=mover('inicio') onmouseout=mout('inicio') .. On 16 Mar 2004, at 08:00, [EMAIL PROTECTED] wrote: Try using html:rewrite page='/images/inicial.gif'/ Subramaniam Olaganthan Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Joao Batistella [EMAIL PROTECTED] 03/16/2004 12:35 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject Context relative URL Hello! I have the following HTML img tag: html:img page=/images/inicial.gif border=0 onmouseover=this.src='/images/inicio-over.gif' onmousedown=this.src='/images/inicio-down.gif' onmouseout=this.src='/images/inicio.gif'/ The problem is that the page attribute is ok, img tag add the app context before de page attribute and the image appears. But the others images in the javascript events dosn't appear because struts doesn't put the app context before the address. I got the following HTML: img src=/myapp/images/inicio.gif border=0 onmouseover=this.src='/images/inicio-over.gif' onmouseout=this.src='/images/inicio.gif' onmousedown=this.src='/images/inicio-down.gif' How can I have this generated with all the images with myapp before the source of the image? Like this: img src=/myapp/images/inicio.gif border=0 onmouseover=this.src='/myapp/images/inicio-over.gif' onmouseout=this.src='/myapp/images/inicio.gif' onmousedown=this.src='/myapp/images/inicio-down.gif' Thanks, JP ForwardSourceID:NT6182 InterScan_Disclaimer.txt- 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: submit an arraylist
The name in the iterate tag needs to match the name you've using to define the form bean in struts-config form-bean name=testForm type=com.mike.struts.TestBeanForm / html:form action=/testAction.do logic:iterate id=mybean name=testForm property=testBean html:text name=mybean property=string1 indexed=true / ... On 12 Mar 2004, at 09:23, Mu Mike wrote: I write this in jsp file,but it failed html:form action=/testAction.do logic:iterate name=TestBeanForm property=testBean id=mybean1 indexId=0 html:text property=testBean value=string1 / /logic:iterate html:submit property=submitValueSubmit Changes/html:submit /html:form is my jsp code right? From: Mu Mike [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: submit an arraylist Date: Fri, 12 Mar 2004 07:55:33 + I have a form as the below TestBeanForm.java public class TestBeanForm extends ActionForm { public ArrayList getTestBean() { if(testBean==null) testBean=new ArrayList(); return testBean; } public void setTestBean(ArrayList testBean) {this.testBean = testBean; } private ArrayList testBean; } how should I write in my configruatio file using logic:iterate to submit values for my ArrayList testBean? _ ~{Cb7QOBTX~} MSN Explorer: http://explorer.msn.com/lccn/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ ~{Cb7QOBTX~} 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: submit an arraylist
does your nested bean have a getString1() method? There's load of examples in the archives. Have a look. On 12 Mar 2004, at 09:48, Mu Mike wrote: Mark I did as you wrote form-bean name=TestBeanForm type=com.mycom.form.TestBeanForm/ in jsp file: html:form action=/testAction.do logic:iterate name=TestBeanForm property=testBean id=mybean1 indexId=index1 html:text name=mybean1 property=string1 indexed=true/ /logic:iterate html:submit property=submitValueSubmit Changes/html:submit /html:form it says no collection found I then changed the jsp file to this html:form action=/testAction.do logic:iterate name=TestBeanForm property=testBean id=mybean1 indexId=index1 html:text name=mybean1 property=testBean value=string1 indexed=true/ /logic:iterate html:submit property=submitValueSubmit Changes/html:submit /html:form it still reports no collection found ThanksRegards From: Mark Lowe [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: submit an arraylist Date: Fri, 12 Mar 2004 09:35:11 +0100 The name in the iterate tag needs to match the name you've using to define the form bean in struts-config form-bean name=testForm type=com.mike.struts.TestBeanForm / html:form action=/testAction.do logic:iterate id=mybean name=testForm property=testBean html:text name=mybean property=string1 indexed=true / ... On 12 Mar 2004, at 09:23, Mu Mike wrote: I write this in jsp file,but it failed html:form action=/testAction.do logic:iterate name=TestBeanForm property=testBean id=mybean1 indexId=0 html:text property=testBean value=string1 / /logic:iterate html:submit property=submitValueSubmit Changes/html:submit /html:form is my jsp code right? From: Mu Mike [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: submit an arraylist Date: Fri, 12 Mar 2004 07:55:33 + I have a form as the below TestBeanForm.java public class TestBeanForm extends ActionForm { public ArrayList getTestBean() { if(testBean==null) testBean=new ArrayList(); return testBean; } public void setTestBean(ArrayList testBean) {this.testBean = testBean; } private ArrayList testBean; } how should I write in my configruatio file using logic:iterate to submit values for my ArrayList testBean? _ ~{Cb7QOBTX~} MSN Explorer: http://explorer.msn.com/lccn/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ ~{Cb7QOBTX~} 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] _ MSN Hotmail http://www.hotmail.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts, Tiles, javax.servlet.Filter: Redirect Problem
try request.getRequestDispatcher(/myACtion.do).forward(request, response); rather than redirect. On 12 Mar 2004, at 10:59, Christian Schlaefcke wrote: Hi Folks, This is the situation: A struts application that uses tiles. A user needs to logon to work with the app. A logged-on user has a value object userSessionVO with some authenication parameter in the session. A not-logged-on user could be identified by the missing session attribute. To prevent a bad guy catching an url from an logged-on user and call the corresponding action directly from his browser I want to use a Filter. That Filter looks in the session for the usersession attribute and if not found redirects to the login page. The problem: The filtering itself works fine, just when the filter tries to redirect my application throws an java.net.SocketException: Conection aborted by peer: socket write error Before this exception happens I can see the following Struts debug message: Can´t insert page 'mypage.jsp': Conection aborted by peer: socket write error at InsertTag.java:945. This is the code that manages the redirect within the filter doFilter method: if(usersessionNotFound) { HttpServletResponseWrapper wrapper = new HttpServletResponseWrapper ((HttpServletResponse)response); wrapper.sendRedirect(wrapper.encodeRedirectURL(myRequest.getContextPath () + /myAction.do)); response = wrapper.getResponse(); } chain.doFilter(request, response); What is wrong? Is it my approach in general or just the way I redirect? Without redirecting everything works fine Thanx Regards, Chris - 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! I m going mad
Okay here's a full example, first of all i'm going to mess with your naming conventions as they'd drive me mad also //bean package com.sparrow.struts; public class TestBean { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } //the form package com.sparrow.struts; import java.util.ArrayList; import java.util.List; import org.apache.struts.action.ActionForm; import org.apache.commons.collections.ListUtils; import org.apache.commons.collections.Factory; public class TestBeanForm extends ActionForm { private List testBeanList; public SizesForm() { initLists(); } private void initLists() { Factory factory = new Factory() { public Object create() { return new TestBean(); } }; this. testBeanList = ListUtils.lazyList(new ArrayList(), factory); } public List getTestBeans() { return testBeanList; } public void setTestBeans(List testBeanList) { this. testBeanList = testBeanList; } public TestBean getTestBean(int index) { return (TestBean) testBeanList.get(index); } public void setTestBean(int index,TestBean testBean) { this. testBeanList.add(index, testBean); } } //struts config form-bean name=testBeanForm type=com.sparrow.struts.TestBeanForm / action path=/testAction name=testBeanForm scope=request ... //jsp html:form action=/testAction.do logic:iterate id=mybean name=testBeanForm property=testBeans html:text name=mybean property=name indexed=true / ... On 12 Mar 2004, at 11:17, Mu Mike wrote: I just cant use logic:iterate correctly! this is my form bean class: public class TestBeanForm extends ActionForm { public String[] getTestBean() { return testBean; } public void setTestBean(String[] testBean) { this.testBean = testBean; } String[] testBean; and this is my form bean declaration form-bean name=TestBeanForm type=com.mike.form.TestBeanForm/ and this is what I have in my jsp file: html:form action=/testAction.do logic:iterate name=TestBeanForm property=testBean id=mybean indexId=index1 %-- html:text property=fontName value=12 indexed=true/--% /logic:iterate html:submit property=submitValueSubmit Changes/html:submit /html:form you can see, I commented out the html:text line, but I still kept getting No collection found error, why? arent String[] a collection? _ ~{SkA*;z5DEsSQ=xPP=;Aw#,GkJ9SC~} MSN Messenger: http://messenger.msn.com/cn - 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, Tiles, javax.servlet.Filter: Redirect Problem
boolean isAJollyGoodFellow = false; //some logic here where you check whether s/he is a jolly good fellow if(isAJollyGoodFellow) { filterChain.doFilter(request, response); } else { request.getRequestDispatcher(/myAction.do).forward(request, response); } doFilter method passes on the request, and lets the request through to be checked but whatever the next filter is. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/servletapi/javax/ servlet/FilterChain.html On 12 Mar 2004, at 12:29, Christian Schlaefcke wrote: I tried this, but had a problem with an IllegalStateException: response already commited. This happens when I run chain.doFilter(...) afterwards. When I leave out this step I don´t get forwarded. So how does it work? Regards, Chris try request.getRequestDispatcher(/myACtion.do).forward(request, response); rather than redirect. On 12 Mar 2004, at 10:59, Christian Schlaefcke wrote: Hi Folks, This is the situation: A struts application that uses tiles. A user needs to logon to work with the app. A logged-on user has a value object userSessionVO with some authenication parameter in the session. A not-logged-on user could be identified by the missing session attribute. To prevent a bad guy catching an url from an logged-on user and call the corresponding action directly from his browser I want to use a Filter. That Filter looks in the session for the usersession attribute and if not found redirects to the login page. The problem: The filtering itself works fine, just when the filter tries to redirect my application throws an java.net.SocketException: Conection aborted by peer: socket write error Before this exception happens I can see the following Struts debug message: Can´t insert page 'mypage.jsp': Conection aborted by peer: socket write error at InsertTag.java:945. This is the code that manages the redirect within the filter doFilter method: if(usersessionNotFound) { HttpServletResponseWrapper wrapper = new HttpServletResponseWrapper ((HttpServletResponse)response); wrapper.sendRedirect(wrapper.encodeRedirectURL(myRequest.getContextPa th () + /myAction.do)); response = wrapper.getResponse(); } chain.doFilter(request, response); What is wrong? Is it my approach in general or just the way I redirect? Without redirecting everything works fine Thanx Regards, Chris - 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: Switching from HTTPS to HTTP
There's some java thingy you can use to do this, sslext or something.. If you are using apache for your webserver you can use mod_rewrite which means less hassle configuring development envionments and such like. Here's an example. NameVirtualHost machinedomain.net:80 VirtualHost www.sparrow.com:80 DocumentRoot /www/www.sparrow.com SSLEngine off RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^\/checkout https://%{SERVER_NAME}%{REQUEST_FILENAME} [R,L] RewriteRule ^\/admin https://%{SERVER_NAME}%{REQUEST_FILENAME} [R,L] /VirtualHost Listen *:443 NameVirtualHost [i used the ip here]:443 VirtualHost www.sparrow.com:443 DocumentRoot /www/www.sparrow.com SSLEngine on RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule !^(\/checkout)|(\/admin) http://%{SERVER_NAME}%{REQUEST_FILE NAME} [R,L] SSLCertificateFile /[apache home]/conf/ssl.crt/server.crt SSLCertificateKeyFile /[apache home]/conf/ssl.key/server.key SSLCACertificateFile /[apache home]/conf/ssl.crt/intermediate.ca /VirtualHost and requests containing /admin or /checkout will have https scheme forced those that are not wont. On 12 Mar 2004, at 13:59, Joao Batistella wrote: Hello! In my application the login page uses HTTPS to send username and password to the server. But after that, if login operation succeed, I want to send the user to the main application page using HTTP protocol, not HTTPS. How can I switch? Thanks in advance, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Switching from HTTPS to HTTP
You could use a filter which without knowing anything about it i imagine what sslext does. Better than hardcoding redirects. jstl may have something to force the scheme also. IMO doing it with mod_rewrite is easier because you any have to worry about your live deployment, but if you're using catalina as your webserver then I guess that you're going to have to configure that. On 12 Mar 2004, at 14:36, Joao Batistella wrote: But, I would like to find a way in Java, not in the web server because, for now, I'm using Tomcat web server. Can I just use a send redirect to a HTTP address?? Ex: sendRedirect(http://myserver/myapp/main.jsp;); -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 12 de março de 2004 13:30 To: Struts Users Mailing List Subject: Re: Switching from HTTPS to HTTP There's some java thingy you can use to do this, sslext or something.. If you are using apache for your webserver you can use mod_rewrite which means less hassle configuring development envionments and such like. Here's an example. NameVirtualHost machinedomain.net:80 VirtualHost www.sparrow.com:80 DocumentRoot /www/www.sparrow.com SSLEngine off RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^\/checkout https://%{SERVER_NAME}%{REQUEST_FILENAME} [R,L] RewriteRule ^\/admin https://%{SERVER_NAME}%{REQUEST_FILENAME} [R,L] /VirtualHost Listen *:443 NameVirtualHost [i used the ip here]:443 VirtualHost www.sparrow.com:443 DocumentRoot /www/www.sparrow.com SSLEngine on RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule !^(\/checkout)|(\/admin) http://%{SERVER_NAME}%{REQUEST_FILE NAME} [R,L] SSLCertificateFile /[apache home]/conf/ssl.crt/server.crt SSLCertificateKeyFile /[apache home]/conf/ssl.key/server.key SSLCACertificateFile /[apache home]/conf/ssl.crt/intermediate.ca /VirtualHost and requests containing /admin or /checkout will have https scheme forced those that are not wont. On 12 Mar 2004, at 13:59, Joao Batistella wrote: Hello! In my application the login page uses HTTPS to send username and password to the server. But after that, if login operation succeed, I want to send the user to the main application page using HTTP protocol, not HTTPS. How can I switch? Thanks in advance, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Your Message to struts-user@jakarta.apache.org is Blocked
Anyone else been getting these when you send stuff to the list? I doubt I've got a virus as I don't use windoze. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Your Message to struts-user@jakarta.apache.org is Blocke d
These seem to be the folks sending such useful information http://www.s2lservers.com/ On 12 Mar 2004, at 15:44, Joao Batistella wrote: I'm getting also. And I don't got a virus... I hope :-) -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 12 de março de 2004 14:43 To: Struts Users Mailing List Subject: [OT] Your Message to [EMAIL PROTECTED] is Blocked Anyone else been getting these when you send stuff to the list? I doubt I've got a virus as I don't use windoze. - 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 automatically forward user's page to a html link at speified time
Filter will do what you want if you're using a supporting container. On 12 Mar 2004, at 17:18, ~{UT~} ~{F=~} wrote: Hi, all I want the struts application have an internal timer. When the specified time(like 9:00pm) arrive, the user's current page should be forwarded to another html link. I know the java.util.timer and java.util.TimerTask can do such thing. Maybe I can put the timer class stuff in HttpSessionListener or ServletContextListener, but I just have no idea how to forward a page inside the TimerTask class not inside action as usual? So did anyone come across the similar problem? Could you shed me light on it? Thanks in Advance. Best Regards, Alex _ ~{Cb7QOBTX~} 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]
Changing position of nested beans
I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing position of nested beans
Can you elaborate? I'd have several indexed properties in my form, how would i know which to extract? On 11 Mar 2004, at 10:43, VAN BROECK Jimmy wrote: Why don't you use a hidden field with the index number in it. So you can use that information in your action. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: donderdag 11 maart 2004 10:31 To: Struts Users Mailing List Subject: Changing position of nested beans I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] STRICTLY PERSONAL AND CONFIDENTIAL This message may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. Ce Message est uniquement destiné aux destinataires indiqués et peut contenir des informations confidentielles. Si vous n'êtes pas le destinataire, vous ne devez pas révéler le contenu de ce message ou en prendre copie. Si vous avez reçu ce message par erreur, veuillez en informer l'expéditeur, ou La Poste immédiatement, avant de le supprimer. Dit bericht is enkel bestemd voor de aangeduide ontvangers en kan vertrouwelijke informatie bevatten. Als u niet de ontvanger bent, dan mag u de inhoud van dit bericht niet bekendmaken noch kopiëren. Als u dit bericht per vergissing heeft ontvangen, gelieve er de afzender of De Post onmiddellijk van op de hoogte te brengen en het bericht vervolgens te verwijderen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing position of nested beans
The only reason why dispatch action appeals is that i can map the form to one action and have several buttons within a form without needing to change to form action with javascript or anything grotty like that. I'm not especially keen dispatch actions . Just this business of using links and the request being cleared leaves me scoping to session and using a link, again i'm not that against scoping to session but I thought someone in the anti httpsession brigade would have a solution for this common problem. I don't think I'm tree-barking but ruminating on dispatch action (although i'm not certain). I'm trying various ways and seeing what happens. But indexed handler parameters seem like the sort of thing that would be required to do such a thing, but seem to be more the consequence of a crack induced state of derangement than something that struts supports. On 11 Mar 2004, at 12:19, Niall Pemberton wrote: Mark, Seems to me you have already worked out the solution, except why do you need a lookup dispatch action - rather than a roll your own - you have two methods right - Move Up and Move Down? Your jsp will populate a (foo?) List with either Move Up or Move Down (depending on the button pressed) in the appropriate index position - so you loop through them until you find a none null entry and call the appropriate method depending on the value with the index position you're at. trying to use look up dispatch action seems to be overly complicating things to me. Niall - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 9:31 AM Subject: Changing position of nested beans I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions. - 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: Changing position of nested beans
Crack smoking gags aside.. I've tried hacking around the problem using the unspecified method to no avail. Looks like storing in session and using links. Unless I have any sudden rushes of blood to the head. On 11 Mar 2004, at 13:21, Niall Pemberton wrote: You know before I read you messages, I would have understood crack programmer as a compliment - now I'm thinking it could be a support group for those of us who spend too much time on lists like this :-). - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 11:51 AM Subject: Re: Changing position of nested beans The only reason why dispatch action appeals is that i can map the form to one action and have several buttons within a form without needing to change to form action with javascript or anything grotty like that. I'm not especially keen dispatch actions . Just this business of using links and the request being cleared leaves me scoping to session and using a link, again i'm not that against scoping to session but I thought someone in the anti httpsession brigade would have a solution for this common problem. I don't think I'm tree-barking but ruminating on dispatch action (although i'm not certain). I'm trying various ways and seeing what happens. But indexed handler parameters seem like the sort of thing that would be required to do such a thing, but seem to be more the consequence of a crack induced state of derangement than something that struts supports. On 11 Mar 2004, at 12:19, Niall Pemberton wrote: Mark, Seems to me you have already worked out the solution, except why do you need a lookup dispatch action - rather than a roll your own - you have two methods right - Move Up and Move Down? Your jsp will populate a (foo?) List with either Move Up or Move Down (depending on the button pressed) in the appropriate index position - so you loop through them until you find a none null entry and call the appropriate method depending on the value with the index position you're at. trying to use look up dispatch action seems to be overly complicating things to me. Niall - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 9:31 AM Subject: Changing position of nested beans I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions. - 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: Changing position of nested beans
Niall Okay.. Can i assume your solution involves links and scoping to session or is there something I'm missing? On 11 Mar 2004, at 12:19, Niall Pemberton wrote: Mark, Seems to me you have already worked out the solution, except why do you need a lookup dispatch action - rather than a roll your own - you have two methods right - Move Up and Move Down? Your jsp will populate a (foo?) List with either Move Up or Move Down (depending on the button pressed) in the appropriate index position - so you loop through them until you find a none null entry and call the appropriate method depending on the value with the index position you're at. trying to use look up dispatch action seems to be overly complicating things to me. Niall - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 9:31 AM Subject: Changing position of nested beans I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which i will once i get things running without it, please no javascript suggestions. - 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: Changing position of nested beans
The radio button could just be the boy.. Nice one Hubert On 11 Mar 2004, at 18:28, Hubert Rabago wrote: Not sure if you're looking different ways to do Move Up/Move Down or just a way to make your one button for each item work. If it's the former, you can include a radio button beside each item and have one Move Up and one Move Down button for the whole form. The radio button will have the index of the item it's sitting next to. When a Move button is pressed, you'll have one non-indexed field containing the index of the item to either move up or down, and you can react appropriately. Hmm... the question is, how do you get the value of logic:iterate's indexId to the value of your html:radio without using %= %? Could I have been on the crack, too, and not know it? Hubert -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 10:05 AM To: Struts Users Mailing List Subject: Re: Changing position of nested beans Crack smoking gags aside.. I've tried hacking around the problem using the unspecified method to no avail. Looks like storing in session and using links. Unless I have any sudden rushes of blood to the head. On 11 Mar 2004, at 13:21, Niall Pemberton wrote: You know before I read you messages, I would have understood crack programmer as a compliment - now I'm thinking it could be a support group for those of us who spend too much time on lists like this :-). - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 11:51 AM Subject: Re: Changing position of nested beans The only reason why dispatch action appeals is that i can map the form to one action and have several buttons within a form without needing to change to form action with javascript or anything grotty like that. I'm not especially keen dispatch actions . Just this business of using links and the request being cleared leaves me scoping to session and using a link, again i'm not that against scoping to session but I thought someone in the anti httpsession brigade would have a solution for this common problem. I don't think I'm tree-barking but ruminating on dispatch action (although i'm not certain). I'm trying various ways and seeing what happens. But indexed handler parameters seem like the sort of thing that would be required to do such a thing, but seem to be more the consequence of a crack induced state of derangement than something that struts supports. On 11 Mar 2004, at 12:19, Niall Pemberton wrote: Mark, Seems to me you have already worked out the solution, except why do you need a lookup dispatch action - rather than a roll your own - you have two methods right - Move Up and Move Down? Your jsp will populate a (foo?) List with either Move Up or Move Down (depending on the button pressed) in the appropriate index position - so you loop through them until you find a none null entry and call the appropriate method depending on the value with the index position you're at. trying to use look up dispatch action seems to be overly complicating things to me. Niall - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 9:31 AM Subject: Changing position of nested beans I was wondering if anyone has found any slick, no javascript dependent solution to the following situation. My question in short is, is there a way of having an indexed dispatch action, or have i been on the crack again? I have a form of nested beans which are ordered according to a position stored in the model. I don't do any sorting in the web tier nor do i want to, other than rejigging the indices of some indexed properties until such a time as the user is ready to save his/her changes to the model. form name=foosForm action=/myapp/save.do input type=text name=foo[0].name input type=text name=foo[1].name input type=text name=foo[2].name /form Now when i save I'll save the index as a field called position, thus all that's fine and dandy. So lets say I want the use to define the position by having a move up and move down, but rather than using an indexed link i want to use a button. I've a lookup dispatch action with a moveup method and all that jazz. html:form action=/save.do logic:iterate id=foo name=foosForm property=foos html:text name=foo property=name indexed=true / html:submit property=method indexed=true bean:message key=button.moveup / /html:submit /logic:iterate /html:form So the rendered html would like like this form name=foosForm action=/myapp/save.do input type=text name=foo[0].nameinput type=submit name=method[0] value=Move Up //and so on /form Of course if i submit this to a lookupdispatch action, its gonna call me a crazy fool. So i need to have some means of having an indexed map key in my key method map, or something to cross the same bridge i'm trying to cross. Any ideas? I know i can do this in javascript which
Re: Newbie Q
html-el:link page=${myProp} a href=c:url value=${myprop} / or as has been suggested html:link page=%= myProp % on tc 5 and other jsp2 supporting containers el works without having to use an el library html:link page=${myProp} On 10 Mar 2004, at 04:12, Paul Stanton wrote: yes, but theres no other way (without writing your own tag) to put myProp into the href attribute. Kunal H. Parikh wrote: Will try this, but doesn't having %=myProp% mean that I am using a scriptlet ? And, shouldn't our JSP not include scriptlets as far as possible ? - 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: Populating form Elements from another object.
Again I haven't used Niall's classes but I'd hazard a guess that as they extend DynaBean that you use the map like interface for accessing these properties. In fact I imagine you can cast them as a DynaBean like you can with the DynaActionForms DynaBean myForm = (DynaBean) form; String foo = myForm.get(foo).toString(); On 9 Mar 2004, at 20:27, Metin Carl wrote: This is really good. An example of processing this form in Action classes would be very useful too as the way Shanmugam needs. Niall Pemberton [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yup, thats it - plus dynamic=true form-bean name=fooForm1 type=lib.framework.struts.LazyValidatorActionForm dynamic=true / form-bean name=fooForm2 type=lib.framework.struts.LazyValidatorActionForm dynamic=true / form-bean name=fooForm3 type=lib.framework.struts.LazyValidatorActionForm dynamic=true / form-bean name=fooForm4 type=lib.framework.struts.LazyValidatorActionForm dynamic=true / Oh, I noticed an error in LazyValidatorForm, its declared as abstract - which it shouldn't be - I don't use it directly, I use LazyValidatorActionForm which extends it. Niall - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 8:53 AM Subject: Re: Populating form Elements from another object. I haven't seen the code but if what i understand of what Niall has been saying you'd use them instead of DynaActionForm. form-bean name=fooForm type=com.ilovesparrows.struts.NiallsForm / of course you'll need to call the package and class name to something appropriate. On 9 Mar 2004, at 09:47, shanmugampl wrote: Hi, I saw your code. I have one doubt. How do you plugin your own DynaBean implementation into the struts framework. Shanmugam PL Niall Pemberton wrote: I wrote these http://www.niallp.pwp.blueyonder.co.uk Niall - Original Message - From: shanmugampl [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 7:00 AM Subject: Populating form Elements from another object. Hi, I have a requirement where i need to populate the values of a form from another object, and then again transform the contents of the form back to the object once the form is submitted. i.e Say, when i click a button, i do some functionalities and have a Properties object as an output. The keys in the Properties object are not static. These values need to be shown in a form. As the keys retrieved for the current operation is not known, i cant define the values in the struts-config.xml for the dynaactionclass. Is it possible to extend the dynaactionclass, and during its init or something, iterate the properties object and populate the form. Are there any other way of doing it. Thanks Shanmugam PL - 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: porting to struts
On 10 Mar 2004, at 12:02, Rajat Pandit wrote: Hello All, we have a product which was built on an inhouse developed controller, and we are currently planning to port the application on struts. This application was built on the MVC architecture with a central controller as the application entry point. for phase I we have to make additional modules for this product and then later integrate these modules in the new ported application. my questions are as follows. a. can i build the new modules around ActionServlet so that the current controller can pass the control to the struts controller when required. You can use servlets and the struts action servlet together yes b. will i be able to access the objects stored in the request, application or session objects by the current controller frm my action class? Yes. c. will the ActionController be able to load the database connections/connection pooling (we are using oracle) Yes.. Don't make any difference which db you use. d. will there be any performance issues? The struts action servlet is an easy way of not getting to bogged down with threads and such like, as the action servlet is one servlet instance. do let me know your views. i need to make a report today and send it over. thanks a lot in advance for ur time. Just bolt struts on to your existing stuff and will work fine (assuming you existing stuff works at the moment). One suggestion, why not just try it out? best regards rajat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Populating form Elements from another object.
I haven't seen the code but if what i understand of what Niall has been saying you'd use them instead of DynaActionForm. form-bean name=fooForm type=com.ilovesparrows.struts.NiallsForm / of course you'll need to call the package and class name to something appropriate. On 9 Mar 2004, at 09:47, shanmugampl wrote: Hi, I saw your code. I have one doubt. How do you plugin your own DynaBean implementation into the struts framework. Shanmugam PL Niall Pemberton wrote: I wrote these http://www.niallp.pwp.blueyonder.co.uk Niall - Original Message - From: shanmugampl [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 7:00 AM Subject: Populating form Elements from another object. Hi, I have a requirement where i need to populate the values of a form from another object, and then again transform the contents of the form back to the object once the form is submitted. i.e Say, when i click a button, i do some functionalities and have a Properties object as an output. The keys in the Properties object are not static. These values need to be shown in a form. As the keys retrieved for the current operation is not known, i cant define the values in the struts-config.xml for the dynaactionclass. Is it possible to extend the dynaactionclass, and during its init or something, iterate the properties object and populate the form. Are there any other way of doing it. Thanks Shanmugam PL - 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: Cookies And Session Problems
As a general point life gets less confusing when you retrieve you objects one at a time rather than drilling through several at once.. When you get used to using stuff on a daily basis then of course you're going to start opting for one line rather than several. but IMO you better thinking/coding like this until you get used to messing with these things. HttpSession session = request.getSession(); session.setAttribute(foo,bar); if you wanted t o get to the application scope to shortest way in an actions would be ServletContext context = getServlet().getServletContext(); or words to that effect. Might be an egg sucking lesson but seems to be this trendy coding style thats confusing you. So could very well be useful. HTH mark On 9 Mar 2004, at 14:15, Daniel Henrique Alves Lima wrote: I think that i've found the problem. Please, look below : Ciaran Hanley wrote: Hi thanks for your reply, I am using form based authentication. Cookies are enabled. I am storing all session information using request.getSession() for example: request.getSession().getServletContext().setAttribute(user, loggedUser); stores the user bean in the session. Ciaran, you must use request.getSession().setAttribute( user,loggedUser ); When you use request.getSession().getServletContext().setAttribute(user, loggedUser); you're putting your bean at application 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]
Re: SSL and actionforms
what's your deployment setup like? running with apache? On 9 Mar 2004, at 16:21, Håkan Fransson wrote: Hi!! I'm running a struts application on Websphere and have encountered a problem when added SSL. It seems that on submit, the set methods on the actionform sometimes are not invoked. It works fine when not using SSL on the container. Does anyone has a suggestion what to do? Hakan Fransson Per Jans vag 3 903 55 Umea +46 (0)90 135061 (home) +46 (0)70 5135061 (mobile) +46 (0)90 7866938 (Work) - 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 starter
strikethis is strike-through formatting/strike On 8 Mar 2004, at 05:36, Martin Gainty wrote: I'll ask the dumb question What is Strike-thru formatting? ~Martin~ - Original Message - From: Joe Germuska [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, March 07, 2004 6:12 PM Subject: Re: Struts starter At 9:14 PM + 3/7/04, Frank Burns wrote: Hi, I'm in the middle of working with my first application using Struts and desperately need some help. I've read nearly all of Ted Husted's Struts In Action book and browsed the mailing list archives but have not found a solution for what I want to do. I mention this to let you know that I have already tried hard, unsuccessfully, to find an answer to what seems to me to be a basic requirement. However, I may be struggling with my own misunderstanding! Frank: Don't blame yourself: you've stumbled onto one of my personal top priorities to improve in Struts: prefilling forms with non-request data. While I was writing this, John McGrath described a general strategy which works *if* you don't already need to use the single ActionForm that is passed to Action.execute for processing *input* data. However, in most cases, you have a chain of events where you have different input and output forms. We've developed a few strategies for ealing with this where I work, but they're all the sort of thing which may not be ready for prime time -- that is, officially adding to the Struts core. Right now, Struts doesn't provide a particularly convenient way to get an instance of what we call the output form -- the form which will be in the view to which control is directed. Since 1.2.0, I've committed a few changes which make it a little easier for you to get Form Bean instances, but what is still missing right now is a proposal for a standard place to configure Struts to know which form bean you want. Practically speaking, you can get an Object of the right class from a static method of RequestUtils with no more than a FormBeanConfig and the ActionServlet. You can get a FormBeanConfig from a ModuleConfig instance, which you can get using ModuleUtils. So inside any Action, you can bootstrap yourself to having a Form bean object, which you can populate however you need. http://jakarta.apache.org/struts/api/org/apache/struts/util/ RequestUtils.htm l#createActionForm(org.apache.struts.config.FormBeanConfig,%20org.apach e.str uts.action.ActionServlet) http://jakarta.apache.org/struts/api/org/apache/struts/config/ ModuleConfig.h tml#findFormBeanConfig(java.lang.String) http://jakarta.apache.org/struts/api/org/apache/struts/util/ ModuleUtils.html #getModuleConfig(javax.servlet.http.HttpServletRequest) One possible flaw with this (as it is now) is that it doesn't honor the scope parameter and search the request or session for possibly existing bean instances. Of course, that code is available inside non-public methods of RequestUtils; it's just a matter of choosing the right way of exposing them publicly. The sticky parts, in terms of packing this up so that it's easy for everyone to use in Struts is configuring the form bean name and scope in the right place -- where in the struts-config.xml (or in some other file) would you tell Struts the name (and scope) of the bean you want? At work, we're using the struts-chain ComposableRequestProcessor with a request chain command PagePrep, which looks up config information and choreographs finding a form bean and making it available to a piece of Java code which might know how to populate it. But Struts is still a good bit away from officially switching to the ComposableRequestProcessor, and our config information is part of a general UIToolkit which is not currently a part of Struts in any way. The general strategy we use would fit decently well into a Tiles Controller, except that a Tiles Controller doesn't have access to the running Servlet, and if you use ValidatorForms, your FormBean must have access to the Servlet object. There's been some talk about trying to apply the general controller pattern to all Struts forwards, and in some ways, that's what we do with our PagePrep strategy, but it's been a while since anyone suggested a specific approach, and I don't think I've ever seen any actual code to do it. I'd be open to community discussions about how to integrate some behavior like this into Struts before we get there, but I must admit that since I have a solution where I need it, I'll need some external motivation to work on a solution that fits into the current RequestProcessing model. This was discussed at great length last Spring (that long ago?!) http://marc.theaimsgroup.com/?l=struts-devm=105415755227385w=2 but nothing ever congealed the point where code was cut for the core Struts distribution. 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
Re: can we have multiple paths for the same action class?
:o) On 4 Mar 2004, at 12:25, Niall Pemberton wrote: Yes you can, no problem. Why not give it a go if you're wondering whether something will work - be brave, seize the day. Niall - Original Message - From: Shobhana.S, ASDC Chennai [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 8:59 AM Subject: can we have multiple paths for the same action class? Hi! Could anyone plz tell if we cld have the same path name for the same action class? for eg: action path=/CreateForm type=createForm name=common.CreateAction /action action path=/UpdateForm type=createForm name=common.CreateAction /action i need this bcoz in my application i use chaining of actions..and i want to avoid circular looping or chaining when i work which may lead to infinite loops Regards Shobhana thnx in advance - 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: Numeric validator
No the field type should be string like all form properties. On 4 Mar 2004, at 12:39, MOHAN RADHAKRISHNAN wrote: Thanks. I was trying to find out why this particular check is not run while the depends=required check in the same validation.xml is run. I can see that this check is not run because it passes control to the action. My field type in the form that this check applies to is 'String'. Is that a problem ? Mohan -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 3:20 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Numeric validator Your can either display all errors: html:errors/ or errors for a specific property. html:errors property=windSpeed/ http://jakarta.apache.org/struts/userGuide/struts-html.html#errors - Original Message - From: MOHAN RADHAKRISHNAN [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 9:08 AM Subject: Numeric validator Hi There are the steps I am following for a numeric check with struts validator. I don't see the proper message and the check is passing. What could be the problem ? validation.xml field property=windSpeed depends=integer msg name=integer key=error.wind.check/ arg0 key=label.wind.incident/ /field in the properties file. error.wind.check=Wind speed is a number in my JSP html:errors/ html:errors property=errors.required/ Do I have to use html:errors property=errors.integer/ Help is appreciated. 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]
Re: Passing a vector to a JSP from an Action
On my way to see my crack dealer right this minute :o) In the request its where is belongs, like pretty much all read only data. Anyone would think that I was arguing in favor of always storing in session.. On 4 Mar 2004, at 17:06, Geeta Ramani wrote: .as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort - 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: Passing a vector to a JSP from an Action
Vector myvector = .. request.setAttrubute(myvector, myvector); ... c:forEach var=item items=${myvector} c:out value=${item.myproperty} / c:forEach or logic:iterate id=item name=myvector bean:write name=item property=myproperty / /logic:iterate The thread in question was more about nested beans and forms, i don't think anyone would suggest putting readonly stuff in the session. On 4 Mar 2004, at 17:14, bort wrote: A request parameter would probably be a better solution, you're right. I looked up the thread you were speaking of, and see that it went in the direction of memory usage by the JVM when loaded up with session variables. Fortunately, that isn't a concern for us as we've loaded up the web server with RAM. Back to my original question... I guess I can just pull the Vector from the request object and iterate through it then? ex. Vector myvector = (Vector)request.getParameter(vectorname); TIA bort Geeta Ramani [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ..as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort - 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: Best way to handle big search results..
Sound's like you'll need some scrolling mechanism in between this can range from changing a query string for a jdbc type app or using an object model like hibernate which supports result scrolling.. I'd say with reasonable confidence that returning 48,000 records in one go is a pretty unreasonable thing to expect. And who's gonna read them all in one go? :o) Lets start at the beginning. How are you retrieving the records at the moment? On 4 Mar 2004, at 17:20, Jerry Jalenak wrote: In my application I often return large amounts of data - for instance, a single user may have access to as many as 8500 accounts; each account may have several hundred detail records associated with it. I've solved my initial problem of being able to return thousands of records (for instance, I can return almost 48,000 detail records in a little under 5 seconds), but the problem I have now is that it takes FOREVER for the jsp to render. I mean, I've waited over an hour for this thing to complete. Does anyone have any tips on improving / optimizing the performance of a compiled JSP? I'm using Tomcat 5.0.18 Stable with J2SDK 1.4.1_02 Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 1:39 PM To: Struts Users Mailing List Subject: RE: Best way to handle big search results.. We have to work with search results that are sometimes 1000+ items in size. In addition, much of the information we have is not keyed so we cannot say give results between id 2000 and id 20020. Some things I found to help with search results where we did do in memory sorting/paging were: 1. Create view-specific lightweight objects to be pulled from the DB 2. Memory allowed, it's faster to pull them all at once than lazy load 4. The real cause of some of our performance problems were the JSP's/HTML in rendering a huge list to the client vs. only showing 20 at once. To handle this, I created a SearchResultListAdaptor that could sit in the session and handle paging (if anyone wants to argue session scope with me, bring it on--). The SearchResultListAdaptor then contained the behavior of sort order/paging, etc. Sorting was done via bean property using a BeanUtilsComparator. So my SearchResultListAdaptor could then work with an list of beans. Best Regards, Jacob -Original Message- From: Arne Brutschy [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 12:57 PM To: Struts Users Mailing List Subject: Best way to handle big search results.. Hi, I'm looking for the best way to handle big search results. Setting: the user can search for other users in the ldap directory. This might return a long list of results (~40.000 entrys). Sadly, OpenLDAP doesn't support server-side sorting, so I have to sort the results myself. I want to display 20 items per page, and the user can browse through these results. What is the best way to handle these result object? Sorting once and storing/caching it in the session or searching and sorting every time the user requests a new page of results? Any thoughts/experiences? Regards, Arne Brutschy - 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 transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [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: Passing a vector to a JSP from an Action
In the example i gave i pretended i had a method called getMyproperty() so bean:write name=item property=myproperty / you can also use c:out value=${item.myproperty} / jsp:getProperty name=item property=myproperty / %= item.getMyproperty() % on tc5 ${item.myproperty} On 4 Mar 2004, at 17:49, bort wrote: I feel like an idiot asking this, but... within the logic:iterate /logic:iterate tags how am I supposed to pull out the objects I have stored in my Vector? bort Mark Lowe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Vector myvector = .. request.setAttrubute(myvector, myvector); ... c:forEach var=item items=${myvector} c:out value=${item.myproperty} / c:forEach or logic:iterate id=item name=myvector bean:write name=item property=myproperty / /logic:iterate The thread in question was more about nested beans and forms, i don't think anyone would suggest putting readonly stuff in the session. On 4 Mar 2004, at 17:14, bort wrote: A request parameter would probably be a better solution, you're right. I looked up the thread you were speaking of, and see that it went in the direction of memory usage by the JVM when loaded up with session variables. Fortunately, that isn't a concern for us as we've loaded up the web server with RAM. Back to my original question... I guess I can just pull the Vector from the request object and iterate through it then? ex. Vector myvector = (Vector)request.getParameter(vectorname); TIA bort Geeta Ramani [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ..as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort --- -- 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: Best way to handle big search results..
Sure but how do does the query get made? On 4 Mar 2004, at 17:49, Jerry Jalenak wrote: Mark, Let me give you some background first. On any given day I will be reporting on about 80,000 accounts with over 300,000 detail records available for the past 90 days. My clients are using this data to determine employment elgibility, etc. The majority of these clients are individual employers that might have between 1 and 100 accounts. These are no problem. The 'problem' clients are organizations that handle this type of work for multiple employers on a contract basis. These clients can and do have several thousand accounts that could *potentially* have data that needs to be reported. The approach I took was to write a separate servlet that wakes up every hours, re-sweeps the account code table, re-sweeps the data table, reconciles these into a set of nested maps, and places it into application scope. Part of this process throws out any account that doesn't have data to be reported, otherwise I'd be trying to handle 200,000 accounts. Based on the account and type of data the user can 'see', they are presented a list of accounts where they can pick one, many, or all. The application then accesses the map structure in application scope, extracts the appropriate data based on account, date range, etc., and returns a set of display / tables to the user. These table are required to be independantly sortable, pagable, etc. Again, for up to 100 or so accounts, this is extremely fast. It just goes down the toilet once I start getting over about 500 accounts. Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:39 AM To: Struts Users Mailing List Subject: Re: Best way to handle big search results.. Sound's like you'll need some scrolling mechanism in between this can range from changing a query string for a jdbc type app or using an object model like hibernate which supports result scrolling.. I'd say with reasonable confidence that returning 48,000 records in one go is a pretty unreasonable thing to expect. And who's gonna read them all in one go? :o) Lets start at the beginning. How are you retrieving the records at the moment? On 4 Mar 2004, at 17:20, Jerry Jalenak wrote: In my application I often return large amounts of data - for instance, a single user may have access to as many as 8500 accounts; each account may have several hundred detail records associated with it. I've solved my initial problem of being able to return thousands of records (for instance, I can return almost 48,000 detail records in a little under 5 seconds), but the problem I have now is that it takes FOREVER for the jsp to render. I mean, I've waited over an hour for this thing to complete. Does anyone have any tips on improving / optimizing the performance of a compiled JSP? I'm using Tomcat 5.0.18 Stable with J2SDK 1.4.1_02 Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 1:39 PM To: Struts Users Mailing List Subject: RE: Best way to handle big search results.. We have to work with search results that are sometimes 1000+ items in size. In addition, much of the information we have is not keyed so we cannot say give results between id 2000 and id 20020. Some things I found to help with search results where we did do in memory sorting/paging were: 1. Create view-specific lightweight objects to be pulled from the DB 2. Memory allowed, it's faster to pull them all at once than lazy load 4. The real cause of some of our performance problems were the JSP's/HTML in rendering a huge list to the client vs. only showing 20 at once. To handle this, I created a SearchResultListAdaptor that could sit in the session and handle paging (if anyone wants to argue session scope with me, bring it on--). The SearchResultListAdaptor then contained the behavior of sort order/paging, etc. Sorting was done via bean property using a BeanUtilsComparator. So my SearchResultListAdaptor could then work with an list of beans. Best Regards, Jacob -Original Message- From: Arne Brutschy [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 12:57 PM To: Struts Users Mailing List Subject: Best way to handle big search results.. Hi, I'm looking for the best way to handle big search results. Setting: the user can search for other users in the ldap directory. This might return a long list of results (~40.000 entrys). Sadly, OpenLDAP doesn't support server-side sorting, so I have to sort the results myself. I want to display 20 items per page, and the user can browse through these results. What is the best way to handle these result object? Sorting
Re: Best way to handle big search results..
Okay .. You said the results are in the application scope already. so you want to scoll through those. so in you servlet theres something like List peopleList = goAndGetShitLoadsOfRecordsFromDB(); context.setAttribute(people, peopleList.toArray()); .. c:forEach var=person items=${people} begin=${param.index} end=${param.index + 20 c:out value=${person.name} / /c:forEach html-el:link page=/scroll.do?index=${param.index + 20}Next/html-el:link On 4 Mar 2004, at 17:58, Jerry Jalenak wrote: Sorry for the misunderstanding - are you asking how the request is made from the user to the app? or from the app to the database? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:55 AM To: Struts Users Mailing List Subject: Re: Best way to handle big search results.. Sure but how do does the query get made? On 4 Mar 2004, at 17:49, Jerry Jalenak wrote: Mark, Let me give you some background first. On any given day I will be reporting on about 80,000 accounts with over 300,000 detail records available for the past 90 days. My clients are using this data to determine employment elgibility, etc. The majority of these clients are individual employers that might have between 1 and 100 accounts. These are no problem. The 'problem' clients are organizations that handle this type of work for multiple employers on a contract basis. These clients can and do have several thousand accounts that could *potentially* have data that needs to be reported. The approach I took was to write a separate servlet that wakes up every hours, re-sweeps the account code table, re-sweeps the data table, reconciles these into a set of nested maps, and places it into application scope. Part of this process throws out any account that doesn't have data to be reported, otherwise I'd be trying to handle 200,000 accounts. Based on the account and type of data the user can 'see', they are presented a list of accounts where they can pick one, many, or all. The application then accesses the map structure in application scope, extracts the appropriate data based on account, date range, etc., and returns a set of display / tables to the user. These table are required to be independantly sortable, pagable, etc. Again, for up to 100 or so accounts, this is extremely fast. It just goes down the toilet once I start getting over about 500 accounts. Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:39 AM To: Struts Users Mailing List Subject: Re: Best way to handle big search results.. Sound's like you'll need some scrolling mechanism in between this can range from changing a query string for a jdbc type app or using an object model like hibernate which supports result scrolling.. I'd say with reasonable confidence that returning 48,000 records in one go is a pretty unreasonable thing to expect. And who's gonna read them all in one go? :o) Lets start at the beginning. How are you retrieving the records at the moment? On 4 Mar 2004, at 17:20, Jerry Jalenak wrote: In my application I often return large amounts of data - for instance, a single user may have access to as many as 8500 accounts; each account may have several hundred detail records associated with it. I've solved my initial problem of being able to return thousands of records (for instance, I can return almost 48,000 detail records in a little under 5 seconds), but the problem I have now is that it takes FOREVER for the jsp to render. I mean, I've waited over an hour for this thing to complete. Does anyone have any tips on improving / optimizing the performance of a compiled JSP? I'm using Tomcat 5.0.18 Stable with J2SDK 1.4.1_02 Thanks! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 1:39 PM To: Struts Users Mailing List Subject: RE: Best way to handle big search results.. We have to work with search results that are sometimes 1000+ items in size. In addition, much of the information we have is not keyed so we cannot say give results between id 2000 and id 20020. Some things I found to help with search results where we did do in memory sorting/paging were: 1. Create view-specific lightweight objects to be pulled from the DB 2. Memory allowed, it's faster to pull them all at once than lazy load 4. The real cause of some of our performance problems were the JSP's/HTML in rendering a huge list to the client vs. only showing 20 at once. To handle this, I created a SearchResultListAdaptor that could sit
Re: Passing a vector to a JSP from an Action
m.. cgi.. On 4 Mar 2004, at 18:14, Niall Pemberton wrote: Geeta, it was a good try - but you have to get him to call you a cgi programmer to get the full points ;-) Niall - Original Message - From: Geeta Ramani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 4:30 PM Subject: Re: Passing a vector to a JSP from an Action Cool: i just knew I could get you going...;) Mark Lowe wrote: On my way to see my crack dealer right this minute :o) In the request its where is belongs, like pretty much all read only data. Anyone would think that I was arguing in favor of always storing in session.. On 4 Mar 2004, at 17:06, Geeta Ramani wrote: .as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort --- -- 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: Best way to handle big search results..
I think html rendering is the least of his worries :o) I'm surprised you can get that many records into the application context in the first place. On 4 Mar 2004, at 18:14, Hookom, Jacob wrote: Yeah, stay away from tables within tables, they can be a big slow up. -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 11:13 AM To: 'Struts Users Mailing List' Subject: RE: Best way to handle big search results.. But. I'm already doing paging. Each independant account table only returns the first 10 detail records; everything is available by paging through the next 'n' pages. For example, one of my clients has access to almost 8900 accounts. Of these accounts, there are about 3500 with reported data in the past 90 days. In the past month alone, these 3500 accounts have almost 48000 detail records. So I'm returning (probably not all 3500 accounts, but a good majority of 'em) say 2000 tables, with potentially 10 detail records per table. Each table has seven columns, so just for the tables I'm returning about 320,000 lines of html. I'm really starting to think this is a client side rendering issue - the browser simply can't process the number of lines of html that I'm pushing it. Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 11:03 AM To: Struts Users Mailing List Subject: RE: Best way to handle big search results.. Jerry, We ran into the same problems you are having, and then there reaches a point where you leave it according to what the requirements say, and when people complain, you tell them it's because it not only takes a while at the server to create the HTML for so many records, but it also takes just as long to render them in your browser. Then they say, Really? and you say, Yes, this is why we should do paging, to which they reply, then we should probably add it in there. -Jake -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:58 AM To: 'Struts Users Mailing List' Subject: RE: Best way to handle big search results.. Sorry for the misunderstanding - are you asking how the request is made from the user to the app? or from the app to the database? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:55 AM To: Struts Users Mailing List Subject: Re: Best way to handle big search results.. Sure but how do does the query get made? On 4 Mar 2004, at 17:49, Jerry Jalenak wrote: Mark, Let me give you some background first. On any given day I will be reporting on about 80,000 accounts with over 300,000 detail records available for the past 90 days. My clients are using this data to determine employment elgibility, etc. The majority of these clients are individual employers that might have between 1 and 100 accounts. These are no problem. The 'problem' clients are organizations that handle this type of work for multiple employers on a contract basis. These clients can and do have several thousand accounts that could *potentially* have data that needs to be reported. The approach I took was to write a separate servlet that wakes up every hours, re-sweeps the account code table, re-sweeps the data table, reconciles these into a set of nested maps, and places it into application scope. Part of this process throws out any account that doesn't have data to be reported, otherwise I'd be trying to handle 200,000 accounts. Based on the account and type of data the user can 'see', they are presented a list of accounts where they can pick one, many, or all. The application then accesses the map structure in application scope, extracts the appropriate data based on account, date range, etc., and returns a set of display / tables to the user. These table are required to be independantly sortable, pagable, etc. Again, for up to 100 or so accounts, this is extremely fast. It just goes down the toilet once I start getting over about 500 accounts. Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 10:39 AM To: Struts Users Mailing List Subject: Re: Best way to handle big search results.. Sound's like you'll need some scrolling mechanism in between this can range from changing a query string for a jdbc type app or using an object model like hibernate which supports result scrolling.. I'd say with reasonable confidence that returning 48,000 records in one go is a pretty unreasonable thing to expect. And who's gonna read them
[OT] was: Re: Passing a vector to a JSP from an Action
Yeah. But see the thread and what i was up against, like no large scale app has ever been released using httpsession somewhere. I think the chap with the 48,000 results scrolling issue and the next man with the html optimization suggestions have beaten me to my dealer :o) I'm gonna have take a couple of valium and go n lye down.. On 4 Mar 2004, at 18:21, Niall Pemberton wrote: Geeta, it was a good try - but you have to get him to call you a cgi programmer to get the full points ;-) Niall - Original Message - From: Geeta Ramani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 4:30 PM Subject: Re: Passing a vector to a JSP from an Action Cool: i just knew I could get you going...;) Mark Lowe wrote: On my way to see my crack dealer right this minute :o) In the request its where is belongs, like pretty much all read only data. Anyone would think that I was arguing in favor of always storing in session.. On 4 Mar 2004, at 17:06, Geeta Ramani wrote: .as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort --- -- 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: [OT] was: Re: Passing a vector to a JSP from an Action
I thought what craig said on a different thread about configuring the container to dump to flat file or db sounded like the solution after all that. PersistentManager I'd much prefer to fiddle around with container config for a day, to solve a problem if and when legitimate use of session became an issue in terms of ram usage than all that other stuff. On 4 Mar 2004, at 18:35, Geeta Ramani wrote: Mark, m'boy, repeat after me: breathe in,... breathe out.. breathe in... breathe out that's 3 sets of 12. Didn't work? Ok, I guess it's that crack dealer's lucky day.. Geeta P.S... just kidding: I actually do (and did) agree with you..!! :) Mark Lowe wrote: Yeah. But see the thread and what i was up against, like no large scale app has ever been released using httpsession somewhere. I think the chap with the 48,000 results scrolling issue and the next man with the html optimization suggestions have beaten me to my dealer :o) I'm gonna have take a couple of valium and go n lye down.. On 4 Mar 2004, at 18:21, Niall Pemberton wrote: Geeta, it was a good try - but you have to get him to call you a cgi programmer to get the full points ;-) Niall - Original Message - From: Geeta Ramani [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 4:30 PM Subject: Re: Passing a vector to a JSP from an Action Cool: i just knew I could get you going...;) Mark Lowe wrote: On my way to see my crack dealer right this minute :o) In the request its where is belongs, like pretty much all read only data. Anyone would think that I was arguing in favor of always storing in session.. On 4 Mar 2004, at 17:06, Geeta Ramani wrote: .as a request attribute..? Look through the archives for a fun and spirited discussion on request vs. session vars held just over a week or so ago.. Geeta P.S. Mark, don't flip out..;) bort wrote: Hi all I have an Action class that loads up a Vector with information from a database. What I would like to do is pass this Vector to the forwarding JSP and create a table listing of the data. I'm thinking of just adding the Vector to the session in the Action class and then retrieving and iterating through it in the JSP. Is there a better way to do this? bort - -- -- 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]
JSP context in an action
Does anyone know how to retrieve the servlet context of a given jsp and place an object in that context (say a map) and then request the page ? I've been putting together a email templating system using velocity, but logic tells me i can do this using the servlet and struts api's without using velocity. Velocity wont let me retrieve the *.vm file without extending velocity servlet which i dont see as nessesary other than to do this. I want to do something like this DynaActionForm theForm = (DynaActionForm) form; jspContext = ... Map map = BeanUtils.describe(theForm); jspContext.setAttribute(email,map); //and now request the page and stream it. .. ??? My nose is firmly lodged in the servlet and struts api's, just hoping someone can help nudge me in the right direction. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT]Re: IdGenerator ... is null
Looks like a torque question to me, but that list can get kinda robot-wars. Its been a while but, does the id field in your schema look like this? column name=FOO_ID type=INTEGER required=true primaryKey=true / On 2 Mar 2004, at 14:41, Silviu Marcu wrote: Hi I configured torque for mysql and into schema I wrote defaultIdMethod=native ... so the ID BROKER should not be used. BUT I receive the following exception: org.apache.torque.TorqueException: IdGenerator for table '...my table ...' is null at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:708) I also searched the mail archives and this error is present but with no response. Regards silviu marcu - 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 context in an action
I'm still chewing on the problem. But a custom tag lib would seem a possibility. I ended up using a velocity servlet and doing things that way, my aim in trying otherwise was not to have to use velocity as its another bunch of libraries that in theory I shouldn't need. Ideally i'd have a template directory under WEB-INF where numb-nuts dreamweaver types can edit email templates and i particularly like the expression syntax which is like jsp2. So i was trying to think of a way of using just that. Velocity would be a really tidy way of doing things if the VelocityEngine class had a getTemplate method that takes in a file rather than just a string. At the moment I've a velocity servlet thats really only there to get around this problem. But as things are its not that bad i've have just preferred not having to have a velocity servlet running just to find the where abouts of the template. Using jsp even better as everythings already there, just how to drill to what i need. RequestDispatcher could be an option request the file get its context and then stuff the map in there, but could be tree-barking or/and smoking too much crack. On 2 Mar 2004, at 12:59, Niall Pemberton wrote: Mark, I'd like to know how to do what you're but, unless someone else knows, how about a different approach: You could have a store tag which gets the body of a tag and stores it somewhere (in the request or session or in a bean in the request or session) and then forwards to an email action which then gets the stored content and sends an email. Something like: --EmailTemplate.jsp- custom:store name=myForm property=emailContent scope=session -- format your email here - /custom:store logic:forward name=emailForward/ --- StoreTag.java- package lib.framework.taglib; import javax.servlet.jsp.tagext.BodyTagSupport; import javax.servlet.jsp.JspException; import org.apache.struts.util.RequestUtils; import org.apache.commons.beanutils.BeanUtils; /** * @author Niall Pemberton * @version 1.0.0 */ public class StoreTag extends BodyTagSupport { protected String name = null; protected String property = null; protected String scope = null; public StoreTag() { } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setProperty(String property) { this.property = property; } public String getProperty() { return property; } public void setScope(String scope) { this.scope = scope; } public String getScope() { return scope; } public int doAfterBody() throws JspException { org.apache.struts.action.RequestProcessor ccc; String value = null; if (bodyContent != null) { value = bodyContent.getString().trim(); } if (property == null) { pageContext.setAttribute(name, value, RequestUtils.getScope(scope)); } else { // find the bean Object bean = RequestUtils.lookup(pageContext, name, scope); if (bean == null) throw new JspException(Cannot find bean '+name+' in scope '+scope+'); try { BeanUtils.setProperty(bean, property, value); } catch (Exception ex) { throw new JspException(Error setting property '+property+' on bean '+name+' in scope '+scope+': +ex); } } return (SKIP_BODY); } public void release() { name = null; property = null; scope = null; } } - 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: calculating sum inside logic:iterate
Depends how you've done things. If your items are nested in a form (indexed/mapped proerties) you could have a total that is calculated there. Thus no need to do it in an action or a jsp. On 2 Mar 2004, at 17:18, Marco Mistroni wrote: Hi all, I have a colletion of items that have a method called price. I was wandering if I could calculate the total of all prices via struts Tags rather than using java code... Anyone has any ideas? Thanx in advance and regards marco - 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: calculating sum inside logic:iterate
I see what you're saying. But at the same time, if you wanted to develop a shopping cart that you could plug onto any model. Then IMO calculating in a web tier bean say an action form isn't the most evil thing in the world. I agree entirely that the total should be calculated in the model, before say saving to the db. But I think there's a case for doing this in the web-tier. On 2 Mar 2004, at 17:39, Nick Wesselman wrote: Technically this seems to be a business method, logic that would be better handled in your model code. So for example you have a ShoppingCart class which has a getItems() method to get your collection of items and a getTotal() method to add their prices. Not the answer you're looking for I think but my 2 cents. Nick Marco Mistroni wrote: Hi all, I have a colletion of items that have a method called price. I was wandering if I could calculate the total of all prices via struts Tags rather than using java code... Anyone has any ideas? Thanx in advance and regards marco - 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: Date attribute in ActionForm
Its also usually the case with dates that downs make less work for the user. This along with beanutils conversions hassles mean s its usually easier to have a day, month , year properties of type String or Integer which then you use to create a Date or Calendar object before passing up to your model or even have gets and sets in you model that do the conversion. On 2 Mar 2004, at 20:03, Larry Meadors wrote: Bean utils (what struts uses in this case) sucks when it comes to parsing anything but Strings. Generally what I do is make put String getter/setter methods on the Form, then in those (or in the Action) use a SimpleDateFormat to parse the string into a date. One other thing to note there is that the date format MM/dd/yy will parse 1/1/04 as 01/01/2004, but 1/1/4 as 01/01/0004, so you need to handle that yourself. Same trick with numeric classes. Larry [EMAIL PROTECTED] 03/02/04 11:36 AM Hello, I have and ActionForm with one element refering to a Date (from Util) property and I get the following exception java.lang.IllegalArgumentException: argument type mismatch Is there a special treatment for these kind of attributes? Thanks, _ Vanessa Monteiro Analista de Sistemas Quality Software 3475-3000 r:5062 - 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: Tiles problem
put name=foo value=${bar} type=string/definition/page / On 2 Mar 2004, at 22:15, Anderson, James H [IT] wrote: There's something I'm not understanding :-( I've got the following tiles definitions. definition name=.mainLayout path=/tiles/layouts/mainLayout1.jsp put name=header value=/tiles/header.jsp/ put name=footer value=/tiles/footer.jsp/ put name=content value=${content}/ variable for substitution /definition definition name=.portfolioLayout path=/tiles/layouts/portfolioLayout.jsp put name =marketdata value=.marketdata/ put name =userinput value=.userinput/ put name =dataview value=/tiles/dataview.jsp/ /definition definition name=.marketdata path=/tiles/layouts/marketdataLayout.jsp put name =quotes value=/tiles/quotes.jsp/ put name =smithbarneyresearch value=/tiles/research.jsp/ put name =marketwatch value=/tiles/marketwatch.jsp/ /definition definition name=.userinput path=/tiles/layouts/userinputLayout.jsp put name =accountview value=/tiles/accountview.jsp/ put name =app-specific value=${app-specific}/ variable for substitution /definition and I want to create a new tile, substituting values for both variable: definition name=.activity.detail extends=.mainLayout put name=content value=.portfolioLayout/ put name=app-specific value=/tiles/activityinfo.jsp/ /definition But this doesn't work! The content variable is replaced as expected, but the app-specific variable is ignored and doesn't show up at all. It looks like the only tile for which variable substitution is supported is the one that's specified in the extends attribute--not in any nested tile. Surely there must be a way to get around this... jim - 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: Tiles problem
all the puts should be have type=string type=definition type=page depending on what it is. For example if .portfolioLayout is a definition put name=content value=.portfolioLayout type=definition / if its a layout then it should be in the definition tag as the content of the path attribute. The naming convention for layouts usually refers to those files that are layouts not definitions as such. definition name=main.base path=/layouts/mainLayout.jsp ... I've used some of your names but i doubt they are that relevent to you. definition name=activity.detail extends=main.base put name=title value=Mellow World!!! type=string / put name=content value=portfolio.default type=definition / put name=app-specific value=/tiles/activityInfo.jsp type=page / /definition When did all this .somename business start then, i've seen this else where. Looks like dirty php to me :o) On 2 Mar 2004, at 22:49, Anderson, James H [IT] wrote: Maybe I didn't follow you, but I changed definition name=.activity.detail extends=.mainLayout put name=content value=.portfolioLayout/ put name=app-specific value=/tiles/activityinfo.jsp/ /definition to definition name=.activity.detail extends=.mainLayout put name=content value=.portfolioLayout/ put name=app-specific value=/tiles/activityinfo.jsp type=page/ /definition and it didn't make any difference. What am I missing? -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 4:40 PM To: Struts Users Mailing List Subject: Re: Tiles problem put name=foo value=${bar} type=string/definition/page / On 2 Mar 2004, at 22:15, Anderson, James H [IT] wrote: There's something I'm not understanding :-( I've got the following tiles definitions. definition name=.mainLayout path=/tiles/layouts/mainLayout1.jsp put name=header value=/tiles/header.jsp/ put name=footer value=/tiles/footer.jsp/ put name=content value=${content}/ variable for substitution /definition definition name=.portfolioLayout path=/tiles/layouts/portfolioLayout.jsp put name =marketdata value=.marketdata/ put name =userinput value=.userinput/ put name =dataview value=/tiles/dataview.jsp/ /definition definition name=.marketdata path=/tiles/layouts/marketdataLayout.jsp put name =quotes value=/tiles/quotes.jsp/ put name =smithbarneyresearch value=/tiles/research.jsp/ put name =marketwatch value=/tiles/marketwatch.jsp/ /definition definition name=.userinput path=/tiles/layouts/userinputLayout.jsp put name =accountview value=/tiles/accountview.jsp/ put name =app-specific value=${app-specific}/ variable for substitution /definition and I want to create a new tile, substituting values for both variable: definition name=.activity.detail extends=.mainLayout put name=content value=.portfolioLayout/ put name=app-specific value=/tiles/activityinfo.jsp/ /definition But this doesn't work! The content variable is replaced as expected, but the app-specific variable is ignored and doesn't show up at all. It looks like the only tile for which variable substitution is supported is the one that's specified in the extends attribute--not in any nested tile. Surely there must be a way to get around this... jim - 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: BODY onLoad Workaround
Iframe would be one possible hack. Have the page that loads run a javascript function that drills back up to your page. or an onload on an image, or simply execute the function in the page. lastly have something like this in your layout tile:get name=javascriptHack scope=page / script language=javascript type=text/javascript !-- function myfuction() { c:out value=${javascriptHack} /; } //-- /script body onload=myfuction() Stick your method as a put in that tile and have it empty for those page where not required. put name=javascriptHack value=alert('my javascript hack') type=string / the rest of the time put name=javascriptHack value= type=string / So the function always runs just usually contains nothing. On 2 Mar 2004, at 23:14, Alan Weissman wrote: Hey everyone - So I have a Struts/Tiles page that I need to have a Javascript function called on when the page loads. Normally this is of course accomplished with the BODY onLoad event however this event isn't fired when my page loads and from doing extensive Googling I've found that this has something to do with the nature of Struts/Tiles pages (though I'm not sure what). What is the best workaround for this? Thanks so much, Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link problem
When i have the misfortune of porting the mother of all abominations known as dreamweaver generated code I tend to use c:url instead a href=c:url value=/findtitle.do / this will do what i think you want. On 2 Mar 2004, at 23:19, mucus snot wrote: Hi list, Just wondering if anyone has any bright ideas. Things that you can do easily with an a ... tag, are not (easily) acheivable with a html:link. For instance in the following code: nested:iterate id=title name=%= Constants.TITLES_COLLECTION % scope=request indexId=counter html:link page=/findtitles.do onmouseover=MM_swapImage('details%= counter %,...)... /nested:iterate counter will not resolve, although it will if the tag is an ordinary anchor. Does anyone know a way around this? I have been resorting to using ordinary a... tags but have just realised that there is no session control if cookies are disabled. I have to use html:link... thanks, al - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BODY onLoad Workaround
correction tiles:useAttribute name=javascriptHack scope=page / On 2 Mar 2004, at 23:33, Mark Lowe wrote: Iframe would be one possible hack. Have the page that loads run a javascript function that drills back up to your page. or an onload on an image, or simply execute the function in the page. lastly have something like this in your layout tile:get name=javascriptHack scope=page / script language=javascript type=text/javascript !-- function myfuction() { c:out value=${javascriptHack} /; } //-- /script body onload=myfuction() Stick your method as a put in that tile and have it empty for those page where not required. put name=javascriptHack value=alert('my javascript hack') type=string / the rest of the time put name=javascriptHack value= type=string / So the function always runs just usually contains nothing. On 2 Mar 2004, at 23:14, Alan Weissman wrote: Hey everyone - So I have a Struts/Tiles page that I need to have a Javascript function called on when the page loads. Normally this is of course accomplished with the BODY onLoad event however this event isn't fired when my page loads and from doing extensive Googling I've found that this has something to do with the nature of Struts/Tiles pages (though I'm not sure what). What is the best workaround for this? Thanks so much, Alan - 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: BODY onLoad Workaround
try a simple alert to test the body onload= you can try my other suggestions but i think the tiles way should work. On 2 Mar 2004, at 23:39, Alan Weissman wrote: Thanks Mark for your response. The issue is that even without my layout, which contains the body tag, if I add an onLoad event it is not fired. I have already tried calling the javascript function from somewhere in the page however it is always called before the entire page is actually rendered, which means that certain items on the page that the function operates on do not have all of their properties. Is there no way to mimic a body onLoad completely? Thanks, Alan -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 5:34 PM To: Struts Users Mailing List Subject: Re: BODY onLoad Workaround Iframe would be one possible hack. Have the page that loads run a javascript function that drills back up to your page. or an onload on an image, or simply execute the function in the page. lastly have something like this in your layout tile:get name=javascriptHack scope=page / script language=javascript type=text/javascript !-- function myfuction() { c:out value=${javascriptHack} /; } //-- /script body onload=myfuction() Stick your method as a put in that tile and have it empty for those page where not required. put name=javascriptHack value=alert('my javascript hack') type=string / the rest of the time put name=javascriptHack value= type=string / So the function always runs just usually contains nothing. On 2 Mar 2004, at 23:14, Alan Weissman wrote: Hey everyone - So I have a Struts/Tiles page that I need to have a Javascript function called on when the page loads. Normally this is of course accomplished with the BODY onLoad event however this event isn't fired when my page loads and from doing extensive Googling I've found that this has something to do with the nature of Struts/Tiles pages (though I'm not sure what). What is the best workaround for this? Thanks so much, Alan - 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: BODY onLoad Workaround
I guess its possible that the layout isn't getting reloaded with the tiles request. an iframe or an image will do as a quick hack. iframe width=0 height=0 src=foo.html / On 2 Mar 2004, at 23:51, Alan Weissman wrote: Thanks Richard for your input. Can you let me know where you see people using it? I have an onLoad=alert('body onload') on my BODY tag which resides in my layout and it is not being called. I also found this, which leads me to believe that I am not alone in this problem. I am however, not able to find where to download the tag library the page refers to. http://retep.org/retep/wiki/retep/taglib/common/onload/index.html Thanks again, Alan -Original Message- From: Richard Yee [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 5:45 PM To: Struts Users Mailing List Subject: Re: BODY onLoad Workaround Alan, I don't see any problem with using the BODY onLoad event handler. I also searched on Google and found several instances where others are using it without any problems. What does your code look like? What happens when you do a view/source in the browser? Have you tried using Netscape and looking at the JavaScript console? -Richard --- Alan Weissman [EMAIL PROTECTED] wrote: Hey everyone - So I have a Struts/Tiles page that I need to have a Javascript function called on when the page loads. Normally this is of course accomplished with the BODY onLoad event however this event isn't fired when my page loads and from doing extensive Googling I've found that this has something to do with the nature of Struts/Tiles pages (though I'm not sure what). What is the best workaround for this? Thanks so much, Alan __ Do you Yahoo!? Yahoo! Search - Find what you're looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BODY onLoad Workaround
view the source.. On 2 Mar 2004, at 23:58, Alan Weissman wrote: Thanks everyone for all your attention to this. Now I'm really confused because I am positive my event isn't being called. Here is the source to my layout page. Pages that use this layout do not get any alert box popping up. Thanks again, Alan %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % html head script language=JavaScript src=js_css/javaScript.js type=text/javascript /script titletiles:getAsString name=title//title meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 / /head body onload=alert() marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgcolor=#FF table width=690 border=0 cellpadding=0 cellspacing=0trtd table width=690 border=0 cellpadding=0 cellspacing=0 tr td tiles:get name=header/ /td /tr tr td tiles:get name=nav/ /td /tr tr td tiles:insert attribute=body/ /td /tr tr td tiles:get name=footer/ /td /tr /table /td /tr /body /html -Original Message- From: Alexander Craen [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 5:53 PM To: Struts Users Mailing List Subject: Re: BODY onLoad Workaround Hi Alain, I have used the body onload successfully http://order.scarlet.be/order/adsl/start.do?language=nlregcode=PIBUS- WS accode=AcUjjdIKproduct=One Using it quite often... I dont have the struts source code here at home... but if you want it I could look into it tomorrow at work.. grtz Alexander Craen - Original Message - From: Richard Yee [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 11:44 PM Subject: Re: BODY onLoad Workaround Alan, I don't see any problem with using the BODY onLoad event handler. I also searched on Google and found several instances where others are using it without any problems. What does your code look like? What happens when you do a view/source in the browser? Have you tried using Netscape and looking at the JavaScript console? -Richard --- Alan Weissman [EMAIL PROTECTED] wrote: Hey everyone - So I have a Struts/Tiles page that I need to have a Javascript function called on when the page loads. Normally this is of course accomplished with the BODY onLoad event however this event isn't fired when my page loads and from doing extensive Googling I've found that this has something to do with the nature of Struts/Tiles pages (though I'm not sure what). What is the best workaround for this? Thanks so much, Alan __ Do you Yahoo!? Yahoo! Search - Find what you're looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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]
Re: struts and DHTML
You want to put all the stuff that you need to be dynamic in div with id's .. then layer the javascript and css on after. This will allow you to get a minimal version running (no dhtml) and get the dhtml stuff running on one browser at a time. Trying to throw it all in together will push your deadline beyond a measurable time span. So server-side user agent detection would be useful, as then you can hide-show dynamic bits when the page is loaded. Beyond that there's no fixed way of going about the problem, and i doubt that forte or any tag lib will do it for you. On 1 Mar 2004, at 11:51, Michel Van Asten wrote: Hi, maybe the question is of topic but. I need to mix javascript in my strut application. I am looking some DHTML taglibs that would help me to build proper javascript code for things like DHTML menus... Does it exist ? I also try to develop my own tags with java forte CE It works ... but when I try to use style I got a strange behavior I output this code to the JSPWriter :: style={background-color:red; border-style: solid; border-width: 1; border-color:blue;} and thats what I get in my Browser :: style=BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; BORDER-LEFT-COLOR: blue; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: blue; BORDER-TOP-COLOR: blue; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: blue Any idea ? Regards, Michel Van Asten - 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: Avoiding app server restarts while doing struts development
How about not redeploying on every single change and do things in batches? On 1 Mar 2004, at 15:18, Marco Mistroni wrote: HI, I guess those changes,which have 'context scope', need Always a redeploy Only changes that don't need a redeploy can be jsp changes (provided that You deploy your application as a 'directory' rather than war file) Regards marco -Original Message- From: Abhishek Srivastava [mailto:[EMAIL PROTECTED] Sent: 01 March 2004 11:28 To: 'Struts Users Mailing List' Subject: Avoiding app server restarts while doing struts development Hello All, I develop my apps on weblogic app server. When doing development on struts I feel for every little operation (change in resource file, change in source file, change config files) it requires me to either redeploy the app or to restart the app server. I have tried to switch to the debug mode, but still the number of redeploys or restarts have not reduced. I find these very time-consuming. Has someone figured out a way in which they can do development without redeployment at every single change? Regards, Abhishek. - 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] MacOS X Java/Struts development (was RE: [OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available))
I use xcode on osx and personally i prefer it to those swing based things, (although IDEA I hear is in a class of its own). Xcode isn't as bigger leap at apple would have you believe I had project builder doing the same sorts of things with ant. But its quite nice that all the basics are there (JBoss-tomcat, ant, xdoclet) and you can create you own templates. Does all you need without messing with your stuff too much like eclipse. Its a different kettle of fish to the old java development on MacOS that you mentioned. On 1 Mar 2004, at 16:45, Nguyen, Hien 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. -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 10:23 AM 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)) I have been extremely happy with IDEA on the MacOS X platform, although Mac was a little late getting a jdk1.4 up and running. I'm on Jaguar, have not migrated to Panther... -jeff On Monday, March 1, 2004, at 09:07 AM, Paul, R. Chip wrote: I had been considering moving to MacOS X for a while now just because of general windows frustration. I was wondering how many issues, such as the one below, there are in developing on a mac? I've heard that Eclipse runs much faster in Windows than on a Mac as well, and I don't know if their Xcode environment can work with java. The last time I was developing java on a mac was about 8 years ago, I think we were using Codewarrior at the time. Are many people on the list developing java with MacOS, and which tools work best on that platform? -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: Saturday, February 28, 2004 8:57 AM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: [OT] Maven (was Re: [ANNOUNCE] Struts 1.2.0 Test Build available) that lets me define the individual versions of *all* dependencies for *all* projects so that I can say, for example, use *this* version of commons-beanutils and *that* version of commons-digester to build ***all*** of the components that are going in to my overall exectable. I am *so* not interested in dealing with runtime exceptions because different dependent packages were compiled against different versions of the dependent libraries. Can someone please help me understand how to do this with Maven? Without it, I'm not planning to switch any of my personal or internal-to-Sun projects (even if the Struts committers decide to switch Struts development itself). This is actually pretty easy, if I understand you correctly. If you define the Maven property maven.jar.override to the value on, then when resolving dependencies, Maven will check each against a possibly defined override. For example, the version of Cactus that everyone else in Struts uses doesn't work on Mac OS X. The Cactus CVS head has the patch that works, so in my Struts/maven environment, I have this defined: maven.jar.override=on # patched version of cactus related to Mac OS X: # http://issues.apache.org/bugzilla/show_bug.cgi?id=25266i maven.jar.cactus-ant=1.6dev-2003-12-07 maven.jar.jakarta-cactus-framework=13-1.6dev You can use full paths to JARs as well as version numbers. This is detailed here: http://maven.apache.org/reference/user- guide.html#Overriding_Stated_Dependen cies Properties are defined like so: (http://maven.apache.org/reference/user- guide.html#Properties_Processing): The properties files in Maven are processed in the following order: *${project.home}/project.properties * ${project.home}/build.properties * ${user.home}/build.properties Where the last definition wins. So, Maven moves through this sequence of properties files overridding any previously defined properties with newer definitions. In this sequence your ${user.home}/build.properties has the final say in the list of properties files processed. We will call the list of properties files that Maven processes the standard properties file set. In addition, System properties are processed after the above chain of properties files are processed. So, a property specified on the CLI using the -Dproperty=value convention will override any previous definition of that property. So if you wanted to have it universally, you'd define this in ${user.home}/build.properties but if it were just for a specific project, you'd define it in ${project.home}/build.properties Did I answer the right question? 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,
Re: microsoft sqlserver driver struts
Just a guess . but its looking for the old GenericDataSource have the the struts-legacy.jar in your lib directory? There's also some weird BillGates-tastic argument you have to pass though with the url string. But i have no experience with ms sql server. On 1 Mar 2004, at 21:28, Danko Desancic wrote: Hi, newbie to struts and I have similar problem namely I added a datasource in my struts-config.xml and after that I can't even reload my app. Non - struts applications are using this driver without problems. Bellow are stack trace from tomcat log (5.0.18) and part of my struts-config. I have all three MS jar files in both my WEB-INF\lib and CATALINA-HOME\common\lib. I did try both types org.apache.commons.dbcp.BasicDataSource and com.microsoft.jdbc.sqlserver.SQLServerDriver without any success data-source key=ContactDB type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=com.microsoft.jdbc.sqlserver.SQLServerDriver/ set-property property=url value=jdbc:microsoft:sqlserver://localhost:1433; databaseName=CONTACT/ set-property property=username value=***/ set-property property=password value=***/ set-property property=maxActive value=20/ set-property property=maxWait value=5000/ set-property property=defaultAutoCommit value=true/ /data-source 2004-03-01 15:18:02 StandardContext[/manager]Manager: restart: Reloading web application at '/contact-struts' 2004-03-01 15:18:03 StandardContext[/contact-struts]StandardWrapper.Throwable java.lang.NoClassDefFoundError: org/apache/struts/legacy/GenericDataSource at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java: 123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappCl assLoader.java:1677) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoade r.java:900) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade r.java:1350) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoade r.java:1230) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServ let.java:1084) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.ja va:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java: 887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext. java:3960) at org.apache.catalina.core.StandardContext.start(StandardContext.java: 4283) at org.apache.catalina.core.StandardContext.reload(StandardContext.java: 2992) at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java: 1019) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java: 377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic ationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil terChain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal ve.java:257) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 564) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCo ntextValve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal ve.java:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:151) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato rBase.java:587) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 564) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav a:195) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav a:164) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 564) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve .java:156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveC ontext.java:151) at
Re: Forwarding between actions
So what do your action mappings look like? action path=/SetEditor name=editForm scope=request forward name=success path=/editorView.jsp redirect=false / /action action path=/Save name=editForm input=/editorView.jsp scope=request forward name=success path=/SetView.do redirect=true / /action If this is the case then you only thing that the actions have to know is what's contained in the mappings, which I think is okay because this is what mappings are for (at least to my mind). On 29 Feb 2004, at 11:21, Boaz Barkai wrote: Hello I have a case where I wish to forward between actions, like the following flow: SetEditor.do-editorView.jsp -submit--Save.do-SetView.do Save.do uses a different form bean then SetView so how can I set the SetView.do form bean? I'm trying to keep the actions incapsulated so I do not wish to get the form (or add myself) from the environment inside the Save.do action (this is the solution I have - but I don't like it - it means that one action should know about the parameters of another action inside the action code. 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: [OT] Gays and computing
Sounds a bit gay to me.. On 28 Feb 2004, at 07:32, Michael McGrady wrote: Yah, off topic. I bet that is what the [OT] is all about. At 04:06 PM 2/27/2004, you wrote: Definitively funny, but Off-topic :) --- Rick Reumann [EMAIL PROTECTED] escribió: On Friday 27 February 2004 4:39 pm, Melvin Kurzchen wrote: Article: http://www.albinoblacksheep.com/flash/you.html Good article but does it have to use all that nude pictures to make his point? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com - To unsubscribe, e-mail: [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: microsoft sqlserver driver struts
Does the error get thrown when you attempt to access the data source or at startup? On 27 Feb 2004, at 11:34, Claire Wall wrote: Hi, I am trying to use microsoft's jdbc driver with my struts application, but to no avail. Here is my datasource definition: data-source key=DB type=org.apache.commons.dbcp.BasicDataSource set-property property=description value=My SqlServer pool/ set-property property=driverClassName value=com.microsoft.jdbc.sqlserver.SQLServerDriver/ set-property property=url value=jdbc:microsoft:sqlserver://SERVERNAME:1433; DatabaseName=DBNAME/ set-property property=username value=xxx/ set-property property=password value=xxx/ set-property property=maxActive value=20/ set-property property=maxCount value=20/ set-property property=minCount value=2/ set-property property=maxWait value=5000/ set-property property=defaultAutoCommit value=false/ set-property property=defaultReadOnly value=false/ /data-source I have the required jars located in the WEB-INF/lib of my application which is running on Tomcat 4.1.29. When i try to connect to the database using this driver from a test class, it connects no problem so i know that the url and driver class name are correct. So the problem must be the type of DataSource which I am to use. Does anybody know which datasource to use with Microsoft's sqlserver driver? I tried using the DataSource that is in the mssqlserver jar but this didnt work either. The error that I get is an Invalid DataSource. Any help would be really appreciated! Thanks Claire - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: microsoft sqlserver driver struts
Can i see the bits of code in the servlets (non action servlets) at start up that retrieve the datasource? And an example from any actions. Also see the load on start up order as i imagine that the struts servlet needs to load before your servlets to be able to access the datasource. On 27 Feb 2004, at 12:39, Claire Wall wrote: It gets thrown when the application starts, but then more errors occur as there are several servlets which load upon start-up - the data source is null at this point (NullPointerException's are being thrown) and so the errors are thrown when these classes try to access the database. - Original Message - From: Mark Lowe [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 27, 2004 11:29 AM Subject: Re: microsoft sqlserver driver struts Does the error get thrown when you attempt to access the data source or at startup? On 27 Feb 2004, at 11:34, Claire Wall wrote: Hi, I am trying to use microsoft's jdbc driver with my struts application, but to no avail. Here is my datasource definition: data-source key=DB type=org.apache.commons.dbcp.BasicDataSource set-property property=description value=My SqlServer pool/ set-property property=driverClassName value=com.microsoft.jdbc.sqlserver.SQLServerDriver/ set-property property=url value=jdbc:microsoft:sqlserver://SERVERNAME:1433; DatabaseName=DBNAME/ set-property property=username value=xxx/ set-property property=password value=xxx/ set-property property=maxActive value=20/ set-property property=maxCount value=20/ set-property property=minCount value=2/ set-property property=maxWait value=5000/ set-property property=defaultAutoCommit value=false/ set-property property=defaultReadOnly value=false/ /data-source I have the required jars located in the WEB-INF/lib of my application which is running on Tomcat 4.1.29. When i try to connect to the database using this driver from a test class, it connects no problem so i know that the url and driver class name are correct. So the problem must be the type of DataSource which I am to use. Does anybody know which datasource to use with Microsoft's sqlserver driver? I tried using the DataSource that is in the mssqlserver jar but this didnt work either. The error that I get is an Invalid DataSource. Any help would be really appreciated! Thanks Claire - 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]