RE: Display only 100 chars of a string
That would cause an IndexOutOfBoundsException if the string was shorter than 100 chars. Try this instead: String.format(%.100s, s); That would return up to 100 characters from the beginning of the string 's'. -Original Message- From: Avlesh Singh [mailto:avl...@gmail.com] Sent: Monday, June 22, 2009 11:42 AM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string c:out value=${fn:substring(yourString, start, end)}/ Cheers Avlesh On Mon, Jun 22, 2009 at 9:07 PM, Stefano Tranquillini stefano.tranquill...@gmail.com wrote: Hi all. there's a possibility inside a jsp to display only the first 100 chars or the first 10 words of a string? if i have a long string, can i display only the first 100 chars directly in a jsp without modification in action or something like that? thanks -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Display only 100 chars of a string
s:property value=@java.lang.str...@format(%.100s, description) / should work (check http://www.opensymphony.com/ognl/html/LanguageGuide/staticMethods.html for OGNL for calling static methods) -Original Message- From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] Sent: Monday, June 22, 2009 11:58 AM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string On Mon, Jun 22, 2009 at 17:46, Jon Pearsonjon.pear...@sixnet.com wrote: String.format(%.100s, s); how can i put this thing in the jsp? -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Display only 100 chars of a string
I could be wrong... Honestly, you'd be better off adding a function to your action class that would format a string to a specific length. It would be clearer what was going on. Something like public String formatString(String s, int maxLen) { return String.format(%. + maxLen + s, s); } It would also be an easy extension later if you decided that you wanted truncated strings to end with elipses: public String formatString(String s, int maxLen) { if (s.length() maxLen) { return s; } else { return s.substring(0, maxLen - 3) + ...; } } -Original Message- From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] Sent: Monday, June 22, 2009 12:27 PM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string are you sure that this thing works? because i don't see anything. I'm inside an iterator , with this thing works s:property value=%{description} / with yours no. seems that description is empty when i do s:property value=@java.lang.str...@format('%.100s', description) / On Mon, Jun 22, 2009 at 18:09, Jon Pearsonjon.pear...@sixnet.com wrote: Sorry, I accidentally embedded double quotes inside double quotes, here's a fix: s:property value=@java.lang.str...@format('%.100s', description) / -Original Message- From: stefano.tranquill...@gmail.com [mailto:stefano.tranquill...@gmail.com] On Behalf Of Stefano Sent: Monday, June 22, 2009 12:07 PM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string @Greg: do u put that code inside the bean? i can't do this. @Jon thanks, but i've some problem with the of the part: %.100s the system found a end tag at the first that it encountred. i tried to put \ but doesn't work. On Mon, Jun 22, 2009 at 18:00, Jon Pearsonjon.pear...@sixnet.com wrote: s:property value=@java.lang.str...@format(%.100s, description) / should work (check http://www.opensymphony.com/ognl/html/LanguageGuide/staticMethods.html for OGNL for calling static methods) -Original Message- From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] Sent: Monday, June 22, 2009 11:58 AM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string On Mon, Jun 22, 2009 at 17:46, Jon Pearsonjon.pear...@sixnet.com wrote: String.format(%.100s, s); how can i put this thing in the jsp? -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Display only 100 chars of a string
Sorry, I accidentally embedded double quotes inside double quotes, here's a fix: s:property value=@java.lang.str...@format('%.100s', description) / -Original Message- From: stefano.tranquill...@gmail.com [mailto:stefano.tranquill...@gmail.com] On Behalf Of Stefano Sent: Monday, June 22, 2009 12:07 PM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string @Greg: do u put that code inside the bean? i can't do this. @Jon thanks, but i've some problem with the of the part: %.100s the system found a end tag at the first that it encountred. i tried to put \ but doesn't work. On Mon, Jun 22, 2009 at 18:00, Jon Pearsonjon.pear...@sixnet.com wrote: s:property value=@java.lang.str...@format(%.100s, description) / should work (check http://www.opensymphony.com/ognl/html/LanguageGuide/staticMethods.html for OGNL for calling static methods) -Original Message- From: Stefano Tranquillini [mailto:stefano.tranquill...@gmail.com] Sent: Monday, June 22, 2009 11:58 AM To: Struts Users Mailing List Subject: Re: Display only 100 chars of a string On Mon, Jun 22, 2009 at 17:46, Jon Pearsonjon.pear...@sixnet.com wrote: String.format(%.100s, s); how can i put this thing in the jsp? -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Stefano - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Option transfer select
I am trying to get an option transfer select control to work, but I'm having difficulty getting the results back out of it. It looks like the control passes values in the two lists back to the server by selecting all items in each list and then letting the standard form submission mechanism do its normal job of passing all selected items, but the select-all code does not appear to run (according to FireBug). Here's the section of code that Struts2 inserted (the line numbers are from FireBug): 311script type=text/javascript 312 var containingForm = document.getElementById(update); 313 StrutsUtils.addEventListener(containingForm, submit, 314 function(evt) { 315 var selectObj = document.getElementById(update_); 316 selectAllOptionsExceptSome(selectObj, key, ); 317 }, true); 318 var containingForm = document.getElementById(update); 319 StrutsUtils.addEventListener(containingForm, submit, 320 function(evt) { 321 var selectObj = document.getElementById(update_chosenColumns); 322 selectAllOptionsExceptSome(selectObj, key, ); 323 }, true); 324 325 326/script I'm not interested in the left list (as is shown by line 315; I'm not setting listName, so it just has the form name there and doesn't end up getting used). But I am interested in the right list (line 321). The form submit event listener seems to register (at least, StrutsUtils.addEventListener() executes), but when I submit the form, the event listener does not actually run and select the list items. As a result, the chosen values are not passed back to the server. Has anyone else gotten this control to work? Is there any property I might be missing? Browser is Firefox 3, using FireBug to investigate. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Option transfer select (WORKAROUND FOUND)
Well, I think something may be wrong with the Struts2 javascript code. But I was able to make it work anyway by writing this function: 117 function selectAndSubmit() { 118 var list = document.getElementById(update_chosenColumns); 119 for (var i = 0; i list.options.length; i++) { 120 list.options[i].selected = true; 121 } 122 123 var form = document.getElementById(update); 124 form.submit(); 125 } Which I call in the onclick= handler for my form submission. -Original Message- From: Jon Pearson Sent: Wednesday, June 17, 2009 9:10 AM To: Struts Users Mailing List Subject: Option transfer select I am trying to get an option transfer select control to work, but I'm having difficulty getting the results back out of it. It looks like the control passes values in the two lists back to the server by selecting all items in each list and then letting the standard form submission mechanism do its normal job of passing all selected items, but the select-all code does not appear to run (according to FireBug). Here's the section of code that Struts2 inserted (the line numbers are from FireBug): 311script type=text/javascript 312 var containingForm = document.getElementById(update); 313 StrutsUtils.addEventListener(containingForm, submit, 314 function(evt) { 315 var selectObj = document.getElementById(update_); 316 selectAllOptionsExceptSome(selectObj, key, ); 317 }, true); 318 var containingForm = document.getElementById(update); 319 StrutsUtils.addEventListener(containingForm, submit, 320 function(evt) { 321 var selectObj = document.getElementById(update_chosenColumns); 322 selectAllOptionsExceptSome(selectObj, key, ); 323 }, true); 324 325 326/script I'm not interested in the left list (as is shown by line 315; I'm not setting listName, so it just has the form name there and doesn't end up getting used). But I am interested in the right list (line 321). The form submit event listener seems to register (at least, StrutsUtils.addEventListener() executes), but when I submit the form, the event listener does not actually run and select the list items. As a result, the chosen values are not passed back to the server. Has anyone else gotten this control to work? Is there any property I might be missing? Browser is Firefox 3, using FireBug to investigate. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: STRUT2 s:property
Perhaps what you want is a br /? -Original Message- From: cmoreno [mailto:cristina.moren...@gmail.com] Sent: Wednesday, June 17, 2009 1:02 PM To: user@struts.apache.org Subject: STRUT2 s:property Hi I have a problem with s:property tag. How can I use into this tag 's value special characters like \r\n. I tried with escape attribute, but it isn't work. I tried to change \r\n with br tag, but isn't work. If I look up into the source code the value is ok (with line return) How can I resolve this? Thank you -- View this message in context: http://www.nabble.com/STRUT2-%3Cs%3Aproperty%3E-tp24077856p240 77856.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Newbie (possibly RTFM) issue
Also, in s:if ... tags, you don't need to enclose the test in %{} because it is evaluated anyway. Not that it'll change your result at all, just thought I'd save you the extra couple of keypresses. -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Monday, June 15, 2009 9:01 AM To: Struts Users Mailing List Subject: Re: Newbie (possibly RTFM) issue On Mon, Jun 15, 2009 at 6:40 AM, chumbobumbochumbobu...@hotmail.com wrote: I am using Struts 2.1.6 if I have model like this: public class model { private Boolean testBool; private boolean testbool; ... public getters and setters for both follow ... } I find that in my corresponding jsp page (assumming that both testbool and testBool are initialised to true and that private member 'model' is available through its getter and a setter from within the action class) s:if test=%{model.testbool}/ evaluates to true, while s:if test=%{model.testBool}/ does not I am highly suspicious that I may be doing something fundamentally wrong as there is a complete absence of posts out there complaining about not being able to evaluate Boolean. Is there something I am missing here? Any help is appreciated, Regards, C Try this - s:if test=%{model.testBool.booleanValue()}/ I could be wrong, I thought modern JVMs supported auto-boxing, etc. making these sorts of method calls redundant. However, I am never quite sure how OGNL is going to evaluate things until I play around with it. -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: File Upload in Mozilla
You're not the only one annoyed by this, but it's a security fix. Here's someone else's opinion on it: http://codangaems.blogspot.com/2008/06/firefox-3s-file-upload-box.html And the security vulnerability description: http://secunia.com/advisories/20442/ Sorry to say, you can't do what you want to do. -Original Message- From: Mageshwaran [mailto:mageshwa...@dhyanit.com] Sent: Tuesday, June 02, 2009 8:03 AM To: Struts Users Mailing List Subject: File Upload in Mozilla Hi All, In my jsp code i had used s:file name=uploadFile label=File size=20 onkeypress = killEvent(event)/ for file upload using IFrame. Issue: While loading in Mozilla browser, if i click on the text field, the upload dialog (File Chooser) opens. I want to open the upload dialog (File Chooser) only if browse button is clicked. Please help me how to resolve this issue. Thanks, Mageshwaran P. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
.dispatcher.FilterDispatcher.doFilter(FilterDispatcher .java:395) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) java.security.AccessController.doPrivileged(Native Method) javax.security.auth.Subject.doAsPrivileged(Subject.java:517) org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav a:218) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:230) org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFi lterChain.java:56) org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterC hain.java:189) java.security.AccessController.doPrivileged(Native Method) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:185) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2 86) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84 5) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process( Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:619) I have no idea DefaultActionMapper would be throwing a NullPointerException, though... -Original Message- From: Jon Pearson Sent: Wednesday, May 20, 2009 12:26 PM To: Struts Users Mailing List Subject: RE: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable I'm having this same problem on Tomcat 6. Here's the stack trace: javax.servlet.ServletException: org/apache/struts2/util/ObjectFactoryDestroyable at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil .java:294) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(Securi tyUtil.jav a:218) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(Securi tyUtil.jav a:178) at org.apache.catalina.core.ApplicationFilterConfig.release(Appli cationFilt erConfig.java:326) at org.apache.catalina.core.StandardContext.filterStop(StandardCo ntext.java :3744) at org.apache.catalina.core.StandardContext.stop(StandardContext. java:4513) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBa se.java:92 4) at org.apache.catalina.startup.HostConfig.checkResources(HostConf ig.java:10 46) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConf ig.java:29 3) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(L ifecycleSu pport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(Conta inerBase.j ava:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProc essor.proc essChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProc essor.proc essChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProc essor.run( ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:254) at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterD ispatcher. java:233) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess orImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth odAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil .java:276) ... 15 more Caused by: java.lang.ClassNotFoundException: org.apache.struts2.util.ObjectFactoryDestroyable
RE: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
I'm having this same problem on Tomcat 6. Here's the stack trace: javax.servlet.ServletException: org/apache/struts2/util/ObjectFactoryDestroyable at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:294) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav a:218) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.jav a:178) at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilt erConfig.java:326) at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java :3744) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4513) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:92 4) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:10 46) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:29 3) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j ava:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc essChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc essChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run( ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:254) at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterDispatcher. java:233) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) ... 15 more Caused by: java.lang.ClassNotFoundException: org.apache.struts2.util.ObjectFactoryDestroyable at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader .java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader .java:1233) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 25 more I checked the exploded WAR, and it includes WEB-INF/lib/struts2-core-2.1.6.jar Any ideas? This is immediately after I deploy the WAR, using the Web Application Manager (or by manually copying the WAR into the webapps/ directory). -Original Message- From: Daniele Del Gaudio [mailto:daniele.delgau...@sociale.it] Sent: Wednesday, May 20, 2009 9:01 AM To: user@struts.apache.org Subject: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable Hello, can someone help me? When I undeploy or redeploy my web application based on struts2 on jboss 4.2.2 I have this error: 13:35:57,788 INFO [TomcatDeployer] undeploy, ctxPath=/PianificazioneWeb, warUrl=.../deploy/PianificazioneWeb.war/ 13:35:57,788 ERROR [BaseModelMBean] Exception invoking method destroy java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:257) at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterD ispatcher.java:221) at org.apache.catalina.core.ApplicationFilterConfig.release(Appli cationFilterConfig.java:332) at org.apache.catalina.core.StandardContext.filterStop(StandardCo ntext.java:3757) at org.apache.catalina.core.StandardContext.stop(StandardContext. java:4517) at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.j ava:1163) at org.apache.catalina.core.StandardContext.destroy(StandardConte xt.java:4617) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at ... My web.xml is ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
RE: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
Well, I got past my problem by providing the name of the action to execute, instead of relying on Tomcat to specify that Struts should execute the default one. I'll play with my configuration later to get that fixed, hopefully it won't be too difficult. -Original Message- From: Jon Pearson Sent: Wednesday, May 20, 2009 12:28 PM To: Struts Users Mailing List Subject: RE: struts2 on jboss java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable Additionally, although it doesn't show up in the log files, when I try to view the application I see a page that includes this stack trace: java.lang.NullPointerException org.apache.struts2.dispatcher.mapper.DefaultActionMapper.getUr iFromActio nMapping(DefaultActionMapper.java:532) org.apache.struts2.dispatcher.ServletActionRedirectResult.exec ute(Servle tActionRedirectResult.java:197) com.opensymphony.xwork2.DefaultActionInvocation.executeResult( DefaultAct ionInvocation.java:361) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:265) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor .doInterce pt(DefaultWorkflowInterceptor.java:163) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.in tercept(Me thodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.validator.ValidationInterceptor.doInte rcept(Vali dationInterceptor.java:249) org.apache.struts2.interceptor.validation.AnnotationValidation Intercepto r.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.in tercept(Me thodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor .intercept (ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIn tercept(Pa rametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.in tercept(Me thodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIn tercept(Pa rametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.in tercept(Me thodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.StaticParametersIntercepto r.intercep t(StaticParametersInterceptor.java:148) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(C heckboxInt erceptor.java:93) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploa dInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.int ercept(Mod elDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ScopedModelDrivenIntercept or.interce pt(ScopedModelDrivenInterceptor.java:128) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) org.apache.struts2.interceptor.ProfilingActivationInterceptor. intercept( ProfilingActivationInterceptor.java:104) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) org.apache.struts2.interceptor.debugging.DebuggingInterceptor. intercept( DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.ChainingInterceptor.interc ept(Chaini ngInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doInter cept(Prepa reInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.in tercept(Me thodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept( I18nInterc eptor.java:148) com.opensymphony.xwork2.DefaultActionInvocation.invoke(Default ActionInvo cation.java:236) org.apache.struts2.interceptor.ServletConfigInterceptor.interc ept(Servle
I18n blew up
I moved away from the web side of my project for a couple of days to take a break, and now as I come back, I18n has completely stopped working. In 'struts.properties' I have the line struts.custom.i18n.resources = global-messages And in 'global-messages.properties' I have text like this i18n.property = Property i18n.value = Value i18n.submit = Submit But Struts can't seem to find these properties... Any idea what might have happened? I don't think I changed anything related to this since last week, when it was working... If it helps any, I'm using Eclipse for Java EE and Tomcat 6.0.18. Sorry to post a tech-support type of problem, but it really makes no sense to me. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: I18n blew up
Upon further examination, it looks like 'struts.properties' is not being loaded -- When I cause an exception, I don't see the development-mode data that I would expect for having this line in that file: struts.devMode = true Still very confused. -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 3:59 PM To: Struts Users Mailing List Subject: I18n blew up I moved away from the web side of my project for a couple of days to take a break, and now as I come back, I18n has completely stopped working. In 'struts.properties' I have the line struts.custom.i18n.resources = global-messages And in 'global-messages.properties' I have text like this i18n.property = Property i18n.value = Value i18n.submit = Submit But Struts can't seem to find these properties... Any idea what might have happened? I don't think I changed anything related to this since last week, when it was working... If it helps any, I'm using Eclipse for Java EE and Tomcat 6.0.18. Sorry to post a tech-support type of problem, but it really makes no sense to me. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: I18n blew up
As far as I can tell, Eclipse is placing struts.xml into WEB-INF/classes when it deploys to Tomcat, but not struts.properties or any of the other important files that I need. No idea why, and I haven't yet figured out how to fix this. Anyone else experience a problem like this? Any idea how to get Eclipse to behave properly again? -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 4:04 PM To: Struts Users Mailing List Subject: RE: I18n blew up Upon further examination, it looks like 'struts.properties' is not being loaded -- When I cause an exception, I don't see the development-mode data that I would expect for having this line in that file: struts.devMode = true Still very confused. -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 3:59 PM To: Struts Users Mailing List Subject: I18n blew up I moved away from the web side of my project for a couple of days to take a break, and now as I come back, I18n has completely stopped working. In 'struts.properties' I have the line struts.custom.i18n.resources = global-messages And in 'global-messages.properties' I have text like this i18n.property = Property i18n.value = Value i18n.submit = Submit But Struts can't seem to find these properties... Any idea what might have happened? I don't think I changed anything related to this since last week, when it was working... If it helps any, I'm using Eclipse for Java EE and Tomcat 6.0.18. Sorry to post a tech-support type of problem, but it really makes no sense to me. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: I18n blew up
Thanks, but the problem is definitely Eclipse. It was working last week, and now it isn't. Eclipse isn't copying the necessary properties files containing those translations for getText() when I deploy to my local Tomcat server for development/testing. It will copy struts.xml, but none of the other files (including other .xml files which struts.xml references). -Original Message- From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Tuesday, May 19, 2009 5:00 PM To: Struts Users Mailing List Subject: RE: I18n blew up typical use is to use getText to acquire the property attribute as defined here s:textfield label=%{getText('label.firstName')} name=firstName /modifying controlheader-core.ftl would allow you to supply neccesary call to getText ${parameters.label?html}:#t/ #assign mm=getText('+parameters.label?html+') /#t/ ${stack.findValue(mm)}:#t/ !-- you can now use the value of label as the key without intervening getText -- s:textfield label=label.firstName name=firstName / struts-default.xml defines the interceptor class as interceptor name=i18n class=com.opensymphony.xwork2.interceptor.I18nInterceptor/ http://www.docjar.com/html/api/com/opensymphony/xwork2/interce ptor/I18nInterceptor.java.html which either gets/sets the request_locale parameter and pushes that to ActionContext.map s:param name=request_localeen/s:param http://cwiki.apache.org/WW/internationalization.html properties are located in one of the following locations ActionClass.propertiesBaseClass.properties (all the way to Object.properties)Interface.properties (every interface and sub-interface)package.properties struts.properties 6.webwork.properties HTH Martin __ Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt. 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. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Subject: RE: I18n blew up Date: Tue, 19 May 2009 16:04:15 -0400 From: jon.pear...@sixnet.com To: user@struts.apache.org Upon further examination, it looks like 'struts.properties' is not being loaded -- When I cause an exception, I don't see the development-mode data that I would expect for having this line in that file: struts.devMode = true Still very confused. -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 3:59 PM To: Struts Users Mailing List Subject: I18n blew up I moved away from the web side of my project for a couple of days to take a break, and now as I come back, I18n has completely stopped working. In 'struts.properties' I have the line struts.custom.i18n.resources = global-messages And in 'global-messages.properties' I have text like this i18n.property = Property i18n.value = Value i18n.submit = Submit But Struts can't seem to find these properties... Any idea what might have happened? I don't think I changed anything related to this since last week, when it was working... If it helps any, I'm using Eclipse for Java EE and Tomcat 6.0.18. Sorry to post a tech-support type of problem, but it really makes no sense to me. Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e
RE: I18n blew up
Fixed -- I had been building the properties files and whatnot in the src/ folder, and Eclipse had been copying them. But then it stopped, so I had to manually move my files from src/ to web/WEB-INF/classes/. Not that this is an Eclipse support forum, but I thought that someone else may encounter this issue in the future. -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 5:04 PM To: Struts Users Mailing List Subject: RE: I18n blew up Thanks, but the problem is definitely Eclipse. It was working last week, and now it isn't. Eclipse isn't copying the necessary properties files containing those translations for getText() when I deploy to my local Tomcat server for development/testing. It will copy struts.xml, but none of the other files (including other .xml files which struts.xml references). -Original Message- From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Tuesday, May 19, 2009 5:00 PM To: Struts Users Mailing List Subject: RE: I18n blew up typical use is to use getText to acquire the property attribute as defined here s:textfield label=%{getText('label.firstName')} name=firstName /modifying controlheader-core.ftl would allow you to supply neccesary call to getText ${parameters.label?html}:#t/ #assign mm=getText('+parameters.label?html+') /#t/ ${stack.findValue(mm)}:#t/ !-- you can now use the value of label as the key without intervening getText -- s:textfield label=label.firstName name=firstName / struts-default.xml defines the interceptor class as interceptor name=i18n class=com.opensymphony.xwork2.interceptor.I18nInterceptor/ http://www.docjar.com/html/api/com/opensymphony/xwork2/interce ptor/I18nInterceptor.java.html which either gets/sets the request_locale parameter and pushes that to ActionContext.map s:param name=request_localeen/s:param http://cwiki.apache.org/WW/internationalization.html properties are located in one of the following locations ActionClass.propertiesBaseClass.properties (all the way to Object.properties)Interface.properties (every interface and sub-interface)package.properties struts.properties 6.webwork.properties HTH Martin __ Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt. 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. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Subject: RE: I18n blew up Date: Tue, 19 May 2009 16:04:15 -0400 From: jon.pear...@sixnet.com To: user@struts.apache.org Upon further examination, it looks like 'struts.properties' is not being loaded -- When I cause an exception, I don't see the development-mode data that I would expect for having this line in that file: struts.devMode = true Still very confused. -Original Message- From: Jon Pearson Sent: Tuesday, May 19, 2009 3:59 PM To: Struts Users Mailing List Subject: I18n blew up I moved away from the web side of my project for a couple of days to take a break, and now as I come back, I18n has completely stopped working. In 'struts.properties' I have the line struts.custom.i18n.resources = global-messages And in 'global-messages.properties' I have text like this i18n.property = Property i18n.value = Value i18n.submit = Submit But Struts can't seem to find these properties... Any idea what might have happened? I don't think I changed anything related to this since last week, when it was working
RE: Date/time formatting
I've looked at that, but it doesn't explain when format.time is used. I can see that format.date gets used when formatting dates using the s:date ... tag, but since there is no s:time ... tag, when is format.time used? -Original Message- From: Rene Gielen [mailto:gie...@it-neering.net] Sent: Thursday, May 07, 2009 9:03 PM To: Struts Users Mailing List Subject: Re: Date/time formatting http://struts.apache.org/2.1.6/docs/formatting-dates-and-numbers.html Jon Pearson schrieb: Right, but I don't want to specify the format explicitely, since it should depend on the localization of the browser. But when I don't specify it, I don't get the time included in the output. Is there a way to get both? -Original Message- From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Wednesday, May 06, 2009 2:20 PM To: Struts Users Mailing List Subject: RE: Date/time formatting you can also use the Struts date tag %...@taglib prefix=s uri=/struts-tags % s:date name=person.birthday format=dd/MM/ / if no format is specified format defaults to DateFormat.MEDIUM (in US = MMM d, )http://struts.apache.org/2.0.14/docs/date.html HTH Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. 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. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 6 May 2009 14:04:33 -0400 From: terry.gard...@sun.com Subject: Re: Date/time formatting To: user@struts.apache.org java.text.SimpleDateFormat formats a java.util.Date according to a locale and a patter specified by the client. On May 6, 2009, at 1:10 PM, Jon Pearson wrote: If I wanted to output a date/time value in the user's locale, is there a simple way to do that? I see there is a date tag which would be helpful for getting the date format correct without manually specifying it, but what about a similar time tag? Am I going to need to manually specify the standard date format as M/D/y h/mm/ss a for US English, and just require any translation to specify its own? Thanks, ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Hotmail® has ever-growing storage! Don't worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM _WL_HM_Tutorial_Storage1_052009 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- René Gielen IT-Neering.net Saarstrasse 100, 52062 Aachen, Germany Tel: +49-(0)241-4010770 Fax: +49-(0)241-4010771 http://twitter.com/rgielen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Date/time formatting
Nevermind, I was reading it wrong; when using those format strings, they belong in s:text ... tags, not in s:date Sorry, and thanks! -Original Message- From: Jon Pearson Sent: Friday, May 08, 2009 7:53 AM To: Struts Users Mailing List Subject: RE: Date/time formatting I've looked at that, but it doesn't explain when format.time is used. I can see that format.date gets used when formatting dates using the s:date ... tag, but since there is no s:time ... tag, when is format.time used? -Original Message- From: Rene Gielen [mailto:gie...@it-neering.net] Sent: Thursday, May 07, 2009 9:03 PM To: Struts Users Mailing List Subject: Re: Date/time formatting http://struts.apache.org/2.1.6/docs/formatting-dates-and-numbers.html Jon Pearson schrieb: Right, but I don't want to specify the format explicitely, since it should depend on the localization of the browser. But when I don't specify it, I don't get the time included in the output. Is there a way to get both? -Original Message- From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Wednesday, May 06, 2009 2:20 PM To: Struts Users Mailing List Subject: RE: Date/time formatting you can also use the Struts date tag %...@taglib prefix=s uri=/struts-tags % s:date name=person.birthday format=dd/MM/ / if no format is specified format defaults to DateFormat.MEDIUM (in US = MMM d, )http://struts.apache.org/2.0.14/docs/date.html HTH Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. 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. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 6 May 2009 14:04:33 -0400 From: terry.gard...@sun.com Subject: Re: Date/time formatting To: user@struts.apache.org java.text.SimpleDateFormat formats a java.util.Date according to a locale and a patter specified by the client. On May 6, 2009, at 1:10 PM, Jon Pearson wrote: If I wanted to output a date/time value in the user's locale, is there a simple way to do that? I see there is a date tag which would be helpful for getting the date format correct without manually specifying it, but what about a similar time tag? Am I going to need to manually specify the standard date format as M/D/y h/mm/ss a for US English, and just require any translation to specify its own? Thanks, ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Hotmail® has ever-growing storage! Don't worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM _WL_HM_Tutorial_Storage1_052009 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- René Gielen IT-Neering.net Saarstrasse 100, 52062 Aachen, Germany Tel: +49-(0)241-4010770 Fax: +49-(0)241-4010771 http://twitter.com/rgielen - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e
RE: Align issues in struts 2 UI atgs
If it's in a table, you need to place each of those elements in its own td. Here's a version of your code that could work like this: s:textfield name=username label=Username required=true/ s:password name=password label=Password maxlength=15 required=true/ tr tds:submit theme=simple value=Log in validate=true targets=loginDiv notifyTopics=/ajaxLogin//td tds:reset theme=simple value=clear//td /tr ~Jonathan -Original Message- From: Murugesh [mailto:muruges...@gmail.com] Sent: Friday, May 08, 2009 8:26 AM To: Struts Users Mailing List Subject: Re: Align issues in struts 2 UI atgs Thanks now it's getting in a row. but the new issue is its coming top of the other fields. like we have four fields s:textfield name=username label=Username required=true/ s:password name=password label=Password maxlength=15 required=true/ s:submit theme=simple align=left value=Log in validate=true targets=loginDiv notifyTopics=/ajaxLogin/ s:reset theme=simple align=right value=clear/ while running this code snippet , i will get both button on top of username field. please suggest me to get it down? On Fri, May 8, 2009 at 5:16 PM, Dave Newton newton.d...@yahoo.com wrote: Murugesh wrote: i have tried out but not getting the solution. i need two buttons in a row like s:submit/ s:reset../ please give me a correct way to implemnt to get output in a single row.. Use the simple theme? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Dynamic property names
Well, I didn't get any responses to this, but luckily I managed to figure it out from the OGNL documentation (http://www.opensymphony.com/ognl/html/LanguageGuide/basicExpressions.ht ml): Under the 'Expression Evaluation' section, it describes how you can write this: #variable(#object) And have OGNL interpret the result of the first expression (#variable) as another expression to evaluate, using the result of the parenthesized expression (#object) as the root object for that evaluation. So, if you have a property name in #variable, and you want to retrieve the value of the property with that name from the object #object, you can retrieve it by writing #variable(#object). Hope this is useful to others! ~Jonathan -Original Message- From: Jon Pearson Sent: Thursday, May 07, 2009 1:14 PM To: Struts Users Mailing List Subject: Dynamic property names I am trying to build out a table of values. I would like the user to be able to choose which columns are visible, and to re-order them (not interactively, on a separate page). My initial method for implementing this looks something like: User preferences: column title=i18n.property.prop1property1/column column title=i18n.property.prop2property2/column ... And then something like this for displaying: table tr s:iterator value=prefs ths:text name=content //th /s:iterator /tr s:iterator value=rows tr s:iterator value=prefs tds:property value=%{getAttribute('title')} //td /s:iterator /tr /s:iterator /table But I'm not sure how to do a double-indirection. %{getAttribute('title')} is going to return something like property1 or property2, but what I really want is to have OGNL go back out and retrieve the value associated with that name, as if I had typed 's:property value=property1 /'. Is there a way to do this? Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Dynamic property names
I am trying to build out a table of values. I would like the user to be able to choose which columns are visible, and to re-order them (not interactively, on a separate page). My initial method for implementing this looks something like: User preferences: column title=i18n.property.prop1property1/column column title=i18n.property.prop2property2/column ... And then something like this for displaying: table tr s:iterator value=prefs ths:text name=content //th /s:iterator /tr s:iterator value=rows tr s:iterator value=prefs tds:property value=%{getAttribute('title')} //td /s:iterator /tr /s:iterator /table But I'm not sure how to do a double-indirection. %{getAttribute('title')} is going to return something like property1 or property2, but what I really want is to have OGNL go back out and retrieve the value associated with that name, as if I had typed 's:property value=property1 /'. Is there a way to do this? Jonathan P. Pearson - Software Engineer -- SIXNET - Solutions for Your Industrial Networking Challenges 331 Ushers Road, Ballston Lake, NY 12019 Tel: 1.518.877.5173, Fax: 1.518.877.8346 www.sixnet.com - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Date/time formatting
If I wanted to output a date/time value in the user's locale, is there a simple way to do that? I see there is a date tag which would be helpful for getting the date format correct without manually specifying it, but what about a similar time tag? Am I going to need to manually specify the standard date format as M/D/y h/mm/ss a for US English, and just require any translation to specify its own? Thanks, ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Date/time formatting
Right, but I don't want to specify the format explicitely, since it should depend on the localization of the browser. But when I don't specify it, I don't get the time included in the output. Is there a way to get both? -Original Message- From: Martin Gainty [mailto:mgai...@hotmail.com] Sent: Wednesday, May 06, 2009 2:20 PM To: Struts Users Mailing List Subject: RE: Date/time formatting you can also use the Struts date tag %...@taglib prefix=s uri=/struts-tags % s:date name=person.birthday format=dd/MM/ / if no format is specified format defaults to DateFormat.MEDIUM (in US = MMM d, )http://struts.apache.org/2.0.14/docs/date.html HTH Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. 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. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 6 May 2009 14:04:33 -0400 From: terry.gard...@sun.com Subject: Re: Date/time formatting To: user@struts.apache.org java.text.SimpleDateFormat formats a java.util.Date according to a locale and a patter specified by the client. On May 6, 2009, at 1:10 PM, Jon Pearson wrote: If I wanted to output a date/time value in the user's locale, is there a simple way to do that? I see there is a date tag which would be helpful for getting the date format correct without manually specifying it, but what about a similar time tag? Am I going to need to manually specify the standard date format as M/D/y h/mm/ss a for US English, and just require any translation to specify its own? Thanks, ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Hotmail® has ever-growing storage! Don't worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM _WL_HM_Tutorial_Storage1_052009 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Radio button grouping in Struts 2
Hi all, I have a page which iterates over a collection of questions, with each question having a number of radio buttons which can be used to select the answer to that question. For example: Question 1: Unanswered O Yes O No O Question 2: Unanswered O Yes O No O etc.. If the question has already been answered previously when the pages loads then the appropriate Yes/No is selected; otherwise Unanswered is selected. I've got this working fine using the following: class Question { long id; String name; String answer; } class ViewQuestionsAction { ListQuestion questions; MapString,String answersMap; // key == value at the moment because didn't seem to work with int keys s:set name=answersMap value=%{answersMap}/ s:iterator value=questions s:property value=name/ s:radio name=%{id} value=%{answer} list=#answersMap/ /s:iterator I need the name=%{id} bit so that I can group the radio buttons per question. And this is the problem, because then I can't find a way for when you submit the form to receive an array of the selected buttons into the target action. The above works on page load (grouped nicely), but on submit I get all kinds of OGNL errors complaining about long id invalid expressions (understandable I guess). But when I choose a sensible name, for example: s:radio name=responses value=%{answer} list=#answersMap/ I get an array of selected buttons in the target action's responses property on submit but the radio grouping isn't working - you can only select on radio button from the whole page because they all share the same name element in the HTML. I then tried: s:radio id=ViewQuestions_responses name=%{id} value=%{answer} list=#answersMap/ To try and force struts to set the responses property, but it still tries to set the property from the name. Which makes me think: if struts always uses the name to set the property, and the browser always groups the radio buttons based on the same name, is what I'm trying to do even possible?!?! Any help gratefully received :) Many thanks James -- View this message in context: http://www.nabble.com/Radio-button-grouping-in-Struts-2-tp2336 5502p23365502.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org You could, instead of relying on Struts2 to automatically call the proper set* routines on submit, implement Preparable and manually parse the results in the prepare() function, which is called BEFORE any set* functions. ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: OGNL in HTML tags
I'm trying to colorize table rows in a JSP based on the result of a function call into the Action. Here's what I want to do: tr class=%{getStatus(deviceID)} ... /tr And have the function String getStatus(long deviceID) { ... } look up the status of a device and return a CSS class name (such as 'normal', 'warning', or 'error'). But OGNL doesn't execute in non-Struts2 tags... Is there a straightforward way to do this? At the moment, I'm thinking I need to implement my own tag library that will add a Struts2-like tr tag. tr class=s:property value=%{getStatus(deviceID)}/ Dave Thanks, that worked. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: OGNL in HTML tags
Dave Newton wrote: tr class=s:property value=%{getStatus(deviceID)}/ Minor addendum: IMO when iterating over a collection of model objects a status lookup like this would be a matter of querying the device, rather than providing a lookup based on the device ID. If device statuses need to be mapped to CSS classnames I'd pass the device itself to a utility translation method rather than forcing the translator to look up the device. This moves the generation of view-level data out of the device model, eliminates the need to look up a device that already exists as a model, and provides a measure of type safety (Java's OOP, after all). The utility class could be used as shown, or in a JSP-based custom tag, which can significantly clean up the view layer depending on your requirements and/or implementation. Dave I would like to do that, but if I have a Device object on the top of the value stack (or perhaps somewhere near the top), how would I grab that and pass it to the function? I just tried this and it didn't work: tr class=s:property value=%{getStatus([0])} / (after modifying the function to take a Device instead of an ID number). - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: OGNL in HTML tags
Dave Newton wrote: tr class=s:property value=%{getStatus(deviceID)}/ Minor addendum: IMO when iterating over a collection of model objects a status lookup like this would be a matter of querying the device, rather than providing a lookup based on the device ID. If device statuses need to be mapped to CSS classnames I'd pass the device itself to a utility translation method rather than forcing the translator to look up the device. This moves the generation of view-level data out of the device model, eliminates the need to look up a device that already exists as a model, and provides a measure of type safety (Java's OOP, after all). The utility class could be used as shown, or in a JSP-based custom tag, which can significantly clean up the view layer depending on your requirements and/or implementation. Dave I would like to do that, but if I have a Device object on the top of the value stack (or perhaps somewhere near the top), how would I grab that and pass it to the function? I just tried this and it didn't work: tr class=s:property value=%{getStatus([0])} / (after modifying the function to take a Device instead of an ID number). Nevermind, I figured it out: s:iterator value=devices var=dev tr class=s:property value=%{getStatus(#dev)} / ... /tr /s:iterator Thanks for your suggestion! ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
OGNL in HTML tags
I'm trying to colorize table rows in a JSP based on the result of a function call into the Action. Here's what I want to do: tr class=%{getStatus(deviceID)} ... /tr And have the function String getStatus(long deviceID) { ... } look up the status of a device and return a CSS class name (such as 'normal', 'warning', or 'error'). But OGNL doesn't execute in non-Struts2 tags... Is there a straightforward way to do this? At the moment, I'm thinking I need to implement my own tag library that will add a Struts2-like tr tag. Thanks! ~Jonathan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org