Re: S2: Use of s:if tag
Are you sure it's not shown in the mailing list? Most likely it's gmail that filters out your own messages sent to mailing lists. Check this URL: http://news.gmane.org/gmane.comp.jakarta.struts.user to see the original list state. Regards Dariusz Wojtas On 4/2/07, Jae K <[EMAIL PROTECTED]> wrote: This is unrelated to this thread, i'm sorry but I have no choice. I asked a question on this thread this morning (5 hours ago) but the post still hasn't shown up on [EMAIL PROTECTED] Does it usually take so long for a new thread to show up? - Jae - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Datetimepicker not working on non-English?
I am using it with PL locale, but I needed to add another property: displayFormat="-MM-dd" regards Dariusz Wojtas On 3/14/07, Petr Blahos <[EMAIL PROTECTED]> wrote: Hi all, I have got the impression that datetimepicker, when picking the date, does not work in non-English localization. You can easily reproduce this one when opening showcase and adding ?request_locale=de to the location bar. Then browse to CRUD-->List available employees--> choose an employee, try picking a date and press submit. I get a validation error - Invalid field value for field "currentEmployee.birthDate". Has anyone got any success with datetimepicker and non-English locale? I am using struts2-2.0.6. Thanks, Petr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ParametersInterceptor Error
What is the type of 'field1'? Is it's String representation passed from the form compatible with what the data type converter expects? I have seen problems like this for properties of type java.util.Date and locale on the server machine different that EN. SImilar problems with Double/Float and non default comma separator. You may try to use custom data converters here. regards Dariusz Wojtas On 3/5/07, sfali <[EMAIL PROTECTED]> wrote: Hi All, I have following scenario: In my Action I set my pojo bean with some values and sets this bean into session. On the next page I displays these values in a form by <s:textfield name="field1" value="%{#sesssion.mypojo.field1}"/>, when I am submitting the form I am geting following error: ERROR [com.opensymphony.xwork2.interceptor.ParametersInterceptor] ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'field1' with value '[Ljava.lang.String;@1d15d1c'. Any Idea what is going wrong? and how to fix it. I am using Struts 2.0.6. Thanks in advance. Regards Syed Ali -- View this message in context: http://www.nabble.com/ParametersInterceptor-Error-tf3351752.html#a9320645 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can actions have paths?
try this: /top/Login.jsp with URL: https://tweb.retcgroup.com/thymeleweb/top/Login.action It is 'namespace' that gives you action prefix in the URL. Regards Dariusz Wojtas On 2/26/07, Neil Aggarwal <[EMAIL PROTECTED]> wrote: Hello: I have this struts.xml: http://struts.apache.org/dtds/struts-2.0.dtd";> /top/Login.jsp When I go to the url https://tweb.retcgroup.com/thymeleweb/Login.action it loads fine. I changed my action to be: /top/Login.jsp Now, when I visit the url: https://tweb.retcgroup.com/thymeleweb/top/Login.action I get this error: There is no Action mapped for action name Login. - [unknown location] com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 86) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct ionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:497) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav a:421) Can actions have paths or are they completely flat? Thanks, Neil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What to use instead of tiles in Struts2?
If Tiles is problematical - try Sitemesh. It will take few hours to learn it and configure (when you do it for the 2nd time - it takes 30 minutes). I use it without problems with S2. I used Tiles in the past, after finding Sitemesh about a year ago I would never switch back to Tiles. Maybe if produced pages would be 100KB+, but that is quite rare case I think. Regards Dariusz Wojtas On 2/26/07, Neil Aggarwal <[EMAIL PROTECTED]> wrote: Hello: The tiles plugin for struts2 is labeled experimental. Is there another way of doing similar functionality on struts2? Thanks, Neil -- Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Struts 2.0.6 questions
Hi, I've been hapily using Struts for some time, most recently the 2.0.5 snapshot. Today I downloaded 2.0.6GA, and that raises a question: * where did the struts2-api.jar go? Are it's interfaces/classes still in use? What interfaces to use now if 'Validatable' and others are not present? Also the main download page [http://struts.apache.org/download.cgi#struts206] lists downloadable zips and gives info about them. Info about the full distribution [struts-2.0.6-all.zip] says it is of size 43 MB, while the actual size is 86MB Regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] doubt working with dates in brazilian format (dd/MM/yyyy)
Hi Daniel, Maybe this will help. You may create converters for any type. Here is one I use for dates. You also need to put 'xwork-conversion.properties' file in classpath, something like: java.util.Date=aaa.utils.typeconverter.DateConverter And the converter class: public class DateConverter extends DefaultTypeConverter { public static final String DATE_FORMAT = "-MM-dd"; @Override public Object convertValue(Map ctx, Object o, Class toType) { if (toType == Date.class) { String val = ((String[]) o)[0]; if (val != null && val.length() > 0) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); try { return sdf.parse(val); } catch (Exception e) { System.out.println("Problem z konwersja daty: " + val + ", " + e.getMessage()); } } } else if (toType == String.class) { return o.toString(); } return null; } } Regards Dariusz Wojtas On 2/24/07, Daniel Amadei <[EMAIL PROTECTED]> wrote: Hi All, I'm working with dates but I'm not able to convert dates to be displayed automatically using the brazilian format (e. g. dd/MM/). Also I'd like to know how to validate my dates using this format and not the standard. If somebody could point me to the docs where I can find some info about those 2 items it would be great! BTW: I`m not using the datetimepicker. Thanks, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IS struts 2 websphere compatible?
Yes, you can use it with Websphere and it's Java 1.4 It worked for me. Look here: http://people.apache.org/builds/struts/nightlies/2.0.x/java-1.4/backport/ http://people.apache.org/builds/struts/nightlies/2.0.x/java-1.4/backport/S2-FOR-J4-README.txt Regards Dariusz Wojtas On 2/17/07, Praveen, Galagali (IE10) <[EMAIL PROTECTED]> wrote: Hi, If struts2 needs jdk version 5 and if websphere 5.x or 6.x is not compatible with jdk 1.5 can we still use struts 2 for our application and still get it work fine ? Thanks, Praveen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:textfield tag breaking line in page
It generates 2 cell row + optional error message for field if parent form is of theme 'xhtml' or 'ajax'. You may override cild behaviour by setting theme 'simple' on a single tag. regards Dariusz Wojtas On 2/7/07, Daniel Amadei <[EMAIL PROTECTED]> wrote: Hi All, I`m using the tags textfield and password and I noticed it is creating a new element which positions the fields vertically. I need them horizontally, so I`d like struts just to create the tag for me, nothing more. How can this be done? Thanks, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
I checked it against struts2-showcase build fresh on s2 trunk. After build I replaced xwork 2.0 with my snapshot xwork 201. I cleaned tomcat (5.5) work & temp dirs before running it. Did not work. Params fetched with the DataTamper plugin for FF Content-Disposition: form-data; name="dojo.birthday" 1910-10-07 Content-Disposition: form-data; name="birthday" 10/10/07 2007-02-07 21:47:55,328 ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:198) - ParametersInterceptor - [setParameters]: Une xpected Exception catched: Error setting expression 'birthday' with value '[Ljava.lang.String;@d134d0' Using Java 6,win xp Regards Dariusz Wojtas On 2/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: It seems to be submitting the value on the right format, so the problem is somewhere else (i18?). Does the UI tags example in showcase works for you? It has a date field, which it prints when the form is submitted. thanks musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
I have created issue WW-1717 describing the problem of logging values by the parameters interceptor. Regards Dariusz Wojtas On 2/7/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: Hi Musachy, I compiled the latest xwork 2.0.1 snapshot. I used S2.0.5 snapshot (last weekend) and today's xwork 2.0.1 snapshot. I have double checked if I use correct JAR files. The problem is still there. Exactly the same symptoms. Date is not set, property is null: And I get the same error on the console: 19:55:00,984 ERROR - ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'myDateProperty' with value '[Ljava.lang.String;@6d4f30' If I uncomment my custom Date converter in xwork-conversion.properties then it works. One extra question. Can the interceptor be modified to check if the parameter is an array (We both know it is at this point), and print at least the 1st element from the array? Dummy toString from array is almost useless. Something like Error setting expression 'myDateProperty' with value ['<1st val>', ] Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
No problem, here is the pair I get for this property. I get such pair for each Date prop. myDateProperty=2007-02-07 dojo.myDateProperty=2007-02-07 Regards Dariusz Wojtas On 2/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Can you find out what is the value that is being submitted? FF plugin "Tamper Data" is handy for this. The other thing is that the datepicker is the only one working right now, the timepicker is broken (doesn't use RFC 3339). I think you are using datepicker, but I just wanted to make sure :) thanks musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
Hi Musachy, I compiled the latest xwork 2.0.1 snapshot. I used S2.0.5 snapshot (last weekend) and today's xwork 2.0.1 snapshot. I have double checked if I use correct JAR files. The problem is still there. Exactly the same symptoms. Date is not set, property is null: And I get the same error on the console: 19:55:00,984 ERROR - ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'myDateProperty' with value '[Ljava.lang.String;@6d4f30' If I uncomment my custom Date converter in xwork-conversion.properties then it works. One extra question. Can the interceptor be modified to check if the parameter is an array (We both know it is at this point), and print at least the 1st element from the array? Dummy toString from array is almost useless. Something like Error setting expression 'myDateProperty' with value ['<1st val>', ] Best regards Dariusz Wojtas On 2/6/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I got the same error on 1.6, but it works on 1.5. thanks musachy Dariusz Wojtas wrote: > Hi Musachy, > > I have problems with compiling xwork from SVN. A fresh copy. > I am using JDK 1.6, maybe this is the reason. > > mvn clean install > > produces after some time > > [ERROR] BUILD FAILURE > [INFO] > > [INFO] Compilation failure > > c:\projects\xwork\src\java\com\opensymphony\xwork2\inject\ContainerImpl.java:[334,50] > > incompatible types > found : java.lang.reflect.Constructor > required: java.lang.reflect.Constructor > > Can you share a copy of xwork or point to some nightly build? > > Regards > Dariusz Wojtas > > On 2/5/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> The patch was already committed to xwork by Phil. You just need to >> update and recompile. >> >> thanks >> musachy >> >> Dariusz Wojtas wrote: >> > ok, I surely will try this patch - somewhen later this week. >> > I will inform you about the results. >> > >> > Thanks for quick response. >> > >> > Best regards >> > Dariusz Wojtas >> > >> > On 2/5/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> >> Hi Dariousz >> >> >> >> I recently sent a patch for XWork to parse dates on RFC 3339 format >> >> (which the datepicker uses): >> >> >> >> https://issues.apache.org/struts/browse/WW-1643 >> >> >> >> Can you recompile xwork and try? >> >> >> >> musachy >> >> >> >> >> >> Dariusz Wojtas wrote: >> >> > Hi, >> >> > >> >> > I have been reporting some problems with conversion at the >> beginning >> >> > of the year. >> >> > There were problems with conversion when some actions/pages were >> >> > invoked from the Opera browser. A bit strange but that's how it >> was. >> >> > >> >> > Now I tried Opera again and I found a case in which some code fails >> >> > under Opera (9.0.2) but works perfectly under FF and IE. >> >> > >> >> > > >> > label="My Date Label"/> >> >> > >> >> > My action defines a property of type java.util.Date >> >> > I select some date in my form, submit it (2007-02-05) and the >> date is >> >> > set in the action when called from IE or FF, but it is still >> null when >> >> > invoked from Opera. >> >> > I only can see some log: >> >> > >> >> > 20:31:15,718 ERROR - ParametersInterceptor - >> >> > ParametersInterceptor - [setParameters]: Unexpected Exception >> catched: >> >> > Error setting expression 'myDateProperty with value >> >> > '[Ljava.lang.String;@1bd06a0' >> >> > >> >> > >> >> > I defined a custom date converter (I already have to use converters >> >> > for float and double, doesn't work without them - commas vs >> dots) and >> >> > it started to work. >> >> > >> >> > Is there any way to have a better, out of the box solution? >> >> > I believe this may be something with the locale, but cant be sure. >> >> > I do not play with locale in my app. >> >> > >> >> > I use a standard widget (which works nicely) but it fails in some >> >> > environments. >> >> > Now I found the reason, I found some solution - works for me - but >> >> > this shows some general problem. >> >> > >> >> > This email is rather not a question for help, but info about some >> >> > problem. >> >> > >> >> > Best regards >> >> > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
Hi Musachy, I have problems with compiling xwork from SVN. A fresh copy. I am using JDK 1.6, maybe this is the reason. mvn clean install produces after some time [ERROR] BUILD FAILURE [INFO] [INFO] Compilation failure c:\projects\xwork\src\java\com\opensymphony\xwork2\inject\ContainerImpl.java:[334,50] incompatible types found : java.lang.reflect.Constructor required: java.lang.reflect.Constructor Can you share a copy of xwork or point to some nightly build? Regards Dariusz Wojtas On 2/5/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: The patch was already committed to xwork by Phil. You just need to update and recompile. thanks musachy Dariusz Wojtas wrote: > ok, I surely will try this patch - somewhen later this week. > I will inform you about the results. > > Thanks for quick response. > > Best regards > Dariusz Wojtas > > On 2/5/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> Hi Dariousz >> >> I recently sent a patch for XWork to parse dates on RFC 3339 format >> (which the datepicker uses): >> >> https://issues.apache.org/struts/browse/WW-1643 >> >> Can you recompile xwork and try? >> >> musachy >> >> >> Dariusz Wojtas wrote: >> > Hi, >> > >> > I have been reporting some problems with conversion at the beginning >> > of the year. >> > There were problems with conversion when some actions/pages were >> > invoked from the Opera browser. A bit strange but that's how it was. >> > >> > Now I tried Opera again and I found a case in which some code fails >> > under Opera (9.0.2) but works perfectly under FF and IE. >> > >> > > > label="My Date Label"/> >> > >> > My action defines a property of type java.util.Date >> > I select some date in my form, submit it (2007-02-05) and the date is >> > set in the action when called from IE or FF, but it is still null when >> > invoked from Opera. >> > I only can see some log: >> > >> > 20:31:15,718 ERROR - ParametersInterceptor - >> > ParametersInterceptor - [setParameters]: Unexpected Exception catched: >> > Error setting expression 'myDateProperty with value >> > '[Ljava.lang.String;@1bd06a0' >> > >> > >> > I defined a custom date converter (I already have to use converters >> > for float and double, doesn't work without them - commas vs dots) and >> > it started to work. >> > >> > Is there any way to have a better, out of the box solution? >> > I believe this may be something with the locale, but cant be sure. >> > I do not play with locale in my app. >> > >> > I use a standard widget (which works nicely) but it fails in some >> > environments. >> > Now I found the reason, I found some solution - works for me - but >> > this shows some general problem. >> > >> > This email is rather not a question for help, but info about some >> > problem. >> > >> > Best regards >> > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] datetimepicker and dates
ok, I surely will try this patch - somewhen later this week. I will inform you about the results. Thanks for quick response. Best regards Dariusz Wojtas On 2/5/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Hi Dariousz I recently sent a patch for XWork to parse dates on RFC 3339 format (which the datepicker uses): https://issues.apache.org/struts/browse/WW-1643 Can you recompile xwork and try? musachy Dariusz Wojtas wrote: > Hi, > > I have been reporting some problems with conversion at the beginning > of the year. > There were problems with conversion when some actions/pages were > invoked from the Opera browser. A bit strange but that's how it was. > > Now I tried Opera again and I found a case in which some code fails > under Opera (9.0.2) but works perfectly under FF and IE. > > label="My Date Label"/> > > My action defines a property of type java.util.Date > I select some date in my form, submit it (2007-02-05) and the date is > set in the action when called from IE or FF, but it is still null when > invoked from Opera. > I only can see some log: > > 20:31:15,718 ERROR - ParametersInterceptor - > ParametersInterceptor - [setParameters]: Unexpected Exception catched: > Error setting expression 'myDateProperty with value > '[Ljava.lang.String;@1bd06a0' > > > I defined a custom date converter (I already have to use converters > for float and double, doesn't work without them - commas vs dots) and > it started to work. > > Is there any way to have a better, out of the box solution? > I believe this may be something with the locale, but cant be sure. > I do not play with locale in my app. > > I use a standard widget (which works nicely) but it fails in some > environments. > Now I found the reason, I found some solution - works for me - but > this shows some general problem. > > This email is rather not a question for help, but info about some > problem. > > Best regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] datetimepicker and dates
Hi, I have been reporting some problems with conversion at the beginning of the year. There were problems with conversion when some actions/pages were invoked from the Opera browser. A bit strange but that's how it was. Now I tried Opera again and I found a case in which some code fails under Opera (9.0.2) but works perfectly under FF and IE. My action defines a property of type java.util.Date I select some date in my form, submit it (2007-02-05) and the date is set in the action when called from IE or FF, but it is still null when invoked from Opera. I only can see some log: 20:31:15,718 ERROR - ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'myDateProperty with value '[Ljava.lang.String;@1bd06a0' I defined a custom date converter (I already have to use converters for float and double, doesn't work without them - commas vs dots) and it started to work. Is there any way to have a better, out of the box solution? I believe this may be something with the locale, but cant be sure. I do not play with locale in my app. I use a standard widget (which works nicely) but it fails in some environments. Now I found the reason, I found some solution - works for me - but this shows some general problem. This email is rather not a question for help, but info about some problem. Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Autopopupation of fields fails with
I cannot say much more than this: http://jakarta.apache.org/commons/fileupload/faq.html I believe that if you are using standard S2 components, then everything should work as expected - the order of interceptors is important here. Regards Dariusz Wojtas On 2/5/07, bob <[EMAIL PROTECTED]> wrote: > check if you have any custom filter in front of your action - > themultipart parser requires a 'virgin' request object, without > accessingany params in it prior to multiparse analysis. Could you say more about this? Does this mean that if I'm using the prepare interceptor / interface ahead of the multi-part interceptor that I will botch the multi-part if I touch ANY of the params? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Autopopupation of fields fails with "enctype="multipart/form-data" in form
Hi Zafer, I would: 1) check the archives of this mailing list from the last 2 weeks, there was a thread about fileupload issues (parameters are not always set from such form). One of the hints was to use some magical filter in front of the application. It is supposed to clear sth. 2) check if you have any custom filter in front of your action - the multipart parser requires a 'virgin' request object, without accessing any params in it prior to multiparse analysis. If you try to operate on the request earlier - multiparser is not able to finish his task. regards Dariusz Wojtas On 2/4/07, zafer Mohamed <[EMAIL PROTECTED]> wrote: I have a form with the enctype set to "enctype="multipart/form-data" as I am uploading a file, the form also contains some other fields. On submission the autopopulation of other fields fails, but it works correctly if I remove the enctype="multipart/form-data". Any idea..? Thanks Zafer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using latest snapshots and getting a xwork error
Try xwork 2.0 final. It was released this month and struts2 is compiled against the final release now. Regards Dariusz Wojtas On 1/31/07, Gonçalo Luiz <[EMAIL PROTECTED]> wrote: Hello, After upgrading my lib directory to have the following jars: tiles-api-2.0-r488734-SNAPSHOT tiles-core-2.0-r488734-SNAPSHOT struts2-tiles-plugin-2.0.5-SNAPSHOT-20070131 struts2-core-2.0.5-SNAPSHOT-20070131 struts2-api-2.0.5-SNAPSHOT-20070131 I get the error I attached in the end of this message. I guess I need to upgrade the xwork jar as well, but I cannot find the latest snapshot (i'm using the one that came with struts 2.0.1 distribution that is xwork-2.0-beta-1 Can anybody help me please? Best Regards, Gonçalo Luiz. SEVERE: Exception starting filter struts2 java.lang.NoSuchMethodError: com.opensymphony.xwork2.config.ConfigurationManager.(Ljava/lang/String;)V at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:443) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:274) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:396) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:107) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:515) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1220) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1398) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:816) at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445) at java.lang.Thread.run(Thread.java:619) -- Gonçalo Luiz
Re: [s2] file upload causing param problems
I had similar problems with fileupload last weekend. At first I thought that it could be caused by a filter that I have in front of my app - prints the URI and all params to the console - does the processing before analising multipart data. But I modified the filter to get/print that info after processing the action. I even disabled the filter - it did not fix it. I had no exceptions. The params were just not set. Now it seems to work but I am really not sure what exactly fixed the issue. I am using the default config, commons-upload with S2.0.4. Dariusz Wojtas On 1/30/07, bob <[EMAIL PROTECTED]> wrote: Hi. I am having some strange problems when using the file upload interceptor. When I use the file upload, I experience an extremely erratic behaviour where sometimes my request params get set on my action and sometimes they do not. All params from my form are either there or not there; this means that when they make it through to my action, its all of them -- both the non file upload related ones as well as the File itself. Anyone else seeing this? I removed the file upload part and the transfer of params works perfectly, so its something there. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] Cannot create a session after the response has been committed: struts or tomcat ?
I usually get IllegalStateException exceptions with Struts2 if there was an unexpected exception in my code, ie. from Hibernate. I can see Hibernate in your stack, are you sure this is not the reason of your problems? Is this the full stacktrace? Dariusz Wojtas On 1/29/07, bob <[EMAIL PROTECTED]> wrote: I'm getting the following error with every request. I can't figure out what it means. I've looked around and tried to read the request myself, but I'm just starting to learn Struts2 so its not the meaningful to me yet. I don't even know whether this is a tomcat problem or a struts2 problem. Note: Even though the first line says could not execute action, the actions do usually execute . . . where's this error message coming from? It anyone can give me some insight, I'd certainly appreciate it. Thanks, Bob 04:17:13,333 ERROR Dispatcher:341 - Could not execute action java.lang.IllegalStateException: Cannot create a session after the response has been committed at org.apache.catalina.connector.Request.doGetSession(Request.java:2214) at org.apache.catalina.connector.Request.getSession(Request.java:2024) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831) at org.apache.struts2.dispatcher.SessionMap.put(SessionMap.java:172) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.intercept(PrepareInterceptor.java:115) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:156) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:124) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:180) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:200) at org.apache.struts2.impl.StrutsActionProxy$1.call(StrutsActionProxy.java:27) at org.apache.struts2.impl.StrutsActionProxy$1.call(StrutsActionProxy.java:26) at org.apache.struts2.impl.RequestContextImpl.callInContext(RequestContextImpl.java:152) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:25) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:330) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:256) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.blackdog.struts.filter.HibernateSessionRequestFilter.doFilter(HibernateSessionRequestFilter.java:31) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at
Re: s:datetimepicker not working
Look at the link I have given you :) http://people.apache.org/builds/struts/nightlies/2.0.x/ These are the nightly builds for Struts 2. Download struts core, struts api + the plugins you need - only a set from the last day. Alternatively checkout the sources from the repository and make a build yourself. Look into wiki for details on this topic. Dariusz Wojtas On 1/28/07, xiao jie <[EMAIL PROTECTED]> wrote: hi: I am using struts 2 2.0.1 but how do I update it to 2.0.4? thanks a lot. Pam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:datetimepicker not working
Which version of S2 are you using? There were changes in this area in the last month. You need to use 2.0.3, or preferably 2.0.4 to use it this way http://people.apache.org/builds/struts/nightlies/2.0.x/ Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Putting a single html input type="text"
If you use theme 'ajax' (eg. textfield nested within form with theme='ajax') then it will generate a row with 2 cells, one with label, one with the input field. The bonus of 'ajax' is that it automatically generates validation error mesage on the field level - if there were validation errors. Look at the 'core' jar for templates. Different themes may generate different output for tags. Dariusz Wojtas On 1/28/07, Omer Basar <[EMAIL PROTECTED]> wrote: Thanks Dave. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] What is the preferred way of exception handling (error 500 and similar)?
Hi, What is the suggested way of exception handling in Struts2? I am talking about cases when there is a * JSP page compilation error * exception inside an action is * someone types url /i.action instead of /index.action ... I tried to turn 'struts.devMode' to true and false. I tried to declare error page in web.xml but I still see error 500 mesage in tomcat (5.5.x) result. Can I declare some global error page in Struts2? Or do I have to use some interceptor? Or what? If this matters I am using sitemesh with it. I am using one of S 2.0.4 snapshots. Regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] To struts2 comitters, please include WW-1570 in 2.0.4
Hello, Issue WW-1570 itself is 'just' an improvement, but since yesterday we know that solution for issue WW-1665 depends heavily on it. Can WW-1570 get a higher priority and be included in 2.0.4? It 'only' adds some property to some ajax tags, and does not hurt. Plase :) Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
Hmmm, if this is so black-magic then who knows if you can still reproduce it tomorrow? What if IE dies in 'some other way'? Thanks for the info, the hope is back :) Best regards Dariusz Wojtas On 1/24/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: With your latest jsp file I was able to reproduce the problem. Here is were it gets Microsoft-black-magic-style. I did something, not sure what, and it then started to work. I killed the "explorer" process, and start it again, and was able to reproduce it again, looks like a though one :) regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 and JDK 1.4
I tried it last week with Websphere 6.0 (jdk 1.4.2) using retrotranslator - with success. The app was a portlet. There were problems with JARs found in the nightly builds (compiled with retro 1.10), but it started to work when I processed the JARs (xwork + struts) with retro 1.20 and option '-advanced' (fails in runtime if this option was not used). Dariusz Wojtas On 1/24/07, Ted Husted <[EMAIL PROTECTED]> wrote: On 1/22/07, Dave Newton <[EMAIL PROTECTED]> wrote: > As was pointed out you may need to run retro with the -advanced (?) > option so it will properly skirt the ThreadLocal.remove method. Any other tips, Dave? Has anyone tried Retotranslater as an alternative? * http://retrotranslator.sourceforge.net/ -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] adding an attribute to ajax link tag
Try using indicator. It is shown in the showcase app. The indicator image can also be found in the showcase app. Edit Dariusz Wojtas On 1/22/07, Jeffrey Hau <[EMAIL PROTECTED]> wrote: Hi, there is a loadingText atrribute for the ajax link tag, is there anyway for me to dispaly an image? do I need to extend the current link tag to do this? If so, can someone point me in the rite direction on how to extend tags, i can't seem to find any related tutorials or guides on the project website. many thanks, Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
Hi Musachy, One more word on the struts version. Because I was afraid I could break sth with the build, I have just downloaded a fresh set of JAR files from: http://people.apache.org/builds/struts/nightlies/2.0.x/ and used them (dated 19-Jan-2007). the same files are not found (404), the same issues under IE Thanks Dariusz Wojtas On 1/21/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: Hi Musachy, I have created an issue WW-1665 and attached 2 files Index.jsp and target.jsp. Place these files in 1 dir and open index.jsp. try to submit data, and switch the 'targets' attribute to point to different DIVs. I also get some javascript errors in IE - most likely something is not found: Could not load widget 'dojo.widget.html.Tooltip' last tried '__package__.js' Using struts 2.0.4 snapshot made 12 hours ago. These are requests logged by my filter when I open index.jsp on a fresh IE (reload with SHIFT after clearing browsers cache). /esu is my app prefix: /esu/ajax/index.jsp /esu/struts/xhtml/styles.css /esu/struts/dojo/dojo.js /esu/struts/dojo/src/browser_debug.js /esu/struts/dojo/src/debug.js /esu/struts/simple/dojoRequire.js /esu/struts/ajax/dojoRequire.js /esu/struts/CommonFunctions.js /esu/struts/dojo/src/widget/html/Tooltip.js /esu/struts/dojo/src/widget/html.js /esu/struts/dojo/src/widget.js /esu/struts/dojo/src/__package__.js /esu/struts/dojo/src.js /esu/struts/dojo/__package__.js It all works under FF 2.0 But I also get some 404s under FF: GET http://localhost:8080/esu/struts/dojo/src/widget/html/Tooltip.js GET http://localhost:8080/esu/struts/dojo/src/widget/html.js GET http://localhost:8080/esu/struts/dojo/src/widget.js GET http://localhost:8080/esu/struts/dojo/src/__package__.js GET http://localhost:8080/esu/struts/dojo/src.js GET http://localhost:8080/esu/struts/dojo/__package__.js Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js' [Break on this error] throw _13||Error(_12); Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
Hi Musachy, I have created an issue WW-1665 and attached 2 files Index.jsp and target.jsp. Place these files in 1 dir and open index.jsp. try to submit data, and switch the 'targets' attribute to point to different DIVs. I also get some javascript errors in IE - most likely something is not found: Could not load widget 'dojo.widget.html.Tooltip' last tried '__package__.js' Using struts 2.0.4 snapshot made 12 hours ago. These are requests logged by my filter when I open index.jsp on a fresh IE (reload with SHIFT after clearing browsers cache). /esu is my app prefix: /esu/ajax/index.jsp /esu/struts/xhtml/styles.css /esu/struts/dojo/dojo.js /esu/struts/dojo/src/browser_debug.js /esu/struts/dojo/src/debug.js /esu/struts/simple/dojoRequire.js /esu/struts/ajax/dojoRequire.js /esu/struts/CommonFunctions.js /esu/struts/dojo/src/widget/html/Tooltip.js /esu/struts/dojo/src/widget/html.js /esu/struts/dojo/src/widget.js /esu/struts/dojo/src/__package__.js /esu/struts/dojo/src.js /esu/struts/dojo/__package__.js It all works under FF 2.0 But I also get some 404s under FF: GET http://localhost:8080/esu/struts/dojo/src/widget/html/Tooltip.js GET http://localhost:8080/esu/struts/dojo/src/widget/html.js GET http://localhost:8080/esu/struts/dojo/src/widget.js GET http://localhost:8080/esu/struts/dojo/src/__package__.js GET http://localhost:8080/esu/struts/dojo/src.js GET http://localhost:8080/esu/struts/dojo/__package__.js Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js' [Break on this error] throw _13||Error(_12); Best regards Dariusz Wojtas On 1/21/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: I will try to send it in 30 minutes. I will try to separate some part of my app into 2 JSPs. I hope it shows the issue. Dariusz Wojtas On 1/20/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: > I tried to replicate this, so I added this to index.jsp on showcase > under apps/showcase/src/main/webapp/ajax/remotelink: > > > > > Try > > > > but it works on both IE 6 and FF 2. The anchor and the button share the > same javascript code, so they should behave the same. They can be used > inside a form, in which case they will submit the parent form or outside > a form, using "formId". Adding theme="ajax" to the form should make no > difference on this case. Can you try the above example and let me know > if it works? > > thanks > musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
I will try to send it in 30 minutes. I will try to separate some part of my app into 2 JSPs. I hope it shows the issue. Dariusz Wojtas On 1/20/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I tried to replicate this, so I added this to index.jsp on showcase under apps/showcase/src/main/webapp/ajax/remotelink: Try but it works on both IE 6 and FF 2. The anchor and the button share the same javascript code, so they should behave the same. They can be used inside a form, in which case they will submit the parent form or outside a form, using "formId". Adding theme="ajax" to the form should make no difference on this case. Can you try the above example and let me know if it works? thanks musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
Hi Musachy, Your question to prepare some test form/page gave some results. My problem was that I had problems submitting remote forms. Submitting with a button had problems, then I tried to submit it with the element. And it worked in FF but not in IE. But I found something interesting after long testing :) Some pseudocode below: Save IE 6 In this case makes request to '/app/namespace/my.action' ut does not attach params. If I switch targets attribute to point to the second div - then it works and passes params The only difference that I see is that it is not it's parent div. Under FF it works in both cases. Is there any special reason of this behaviour? Can it be fixed? Now I can easily make workarounds - now I know the reason of failures, but can it be fixed? Or this is some bug in IE? Or maybe this is not allowed? In fact what I tried is that the 'myParentDiv' element is of type and the form is loaded by the browser in a separate request. But I tried to make both div elements to be declared with that preload their contents. It still works only if the target is not the parent div but the other div. Best Regards Dariusz Wojtas On 1/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Can you create a ticket with the scenarios that do not work? I'll probably have time to go over it on the weekend. thanks musachy Dariusz Wojtas wrote: > Hi Musachy, > > This is probably lack of precision from my side. > Saying "ajax forms" I thought about remote forms. > > Even having them working with inputs of type submit/image only (no > anchors) - just to have one method of submission that works in all > cases. Currently there are problems with both: anchor and input button > submission. > > At least one submission method that works with remote forms in all > scenarios > > Best regards > Dariusz Wojtas > > > On 1/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> I think the problem is only with files right? On showcase there are >> several examples (not the remoting forms), like on the div, anchor, and >> button page which work. >> >> regards >> musachy >> >> Dariusz Wojtas wrote: >> > Hi, >> > >> > Does the current form submission come from a problem in dojo? >> > Or is this something else? >> > What are the current conclusions about it? >> > >> > I do not want to be too annoying, this is just important for me. >> > Any chance to have it working within a week or two? >> > >> > Best regards >> > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Any hope to have ajax form submission working?
Hi Musachy, This is probably lack of precision from my side. Saying "ajax forms" I thought about remote forms. Even having them working with inputs of type submit/image only (no anchors) - just to have one method of submission that works in all cases. Currently there are problems with both: anchor and input button submission. At least one submission method that works with remote forms in all scenarios Best regards Dariusz Wojtas On 1/17/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I think the problem is only with files right? On showcase there are several examples (not the remoting forms), like on the div, anchor, and button page which work. regards musachy Dariusz Wojtas wrote: > Hi, > > Does the current form submission come from a problem in dojo? > Or is this something else? > What are the current conclusions about it? > > I do not want to be too annoying, this is just important for me. > Any chance to have it working within a week or two? > > Best regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Any hope to have ajax form submission working?
Hi, Does the current form submission come from a problem in dojo? Or is this something else? What are the current conclusions about it? I do not want to be too annoying, this is just important for me. Any chance to have it working within a week or two? Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Ajax form and file submission with s:a
Thanks for the tips. Looks like string is the only option for now with timepicker. It's not a serious issue once you understand the limitation. Most of the issues that were really hurting me are gone. The most important issue is now the remote form submission problem ... Even simple remote forms have problems with param passing. I had no ajax background before, but when I understood how useful this is - I started to love it. Observing how JIRA issues are shuffled around I can make some conclusions about the GA. Any chance to have this fixed before? If this was only about Java code - I could try to fix something myself, propose something. But with Javascript ... I can't do much. Dariusz Wojtas On 1/15/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Sorry for the name misspelling :) musachy Musachy Barroso wrote: > Dariouz > > There are two problems with the time picker tag, one is that xwork > doesn't support dates in RFC3399 format (only the SHORT, MEDIUM and > LONG from DateFormat), for that I attached a patch here: > > https://issues.apache.org/struts/browse/WW-1643 > > xwork was just released, so I don't think this will get applied > anytime soon. The other problem is the Dojo widget DropDownTimePicker > which is broken, here is the tracking issue: > > http://trac.dojotoolkit.org/ticket/1677 > > I attached a patch with the explanation to: > > https://issues.apache.org/struts/browse/WW-1644 > > As a workaround, while this gets sorted out, use "String" for your > date field. > > musachy > > Dariusz Wojtas wrote: >> Musachy! >> >> I must have been blind (no wine today). >> I checked again the datetimepicker in the ajax form - but I can >> clearly see that it nicely generates a table row with 2 columns. >> I am sorry for the wrong message before - it's blindness. >> >> [time is still not recognized] >> >> Best regards >> Dariusz Wojtas >> >> On 1/14/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >>> I've never tried that myself, but if dojo.bind() supports submission of >>> forms with files, then it should be possible. >>> >>> //did you ever figure out the problem with the date? >>> >>> regards >>> musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts2 portlet app on JDK 1.4.2 - problem
Thanks for the tip Taras. It finally started to work. It is important to use the -advanced switch as you advised. At first I forgot about it and it did not work. After using the switch it started and i could run my simple portlet. Yes, Struts2 portlets do work with Websphere Portal 6.0 (WAS 6.0 using JDK 1.4.2). I did not use any specific websphere descriptors. Pure servlet 2.3 (used in web.xml) and portlet.xml as described in wiki. + struts2 descriptors of course. That does not mean yet it works in all cases, but this is a good starting point. Thanks for help again Dariusz Wojtas On 1/15/07, Taras Puchko <[EMAIL PROTECTED]> wrote: Hi Dariusz! The ThreadLocal.remove() method should work if you translate Struts by Retrotranslator 1.2.0 with the -advanced option. But ensure your jars where not previously translated by Retrotranslator 1.1.0. Regards, Taras - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Struts2 portlet app on JDK 1.4.2 - problem
I know this is rather a problem with xwork on 1.4.2, but on the nightly builds page there is statement to report problems of S2 retroweaved to 1.4. I downloaded the latest nightly JAR files (api, core, spring, xwork.2.0), retroweaved them using retrotranslator 1.1.0 and deployed it all (+ retrotranslator-runtime-1.1.0.jar, + backport-util-concurrent.jar) in a single war file. Target deployment on Websphere Portal 6.0 backed by Websphere 6.0 (uses 1.4.2 from IBM). It was a portlet app. The result is a stacktrace: Caused by: java.lang.NoSuchMethodError: java.lang.ThreadLocal: method remove()V not found at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:87) at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:121) at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:559) at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:457) at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:498) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:546) at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:496) at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32) at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:134) at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49) at com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(ContainerImpl.java:428) at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:443) at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:47) at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:287) at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:116) at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:114) at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:539) at com.opensymphony.xwork2.inject.ContainerImpl.injectStatics(ContainerImpl.java:113) at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:494) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:144) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:394) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450) at org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher.init(Jsr168Dispatcher.java:190) I had some ClassNotFound errors before due to lack of retroweaver JAR files. Now I have other type of error. Does it means struts2 apps will not support 1.4.2? I know even this kind of support was unnoficial - but does it close any hope? regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Internationalisation of conversion type messages
I have created a custom Double converter and plugged it in using the xwork-conversion.properties file in the root of the classpath. This works for me. But I cannot manage it to use my translated field names in the response. regards Dariusz Wojtas On 1/14/07, Martin Gainty <[EMAIL PROTECTED]> wrote: My understanding is it is supposed to go thru this chain in package org.apache.struts.views.jsp.ui. default.properties WhateverNameOfActionClass_locale.properties WhateverNameOfActionClass.properties Conversions in Struts1 use Commons-Beanutils Conversions in Struts2 uses OGNL for type conversion http://struts.apache.org/2.x/docs/comparing-struts-1-and-2.html Anyone else? M- - Original Message - From: "Dariusz Wojtas" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Sunday, January 14, 2007 1:26 PM Subject: [S2] Internationalisation of conversion type messages > Hi, > > Can someone help me figure out how to translate into my language field > names that have type conversion problems? > > I have a Double field and put value: aa - obvious error. > Struts prints message: > Invalid field value for field "myBean.myProperty". > > I would like to change it to: > Invalid field value for field "Translated field name". > > I tried to put property > invalid.fieldValue.myBean.myProperty=Translated field name > into files: > a) MyActionName.properties (in the same package as the action being invoked) > b) package.properties (the same package) > c) define custom i18.properties file and define it in struts.properties > > but none of these solutions work. > Other messages get translated but not these from type conversion. > > And how to translate the > Invalid field value for field {0}. > message? > > Any help? > > regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Internationalisation of conversion type messages
Hi, Can someone help me figure out how to translate into my language field names that have type conversion problems? I have a Double field and put value: aa - obvious error. Struts prints message: Invalid field value for field "myBean.myProperty". I would like to change it to: Invalid field value for field "Translated field name". I tried to put property invalid.fieldValue.myBean.myProperty=Translated field name into files: a) MyActionName.properties (in the same package as the action being invoked) b) package.properties (the same package) c) define custom i18.properties file and define it in struts.properties but none of these solutions work. Other messages get translated but not these from type conversion. And how to translate the Invalid field value for field {0}. message? Any help? regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Ajax form and file submission with s:a
Musachy! I must have been blind (no wine today). I checked again the datetimepicker in the ajax form - but I can clearly see that it nicely generates a table row with 2 columns. I am sorry for the wrong message before - it's blindness. [time is still not recognized] Best regards Dariusz Wojtas On 1/14/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I've never tried that myself, but if dojo.bind() supports submission of forms with files, then it should be possible. //did you ever figure out the problem with the date? regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Ajax form and file submission with s:a
Please have a look at : https://issues.apache.org/struts/browse/WW-1598 Dariusz Wojtas On 1/14/07, Martin Gainty <[EMAIL PROTECTED]> wrote: Darius/Muscachy- http://trac.dojotoolkit.org/search?q=1598&ticket=on&changeset=on&wiki=on 1598 isnt on the dojo buglist.. and ...neither is Error setting expression 'timeProp' with value Did I mis-understand? M- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Ajax form and file submission with s:a
Hi Musachy, Is there any chance to ... check the file submission with an anchor? Does not work for me. And IE still has plenty of problems with param passing. I tried to reopen WW-1598 yesterday - but I do not have enough rights. I just ended with adding a comment. (what should I do in such case? create a new issue?) Dates. The s:datetimepicker tag works nicely now when it is configured for 'date', but if fails for 'time' (backed by a java.util.Date property). datetimepicker of type 'date' sends 2 properties in the request dateProp dojo.dateProp but time property only sends single property timeProp and I can observe an error message in logs: 16:57:01,656 ERROR - ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'timeProp' with value '[Ljava.lang.String;@18806f7' I have a form of theme 'ajax' and datetime properties still do not generate table row. I am saying that as I am not sure how our last discussion ended and what you are exactly asking for :) Using yestardays trunk build. regards Dariusz Wojtas On 1/14/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I've never tried that myself, but if dojo.bind() supports submission of forms with files, then it should be possible. //did you ever figure out the problem with the date? regards musachy Dariusz Wojtas wrote: > Hi, > > I have a form declared this way: > > theme="ajax" >method="POST" >enctype="multipart/form-data"> > > ... >Save >... >... > > > > > > file declaration: > private java.io.File myFile // +getter/setter > > When I press the link and there is no s:file element, the form gets > submitted. > But if the file is in the form, pressing the link makes request to: > http://localhost:8080/myApp/struts/dojo/iframe_history.html?noInit=true > [as shown by FF 2.0, using FireBug] > and the request is not passed to the server. > Firefox shows: > [object HTMLDocument] > in the target div instead of the expected content. > > > It's difficult to say what exactly IE is doing because it fails as > even the hidden param is not passed with the request. But IE at least > makes that request to the server. > > Is submission of forms with files supperted by S2? > I am using S2 trunk. > > Regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Ajax form and file submission with s:a
Hi, I have a form declared this way: ... Save ... ... file declaration: private java.io.File myFile // +getter/setter When I press the link and there is no s:file element, the form gets submitted. But if the file is in the form, pressing the link makes request to: http://localhost:8080/myApp/struts/dojo/iframe_history.html?noInit=true [as shown by FF 2.0, using FireBug] and the request is not passed to the server. Firefox shows: [object HTMLDocument] in the target div instead of the expected content. It's difficult to say what exactly IE is doing because it fails as even the hidden param is not passed with the request. But IE at least makes that request to the server. Is submission of forms with files supperted by S2? I am using S2 trunk. Regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] - datetimepicker not setting value
I believe this is what I expressed in the initial mail. The data is populated in the component, it creates 2 url params and they seem to be correct. But the value is obviously not passed to the action on submit. Maybe something is wrong with the interceptor? Or it's excludes? or ...? Why does it print that error message? Dariusz Wojtas On 1/10/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: That's weird because if the value is being submitted, then the problem is not related to the tag, it should fail for a regular input also. musachy Dariusz Wojtas wrote: > my svn client shows no file is changed (I dropped all changes, updated > the code) > > mvn clean -Pextras,plugins,apps > mvn -Dmaven.test.skip=true -Pextras,plugins,apps > > then I dropped everything from $TOMCAT_HOME/work and webapps, copied > the showcase war and started ... > > That is the procedure that I use every time now after some problems in > the past. > Using tomcat 5.5.15, JDK 1.6, windows xp, locale pl (default, i do not > override anything). > > I can see that error message twice, most likely it uses the > interceptor with double parameter setting. [..] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] - datetimepicker not setting value
my svn client shows no file is changed (I dropped all changes, updated the code) mvn clean -Pextras,plugins,apps mvn -Dmaven.test.skip=true -Pextras,plugins,apps then I dropped everything from $TOMCAT_HOME/work and webapps, copied the showcase war and started ... That is the procedure that I use every time now after some problems in the past. Using tomcat 5.5.15, JDK 1.6, windows xp, locale pl (default, i do not override anything). I can see that error message twice, most likely it uses the interceptor with double parameter setting. This is the POST request from FF Content-Type: multipart/form-data; boundary=---146043902153 Content-Length: 2187 -146043902153 Content-Disposition: form-data; name="name" -146043902153 Content-Disposition: form-data; name="dojo.birthday" 2007-01-01 -146043902153 Content-Disposition: form-data; name="birthday" 07/01/01 -146043902153 Content-Disposition: form-data; name="bio" -146043902153 Content-Disposition: form-data; name="favouriteColor" None -146043902153 Content-Disposition: form-data; name="favouriteLanguage" None -146043902153 Content-Disposition: form-data; name="__checkbox_legalAge" true -146043902153 Content-Disposition: form-data; name="region" South -146043902153 Content-Disposition: form-data; name="state" Florida -146043902153 Content-Disposition: form-data; name="favouriteVehicalType" MotorcycleKey -146043902153 Content-Disposition: form-data; name="favouriteVehicalSpecific" YamahaKey -146043902153 Content-Disposition: form-data; name="picture"; filename="" Content-Type: application/octet-stream -146043902153 Content-Disposition: form-data; name="leftSideCartoonCharacters" Popeye -146043902153 Content-Disposition: form-data; name="leftSideCartoonCharacters" He-Man -146043902153 Content-Disposition: form-data; name="leftSideCartoonCharacters" Spiderman -146043902153 Content-Disposition: form-data; name="rightSideCartoonCharacters" Superman -146043902153 Content-Disposition: form-data; name="rightSideCartoonCharacters" Mickey Mouse -146043902153 Content-Disposition: form-data; name="rightSideCartoonCharacters" Donald Duck -146043902153 Content-Disposition: form-data; name="thoughts" -146043902153-- Dariusz Wojtas On 1/10/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Actually that's the one I was talking about, the UI example. It is working for me. Do you have any local changes or anything? Can you make a clean checkout and try? regards musachy Dariusz Wojtas wrote: > I updated my s2 sources from trunk, cleaned the previous builds and > created a new one. > Yes, the sample works: >struts2-showcase/tags/ui/datepicker/ > but it is not backed by any form to submit it's data. > > But the issue can be reproduced here: > /struts2-showcase/tags/ui/example!input.action > > I chose the birthday date as 1st Jan 2007 and got such message in logs: > > 2007-01-10 21:31:06,937 ERROR > (com.opensymphony.xwork2.interceptor.ParametersInterceptor:198) - > ParametersInterceptor - [setParameters]: Une > xpected Exception catched: Error setting expression 'birthday' with > value '[Ljava.lang.String;@bb1ead' > > + a validation message in the JSP page - invalid field value for > birthday. > > showcase was just build and freshly deployed. > > Best regards > > Dariusz Wojtas > > > On 1/10/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: >> My code has not changed - except for the tag name. >> Maybe something has changed in the interceptor area? >> How does a Date field get filled from the request? >> >> I will run the showcase and see how it behaves. >> >> Dariusz Wojtas >> >> On 1/10/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> > Hi Dariusz >> > >> > The tag name changed, but nothing else (that I know of). The UI Tags >> > example in showcase works. The date is in the action, not a nested >> > object, but that shouldn't be a problem. >> > >> > musachy >> > >> > Dariusz Wojtas wrote: >> > > using nigh
Re: [S2] - datetimepicker not setting value
I updated my s2 sources from trunk, cleaned the previous builds and created a new one. Yes, the sample works: struts2-showcase/tags/ui/datepicker/ but it is not backed by any form to submit it's data. But the issue can be reproduced here: /struts2-showcase/tags/ui/example!input.action I chose the birthday date as 1st Jan 2007 and got such message in logs: 2007-01-10 21:31:06,937 ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:198) - ParametersInterceptor - [setParameters]: Une xpected Exception catched: Error setting expression 'birthday' with value '[Ljava.lang.String;@bb1ead' + a validation message in the JSP page - invalid field value for birthday. showcase was just build and freshly deployed. Best regards Dariusz Wojtas On 1/10/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: My code has not changed - except for the tag name. Maybe something has changed in the interceptor area? How does a Date field get filled from the request? I will run the showcase and see how it behaves. Dariusz Wojtas On 1/10/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: > Hi Dariusz > > The tag name changed, but nothing else (that I know of). The UI Tags > example in showcase works. The date is in the action, not a nested > object, but that shouldn't be a problem. > > musachy > > Dariusz Wojtas wrote: > > using nightly build from 09-Jan > > [http://people.apache.org/builds/struts/nightlies/2.0.x/] > > + xwork 2.0.0 final > > > > > name="dp.date1" > > displayFormat="-MM-dd" > > language="pl" type="date" label="My date"/> > > > > Property 'date1' in bean 'dp' is of type java.util.Date. > > The widget itself is correctly loaded with value from the action > > property and it displays itself using format specified by > > displayFormat. > > > > After submit it generates 2 parameters with the uri, eg.: > > > > dp.date1=2006-09-25 > > dojo.dp.date1=2006-09-25 > > > > The date is not set, I am forwarded back to the input action. > > Tomcat logs show such message: > > > > 20:39:11,234 ERROR - ParametersInterceptor > >- ParametersInterceptor - [setParameters]: > > Unexpected Exception catched: > > Error setting expression 'dp.date1' with value > > '[Ljava.lang.String;@16b7f83' > > > > This worked recently, but now I had to switch from > > dropdowndatetimepicker to datetimepicker and it does not work any > > more. All tags parameters are unchanged. > > > > Page uses: > > Parent form uses theme 'ajax'. > > > > > > Is this a bug in the current trunk? > > > > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] - datetimepicker not setting value
My code has not changed - except for the tag name. Maybe something has changed in the interceptor area? How does a Date field get filled from the request? I will run the showcase and see how it behaves. Dariusz Wojtas On 1/10/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Hi Dariusz The tag name changed, but nothing else (that I know of). The UI Tags example in showcase works. The date is in the action, not a nested object, but that shouldn't be a problem. musachy Dariusz Wojtas wrote: > using nightly build from 09-Jan > [http://people.apache.org/builds/struts/nightlies/2.0.x/] > + xwork 2.0.0 final > > name="dp.date1" > displayFormat="-MM-dd" > language="pl" type="date" label="My date"/> > > Property 'date1' in bean 'dp' is of type java.util.Date. > The widget itself is correctly loaded with value from the action > property and it displays itself using format specified by > displayFormat. > > After submit it generates 2 parameters with the uri, eg.: > > dp.date1=2006-09-25 > dojo.dp.date1=2006-09-25 > > The date is not set, I am forwarded back to the input action. > Tomcat logs show such message: > > 20:39:11,234 ERROR - ParametersInterceptor >- ParametersInterceptor - [setParameters]: > Unexpected Exception catched: > Error setting expression 'dp.date1' with value > '[Ljava.lang.String;@16b7f83' > > This worked recently, but now I had to switch from > dropdowndatetimepicker to datetimepicker and it does not work any > more. All tags parameters are unchanged. > > Page uses: > Parent form uses theme 'ajax'. > > > Is this a bug in the current trunk? > > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - autocompleter requires 'list' even if href is defined
Hi, This is something recent as about a week ago therew as no such problem. Now autocompleter complains if there is no 'list' param set for it. If I set it to some dummy value than it seems to work. I remember there was some issue about that a few days ago in JIRA but can't find it. I am running yesterdays nightly build. Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - datetimepicker not setting value
using nightly build from 09-Jan [http://people.apache.org/builds/struts/nightlies/2.0.x/] + xwork 2.0.0 final Property 'date1' in bean 'dp' is of type java.util.Date. The widget itself is correctly loaded with value from the action property and it displays itself using format specified by displayFormat. After submit it generates 2 parameters with the uri, eg.: dp.date1=2006-09-25 dojo.dp.date1=2006-09-25 The date is not set, I am forwarded back to the input action. Tomcat logs show such message: 20:39:11,234 ERROR - ParametersInterceptor - ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'dp.date1' with value '[Ljava.lang.String;@16b7f83' This worked recently, but now I had to switch from dropdowndatetimepicker to datetimepicker and it does not work any more. All tags parameters are unchanged. Page uses: Parent form uses theme 'ajax'. Is this a bug in the current trunk? Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - select tag and supported data types.
Hi, I am trying to gather some more info before I try to recreate the issue WW-1601 . What are the supported data types for * property that carries the actual data * beans inside collection/map/array that carry the displayable options Background: // the action class class MyAction .. { private Integer rate;// property carrying the actual data, may be Byte, Long, ... private ArrayList rates; // displayable options .. } // Single option bean class OptionBean implements Serializable { private Integer id; // in general the same data type as in my action (Byte, Long, ...) private String name; } Sample option beans: 1, London 2, Paris 3, Warsaw data carried by the action.rate = 2 If I open my web page then Paris is not preselected. It does not find equality between Integer(1) in action.rate and Integer(1) in an option bean. If I change the property in the action to String private String rate; then it finds equality. After WW-1601 there was a test added for the tag, but it carries a collection of Strings, not objects that would match identifier in the carried option bean. Did anyone else experience the same problem? It works with Strings but has problems with other value types. I would add the comment to the issue, but it is marked as fixed and I am not sure if it is still read by anyone. Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Struts 2 and portlets - I found some info
ok, I have filled the CLA and sent it with fax. waiting for more :) Dariusz Wojtas On 1/9/07, Don Brown <[EMAIL PROTECTED]> wrote: Could you file a CLA [1] so that we could give you access to the wiki directly? As one of the few active portlet users on this list, it would be very helpful for you to be able to beef up our portlet docs directly. Don [1] http://www.apache.org/licenses/ On 1/9/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: > Hi, > > Nobody answered my last questions about portlets - but I found some > useful info and will try to share it. > > The webwork wiki stuff has been copied/migrated to struts 2, but some > parts were not updated. For example: > http://cwiki.apache.org/WW/portlet-tutorial.html > > This page is mostly valid and gives some hints but the discussed > xwork.xml > file references another one: > > > And here is the trick. > I tried to include 'struts-portlet-default.xml' instead but there is > no such file. > > Instead there is 'struts-plugin-default.xml' in the struts-core.jar > file that should be referenced, and packages that want to support > portlets should extend the 'struts-portlet-default' package (or define > some other based on it's results/redirectors). > > Suddenly everything started to work :) > I had no chance to test it under websphere portal yet, but it > definitely works under jetspeed-2. > > I hope this saves somebody's time and gives some hope for portlets in struts2. > > Please - the struts team - update that wiki page, it's crucial. > At least describe why that extra file needs to be included (defines > portlet specific results/dispatchers) and what is it's correct name > after migration to struts. > > Best regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Struts 2 and portlets - I found some info
Hi, Nobody answered my last questions about portlets - but I found some useful info and will try to share it. The webwork wiki stuff has been copied/migrated to struts 2, but some parts were not updated. For example: http://cwiki.apache.org/WW/portlet-tutorial.html This page is mostly valid and gives some hints but the discussed xwork.xml file references another one: And here is the trick. I tried to include 'struts-portlet-default.xml' instead but there is no such file. Instead there is 'struts-plugin-default.xml' in the struts-core.jar file that should be referenced, and packages that want to support portlets should extend the 'struts-portlet-default' package (or define some other based on it's results/redirectors). Suddenly everything started to work :) I had no chance to test it under websphere portal yet, but it definitely works under jetspeed-2. I hope this saves somebody's time and gives some hope for portlets in struts2. Please - the struts team - update that wiki page, it's crucial. At least describe why that extra file needs to be included (defines portlet specific results/dispatchers) and what is it's correct name after migration to struts. Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 & JSON
http://json.org/ Something of form: [["name", "id"], ["name", "id"]] or [["name", "id"], ["name", "id"],] Remember to escape special characters. Dariusz Wojtas On 1/8/07, André Faria <[EMAIL PROTECTED]> wrote: What is necessary to write a JSON response in struts to use with a Autocomplete tag? example: public class JSONListAction { public String execute { return JSON object! } } Thank's André Faria
Re: [S2] How to separate Action from "FormBean"
I work with struts2 for about a month and it is perfectly stable. The only 'issues' I could see were related to it's ajax support - but it already works perfectly in most areas, and the issues being found are quickly examined by the struts team. It's definitely worth to try it. It's simpler than S1 and has much more power. But ... at the beginning you will spend some time even on simple things :) Dariusz Wojtas On 1/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Dariusz Wojtas <[EMAIL PROTECTED]> wrote: > Want to have a bean separate from the action and just reference it? > Define your bean (whatever you want) and just declare it as a variable > on your action. Thanks Dariusz. That's exactly what I was looking for. Looks like I should definitely give S2 a try :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Struts 2 and portlets
I will repeat my question sent few days ago, maybe this time someone will help me. What is the state of Struts 2 and it's portlet support? I am considering to start my new project [must work as a portlet app] using Struts2 but I do not know if this is worth doing now. The projects starts in the next few days, should be finished after 2 months. Examples provided with the framework (2.0.1 and trunk) did not run for me. I tried to modify the war files, update descriptors but with no success. I tried it under Websphere Portal and JBoss Portal. Can I use sitemesh in such environment? Does anybody have experience with Struts2, portlets and Websphere portal 6? Thanks for any response Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] How to separate Action from "FormBean"
Want to have a bean separate from the action and just reference it? Define your bean (whatever you want) and just declare it as a variable on your action. Nothing more. Add getter and setter. class MyAction ... { private MyBeanClass myBean; } in your JSP just prefix bean components with the bean name; That's all :) Dariusz Wojtas On 1/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I just took a look at the tutorials of Struts 2 today. As a Struts 1 user, I don't like form beans that mostly copy your business data beans. In Struts 2, you don't need form beans anymore, but the tutorial states that you have to implement an execute() method into your business bean. Actually, what I would prefer is an Action class, that just references the form bean, i.e., I can use my business bean unchanged but only have to link them to an action. Is this possible in Struts 2 and how do I achieve this? Further, is are there any plans/release dates for a book on Struts 2? Cheers, Thorsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] dropdowndatetimepicker questions
I do not know if you did see my comment to WW-1605. It somehow produces endless loop ... Dariusz Wojtas On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: ok, here is the right one: https://issues.apache.org/struts/browse/WW-1605 musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] dropdowndatetimepicker questions
Will it work with all modes of the parent form? (ajax, xhtml) as expected? Did anyone recognize the issue with textarea? If included inside a form with theme="ajax" then it automatically is ajaxified (rich text) instead of just being rendered in a table row with two cols. btw, I am just sitting with a 2nd glass of a good red wine (no joke). If my future messages today are out of context - you know the reason :) Thanks for your time :) Dariusz Wojtas On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I swear I haven't been drinking today :). I will do a similar fix for the dropdowndatetimepicker musachy Dariusz Wojtas wrote: > Maybe this fix helps, but for autocompleter. > I asked for dropdowndatetimepicker :) > > Greetings > Dariusz Wojtas > > On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> I logged this ticket with a simple patch: >> https://issues.apache.org/struts/browse/WW-1602 >> >> (remember to remove theme="ajax" for the ones that you want it to render >> the label) >> >> regards >> musachy >> >> Dariusz Wojtas wrote: >> > Hi, >> > >> > I am absolutely nod in mood to be the 1st class troublemaker for S2 >> > ajax support - which is very nice - but real life usage brings some >> > questions. >> > >> > I have a form using theme ajax. >> > And I have some: >> > >> > >> > >> > fields inside. >> > Fields 'textfield' and 'select' do create a row in table with 2 cols: >> > label, field. >> > But the datetimepicker field only creates a single 'span' element >> > withsome contents inside but seems to ignore the fact that it is >> > placed inside an ajax form. >> > >> > Label defined for such field is not displayed. >> > Is it supposed to behave like this? >> > I may create that row myself, but I am worried that one day it will be >> > 'fixed' and then my code is wrong. >> > >> > I also have some question about the dropdowndatetimepicker in 'time' >> > mode. >> > What is the data type supported for this on the action side? >> > If I have a Date property in my field and want to dysplay it as 2 >> > fields in the form, using dropdowndatetimepickers: date & time - what >> > is the advised approach? >> > I did not find any info in the docs/wiki about this. >> > >> > Thanks in advance >> > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Possible issue with remote form submission
I removed theme ajax from my form and it still did not work. Because the current showcase has problems, I copied the remoteforms sample to my app. Only 2 of these forms do work with IE (pass params). I can be sure of this because I have a filter in front of the app which renders the requested URI with params (works with GET and POST - works for months). If this can help, IE shows an error message in the status bar: Could not load 'dojo.widget.html.Tooltip'; last tried '__package__.js' It is something general with the recent S2 from trunk. Dariusz Wojtas On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Just to make sure that's not it, can you remove the theme="ajax" from the form? In the remote button page, on showcase there is an example of a button submitting a form, is that working for you? musachy Dariusz Wojtas wrote: > Hi Musachy, > > I have a form of this type: > > > ... > cssClass=".." /> > > > And this one gets submitted, but IE seems to post it without parameters. > At the same time FF posts it with parameters. > In both browsers targetting of the submission form works, but IE does > not pass params. > > If this could help, I have a form with some custom tabular structure > inside. > Also some dojo scripts do not get loaded with current S2 - this could > also be the reason ... > > Best regards > Dariusz Wojtas > > > On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> Hi Dariusz >> >> The remote forms example(and probably the tag) are broken right now. The >> easiest way to submit forms asynchronously, that I know is working like >> >> >> >> >> >> check the ajaxtags doc for examples: >> >> http://struts.apache.org/2.x/docs/ajax-tags.html >> >> musachy >> >> Dariusz Wojtas wrote: >> > Using S2 trunk. >> > I have noticed that in some cases remote form submission does not pass >> > form data to the url. >> > This may be reproduced with the showcase: >> > /struts2-showcase/ajax/remoteforms/ >> > where some of the samples do workand pass parameters, while some >> > others do not. >> > The same behavious in IE, FF and Opera 9 >> > >> > Has anyone lse noticed this? >> > >> > Also some of the forms on that page uses 'afterLoading', >> > 'beforeLoading' attributes that do not let this page compile by >> > default. >> > >> > Best regards >> > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] dropdowndatetimepicker questions
Maybe this fix helps, but for autocompleter. I asked for dropdowndatetimepicker :) Greetings Dariusz Wojtas On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I logged this ticket with a simple patch: https://issues.apache.org/struts/browse/WW-1602 (remember to remove theme="ajax" for the ones that you want it to render the label) regards musachy Dariusz Wojtas wrote: > Hi, > > I am absolutely nod in mood to be the 1st class troublemaker for S2 > ajax support - which is very nice - but real life usage brings some > questions. > > I have a form using theme ajax. > And I have some: > > > > fields inside. > Fields 'textfield' and 'select' do create a row in table with 2 cols: > label, field. > But the datetimepicker field only creates a single 'span' element > withsome contents inside but seems to ignore the fact that it is > placed inside an ajax form. > > Label defined for such field is not displayed. > Is it supposed to behave like this? > I may create that row myself, but I am worried that one day it will be > 'fixed' and then my code is wrong. > > I also have some question about the dropdowndatetimepicker in 'time' > mode. > What is the data type supported for this on the action side? > If I have a Date property in my field and want to dysplay it as 2 > fields in the form, using dropdowndatetimepickers: date & time - what > is the advised approach? > I did not find any info in the docs/wiki about this. > > Thanks in advance > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Possible issue with remote form submission
Hi Musachy, I have a form of this type: ... And this one gets submitted, but IE seems to post it without parameters. At the same time FF posts it with parameters. In both browsers targetting of the submission form works, but IE does not pass params. If this could help, I have a form with some custom tabular structure inside. Also some dojo scripts do not get loaded with current S2 - this could also be the reason ... Best regards Dariusz Wojtas On 1/7/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: Hi Dariusz The remote forms example(and probably the tag) are broken right now. The easiest way to submit forms asynchronously, that I know is working like check the ajaxtags doc for examples: http://struts.apache.org/2.x/docs/ajax-tags.html musachy Dariusz Wojtas wrote: > Using S2 trunk. > I have noticed that in some cases remote form submission does not pass > form data to the url. > This may be reproduced with the showcase: > /struts2-showcase/ajax/remoteforms/ > where some of the samples do workand pass parameters, while some > others do not. > The same behavious in IE, FF and Opera 9 > > Has anyone lse noticed this? > > Also some of the forms on that page uses 'afterLoading', > 'beforeLoading' attributes that do not let this page compile by > default. > > Best regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] dropdowndatetimepicker questions
Hi, I am absolutely nod in mood to be the 1st class troublemaker for S2 ajax support - which is very nice - but real life usage brings some questions. I have a form using theme ajax. And I have some: fields inside. Fields 'textfield' and 'select' do create a row in table with 2 cols: label, field. But the datetimepicker field only creates a single 'span' element withsome contents inside but seems to ignore the fact that it is placed inside an ajax form. Label defined for such field is not displayed. Is it supposed to behave like this? I may create that row myself, but I am worried that one day it will be 'fixed' and then my code is wrong. I also have some question about the dropdowndatetimepicker in 'time' mode. What is the data type supported for this on the action side? If I have a Date property in my field and want to dysplay it as 2 fields in the form, using dropdowndatetimepickers: date & time - what is the advised approach? I did not find any info in the docs/wiki about this. Thanks in advance Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Possible issue with remote form submission
Using S2 trunk. I have noticed that in some cases remote form submission does not pass form data to the url. This may be reproduced with the showcase: /struts2-showcase/ajax/remoteforms/ where some of the samples do workand pass parameters, while some others do not. The same behavious in IE, FF and Opera 9 Has anyone lse noticed this? Also some of the forms on that page uses 'afterLoading', 'beforeLoading' attributes that do not let this page compile by default. Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - inner div, session timeout and login page
Hi, Struts2 allows me to use easily inner div functionality, submitting forms with a specific targets, etc ... Works wonderfully. But ... now I have a problem with it. User navigates through such ajax enabled page, some links and submit buttons on that page have target to some divs. After some time the user's session expires - then a click is made on such targetted link or submit button. I have a problem with security now (acegi) when the login window is targetted into some div, sometimes in strange places and this really is a problem for me. Is there any way to escape the target div and load the result into the main window? Or some esy to define poller that automatically redirects to some page just before session expiring? or some other solution? I am pretty sure more people had this similar problem. Thanks in advance Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] struts2-portlet application problems
Hi, After playing with it a bit with the sample portlet app on the 2.0.3 trunk code (jboss portal 2.4.1) I finally managed to pass the basic problems (descriptors, missing JAR files: spring, dwr, spring plugin) and now I get some strange exception that I do not understand: .. 08:48:31,805 INFO [StrutsSpringObjectFactory] ... initialized Struts-Spring integration successfully 08:48:32,195 INFO [XmlConfigurationProvider] Parsing configuration file [struts-default.xml] 08:48:32,258 INFO [XmlConfigurationProvider] Parsing configuration file [struts-plugin.xml] 08:48:32,258 INFO [XmlConfigurationProvider] Parsing configuration file [struts.xml] 08:48:32,258 ERROR [[/struts2-portlet]] Exception starting filter action2 com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDepend encyException: No mapping found for dependency [type=java.lang.String, name='devMode'] in public static void com.opensymphony.xwork2.util.OgnlValueStack.setDevMode(java.lang.String). at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:156) at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:125) at com.opensymphony.xwork2.inject.ContainerImpl.injectStatics(ContainerImpl.java:110) at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:494) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:140) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:394) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:450) at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:223) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:304) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:77) [...] Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for depen dency [type=java.lang.String, name='devMode'] in public static void com.opensymphony.xwork2.util.OgnlValueStack.setDevMode(java.lang.String). at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:238) at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:228) at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.(ContainerImpl.java:281) at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:129) at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:127) at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:153) ... 129 more I am trying to do my best to try portlets with struts2 but so far it does not work for me. Any advises what can be wrong? Best regards Dariusz Wojtas On 1/3/07, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: Hi, I have downloaded the struts2-portlet sample application, both versions 2.0.1 and a nightly build of 2.0.2 but it fails to start. It does not even have the struts.xml file /WEB-INF/classes, but the file xwork.xml instead. if I rename this file to struts.xml then it complaints: 14:26:46,844 ERROR [ConfigurationUtil] Unable to find parent package struts-portlet-default on the console. The daily build of 2.0.2 does not even have dependencies filled. If I update them that I even get some stacktraces. Issue WW-1407 discusses similar problems, is marked as resolved 3 months ago, but the issue still remains. I am trying to run it under JBoss 4.0.5 and have plans to test it under Websphere. Can anybody help me with this? Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] struts2-portlet application problems
Hi, I have downloaded the struts2-portlet sample application, both versions 2.0.1 and a nightly build of 2.0.2 but it fails to start. It does not even have the struts.xml file /WEB-INF/classes, but the file xwork.xml instead. if I rename this file to struts.xml then it complaints: 14:26:46,844 ERROR [ConfigurationUtil] Unable to find parent package struts-portlet-default on the console. The daily build of 2.0.2 does not even have dependencies filled. If I update them that I even get some stacktraces. Issue WW-1407 discusses similar problems, is marked as resolved 3 months ago, but the issue still remains. I am trying to run it under JBoss 4.0.5 and have plans to test it under Websphere. Can anybody help me with this? Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] - access to the action from a JSP page
I wanted to access some complex object from the action inside the JSP page. My idea was to get access to the action, then to the object instance. Possibly this can be fixed by exposing the property as a ascriptlet variable and then casting it, ut I just wanted to know if this is allowed directly. Dariusz Wojtas On 1/3/07, Dave Newton <[EMAIL PROTECTED]> wrote: From: Dariusz Wojtas [mailto:[EMAIL PROTECTED] > I know how to access it using tags, but what I want is to access it > with plain Java inside a scriptle area. > Something similar to this: > > <% > MyTestAction act = ... ? > %> Why? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - Struts2, portlets and Websphere Portal
Hello, We are just considering libraries to be used in a new project that is supposed to be a portlet application and work in Websphere 6.x Portal version. I have heard some comments about issues with Struts 1.x in this environment. What does it look like in Struts 2? Are there any issues with using it also with sitemesh in such app? I have downloaded the portlet sample app for struts 2 and will try to run it, but I would also ask for opinions of people that have some experience in it. Thanks in advance Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with encoding
I was just going to recommend the same app. Works for me with 3.2 But there is also a standalone JNLP app. Works perfectly. Dariusz Wojtas On 1/3/07, Antonio Petrelli <[EMAIL PROTECTED]> wrote: Mike Baroukh ha scritto: > Do you know if there is a way to tell him to do it automatically ? > It's strange that Eclipse default properties editor doesnt handle this > automatically, isn't it ? Try this: http://propedit.sourceforge.jp/index_en.html I used it a while ago with Eclipse 3.1. It seems not to be updated, so I don't know if it works. Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Strange problem with Date handling
I am using Spring 2 but I do not define actions in Spring. I use Spring to manage my services and security (acegi). As I understand this way the actions are created the 'traditional' way, and only some setters are later autowired - in this case by name. My date property does not match any spring service, not even close ... Do I still have to set the scope somewhere? I only set some props in my struts.properties: struts.devMode=true struts.enable.DynamicMethodInvocation=false struts.action.extension=action struts.objectFactory=spring struts.objectFactory.spring.autoWire=name Best regards Dariusz Wojtas On 1/1/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: I had a similar problem before, are you using Spring 2 with S2? If you are, remember to set scope="prototype" in applicationContext.xml for your action bean musachy Dariusz Wojtas wrote: > Now I am stuck with some other issue, something so strange that seems > to be irrational. > > I have an URL >/myAction.action?dataPierwszejRejestracji=2006-12-31 > that leads to an action with a Date property - dataPierwszejRejestracji > > I submit this URL in IE and Firefox - works. > I submit the same URL under Opera and it fails with long stacktrace on > the Tomcat console. > I repeated it several times. > > java.lang.NullPointerException > > com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:197) > > > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:337) > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) > > > com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115) > > > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) > > > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) > > > com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) > > > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) > > > com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:154) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) > > > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) > > > com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) > > > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) > > > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) > > [...] > > > Has anyone faced this problem? > It does not make sense to me, but that's how it behaves. > The date comes from dropdowndatetimepicker. > I have cut all other request properties to narrow the problem down, > and this is the property left. Without this param in URL the action > executes. > > Using Struts 2, > 2.0.3 snapshot from trunk. > > Regards > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
Hey! Your fix works as you said. Under both IE and Opera. There are still the issues described in my previous mail (resubmit of stacked autocompleters on all browsers, dropdown problem on Opera), but the things that you just fixed - do work as expected. I just had to refresh/clear cache in IE and it started to work. Best regards Dariusz Wojtas On 12/31/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: With the "Object error" and the encoding problem out of the way I will start looking at other problems next year :) regards musachy Dariusz Wojtas wrote: > Hi Musachy, > > I have just built new S2 (after tag 2.0.2), made sure that the old JAR > files are replaced and restarted it. If something is fixed - great, > but it still misbehaves under IE and Opera. > There is also some issue common to all browsers (including FF): > > *) If I have 3 stacked autocompleters, every autocompleter has a value > and I submit the form to go to the same action (reload with selected > values), then only the top autocompleter is displayed with the correct > value. The other 2 autocompleters are empty - but the code in > generated HTML suggests that the correct values were passed to dojo: >initialKey="3541" ... > > The dependent autocompleters are just blank. > And the funny thing is that the browser asks the server for valus to > be shown in autocompleter2 and autocompleter3 and gets the correct > values - on page load. Even more funny is that it shows autocompleter1 > with the predefined value, and I may expand both autocompleter2 and > autocompleter3 (nothing selected in autocompleter2). > > > *) Problem under Opera 9.0.2. > I know a little more about problems under Opera. > It is enough to have single autocompleter to reproduce it. > Some value is selected, the dropdown is hidden. > I click the downArrow with mouse, the dropdown with options nicely > opens and I may change selection. If I mark with mouse/keyboard at > least 1 character in the selected value (as if you were preparing for > copy/paste) then clicking the downArrow has no effect. If I deselect > the character - it works again. > The problem is that after making a selection with mouse - the value is > automatically marked/selected and the downArrow will not work. > Possibly the solution would be to make sure that no character is > marked after choosing an option. Or changing the condition under which > the dropdown checks what options to display. > > Similar problem under Opera when typing something in the autocompleter. > If the dropdown is already shown/opened - it will work. > But if you start typing when it is hidden, it will not work because > some characters are automatically marked/selected. Pressing backspace > makes it work. > It is all reproductible with the sample I have sent you. > > *) IE 6 > Still problems on my machine. Even with simple autocompletes. > I can see an error in the status bar. No details. Just: > Line: 4872 [It must be sth in the javascript, the HTML code is > much shorter] > Char: 1 > Error: [object error] > Code: 0 > > > Thanks for your help. > And a Happy New Year! > > Dariusz Wojtas > > > > On 12/31/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> Both problems should now be fixed on IE 6. >> >> regards >> musachy >> >> Musachy Barroso wrote: >> > I will fix it so it ignores that null value. UTF-8 works. >> > >> > regards >> > musachy >> > >> > Dariusz Wojtas wrote: >> >> I am not really sure if it worked before, both autcompleter and my >> >> code do evolve ;) >> >> I was always using JSP with UTF-8 encoding to generate my options. >> >> Is UTF-8 a problem here? >> >> >> >> You mean >> >>[ ["A", "B"] , ] >> >> is problematical for IE, but >> >>[ ["A", "B"] ] >> >> will work? Should I change something in the json list generation or >> >> the autocompleter will recognize such case? >> >> >> >> Dariusz Wojtas >> >> >> >> On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> >>> This is what I found so far, there are 2 problems, one is that when >> >>> there is a json array like: >> >>> >> >>> [ ["A", "B"] , ] >> >>> >> >>> IE puts a null object in the array. That one is easy to fix. The >> other >> >>> problem is that using freemaker, like in showcase to render the json >> >>> array, the charset of the response is set to Cp1252, which causes >> the >> >>> error on IE. If I use a jsp to render the json array, the >> encoding is >> >>> ISO-8859-1 which works fine. Was this working for you before? >> >>> >> >>> regards >> >>> musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Strange problem with Date handling
Now I am stuck with some other issue, something so strange that seems to be irrational. I have an URL /myAction.action?dataPierwszejRejestracji=2006-12-31 that leads to an action with a Date property - dataPierwszejRejestracji I submit this URL in IE and Firefox - works. I submit the same URL under Opera and it fails with long stacktrace on the Tomcat console. I repeated it several times. java.lang.NullPointerException com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:197) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:337) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:154) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:217) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) [...] Has anyone faced this problem? It does not make sense to me, but that's how it behaves. The date comes from dropdowndatetimepicker. I have cut all other request properties to narrow the problem down, and this is the property left. Without this param in URL the action executes. Using Struts 2, 2.0.3 snapshot from trunk. Regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
Hi Musachy, I have just built new S2 (after tag 2.0.2), made sure that the old JAR files are replaced and restarted it. If something is fixed - great, but it still misbehaves under IE and Opera. There is also some issue common to all browsers (including FF): *) If I have 3 stacked autocompleters, every autocompleter has a value and I submit the form to go to the same action (reload with selected values), then only the top autocompleter is displayed with the correct value. The other 2 autocompleters are empty - but the code in generated HTML suggests that the correct values were passed to dojo: wrote: Both problems should now be fixed on IE 6. regards musachy Musachy Barroso wrote: > I will fix it so it ignores that null value. UTF-8 works. > > regards > musachy > > Dariusz Wojtas wrote: >> I am not really sure if it worked before, both autcompleter and my >> code do evolve ;) >> I was always using JSP with UTF-8 encoding to generate my options. >> Is UTF-8 a problem here? >> >> You mean >>[ ["A", "B"] , ] >> is problematical for IE, but >>[ ["A", "B"] ] >> will work? Should I change something in the json list generation or >> the autocompleter will recognize such case? >> >> Dariusz Wojtas >> >> On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: >>> This is what I found so far, there are 2 problems, one is that when >>> there is a json array like: >>> >>> [ ["A", "B"] , ] >>> >>> IE puts a null object in the array. That one is easy to fix. The other >>> problem is that using freemaker, like in showcase to render the json >>> array, the charset of the response is set to Cp1252, which causes the >>> error on IE. If I use a jsp to render the json array, the encoding is >>> ISO-8859-1 which works fine. Was this working for you before? >>> >>> regards >>> musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Redirecting to another action with preserving error messages
ok, this is the obvious candidate if I want to make it 'by hand'. Some little method in the base action or filter that takes care for it as I would do it in Struts 1. But I thought about something ... out of the box. I do not need to make extra redirect through the browser, I want to switch to another action in the same request - and in such case it should be possible to do it without playing with session. I tried to play with the result of type 'chain' but I only got exceptions. I am not sure if I understand 'chain' as it did not work for me. Thanks for your valuable tips. They are valuable. I will use the session approach probably, fits most use cases, but I was wondering if it is possible to reuse the messages/errors in the same request across different actions. Best regards Dariusz Wojtas On 12/30/06, Nick Tucker <[EMAIL PROTECTED]> wrote: Hi You could put the message in a session attribute and then get the second action to check for the attribute and display it if found (remembering to remove it once displayed) . How to get access to the session is in the Struts 2 faq. Nick Dariusz Wojtas wrote: > > Excellent hint, thanks. > I forgot I may jump between various methods this way in the struts config. > This will perfectly work in the case I described. > > Any idea how to solve the problem with various messages or errors to > be displayed, when I have no control on the messages/errors being > added? > > Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with special characters in an ActionForm
It is not problem of Struts or form properties but the encoding of the parameters. You may check what is the encoding used to get params from request: request.getCharacterEncoding() and chect if it matches your needs and/or the way that characters are coded by the browser. If you want to have full control over it: * specify encoding in your JSPs <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> * use a filter for your application that sets the required encoding before the request is used by the action: public void doFilter(...) HttpServletRequest req = (HttpServletRequest) request; if (req.getCharacterEncoding() == null) { req.setCharacterEncoding("UTF-8"); } chain.doFilter(req, res); } Instead of using filter, you may try to configure your app server to use the required encoding. Tomcat supports it, most likely other app servers also - but this is app server specific setting. Regards Dariusz Wojtas On 12/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, I have a simple action form where users can enter texts, including special characters such as German umlauts. If a user enters "müller" in the text field, I only get "müller" from the actionform. I assume that there is a problem with the encoding, but I don't know how I can resolve it. The actionform looks like this: Submit The Action itself uses a DynaValidatorForm: DynaValidatorForm f = (DynaValidatorForm) form; System.out.println(f.getString("text")); return mapping.findForward(SUCCESS); Any hints how I can get the right String from the dyna form? Cheers, Thorsten
Re: [S2] Redirecting to another action with preserving error messages
Excellent hint, thanks. I forgot I may jump between various methods this way in the struts config. This will perfectly work in the case I described. Any idea how to solve the problem with various messages or errors to be displayed, when I have no control on the messages/errors being added? Dariusz Wojtas On 12/30/06, Nick Tucker <[EMAIL PROTECTED]> wrote: Hi If you are always going to display the same message then you could get the action you redirect to to display the message. I have done this to get "Processing Successful" messages output after updates e.g. in your action:- return "missingid"; redirect this result to a method in your other action input!noId and in the method output your message before doing your normal processing public String noId() { addActionError(getText("some.id.not.set")); return execute(); } N Dariusz Wojtas wrote: > > Hi, > > I have some action [/namespace/edit.action] which cannot be called > without ID. > In fact the ID parameter is needed under some conditions. > > Therefore if I do not have ID when it is needed I add error message > and redirect to INPUT: > > addActionError(getText("some.id.not.set")); > return INPUT > > How do I define my action to redirect to another action (not a JSP) > AND keep the message so it can be displayed? > I tried to configure my result in different ways > > a) try result type 'chain' - pointing to another action name in the > same package (does not need any params) > > /WEB-INF/jsp/pages/package/input.jsp > index > > > b) I tried result type 'redirect', 'redirect-action' > but then I loose my error message > > c) I tried 'dispatcher' to a fully qualified action URL > type="dispatcher">/package/index.action > but then I get exception from Tomcat: > > HTTP Status 404 - //package/index.action > The requested resource (//package/index.action) is not > available. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: index.action problem
Wesley Wannemacher wrote: > Hello, > > I have a small problem and was wondering if anyone else has come across > it. > > In Tomcat 5.5 (and possibly other versions), tomcat will check for the > existence of a file and if it doesn't exist send out a 404 before it can > be handled by struts when it comes to welcome-files... > > For instance, if I have the following in my web.xml: > > > index.action > > > And someone visits a page by hitting the directory (i.e. > http://localhost/context-name/) and a valid mapping exists (maybe taking > them to index.jsp), tomcat will deliver a 404 error. However, if I make > a blank file called 'index.action,' Tomcat will appropriately handle the > request by passing it to struts. > > Has anyone else encountered this? Is there a better solution than making > a blank file called index.action? > > I tried making an index.html file, but I am also learning sitemesh and I > am having a heckuva time figuring out how to get sitemesh not to > decorate the index.html file. Creating an empty index.action file is the right way to do this on Tomcat. Different containers have different interpretations of the Servlet spec with respect to this area, but Tomcat's interpretation is that it should check for a physical file-system resource, even if the request URL will be served by a servlet/JSP/whatever. I think this depends on the level of the servlet specification being in use. Since Servlet 2.4 it is required that the container examines both static resources and mapped servlets of the application. In earlier versions of the spec this was not a requirement. A quote from the servlet 2.4 final specification, part of chapter 9.10 "Welcome files": "If a Web container receives a valid partial request, the Web container must examine the welcome file list defined in the deployment descriptor. The welcome file list is an ordered list of partial URLs with no trailing or leading /. The Web server must append each welcome file in the order specified in the deployment descriptor to the partial request and check whether a static resource or servlet in the WAR is mapped to that request URI. TheWeb container must send the request to the first resource in the WAR that matches." If you have problems with dynamic welcome files, try to "upgrade" your application to use servlet 2.4 or newer - if possible. Best regards Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] dropdowndatetimepicker
The latest patch fixed all issues that I had before with this tag. I tested it with various displayFormat values -MM-dd MM dd-MM- and it always worked as expected. Thanks a lot. Dariusz Wojtas On 12/29/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: I attached a new patch to WW-1579, the name of the textfield will now be "dojo.${name}". This will make the "params" interceptor throw an exception, WW-1551 is asking to ignore such parameters. In the meanwhile you can implement ParameterNameAware on your action and ignore anything that starts with "dojo". regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] dropdowndatetimepicker
That's even better idea :) If you know how - I am 100% with you. Darek On 12/29/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: I don't think we need to submit two at all, just one on the RFC 3379 format (the one that works), the other one, which is the one on the textbox should be prefixed with "dojo." so S2 ignores it (that's another issue by the way). regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] dropdowndatetimepicker
Great news! I have applied the patch for me, tested and it reads the property perfectly :) It is now correctly initialized. Good work. Thanks! But some issue is still there - format of the data submitted with the form. If I use it this way: Produced URL: /my.action?=2006-12-25&end=2006-12-25 then it works. But if I change it to: Produced URL: /my.action?=2006-12-25&end=25-12-2006 Then it ends with a large stacktrace in the browser and logs (see WW-1577). The display format attribute works perfectly for displaying it on the form, but still not in the submitted form data. Each dropdowndatepicker creates a pair of properties. The 1st one is always unnamed and contains date in the correct format for parsing (I think). The 2nd format depends on the displayFormat. Maybe the property name could be controlled in the same way as it is done with autocompleter? It could mean: hidden 'end' field using the standard save format - matches the Date property in form displayed 'endDisplay' field using the display format - not needed in Form, may be ignored I know this is not something new, but if it works for autocompleter ... Best regards Dariusz Wojtas On 12/29/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: I logged a ticket for this issue, with a patch: https://issues.apache.org/struts/browse/WW-1579 The tag was not reading the value from properties. Now it will get the value from the property specified in "name", the value needs to be of type Date, or any object whose toString method returns an string that can be parsed into a date, using the "displayFormat", or SimpleDateFormat.parse(). I removed the "saveFormat" attribute because it is confusing, the possible values for it were "rfc", "iso" or "unix". This is Dojo stuff. Now it will always be "rfc" (RFC 3379) regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
I am not really sure if it worked before, both autcompleter and my code do evolve ;) I was always using JSP with UTF-8 encoding to generate my options. Is UTF-8 a problem here? You mean [ ["A", "B"] , ] is problematical for IE, but [ ["A", "B"] ] will work? Should I change something in the json list generation or the autocompleter will recognize such case? Dariusz Wojtas On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: This is what I found so far, there are 2 problems, one is that when there is a json array like: [ ["A", "B"] , ] IE puts a null object in the array. That one is easy to fix. The other problem is that using freemaker, like in showcase to render the json array, the charset of the response is set to Cp1252, which causes the error on IE. If I use a jsp to render the json array, the encoding is ISO-8859-1 which works fine. Was this working for you before? regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
showcase, just built ans started on tomcat 5.5.17 1) Firefox Everything seems to work. About the preloaded aurocompletes at the bottom: Yes, the value is preloaded but entering and leaving the "Autocompleter 1" makes it clear on blur. But filtering of "Autocompleter 2" works as expected, even when I change the value in "Autocompleter 1" later. 2) IE 6 The examples at the top work, down to Disabled. The linked autocompleters have problem. a) Fresh page just after loading. Nothing is touched, I press the down icon on "Autocomplete2" to see options but nothing opens. And I see no javascript error message. b) Fresh page. I give focus with mouse to Autocompleter 1, then Autocompleter 2. Autocompleter 1 looses value. No options in autocompleter 2 c) I try to change values in Autocompleter 1, but nothing loads into autocompleter 2 With IE I could see no error messages. It just did not work. 3) Opera 9.0.2 The top examples do work (single autocompleters) - all seem to work for me. Linked autocompletes: a) focus into Autocompleter 1, then Autocompleter 2 - auto 1 looses value b) changing auto1 does not load anything into auto2 (empty all the time) When I open the error console in Opera - I see some warnings and errors. Best regards Dariusz Wojtas On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: Is showcase working for you? On IE I'm getting a "Error: System error: -1072896658". Some people have had the same problem due to encoding issues. The error message is really explicit :) musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
On 12/28/06, Martin Gainty <[EMAIL PROTECTED]> wrote: can we see the autoCompleter code any relevant JS (setBeforeLoading,setAfterLoading) ok, the last question made me check the code again. I found an error in my code - an artefact from the yesterdays autocompleter usage. formId="kalkulatorForm" formFilter="filterModelPojazdow" with some of the autocompletes. They all look identical and differ only in the field names function filterModelPojazdow(field) { return (field.name == "carMakerKey") || (field.name == "carModelFilter"); } but still contained old field names and did not let the params to be attached to the URL loading the combo. With the above function (updated names) it works better. That means that when preloading carMaker with some value - IT CORRECTLY CAUSES DEPENDENT AUTOCOMPLETER TO LOAD ITS FILTERED OPTIONS. Both Firefox and IE. Current problems: a) Firefox and IE If carMaker is preloaded, I select carModel and carType then if I give focus to carMaker and then leave the field: all 3 fields are cleared. carMaker is cleared and it propagates the change to other fields. b) IE I preload carMaker (AUDI). I enter the carMaker field and try to type something, for example delete the last leter (now we have AUD) and it causes javascript error in IE. Works under Firefox. I can see a dropdown with matching value, and later matching values. c) some general problem with dojo - static resources are loaded once per each component instance. If I have 3 autocompletes then /struts/dojo/src/widget/templates/images/combo_box_arrow.png is requested 3 times. That was true a month ago, that is true now. The same applies for datetimepicker and possibly other ajax components. The same behaviour under Firefox and IE. Sorry for the false report before. Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
Hi, These are excerpts from my JSP page: And the direct dependent autocompleter: Values "AUDI" and 354 are axactly the same as one of the pairs returned by the JSON list. The 'disappear' behaviour happens on Firefox 2. I have 3 autocompleters in chain carMaker - preloaded (AUDI, 352) carModel - empty carType - empty I click on carMaker (no request is sent to the server), then I click somewhere else (but not in any autocompleter) and here is what i can observe: * carMaker field is cleared * server gets request for options of the autocompleter carType * server gets request for options of the autocompleter carModel * server gets request for options of the autocompleter carType This happens on Firefox. On IE the carMaker field is not cleared on blur. Also no error in the status bar. But changes in carMaker do not generate requests to the server to load carModel. Dariusz Wojtas On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: Dariusz Wojtas wrote: > > But If I open such page [the same values preloaded] and just click > somewhere in that autocompleter [no changes] and leave the field - the > value is lost. > Some event is generated that causes fresh reload of the field. > Submitted form shows both properties empty. > Are you using "forceValidOption"="true" on that one? > One little other issue is that if carMaker is preselected on load, > then the dependent autocompleter (carModel) is not preloaded with > options. I have to change carMaker to make carModel loaded with > options. > humm...does it happen on FF and IE? Is it different from the example on showcase? > Best regards > Dariusz Wojtas > > On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: >> Hi Dariusz >> >> I need to update the documentation with this info, the thing is that for >> each autocompleter, struts will create 2 fields, one for the text >> entered, with the name "${name}" and another for the key, with the name >> "${name}Key", we need both to "remember" the values if there is a >> validation error or you return INPUT from your page, so if you have: >> >> ["ACURA","351"] >> >> and >> >> >> >> when you click submit, it will submit: >> >> car=ACURA&carKey=351 >> >> you need to add the property "car" and "carKey" in your action. About >> the opera problem, I haven't test it on opera, but I will check it out. >> >> regards >> musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
Hi Musachy, I tried as you advised. Works, no more exceptions and the values are set as expected. But there is still some little problem with preloading. Now I have properties private String carMaker = "AUDI"; private Integer carMakerKey = 354; with hardcoded initial value, just for test. I open my page and the value is preloaded as expected. AUDI is shown. I submit the form - params are filled as expected. AUDI and 354. But If I open such page [the same values preloaded] and just click somewhere in that autocompleter [no changes] and leave the field - the value is lost. Some event is generated that causes fresh reload of the field. Submitted form shows both properties empty. One little other issue is that if carMaker is preselected on load, then the dependent autocompleter (carModel) is not preloaded with options. I have to change carMaker to make carModel loaded with options. Best regards Dariusz Wojtas On 12/28/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: Hi Dariusz I need to update the documentation with this info, the thing is that for each autocompleter, struts will create 2 fields, one for the text entered, with the name "${name}" and another for the key, with the name "${name}Key", we need both to "remember" the values if there is a validation error or you return INPUT from your page, so if you have: ["ACURA","351"] and when you click submit, it will submit: car=ACURA&carKey=351 you need to add the property "car" and "carKey" in your action. About the opera problem, I haven't test it on opera, but I will check it out. regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Redirecting to another action with preserving error messages
Hi, I have some action [/namespace/edit.action] which cannot be called without ID. In fact the ID parameter is needed under some conditions. Therefore if I do not have ID when it is needed I add error message and redirect to INPUT: addActionError(getText("some.id.not.set")); return INPUT How do I define my action to redirect to another action (not a JSP) AND keep the message so it can be displayed? I tried to configure my result in different ways a) try result type 'chain' - pointing to another action name in the same package (does not need any params) /WEB-INF/jsp/pages/package/input.jsp index but it ends with: java.lang.NullPointerException at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:197) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:337) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115) b) I tried result type 'redirect', 'redirect-action' but then I loose my error message c) I tried 'dispatcher' to a fully qualified action URL /package/index.action but then I get exception from Tomcat: HTTP Status 404 - //package/index.action The requested resource (//package/index.action) is not available. Any suggestion how to call another action that does not need any params and still have the error messages displayable? Solution b) successfully redirects but issues another requests from the browser and that way I lose my error message. I am using struts2 trunk builds. Thanks in advance Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
Hello, I am very happy with the changes being made. They really seem to help - on Firefox 2 :) I can see much better propagation of events in cascaded autocompleters, predefining seems to work on the simple test case that I made. But there are still problems, some of them seem to be very new. I have made a fresh build today (trunk of S2, revision 490697) and the problems that I can now see [on Windows XP SP2] are: a) problems on MsExplorer (latest 6.xx) - problems with propagating events even if I try to type characters in the 1st autocompleter in the chain I get javascript error. I cannot say much about the error [poor console in ie] but it makes it unusable. If I try to click on the dropdown first - usually it opens as it should. But events are still not propagated. b) problems on Opera (9.0.2) - propagating events does not seem to work. There is also one big problem that is browser independent. I have a property in my action: private Integer carMakerId; with getter and setter. And I have autocompleter attached to it that. The list it is loaded with is like this (part of real output) - [name, id]: [ ["ACURA","351"], ["ALFA ROMEO","353"], ["AUDI","354"],] After I select AUDI and submit the form I get URL like this /myApp/myAction.action?carMakerId=AUDI&carMakerIdKey=354 And that creates a long stacktrace because the carMakerId property is of type Integer, which makes the action fail completely - stacktrace. I created a separate JIRA ticket for the exception problem: WW-1577 [improve property handling]. But the question here is - How should I handle such properties in my actions? Create property private Integer carMakerIdKey; instead? Will it be understood when preloading the value? What if the property postfix changes? [I think it did recently]. Any hints on that? Thanks a lot, I am really trying not to complain, I really see improvements but there is still a lot to be done ;( Best regards Dariusz Wojtas On 12/27/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: I attached a patch to WW-1562 to fix some of the things you requested. regards musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] dropdowndatetimepicker
Hi, I ma trying to use the dropdowndatetimepicker tag but with little success. My Action defines field java.util.Date registrationDate; And here is my JSP part: Questions that I's like to ask: a) how do I force the tag to load initially with a value from the property? If I set the property to some non-null value, it is still not displayed. The showcase app uses an easy way, it predefines the initial value this way: Which means the value is already formatted for the tag by hand. How to tell the tag to read my value from the property? Whatever I do - it displays empty date field when loaded from action. b) submitting the form with date I'd like to display the date in format 'dd-MM-' (Poland) And if I set it to the tag - it works for displaying. But it uses the same format to send the data when the field is submitted. And this causes an exception because validators cannot parse it: 22:49:53,187 ERROR - Dispatcher - Could not execute action java.lang.NullPointerException at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:197) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:337) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) [...] Then I thought about using the saveFormat attribute for this purpose but it still fails. And here is the GET url generated by the browser for two Date properties on a form using dropdowndatetimepicker with the settings shown above: displayFormat="dd-MM-" saveFormat="-MM-dd" /myAction.action?=2006-12-22&date1=22-12-2006&=2006-12-23&date2=23-12-2006 Such request produces stacktrace. Looks like the datepicker has empty names for the additional properties containing values in saveFormat. Using Struts 2.0.2 Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] s:iterator and s:checkboxlist inside (using 2.0.2 trunk)
I have found a solution after lots of experiments. I am still not sure what caused the problems (I tried tons of variants in the JSP) but finally it started to work. No changes in the action code, only in the JSP block. It started to work after I added jstl into the game and dropped the s:iterate tag. ${group.desc} Can somebody say what caused problems in the previous code I have sent? Why did it work on the 1st invocation and failed on all other calls? Dariusz Wojtas On 12/22/06, Dariusz Wojtas <[EMAIL PROTECTED]> wrote: Hi, I have such properties in my action: private ArrayList extensionGroups = null; private HashMap> groupedExtensions = null; The 1st list contains only some 'Extension' elements. The 2nd map contains other lists of extensions (values) with some property (treeNo) from the parent used as the key. Then I have a JSP page with such construct somewhere in it: ${desc} And here is a strange thing: When I start the app and run the action for the 1st time I get nice result AS EXPECTED: GROUP1 chk: extension1 chk: extension2 chk: extension3 GROUP2 chk: extension4 chk: extension5 But after reloading the page (no extra params in the url, just plain GET), the result is: chk: GROUP1 chk: GROUP2 Looks like the context of the data beaing displayed is different. But it's the same page! The same code and the same data. After restarting the app it is again the same behaviour. My debugs in the actions (getters) show that the same data is returned in all cases. What am I doing wrong? Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] s:iterator and s:checkboxlist inside (using 2.0.2 trunk)
Hi, I have such properties in my action: private ArrayList extensionGroups = null; private HashMap> groupedExtensions = null; The 1st list contains only some 'Extension' elements. The 2nd map contains other lists of extensions (values) with some property (treeNo) from the parent used as the key. Then I have a JSP page with such construct somewhere in it: ${desc} And here is a strange thing: When I start the app and run the action for the 1st time I get nice result AS EXPECTED: GROUP1 chk: extension1 chk: extension2 chk: extension3 GROUP2 chk: extension4 chk: extension5 But after reloading the page (no extra params in the url, just plain GET), the result is: chk: GROUP1 chk: GROUP2 Looks like the context of the data beaing displayed is different. But it's the same page! The same code and the same data. After restarting the app it is again the same behaviour. My debugs in the actions (getters) show that the same data is returned in all cases. What am I doing wrong? Dariusz Wojtas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Display a list of items in multiples HTML files but within one JSP and action
No answer so far, then maybe I will help. The described solution was found long time ago somewhere in the net, I have also used it in some projects with success. I use the displaytag library, which does excellent job in displaying paged tabular data. It has some annoyances and sometimes I think it is a semi-abandoned project, but most of the fixes I needed were found in the project's JIRA issues (patches). Important. The solution below works with displaytag using EXTERNALLY sorted pages. When displaying paged data you need at least 2 things 1) info about the request I use a bean for it class PageRequest implements Serializable { private int pageNumber; // the number of the requested page private int pageSize; // requested page size private SortOrder sortOrder; // UP-DOWN private String sortColumn; // the column to use for sorting private boolean countResults; // if I want it to count the number of all matches } I have some utility that parses the request and returns such bean. I designed it to be compatible with displaytag and the way it passes that info in URLs. Something like parseRequestBean(HttpServletRequest req, String tableName, boolean countResults) 2) info about the result page class PageResponse implements Serializable { private ArrayList list; private int pageNumber; private long totalElmementCount; private int pageSize; ... } I also have some utility methods (both Hibernate and JDBC) that accept: + the PageRequest + know which table to query + optional params and return a PageResponse of beans. My pagingmethods in DAOs look like this: String baseQuery = "from MyHibernateBean myHibernateBean "; PageResult page = HibernatePager.page(MyHibernateBean.class, session,// hibernate session baseQuery, "select count(*) " + baseQuery, params, paramTypes,// hibernate specific stuff pRequest); Then I have another utility method that stores my result page in the request - in a way compatible with displaytag. And ... that's all. Maybe it sounds complicated but really works, and in fact requires very little code when using it later. The whole concept is build with: 2 beans(PageRequest, PageResponse) 2-3 utility classes It's usage in the action class is also very simple: PageRequest pRequest = DisplayTagUtils.getRequest(getRequest(), TABLE_NAME, PAGE_SIZE); PageResponse page = getDbService().listMyBeans(param1, ..., pRequest); DisplayTagUtils.storePage(getRequest(), TABLE_NAME, page); That's all. I have tons of such actions/tables. It only loads the beans that need to be displayed, with sorting done in DB. This one works perfectly for me (after fixing some displaytag annoyances). Will anyone else share other ideas? Dariusz Wojtas On 12/21/06, Fabio Miranda Hamburger <[EMAIL PROTECTED]> wrote: Hello, Let's assume I have this big list of item, 250 records are going to be display. I have search.jsp that asks in a FORM the search criteria, then, based on the parameters, search.do is execute, and, let's say the first 25 items are shown, then, the next 25 (from 25 to 50) are shown and so on. Questions (all of them are related): 1. How can I coordinate this per basis display of items between the searchResults.jsp (search.do success to that file) and the action ? 2. In search.do action, how can I know the offset to display? 3. How searchResults.jsp keeps the offset between consecutive displays and how does it resend it to the action ? A simple code in JSP, html and STRUTS will be very kind. Best regards, --- Fabio Andrés Miranda Ingeniería en sistemas informáticos Universidad Latina - Costa Rica http://ns.isi.ulatina.ac.cr/~fabmirha
Re: [S2] - access to the action from a JSP page
Thanks for the response. I know how to access it using tags, but what I want is to access it with plain Java inside a scriptle area. Something similar to this: <% MyTestAction act = ... ? %> Do I have to play with extra interfaces on the action? Or make it request aware and put the action itself in the request as an attribute? Or it is possible out of the box? Darek On 12/21/06, Wesslan <[EMAIL PROTECTED]> wrote: You can access all your actions public getters (and setters) from your JSP with something like . Action: Public String getPetName() { return "Dinky"; } JSP: Or did I misunderstand you? Hth, Peter -Original Message- From: Dariusz Wojtas [mailto:[EMAIL PROTECTED] Sent: den 20 december 2006 22:29 To: Struts Users Mailing List Subject: [S2] - access to the action from a JSP page Hi, Can somebody help me and give an example how to access the 'parent' action from a JSP page? Lets say I have MyTestAction which redirects to 'page.jsp'. How do I get access to the action (it's properties?) <% MyTestAction act = ... ? %> Darek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] - access to the action from a JSP page
Hi, Can somebody help me and give an example how to access the 'parent' action from a JSP page? Lets say I have MyTestAction which redirects to 'page.jsp'. How do I get access to the action (it's properties?) <% MyTestAction act = ... ? %> Darek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: read/display image from Database using struts
On 12/18/06, Kranti <[EMAIL PROTECTED]> wrote: Dear Dariusz , this is the first time for me to solve this kind of problem. could you provide some sample code to address this. thanks in advance This is something simplified, may not compile - but exactly shows what needs to be done. Passing of blobID may be done in many ways, this way gives you chance to pass nice URLs without questionmarks, etc. Something of type /dbImg/123456.jpg /dbImg/123456.png etc. Dariusz Wojtas public class MyBlobImageServlet extends HttpServlet { public static final long EXPIRY_PERIOD = 60 * 60 * 1000; // one hour, depends on your needs @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String pathInfo = request.getPathInfo(); String blobID = calculateBlobID(pathInfo); if (blobID == null) { // write some debug if needed return; } byte[] imageData = getBlobFromDB(BlobID); if (imageData == null) { // write some debug if needed return; } long lastModified = ... // depends on the logic, may be System.currentTimeMillis() // set response headers response.setContentLength(imageData.length); response.setContentType("image/png"); // depends on your actual blob content, may vary response.setDateHeader("Last-Modified", lastModified); response.setDateHeader("Expires", lastModified + EXPIRY_PERIOD); // send the image to the browser try { response.getOutputStream().write(imageData); } catch (Exception e) { // write stacktrace, maybe some more info (request params, etc.) } } } web.xml Define servlet, then mapping to it. blobImageServlet my.package.MyBlobImageServlet blobImageServlet /dbImg/* - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: read/display image from Database using struts
Custom servlet which retrieves data from DB, writes it to the output stream. It should define correct headers first (mimeType, Expires, Date). Map it to some url like /images/* and you may pass identifiers by composing URLs like /images/.jpg Dariusz Wojtas On 12/18/06, Kranti <[EMAIL PROTECTED]> wrote: Hi, How should I read/display image from Database...which is stored interms of bytes in the Database. Please suggest me some way to render the image in JSP. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] autocompleter, predefining initial value
I would leave the current behaviour as the default. When there is small amount of data (up to hundreds of entries) it may give the end user feeling of a faster response. If there is more data then the developer should make use the the new feature. The info about reloading is a great news :) Thanks a lot. Dariusz Wojtas On 12/17/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: Making the autocompleter reload its content while typing was easier than expected :). Do you think it would be better to have that behavior , or the current one, by default? musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] autocompleter, predefining initial value
Hi, I am using Struts 2.0.2, trunk. I have an action (/listy/kodyPocztowe) that returns postal codes [id, name] and another action that server a form (form points to the same action back). How to define the initial value in the autocompleter field? Even if I submit the form and it reloads with the same action, the autocompleter does not display previously selected option. I tried to use a javascript (shown below) to debug it (print field names). When an alert shows, in place of autocompleter I can see plain textfield with resubmitted values (as expected), after alert messages do finish it is replaced by the autocompleter widget - empty value, nothing selected. the widget is loaded with options, but none is selected. Any hint how to solve this mistery? What am I missing? function filterKodPocztowy(field) { alert(field.name); return field.name == "kodPocztowy"; } [...] [...]
Re: S2 with eclipse/WTP
I also use eclipse with S2 with no problem, and 'mvn eclipse:eclipse' works as it should. I repeated it also today on fresh source tree. 1) define Maven repository (for referencing JAR files) Window --> Preferences --> Java --> Build Path --> ClassPath Variables Define variable M2_REPO with value pointing to your repository, in my case: c:/Documents and Settings/Darek/.m2/repository 2) After this command, just open eclipse, menu File --> Import --> Existin Projects into Workspace Root Directory: path to your Struts2 root. Button "Browse" and you get list of Struts projects (api, core, plugins) Works great. I only had 1 problem, when using maven to build JAR files of struts. By default eclipse is pointed to compile code into the same directories as maven, and maven was somehw confused with that - caching issues. You may change the eclipse build path by: clicking on the project preferences, Java Build Path, Default Output Folder. Just specify some other directory. Now it seems to work. Side note From time to time my struts 2 compilation in maven only works if I fetch xwork sources into the same parent dir as struts2. Dariusz Wojtas On 12/15/06, Rick Schumeyer <[EMAIL PROTECTED]> wrote: I would like to learn S2 while using the eclipse/WTP IDE. I currently use eclipse/WTP for a struts 1.3 project. But the way I constructed the eclipse project was a bit of a pain. In reviewing the list archives, it looks like there is an easy way to generate a blank template for an S2 project with eclipse/WTP using maven. The problem is, I don't really understand the process. It seems to have something to do with the S2 source tree (which I have) a pom file, and typing "mvn eclipse:eclipse". I tried that and I'm not really sure what it did. I'm sure maven is a wonderful tool, but I'm hoping to avoid learning much about it right now. Perhaps I'm lazy, but I'm still trying to learn more about struts, jsp, servlets, hibernate, eclipse, ant, etc. So is there an idiot-proof way for me to generate an eclipse/WTP/S2 project? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] the autocompleter tag - the href value
Works perfectly now. Most likely maven had issues with the compiling struts2 code into the same directories as eclipse. After I pointed eclipse to compile into separate directories - maven started to work as expected. Thanks for help Darek On 12/15/06, Musachy Barroso <[EMAIL PROTECTED]> wrote: Showcase is working and it has this: Are you working with head svn? Because it was behaving as you say(wrong) a few days ago. musachy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]