Re: [S2] Error running under Weblogic 10.3.2.0
2010/3/18 Gustavo Felisberto gustavo.felisbe...@wit-software.com: What I would love would be a small tutorial on how to do it properly. I found some tutorials but are for older versions of Idea. I don't have any particular setup, I'm just connecting with WebLogic in debug mode (or start it) and then I'm able to compile a class that will be reloaded by WebLogic. Regards -- Łukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can a collection property have its changes saved back to the ActionForm?
Thanks Adam. I ended up using your solution. I'm not thrilled about the user seeing the listbox items get auto selected after they submit the form, but the code is certainly cleaner than adding and removing hidden controls. For the archives, here's what I went with: JSP function setStatus() { var emailSelect = document.getElementById(emailSelect); emailSelect.multiple = true; emailSelect.focus(); // This is needed to force IE to execute the line above. for (var i = 0; i emailSelect.length; i++) { emailSelect.options[i].selected = true; } } html:select name=formName property=addresses onchange=setEmailButtonStatus(); size=4 html:options name=preferencesForm property=oldAddresses/ /html:select ACTIONFORM private String[] addresses; public String[] getAddresses() { return addresses; } public void setAddresses(String[] value) { addresses = value; } private final ListString oldAddresses = new ArrayListString(); public ListString getOldAddresses() { return oldAddresses; } Thanks again, Andrew - Original Message From: adam pinder apin...@hotmail.co.uk To: user@struts.apache.org Sent: Thu, March 18, 2010 6:11:27 AM Subject: RE: Can a collection property have its changes saved back to the ActionForm? you want to save the options in the select not a selected option... if you make the select a multiple select and in javascript you select all options are all the option values sent to the server against the same parameter name (turn on parameter interceptor logging to check)... if so, add a set method in your action with the same name as the select element that accepts a string array, like setNewRole(String[] newRoles) inside this method you can initialise your proper ArrayList and add the elements from the string array into it. you still need the javascript to select options but at least you're not creating new elements. i haven't checked if multiple selects sends its parameters in this way but it works when multiple checkbox elements all have the same name and are sent as name/values pair. ps. if i've misunderstood and you just want to save multiple selected options, then you can omit the javascript part which would be better. Date: Wed, 17 Mar 2010 17:23:45 -0700 From: andrewrwsha...@yahoo.com Subject: Re: Can a collection property have its changes saved back to the ActionForm? To: user@struts.apache.org For the archives, the solution I'm going with is to have the javascript add elements to the document corresponding to the new values in the select. The names of the hidden elements will be indexed. Something like this: Action Form: public List getOldList() public String getSelectedValue() public void setNewList(int index, String value) JSP: Then the setNewList method gets called on the form with the new values from the select box. If anyone has any better ideas I'm open to hearing them, but this seems to do the trick. Andrew - Original Message From: Andrew Sharpe To: user@struts.apache.org Sent: Mon, March 15, 2010 6:03:30 PM Subject: Can a collection property have its changes saved back to the ActionForm? Hello all, I have a List collection that I am displaying in an and it is working great. The problem is that my jsp page makes changes to that control via javascript (adds new options, removes, etc). I would like these changes to be saved back to the ActionForm, preferrably to the same collection where it got its data from. Struts does not seem to do it by default, that is, the tag seems to make use of the ActionForm's get property, but not its set. If it is supposed to behave this way please let me know and I will reexamine my syntax. Otherwise can someone tell me the easiest way to do this? I am using Struts 1.3.8 and unfortunately cannot upgrade to Struts 2. Many thanks in advance, Andrew __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Got a cool Hotmail story? Tell us now http://clk.atdmt.com/UKM/go/195013117/direct/01/
Re: Can a collection property have its changes saved back to the ActionForm?
Apologies all, I am editing my solution below for clarity and accuracy: - Original Message From: Andrew Sharpe andrewrwsha...@yahoo.com To: Struts Users Mailing List user@struts.apache.org Sent: Mon, March 22, 2010 8:44:42 AM Subject: Re: Can a collection property have its changes saved back to the ActionForm? Thanks Adam. I ended up using your solution. I'm not thrilled about the user seeing the listbox items get auto selected after they submit the form, but the code is certainly cleaner than adding and removing hidden controls. For the archives, here's what I went with: JSP function setStatus() { var emailSelect = document.getElementById(emailSelect); emailSelect.multiple = true; emailSelect.focus(); // This is needed to force IE to execute the line above. for (var i = 0; i emailSelect.length; i++) { emailSelect.options[i].selected = true; } } html:select name=formName property=addresses size=4 styleId=emailSelect html:options name=preferencesForm property=oldAddresses/ /html:select html:submit onclick=setStatus()/ ACTIONFORM private String[] addresses; public String[] getAddresses() { return addresses; } public void setAddresses(String[] value) { addresses = value; } private final ListString oldAddresses = new ArrayListString(); public ListString getOldAddresses() { return oldAddresses; } Thanks again, Andrew - Original Message From: adam pinder apin...@hotmail.co.uk To: user@struts.apache.org Sent: Thu, March 18, 2010 6:11:27 AM Subject: RE: Can a collection property have its changes saved back to the ActionForm? you want to save the options in the select not a selected option... if you make the select a multiple select and in javascript you select all options are all the option values sent to the server against the same parameter name (turn on parameter interceptor logging to check)... if so, add a set method in your action with the same name as the select element that accepts a string array, like setNewRole(String[] newRoles) inside this method you can initialise your proper ArrayList and add the elements from the string array into it. you still need the javascript to select options but at least you're not creating new elements. i haven't checked if multiple selects sends its parameters in this way but it works when multiple checkbox elements all have the same name and are sent as name/values pair. ps. if i've misunderstood and you just want to save multiple selected options, then you can omit the javascript part which would be better. Date: Wed, 17 Mar 2010 17:23:45 -0700 From: andrewrwsha...@yahoo.com Subject: Re: Can a collection property have its changes saved back to the ActionForm? To: user@struts.apache.org For the archives, the solution I'm going with is to have the javascript add elements to the document corresponding to the new values in the select. The names of the hidden elements will be indexed. Something like this: Action Form: public List getOldList() public String getSelectedValue() public void setNewList(int index, String value) JSP: Then the setNewList method gets called on the form with the new values from the select box. If anyone has any better ideas I'm open to hearing them, but this seems to do the trick. Andrew - Original Message From: Andrew Sharpe To: user@struts.apache.org Sent: Mon, March 15, 2010 6:03:30 PM Subject: Can a collection property have its changes saved back to the ActionForm? Hello all, I have a List collection that I am displaying in an and it is working great. The problem is that my jsp page makes changes to that control via javascript (adds new options, removes, etc). I would like these changes to be saved back to the ActionForm, preferrably to the same collection where it got its data from. Struts does not seem to do it by default, that is, the tag seems to make use of the ActionForm's get property, but not its set. If it is supposed to behave this way please let me know and I will reexamine my syntax. Otherwise can someone tell me the easiest way to do this? I am using Struts 1.3.8 and unfortunately cannot upgrade to Struts 2. Many thanks in advance, Andrew __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ - To
S2 - sx:datetimspicker calendar background color
Does anyone know how to change the calendar style of datetimepicker? Using templateCssPath to point to a new css with different background does not work. Any suggestion? Thanks, Helen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
About bank application using Struts 2
Hi to all, right now i'm going to develop something like bank application to enable users to manage their accounts, transfer money, pay services and so on, and really i have no experience developing applications like that (where security is really important) so i don't know if exists some book about critical applications development with struts 2 or you can give me some tips to develop a secure application, also tips about struts and ssl, or if you know internet resources that talk about that. Thanks in advance. -- Oscar
Re: About bank application using Struts 2
There are quite a few good books about general security practices for software development... There used to be a library that you can use to help secure your web-app ...looking... http://www.hdiv.org/ They used to support an s2 plugin, but I'm not sure which version it works with. In general, you want to treat security as something you approach in layers. Obviously, you want to encrypt communications that might expose sensitive information (apply ssl), and you want to utilize an authentication and authorization mechanism (spring-security). After that, you want to treat all user input as unsafe/tainted (escape before displaying to other users, use parameterized sql statements rather than constructing strings of sql) and make sure that you pay close attention that you try not to put sensitive data on the URL string (using form method=GET for form-based authentication). In addition, it may not hurt and would probably be worth the money to involve a security professional to perform audits or to participate in code reviews. There are new attack mechanisms that crop up all the time and a lot of times security pros can point out things that you didn't know where potential problems. Lastly, make sure you secure your application server... There is a guide to hardening Tomcat here - http://cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.servers.web.apache If you are not using tomcat, make sure you know enough about your application server that you don't open up attack vectors at the server. -Wes On Mon, Mar 22, 2010 at 4:28 PM, Oscar oscar.kalde...@gmail.com wrote: Hi to all, right now i'm going to develop something like bank application to enable users to manage their accounts, transfer money, pay services and so on, and really i have no experience developing applications like that (where security is really important) so i don't know if exists some book about critical applications development with struts 2 or you can give me some tips to develop a secure application, also tips about struts and ssl, or if you know internet resources that talk about that. Thanks in advance. -- Oscar -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: About bank application using Struts 2
implementing parameterised dynamic statements are of particular interest to me.. does anyone know how i can achieve paramterised dynamic statements with hibernate?? Many Thanks to Wes for the advice on hardening Tomcat Martin Gainty __ Please do not modify or disrupt this transmission. Thank You Date: Mon, 22 Mar 2010 17:01:22 -0400 Subject: Re: About bank application using Struts 2 From: w...@wantii.com To: user@struts.apache.org There are quite a few good books about general security practices for software development... There used to be a library that you can use to help secure your web-app ...looking... http://www.hdiv.org/ They used to support an s2 plugin, but I'm not sure which version it works with. In general, you want to treat security as something you approach in layers. Obviously, you want to encrypt communications that might expose sensitive information (apply ssl), and you want to utilize an authentication and authorization mechanism (spring-security). After that, you want to treat all user input as unsafe/tainted (escape before displaying to other users, use parameterized sql statements rather than constructing strings of sql) and make sure that you pay close attention that you try not to put sensitive data on the URL string (using form method=GET for form-based authentication). In addition, it may not hurt and would probably be worth the money to involve a security professional to perform audits or to participate in code reviews. There are new attack mechanisms that crop up all the time and a lot of times security pros can point out things that you didn't know where potential problems. Lastly, make sure you secure your application server... There is a guide to hardening Tomcat here - http://cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.servers.web.apache If you are not using tomcat, make sure you know enough about your application server that you don't open up attack vectors at the server. -Wes On Mon, Mar 22, 2010 at 4:28 PM, Oscar oscar.kalde...@gmail.com wrote: Hi to all, right now i'm going to develop something like bank application to enable users to manage their accounts, transfer money, pay services and so on, and really i have no experience developing applications like that (where security is really important) so i don't know if exists some book about critical applications development with struts 2 or you can give me some tips to develop a secure application, also tips about struts and ssl, or if you know internet resources that talk about that. Thanks in advance. -- Oscar -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3
Re: About bank application using Struts 2
Thanks for the tips Wes, unfortunately we can't use Spring because the time, but i going to read about ssl in struts and the security in server (Glassfish in my case). For Martin, Hibernate doesn´t handle by default parametizered statements? 2010/3/22 Martin Gainty mgai...@hotmail.com implementing parameterised dynamic statements are of particular interest to me.. does anyone know how i can achieve paramterised dynamic statements with hibernate?? Many Thanks to Wes for the advice on hardening Tomcat Martin Gainty __ Please do not modify or disrupt this transmission. Thank You Date: Mon, 22 Mar 2010 17:01:22 -0400 Subject: Re: About bank application using Struts 2 From: w...@wantii.com To: user@struts.apache.org There are quite a few good books about general security practices for software development... There used to be a library that you can use to help secure your web-app ...looking... http://www.hdiv.org/ They used to support an s2 plugin, but I'm not sure which version it works with. In general, you want to treat security as something you approach in layers. Obviously, you want to encrypt communications that might expose sensitive information (apply ssl), and you want to utilize an authentication and authorization mechanism (spring-security). After that, you want to treat all user input as unsafe/tainted (escape before displaying to other users, use parameterized sql statements rather than constructing strings of sql) and make sure that you pay close attention that you try not to put sensitive data on the URL string (using form method=GET for form-based authentication). In addition, it may not hurt and would probably be worth the money to involve a security professional to perform audits or to participate in code reviews. There are new attack mechanisms that crop up all the time and a lot of times security pros can point out things that you didn't know where potential problems. Lastly, make sure you secure your application server... There is a guide to hardening Tomcat here - http://cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.servers.web.apache If you are not using tomcat, make sure you know enough about your application server that you don't open up attack vectors at the server. -Wes On Mon, Mar 22, 2010 at 4:28 PM, Oscar oscar.kalde...@gmail.com wrote: Hi to all, right now i'm going to develop something like bank application to enable users to manage their accounts, transfer money, pay services and so on, and really i have no experience developing applications like that (where security is really important) so i don't know if exists some book about critical applications development with struts 2 or you can give me some tips to develop a secure application, also tips about struts and ssl, or if you know internet resources that talk about that. Thanks in advance. -- Oscar -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3 -- Oscar
RE: About bank application using Struts 2
hibernate can use parameterised statements out of the box and handles the encoding of values to stop sql injection. you can use names like :orgId in an sql statement and set either the value with a set statement or by setting an object containing a getOrgId method and hibernate will call it for you. From: oscar.kalde...@gmail.com Date: Mon, 22 Mar 2010 15:59:37 -0600 Subject: Re: About bank application using Struts 2 To: user@struts.apache.org Thanks for the tips Wes, unfortunately we can't use Spring because the time, but i going to read about ssl in struts and the security in server (Glassfish in my case). For Martin, Hibernate doesn´t handle by default parametizered statements? 2010/3/22 Martin Gainty implementing parameterised dynamic statements are of particular interest to me.. does anyone know how i can achieve paramterised dynamic statements with hibernate?? Many Thanks to Wes for the advice on hardening Tomcat Martin Gainty __ Please do not modify or disrupt this transmission. Thank You Date: Mon, 22 Mar 2010 17:01:22 -0400 Subject: Re: About bank application using Struts 2 From: w...@wantii.com To: user@struts.apache.org There are quite a few good books about general security practices for software development... There used to be a library that you can use to help secure your web-app ...looking... http://www.hdiv.org/ They used to support an s2 plugin, but I'm not sure which version it works with. In general, you want to treat security as something you approach in layers. Obviously, you want to encrypt communications that might expose sensitive information (apply ssl), and you want to utilize an authentication and authorization mechanism (spring-security). After that, you want to treat all user input as unsafe/tainted (escape before displaying to other users, use parameterized sql statements rather than constructing strings of sql) and make sure that you pay close attention that you try not to put sensitive data on the URL string (using form method=GET for form-based authentication). In addition, it may not hurt and would probably be worth the money to involve a security professional to perform audits or to participate in code reviews. There are new attack mechanisms that crop up all the time and a lot of times security pros can point out things that you didn't know where potential problems. Lastly, make sure you secure your application server... There is a guide to hardening Tomcat here - http://cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.servers.web.apache If you are not using tomcat, make sure you know enough about your application server that you don't open up attack vectors at the server. -Wes On Mon, Mar 22, 2010 at 4:28 PM, Oscar wrote: Hi to all, right now i'm going to develop something like bank application to enable users to manage their accounts, transfer money, pay services and so on, and really i have no experience developing applications like that (where security is really important) so i don't know if exists some book about critical applications development with struts 2 or you can give me some tips to develop a secure application, also tips about struts and ssl, or if you know internet resources that talk about that. Thanks in advance. -- Oscar -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_3 -- Oscar _ Do you have a story that started on Hotmail? Tell us now http://clk.atdmt.com/UKM/go/195013117/direct/01/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: S2 - sx:datetimspicker calendar background color
parameters will not be able to render without the accompanying .ftl WEB-INF\classes\template\ajax\datetimepicker.ftl Martin Gainty __ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Date: Mon, 22 Mar 2010 14:39:28 -0400 Subject: S2 - sx:datetimspicker calendar background color From: shen.he...@gmail.com To: user@struts.apache.org Does anyone know how to change the calendar style of datetimepicker? Using templateCssPath to point to a new css with different background does not work. Any suggestion? Thanks, Helen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID27925::T:WLMTAGL:ON:WL:en-US:WM_HMP:032010_2
How to get s:select id and name under struts2 action?
I have a jsp,it contains a s:select,like follows: s:select name=test list=#request.testList listKey=id listValue=tname size=6 cssClass=tbcell/ When this jsp submit,it will submit to a struts2 action,I want to know how to get all id and name of s:select and how to get selected id and name of s:select ? How to do it? An example is better. Thanks!