Struts 2.3.20 Bug?
Hi I have upgraded to Struts 2.3.20 and I'm trying to use the new s:datetextfield tag. The creation of the jsp fails with the error listed below. I've checked and the datetextfield.ftl is not in any of the template directories in struts2-core-2.3.20.jar org.apache.jasper.JasperException: Template /template/simple/datetextfield.ftl not found. - Class: freemarker.template.Configuration File: Configuration.java Method: getTemplate Line: 580 - freemarker/template/Configuration.java:580:-1 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:570) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:188) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:273) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
2.3.20 Bug with s:action or s:select tag
Hi After upgrading to 2.3.20 from 2.3.16.1 the following .jsp snippet fails to compile. Reverting back to 2.3.16.1 and it starts to work again. s:action name=list-platforms var=list / s:select list=#list.platforms listKey=%{id} listValue=%{platformName} name=platformId value=platformId headerKey=-1 headerValue=--- Select Platform --- / org.apache.jasper.JasperException: tag 'select', field 'list', name 'platformId': The requested list key '#list.platforms' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:570) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:188) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:273) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
Re: 2.3.20 Bug with s:action or s:select tag
Referring to the log file, the dump was preceded by the following few lines; 16 Dec 2014 15:44:09 ERROR ActionComponent,http-bio-8080-exec-5:42 - Could not execute action: /admin/list-platforms There is no Action mapped for namespace [/admin] and action name [list-platforms] associated with context path [/FaultmateGenesis-Server]. - [unknown location] So it looks as if the change is with the s:action tag processing, or has something else changed between 2.3.16.1 and 2.3.20 that I've missed? Regards On 16 December 2014 at 15:55, Lukasz Lenart lukaszlen...@apache.org wrote: Can you post the whole log? Maybe there are some warnings 2014-12-16 14:48 GMT+01:00 Roger Varley roger.var...@googlemail.com: Hi After upgrading to 2.3.20 from 2.3.16.1 the following .jsp snippet fails to compile. Reverting back to 2.3.16.1 and it starts to work again. s:action name=list-platforms var=list / s:select list=#list.platforms listKey=%{id} listValue=%{platformName} name=platformId value=platformId headerKey=-1 headerValue=--- Select Platform --- / org.apache.jasper.JasperException: tag 'select', field 'list', name 'platformId': The requested list key '#list.platforms' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:570) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:188) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:273) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244
Re: Struts 2.3.20 Bug?
I couldn't seem to be able to re-open WW-3493 so a new one WW-4434 has been created Regards On 16 December 2014 at 15:44, Lukasz Lenart lukaszlen...@apache.org wrote: You are right! I have once again reviewed https://issues.apache.org/jira/browse/WW-3493 and the template is missing :( Overlooked that :( Feel free to re-open the issue or create a new one. 2014-12-16 14:35 GMT+01:00 Roger Varley roger.var...@googlemail.com: Hi I have upgraded to Struts 2.3.20 and I'm trying to use the new s:datetextfield tag. The creation of the jsp fails with the error listed below. I've checked and the datetextfield.ftl is not in any of the template directories in struts2-core-2.3.20.jar org.apache.jasper.JasperException: Template /template/simple/datetextfield.ftl not found. - Class: freemarker.template.Configuration File: Configuration.java Method: getTemplate Line: 580 - freemarker/template/Configuration.java:580:-1 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:570) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:164) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:188) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:273) org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:76) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:229) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:125) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244) com.opensymphony.xwork2
Re: 2.3.20 Bug with s:action or s:select tag
Yes, I do. I've checked - and calling the action directly from the browser gives the same response. The action code is below. Regards package com.blackbox.x.actions.admin; import java.util.List; import org.springframework.stereotype.Service; import com.blackbox.entities.db.Platform; import com.blackbox.services.Services; import com.opensymphony.xwork2.ActionSupport; @Service public class ListPlatforms extends ActionSupport { /** * */ private static final long serialVersionUID = 7092585407905567102L; ListPlatform platforms; public String execute() { platforms = Services.listAllPublishedPlatforms(); return SUCCESS; } public ListPlatform getPlatforms() { return platforms; } } On 16 December 2014 at 16:09, Lukasz Lenart lukaszlen...@apache.org wrote: 2014-12-16 15:03 GMT+01:00 Roger Varley roger.var...@googlemail.com: Referring to the log file, the dump was preceded by the following few lines; 16 Dec 2014 15:44:09 ERROR ActionComponent,http-bio-8080-exec-5:42 - Could not execute action: /admin/list-platforms There is no Action mapped for namespace [/admin] and action name [list-platforms] associated with context path [/FaultmateGenesis-Server]. - [unknown location] So it looks as if the change is with the s:action tag processing, or has something else changed between 2.3.16.1 and 2.3.20 that I've missed? A lot ;-) That's the problem with .20 - too many changes :( Do you use the Convention plugin? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: 2.3.20 Bug with s:action or s:select tag
Oh bugger :( I've got actions failing all over the place - but strangely, not all of them. The config-browser plugin see's my configured namespaces, but lists no actions in any of them. Regards On 16 December 2014 at 16:23, Roger Varley roger.var...@googlemail.com wrote: Yes, I do. I've checked - and calling the action directly from the browser gives the same response. The action code is below. Regards package com.blackbox.x.actions.admin; import java.util.List; import org.springframework.stereotype.Service; import com.blackbox.entities.db.Platform; import com.blackbox.services.Services; import com.opensymphony.xwork2.ActionSupport; @Service public class ListPlatforms extends ActionSupport { /** * */ private static final long serialVersionUID = 7092585407905567102L; ListPlatform platforms; public String execute() { platforms = Services.listAllPublishedPlatforms(); return SUCCESS; } public ListPlatform getPlatforms() { return platforms; } } On 16 December 2014 at 16:09, Lukasz Lenart lukaszlen...@apache.org wrote: 2014-12-16 15:03 GMT+01:00 Roger Varley roger.var...@googlemail.com: Referring to the log file, the dump was preceded by the following few lines; 16 Dec 2014 15:44:09 ERROR ActionComponent,http-bio-8080-exec-5:42 - Could not execute action: /admin/list-platforms There is no Action mapped for namespace [/admin] and action name [list-platforms] associated with context path [/FaultmateGenesis-Server]. - [unknown location] So it looks as if the change is with the s:action tag processing, or has something else changed between 2.3.16.1 and 2.3.20 that I've missed? A lot ;-) That's the problem with .20 - too many changes :( Do you use the Convention plugin? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: 2.3.20 Bug with s:action or s:select tag
No - that marks it for auto-scanning. In the meantime I've gone back to 2.3.16.1 and everything is working again :( Regards On 16 December 2014 at 18:00, Lukasz Lenart lukaszlen...@apache.org wrote: 2014-12-16 15:23 GMT+01:00 Roger Varley roger.var...@googlemail.com: import org.springframework.stereotype.Service; @Service Doesn't this annotation define Singleton? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Need to lookup additional data to append to redirection to outside web site
On Mon, 2011-06-20 at 20:44 -0500, John Himpel wrote: Good evening, I have an S2 application the needs to: 1) Verify some input parameters (I know how to do this) 2) Retrieve some additional data based upon the input parameters (I know how to do this). 3) Then format a post type http request with hidden fields containing data from #1 and #2 above to be sent via https to an outside vendor provided web based application running in the outside vendor's domain. 4) The vendor app will then process the application to completion. I believe I know how to do this as a get http request by defining the redirect result in struts.xml. However, I'm at a loss on how do this via a post request. Any advise would be greatly appreciated. To facilitate HTTP comms between your action and a third party web-app you may wish to look at the client portion of Apache HTTPComponenents http://hc.apache.org/ (which I've never used although I've used it in it's previous incarnation as HttpClient) or HttpUnit (http://httpunit.sourceforge.net/) which is heavier and emulates a browser in it's own right. Originally designed for unit-testing web pages, it works well when used to scrape third-party web-apps, form-fill etc etc. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: optiontransferselect don't use hidden input.
On Tue, 2011-05-31 at 13:44 +0200, Alejandro wrote: Hi all, With optiontransferselect, I am trying to get the list of double list but it is impossible if you dont select all them. I had seen an input hidden with __multiselect_ but it isn't filled properly. Thanks for all! Can you post your .jsp and backing action please. In the mean time, check that you have included the s:head tag in your page. This drags in a small javascript file which the optiontransferselect tag needs to work properly Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Redirect and pass as a parameter the original url from an Interceptor
On Thu, 2011-03-17 at 12:48 -0600, Alfredo Manuel Osorio Martinez wrote: I am implementing a Login interceptor which needs to redirect to an action to first authenticate the user. The problem is that I want to send as a parameter to that action the original url, the one that the user was trying to get before the redirect to the login page. This is not a direct answer to your question, but I would suggest that rather than re-inventing the wheel, you take a look at integrating Spring Security, what you're looking for is implemented out of the box with a bit of configuration. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: File Download with multiple files. Design question
On Sat, 2010-11-20 at 09:41 +0100, Paweł Wielgus wrote: Hi All, read about streamResult (I assume You use struts2), and also there is no need for next action in chain, user can simply check as many files as he wants and click download what will call downloadAction that will simply return zip file for download, after downoading user is still at the same page. Hi Pawel That's what I'm doing, but the StreamResult requires an InputStream which forces the intermediate step of creating a temporary file and it's the issue of how to clean up the temporary file (knowing when the StreamResult has completed) that's causing the issue. Li's suggestion of writing directly to the response.getOutputStream() would work, but it means my action now has to know about the servlet api and will be awkward to test. A third alternative I was considering was something like; public class DeleteOnCloseFileInputStream extends FileInputStream { File file; public DeleteOnCloseFileInputStream(File file) { super(file); this.file = file; } @Override public void close() { super.close(); file.delete(); } } and passing that to the StreamResult. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 Spring Plugin Usage
I use the convention plugin for Struts and I take advantage of the spring auto wiring (by name) to automagically inject my service layer. You can do the same for the rest. Check out the reference guide over at spring framework to do so. Weirdly I like having my DAO and Service classes in the appcontext xml file.. But then that is because I am weird... Either I'm misunderstanding the responses or I'm not being clear (I'm also using the convention plugin along with the Spring plugin.) bean id=securityManager class=com.myApp.security.PasswordChecker / is sufficient to have the PasswordChecker injected everywhere any action contains a getSecurityManager() method. However if my PasswordChecker also has need of injection to access a database (ie. PaswordChecker contains a getDaoManager() method then simply having bean id=securityManager class=com.myApp.security.PasswordChecker / bean id=daoManager class=com.myApp.security.DaoManager/ in the application.context.xml does not appear to be sufficient. My action is injected with the PasswordChecker, but the PasswordChecker is not injected with the DaoManager. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 Spring Plugin Usage
If I am understanding you then that is fine. I often do the same, as I like to have a DAO as well as a Service layer. So inject my DAO's into my Service and my Service into my actions. Good ole' code by interface approach :) It's the means that I have to employ to go down the next level I was questioning. Whereas the action gets injected with a simple bean id=securityManager class=com.myApp.security.PasswordChecker /, I have to use the longer version bean id=securityManager class=com.myApp.security.PasswordChecker property name=serviceref local=Service/ /property /bean to get things injected into my bean. I was wondering why just declaring the service bean in the same way as the SecurityManager doesn't seem to work. Mind you, it's nice to know my design approach isn't totally AWOL as well. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Convention plugin blues
Hi Is there a setting/property I can set to get the Convention plugin to tell me where what it's looking for to resolve to the result classes. Having split a Struts 2 (2.1.7) application that was running solely on Tomcat to now serve static content from an Apache Webserver and pass Struts requests through to Tomcat, I've got the html being served ok, config-browser/index.action finds my actions, but I cannot for the life of me get it to find my result classes. If I could only see what/where it's trying to find them .. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] best practice for reading POST body in an action
On Thursday 08 January 2009 18:12:48 John Cartwright wrote: No, in this case the mime type is not application/x-www-form-urlencoded and not sent w/ KVP from a form. The body of the POST is all content. Hmm, then I'm sorry I'm probably not going to be much help. Although I've done quite a bit of this sort of thing in the past, I always made sure that the body content was written as data=xmlblob/ by the client, and I don't think/remember that the mime type being sent by the client as being particularly significant. So ideas, assuming that you can't change your client to write the body as a key/value. Firstly I'd be surprised if Struts actually ignored/dropped your data so maybe the first thing to try is to post your data to an action and then look for any error/info messages that might give a hint as to what is going on if Struts can't map your request data to the RequestMap. You could look at implementing the ServletAware interface interceptor, but this ties your action too closely to the transport mechanism for my taste and makes testing a little more cumbersome. If all else fails, I'd be tempted to create a custom interceptor that looks for these Posts and changes the body of the post to a key/value pair. Sorry I can't be of more help. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] best practice for reading POST body in an action
On Wednesday 07 January 2009 17:58:48 John Cartwright wrote: Hello All, Is there a best practice for using the body of a POST request w/in an action? The request is not key/value pairs but a blob of XML. Before I dropped back to using a traditional HTTPServletRequest approach, I'd see if there was a better way in S2. Forgive me if I'm being dense, but won't you still have a single key/value pair where key will be something and the value is your XML blob? Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [OT] What slows you down?
On Friday 20 June 2008 15:07:17 Al Sutton wrote: Web Design :). I can code it in a few days, but getting it to look pretty so that users don't complain, thats a b**ch. That shouldn't be my problem. I'm a developer not a graphic designer. What would be nice though, would be if it were easier to label and tag everything in sight in the generated HTML and then we could simply lob the HTML over the fence to a graphic designer - which is the route proposed by http://www.csszengarden.com. Just my $0.02 worth. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts 2] Formatting double
On Wednesday 04 June 2008 22:49:15 Felipe Lorenz wrote: Are you brazilian to use a comma for decimal separator? You might be surprised at the number of countries that use a comma as the decimal separaor as opposed to the dot. http://en.wikipedia.org/wiki/Decimal_point Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i18n Struts Jco Code in Windows English and Polish System
On Friday 23 May 2008 13:51:08 Raghuveer wrote: I am working on Struts ,SAP-JCO . This is i18n application running on Tomcat. I have designed my application in UTF8 charset. When Saving the polish characters from application they are saved into SAP Database properly. Before Saving i am doing following String modifications. The same code doesn't work on Tomcat Server on Windows English System.Here the Polish characters( aeclónszz ) are saved as #. What would be cause for this. What changes i need to do in my code to work on both English And Polish Windows (Tomcat Server) strConvertedMessage = new String(strText.getBytes(UTF8), UTF8); inputTable.setValue(strConvertedMessage,TABLENAME); Without more information, it's difficult to suggest the soloution, but a couple of questions come to mind. Firstly what are the values of strConvertedMessage and inputTable before you try to update SAP? Have you tried debugging your Function Module in SAP to see what SAP is recieving before you commit your update to the database (I assume that its Oracle?) Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ajax layout - how to place 2 submit buttons one after the other?
There are at least three choices: (1) Do something via CSS (inline or something) (2) Modify the existing Ajax theme (3) Create a new theme I know I'm probably going to be shot down in flames for this, but why do the Struts 2 tags attempt to control any sort of layout? Why is there not a theme that simply renders the tags and relies on a seperate CSS to do the layout. (I know .. and if I had the skill, I'd probably try) Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] XML Preprocessing
I've never tried to do this since, normally, you want the XML processor to handle entities such as the symbol - and if either the input XML or output XML contains these symbols unaltered then you don't have legal XML. If you really need to leave these unprocessed, then perhaps you can replace the SAX EntityResolver with your own implementation? Perhaps if you could explain what you're trying to do? Regards On Monday 17 March 2008 05:39:07 Chris Pratt wrote: Sorry I missed the normal Friday free-for-all with my Off Topic question, but I'm hoping someone around here has already solved the problem I'm staring at. I am trying to pre-process a stream of HTML/XML. My first thought was to just use SAX (with TagSoup for the HTML) and watch for the tokens I needed to modify while passing the rest through, but all the XML tools I can find are geared towards processing XML, not pre-processing it. So they help you out by automatically converting entities to their values and other things that completely get in the way of pre-processing. Has anybody else had to solve this problem? If so, any pointers would be GREATLY appreciated. Thanks. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Populating dropdown
On Monday 11 February 2008 12:01, Jayaveeran wrote: Hi all, I am populating a dropdown in my jsp which has more than 10,000 elements in it. Since the record size is very huge the time taken for the JSP to load is very high. I am using the folowing snippet to populate the dropdown. I am using struts framework. Is there any other way that I can populate the dropdown to make it faster ? Please help. I'd recommend re-thinking your design. Even if you could make the population of your drop-down faster, you're still going to have some serious useability issues with a dropdown of that size. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionAware vs ActionContext access to session - confused..
On Tuesday 11 September 2007 23:03, Nils-Helge Garli wrote: You could, but I would recommend using the *Aware interfaces in your actions. It makes them easier to test. Hmm.. I've always handled session data by creating an application base action that implements a getUserData() and a setUserData() method. All my actions extend this base action. I then use an interceptor to grab the session data build whatever object I decide to use to hold the data and inject it into the base action. In this way, all my actions can simply getUserData() without having to care where the data comes from. Is this bad practice or just a matter of personal preference? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic Tree Example
What I would really like to do is create a model Petshop application for Struts 2. I've setup a Google Code site for this purpose, but I haven't had a chance to seriously pursue it yet. * http://code.google.com/p/sq1-petstore/ My dream would be to have a full set of use cases, a reasonable set of formal requirements, and full suite of JUnit and Selenium tests for Petstore, along the lines of what I do for my own projects. Would there be merit in suggesting that maybe we should have two seperate versions. One traditional implementation - minimal javascript, no ajax etc and a second version using the full gamut of available technologies. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 and Tomcat 5.0.27 filter start error
On Friday 13 July 2007 18:08, Phillip Blevins wrote: Greetings, I am trying to use a struts 2 application on Tomcat 5.0.27. I originally had it working on 5.5 but i had to downgrade to 5.0.27 because thats the version my web service has. I am getting the error SEVERE: Error filterStart when i try and start Tomcat. Thinking this might have to do with my application I tried it using the Struts Blank application and I get the same error. This page has a reference to the problem, https://issues.apache.org/struts/browse/WW-1820 But no solution that i can get to work. Has anyone gotten struts 2 to work on 5.0.27 or .28. I had a simarly unhelpful error message today while migrating an existing project to a new machine. You are probably missing a .jar file in your project that is not needed to compile, but is needed to run. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring Action Instantiation
On 20/06/07, Dave Newton [EMAIL PROTECTED] wrote: ?! I didn't understand a word of that either :-) --- Martin Gainty [EMAIL PROTECTED] wrote: Assuming Spring is your AOP framework Logging is now an Advised entity to be injected at compile time or runtime via 'pointcut' details on implementation are located here http://www.devx.com/Java/Article/30799/0/page/1 to quote 'Because this FactoryBean concept is how Spring wraps beans and then creates a proxy for the bean (using some internal tool such as dynamic proxies, CGLIB, etc.) that executes some advice on method calls when the pointcut says the method is a joinpoint (assuming a pointcut is defined). ' M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, June 20, 2007 9:45 AM Subject: Re: Spring Action Instantiation I replaced the spring bean id in my action mapping with the fully qualified class name to rule Spring out completely. I am still never seeing the log4j output in the constructor of my action class! I have double checked my log4j.properties and the debug output would be written out if the constructor were called. Any ideas? Could this have anything to do with an interceptor? On 6/20/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm using Spring 2.x and the attribute scope=prototype On 6/19/07, Zarar Siddiqi [EMAIL PROTECTED] wrote: It sounds to me like your Action class might be configured as a singleton. If that's the case the action class' constructor would only be called once on startup. Make sure you have singleton=false in your Spring config for the action class. The default value for singleton is true. stanlick wrote: It appears as though I am not getting a new Action instance created for each request! I have placed a logging statement in the constructor of my Action class and it is not emitting output. The Bean inside the Action *is* emitting log statements from its constructor so I must have the Spring beans wired correctly. I am injecting both the Actions and Action Beans via Spring. I have scope=prototype on them both. Any ideas? Thanks, Scott -- View this message in context: http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED] -- Scott [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: facade stored in Session
On 02/06/07, Mansour [EMAIL PROTECTED] wrote: Hello every one: I am trying to access my business layer from Actions. However, I need to hold a reference to the business layer facade and access it from any Actions classes. I am saving the reference to servicesFacade in a session and retrieving it in the Action. I am having no problem with this, but I don't know if this is the proper way to do it. Is there other alternatives ? I need an advice. I've done a similair thing and stored a reference to the layer in the session. However, I extended the base struts 2 action with a layer-aware interface to get the reference to a layer and an interceptor to inject the reference. All my actions extend the new base class and I can retrieve the business layer with a simple getLayer() method. This means I don't need to fiddle around with the session object in my actions. YMMV Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ending session
On 05/06/07, Mansour [EMAIL PROTECTED] wrote: I am saving objects in the session. After the browser closes I would like to clean the remaining junk. How do I achieve this ? Implement an HttpSessionListener. The destroy() method will be invoked by the servlet container when the session ends. You should be aware that unless you have some means of detecting when the browser closes or the user navigates away from your site and you destroy the session yourself, the destroy() method will not called until the session times out. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ending session
2. if the user simply closes the browser, you have no option but to wait for the session to expire. Maybe all you really want is a shorter session timeout.; but I'm sure that I've read that it's possible, using Javascript, to detect if a client closes the browser if that's true, then you could use an AJAX call to invalidate the session. Having said that, unless the you store huge amounts of data in the session, it probably won't be too much of a problem to wait for the session to timeout on its own. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ending session
Roger Varley wrote: I'm sure that I've read that it's possible, using Javascript, to detect if a client closes the browser if that's true, then you could use an AJAX call to invalidate the session. This is possible, but you can't bet on it actually working. The user might have javascript disabled, or the browser may not fire javascript events as it's closing itself entirely (instead of just closing one window, for instance). Basically, the only reliable way to destroy a session is to wait for it to time out (unless the user explicitly logs out, of course). I would not disagree with this. However, you have to suspect that the majority of clients don't have Javascript turned off, otherwise Ajax wouldn't be the current favourite technology. :-) Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi lingual web site
Using the locale, you should be able to construct a SQL query to load the correct data from the table structure I mentioned. Or you could add language choice as a user selectable option on either your login page (if you use a login) or on your home page. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Table Tags - Installation
Hi I've just downloaded the Struts 2 table tags from Sourceforge. Are there any installation instructions anywhere? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: preInvokeJS in s:submit
On 25/05/07, Musachy Barroso [EMAIL PROTECTED] wrote: Use notifyTopics instead. I've been trying to do this for ages (display a confirmation dialog when the user is about to do something irrevokable) and it never occured to me to use Ajax :-( Is there any example code anywhere? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Results Based on URL File Types
I'm still a newbie as well so take this with a pinch of salt. I would try doing it this way; http://www.domain.com/struts2/queryName?param1=foo,param2=xml http://www.domain.com/struts2/queryName?param1=foo,param2=json http://www.domain.com/struts2/queryName?param1=foo,param2=html http://www.domain.com/struts2/queryName?param1=foo,param2=rss Include getter and setter for param2 in your action and set your result strings as appropriate to get the results you want so, for example after executing your query, you could include in your action method; return getParam2() which would return xml,json,html or rss and then in your struts.xml you'd specify result name=xmlYourResultTypeForXML/result result name=jsonYourResultTypeForJSON/result etc etc Does this help. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serious memory leak
On 22/05/07, Balazs Michnay [EMAIL PROTECTED] wrote: Hi, I have just downloaded NetBeans Profiler to see how my web-app performs and realized that it produces serious memory leaks... The interesting part is that I have nothing on my JSP but static struts tags (no dynamic content at all) and it turned out that the leaks are not made by my application, but made by either struts (???) or Tomcat (???) or Java itself, I don't know what... I don't want to be seen to be teaching my grannie to suck eggs, but are you doing your profiling with a clean start of Netbeans and Tomcat? I've just been indulging in a fairly rapid cycle of develop, deploy in-situ, test using Netbeans and the embedded Tomcat, and have crashed with an OOM error. So something in Netbeans or, more likely, Tomcat is holding resource when you re-deploy in-situ. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] unexpected Tomcat shutdown everyday
Unfortonutalely, I don't have any class that invokes System.exit() nor Spring scheduler. Nothing particular happens before tomcat shutdown (see logs). And No database is backed up or restarted during this time. This is really strange (and critical) and I suspect that it comes from Struts. Tomcat listens on port 8009 (I think) for a shutdown command. Try changing the port in your Tomcat configuration and see if the problems goes away. I have read of weird situations where there are multiple installations of Tomcat and one incorrectly configured installation would take down another installation when the shutdown command was issued because the port number wasn't unique to each installation. HTH Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Inappropriate Error Message
I'm developing using Struts 2 with the Spring plugin within Netbeans 5.5 using the embedded Tomcat as the servlet engine. If I screw up my Spring applicationContext.xml by incorrectly specifying the path to the class in a bean element, then when I try to deploy the project I get the error message in the Tomcat start up logs. SEVERE: Parse Fatal Error at line 1 column 1: Content is not allowed in prolog. org.xml.sax.SAXParseException: Content is not allowed in prolog. rather than a more helpful can't find class foo.bar.baz.class It's not too big a problem at the moment as I only have half a dozen beans defined, but for larger projects a more helpful error message would be nice. Is this actually a Struts 2 issue, a Spring issue or a product of my development environment? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Spring Injection
Hi I suspect that this going to be a stupid question but please bear with me. I have a BaseAction for my application that extends ActionSupport and all my actions extend BaseAction. BaseAction recieves a reference to a Service bean, through which my actions obtain objects from my Business Layer, by injection from the Spring container. Is there a way of configuring Struts and Spring so that I only need to do this for my BaseAction and therefore avoid having to define all my actions to Spring or do I still need to inject the Service object into each action. I'm sorry if this is a really stupid question, but this is all new stuff to me. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Inappropriate Error Message
Usually this means that there is something other than the BOM before your ?xml processing instruction. Are you sure you don't have anything before the beginning of your XML, or is this easily repeatable by simply using a bogus class name? This is repeatable by using a bogus class name, so that suggests that Struts/Spring is the root cause. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to get Exception info when I use global exception mappings?
Thanks for your help, I got it. As an aside, it may be worth pointing out that exposing your users to a detailed StackTrace is not usually considered to be a good idea. Firstly, a stack trace means nothing to your users and may actually intimidate them, and secondly, if your application is web facing (as opposed to an intranet) then you are probably revealing too much information about your system and it's set up. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Problem with ! notation
Hi I'm trying to call a method on my action using the ! notation as explained in the CRUD demo. If I call my action from the browser bar as http://localhost:8084/Tiger/StartOrder.action then the execute() method runs. If I call http://localhost:8084/Tiger/StartOrder!execute.action then I get the Struts error page with the message There is no Action mapped for namespace / and action name StartOrder!execute. - [unknown location] (I've checked it with !Execute as well). I'm obviously missing something Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with ! notation
Is dynamic method invocation turned on? (Hey dynamic method invocation... you sure are looking good today, he cajoled, breathily.) It wasn't. I've changed the struts.properties file from struts.enable.DynamicMethodInvocation = false to struts.enable.DynamicMethodInvocation = true and restarted Tomcat but no joy I'm afraid - http://localhost:8084/Tiger/StartOrder!execute.action still gives me the error message. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with ! notation
You might have to post config snippets... I'm assuming Tiger is the webapp? Yes, Tiger is the webapp. My struts.xml contains action name=StartOrder class=com.mysite.ecommerce.actions.StartOrderAction method=input result/startOrder.jsp/result /action My struts.properties is located in WEB_INF/classes along with the struts.xml file and contains struts.devMode = true struts.enable.DynamicMethodInvocation = true If I call http://localhost:8084/Tiger/StartOrder.action then I can see that the input() method is called on StartOrder.action through using System.out.println(). However http://localhost:8084/Tiger/StartOrder!input.action gives There is no Action mapped for namespace / and action name StartOrder!input. - [unknown location] Is there anything else you need to see? I don't want to send too much unneccassary data Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with ! notation
On 21/05/07, Roger Varley [EMAIL PROTECTED] wrote: You might have to post config snippets... I'm assuming Tiger is the webapp? Dave Forget the previous post - it's working after a fashion. http://localhost:8084/Tiger/StartOrder.action runs OK and calls StartOrder.input(). http://localhost:8084/Tiger/StartOrder!input.action runs OK and calls StartOrder.input() http://localhost:8084/Tiger/StartOrder!execute.action fails even though I have an execute method. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with ! notation
Is dynamic method invocation turned on? As an aside, why is dynamic method invocation turned off by default. From experience this suggests that either the functionality is experimental, or is not the sort of thing you should be using unless you have good reason and know what you're doing. Are there any gotchas I should know about? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2, Popup window ?
1. I am on a page and would like the user to click on a link which would invoke my popup window picker. Sorry, but what is a popup window picker? I've a need to display popup windows in my application I've tried googling and can't find anything. Incidentally, has anyone tried overriding the Struts 2 error tags to display the messages in a popup window like the javascript alert() box. I particularly want to override the existing Struts 2 tags so when I finally convince the client that this is not a good idea, it will be straight forward to revert to standard Struts 2 behaviour. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action View wiring
On 16/05/07, Mansour [EMAIL PROTECTED] wrote: Mansour wrote: I found it. I'll post it just in case someone needs it. I used %{id} instead of ${id} and EL expression is evaluated immediately on the first load. I don't know why. I 'd love to hear explanation form someone. But it's working after all. Is there any clear documentation that will explain when you need to use '%', '$' or '#' in Struts2 .jsp pages as I'm finding it all very confusing. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Ajax Forms
Hi Is it possible to insert/update the value of a s:textfield tag in a form using Ajax? I've listed the data entry jsp and the Ajax response jsp page below. When the form is loaded at start up, I see the text values and an empty text field from the ajax response. After entering a value into productCode field, I see the text, the s:property value is displayed, but the s:textfield stays empty. Regards Roger !-- Data Entry jsp -- %@ taglib prefix=s uri=/struts-tags % !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01//EN html head titleEdit Sales Order with Static Form/title s:head theme=ajax debug=true/ script type=text/javascript function filterProductCode(field) { return field.name==orderDetailLine.productCode; } /script /head body s:text name=Account Number/ s:property value=order.header.accountNumber/ br s:text name=Order Number/ s:property value=order.header.orderNumber/ br s:div name=detailLines cssClass=detailLines s:iterator value=order.details status=status s:set name=indexValue value=#status.index/ s:textfield name=order.details[%{#status.index}].productCode value=%{productCode} theme=simple disabled=true/ s:textfield name=order.details[%{#status.index}].productDescription value=%{productDescription} theme=simple disabled=true/ s:textfield name=order.details[%{#status.index}].quantity value=%{quantity} theme=simple disabled=true/ br/ /s:iterator /s:div s:div name=detailEntry cssClass=detailEntry s:url id=getProductInfoURL action=ListProductInfo/ s:form id=form method=post action=EditOrder theme=simple s:textfield name=orderDetailLine.productCode label=productCode id=productCode onchange=dojo.event.topic.publish('getProductInfoTopic', this.value);/ s:div name=updateDiv theme=ajax loadingText=Hang on a sec href=%{getProductInfoURL} formId=form listenTopics=getProductInfoTopic formFilter=filterProductCode /s:div s:textfield name=orderDetailLine.quantity value=%{quantity}/ s:submit/ /s:form /s:div /body /html !-- Ajax Response JSP -- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; [EMAIL PROTECTED] contentType=text/html% [EMAIL PROTECTED] pageEncoding=UTF-8% [EMAIL PROTECTED] prefix=s uri=/struts-tags % This text should appear in the divbr/ The following is the property valuebr/ s:property value=productInfo.productDescription/ s:textfield name=productInfo.productDescription value=%{productDescription}/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Framework needed
Hi Sorry for the off-topic post, but if anyone is likely to know the answer they'll probably be here. In the same way that we have Hibernate, Ibatis et al for mapping between RDBMS and Java objects, does anyone know of a framework that will map between SAP R3 Remote Function Calls and Java objects? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] s:form tag problems
I'm sorry to keep harping on about this but some of the attributes of the s:form tag used in a .jsp do not render in the output HTML. Examples are s:form id=form method=post action=EditOrderUsingSession disable=true s:form id=form method=post action=EditOrderUsingSession onclick=alert('Form') In both cases, neither the disable or onclick attributes appear in the rendered HTML If I've misunderstood the use of the tag or haven't RTFM'd the right documentation please tell me. If it's a bug, and someone would point me in the right direction I'll have a stab at fixing it myself. This is something I need to either get working or start a re-design. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [BEER] Re: Books
On 27/04/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: I don't know what information I can or can't give out, so suffice it to say you won't be waiting too much longer for books specifically on S2... and no, before anyone asks, I'm not writing one :) Is this the one that you're hinting at http://www.amazon.com/Struts-Design-Programming-Tutorial/dp/0980331609 Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with Form Tag
Did you tried set readOnly? Are you using ajax theme? If yes, maybe this is the problem. Try the others theme. In the most of cases, this won't affect the ajax behavior of application, once submit has its theme setted to ajax. I'm using the simple theme. I've now also found that specifying the onclick attribute on the s:form tag doesn't map through to the generated HTML either. Regards Rogetr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Newbie Passing S2 variables to javascript functions
Without seeing the error and the JSP code that generated it, it's hard to tell you what's wrong. However, remember that Javascript runs on the client, after the page has been generated. View the page source to see what the syntax error is. In this case, it's probably the lack of quotes around the OGNL expression. It may also be that an in-line expression like that wont work. Here's a couple of suggestions to try: ... onclick=enableField('%{#indexValue}') ... ... onclick=%{'enableField(\'' + #indexValue + '\')'} ... ... onclick=enableField('${indexValue}') ... I've tried all your suggested variations, but looking at the source, all the expressions are passed as a string, there's no evaluation of the expression. Which, now you've explained that Javascript executes on the client makes sense. So the question becomes is it possible to interact with the action stack in Javascript? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Problem with Form Tag
Hi I've got this snippet in my .jsp file s:iterator value=order.details status=status s:set name=indexValue value=#status.index/ s:form id=form%{#indexValue} method=post action=setLineItemAction disabled=true s:textfield name=order.details[%{#status.index}].productCode/ s:textfield name=order.details[%{#status.index}].productDescription/ s:textfield name=order.details[%{#status.index}].quantity/ s:submit/ /s:form /s:iterator but the disabled attribute is not being rendered into the final html, so all the forms are active. What am I doing wrong? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Problem with Form Tag
On 27/04/07, Felipe Rodrigues [EMAIL PROTECTED] wrote: Put disabled in the fields instead of in the form. That's no good for me. If you click on a field within a disabled form, the onclick() event is triggered, but if you leave the form active and disable each field individually the onclick() event does not fire. I need to responsd to the onclick() event to make that form the active form for the page. I can work around it by calling document.forms[].disabled=true for each form on the page in a script called from the body onload() event but I was wondering why the s:form tag doesn't appear to support the disabled attribute. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Newbie Passing S2 variables to javascript functions
Hi Within a s:iterator tag I have the following statement s:set name=indexValue value=#status.index/ (because status seems to disappear when the iterator exits) and I use the expression %{#indexValue} within other struts s: tags without a problem. I now need to pass this value to a javascript function i.e onclick=enableField(%{#indexValue}) but the browser complains about invalid syntax. How do I pass the value indexValue to a javascript function? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Newbie. Authentification Interceptors
On 25/04/07, Zoran Avtarovski [EMAIL PROTECTED] wrote: For what it's worth we use a combination of both JAAS and a custom AuthInterceptor. JAAS handles authentication and the AuthInterceptor manages authorisation. This leverages off the strength of JAAS and has the flexibility required for our needs. A couple of sources of useful information are: 1. the JAAS in Action book (free) 2. WebWork in Action 3. Mark Mernards Blog has good example of implementing an interceptor. Thanks for the pointer to the JAAS in Action book. Would anyone care to be a bit more specific in regard to the inflexibility of container managed authentication/authorisation? Is it a case of the interceptor approach being better across the board, or is there a point at which the choice tips from container to interceptor? Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Newbie. Authentification Interceptors
Hi I notice that there have been a few threads over the last couple of days where people have been talking about implementing login authentication via a Struts2 interceptor. Could someone simply outline the reason why they would want to do it this way rather than using container authentication? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] (Newbie) Using Preparable
Hi Can someone please explain the point of the Preparable interceptor and prepare(). What do I gain over doing everything in the execute() method of my action. Obviously there must be some advantage otherwise Preparable wouldn't be there, but I can't see it at the moment. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Going nuts with s:set
s:set name=idx value=#status.index scope=request/ [...] s:property value=#request.idx/ Which is actually what you asked. Doh! Thanks very much. It was the #request. bit I was missing. I also didn't realise that I could specify the values that s:iterator uses! Are there any in depth tutorials out there or books in the pipline, 'cos I'd never have got that from the Struts2 site. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
{S2] Newbie: Sharing a POJO between two or more actions
Hi I need to share an object between two actions. As I'm familiar with servlet programming I reached for the SessionAware interface and share the object that way. And it works. However. the Javadoc for SessionAware discourages the use of this interface as it ties the actions to a servlet environment. What is the recommended Struts 2 way of doing this? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Going nuts with s:set
Hi I have this fragment of .jsp code s:iterator value=order.details status=status s:set name=indexValue value=#status.index scope=request/ s:text name=index/ s:property value=#status.index/ s:text name=variable/ s:property value=#indexValue/ !-- Other Stuff here -- /s:iterator When this runs I see the text Index and the value of #status.index followed by the text variable but the value of #indexValue is not displayed. What am I doing wrong? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2] Is this a sensible way of doing in-line editing in a table?
Following on from this, could anyone point me towards a tutorial/example code on how to deal with an indexed edit technique when I also need to use paging. For example, I have to do a similair thing to the OP however I am restricted to editing 10 lines per page. This would be easy if I could pass start and end values to the s:iterator tag from my action class, but I can't see how to do that. The only other way I can see to do this is to have both a full list of line items and a smaller current page list that are maintained in my action class. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Newbie question about HTTP Sessions
Hi A couple of newbie questions. Firstly, does Struts2 automatically create an HTTP Session or do I need to explicitly create it. Early experimentation suggests that it's automatically created as I'm seeing the JSESSIONID parameter in the Urls generated without doing anything, but I'd like to be sure. Secondly I need to know when a session is ended. Is there an established Struts 2 practice for this or do I still create an HTTPSessionListener object and register it in web.xml as I would with a basic web-app. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Newbie question about HTTP Sessions
Yes - you are right. The sessions are generated automatically by the container (tomcat, etc). Thanks. In a servlet based web-app I would create the session object programatticaly with httpServletRequest.getSession(true). I just wasn't sure if Struts 2 was creating the session for me since I appear not to have direct access to the httpRequest and httpResponse objects in my actions unless I specifically code for it through an interceptor. Secondly I need to know when a session is ended. Is there an established Struts 2 practice for this or do I still create an HTTPSessionListener object and register it in web.xml as I would with a basic web-app. HTTPSessionListener? A class that implements the HttpSessionListener interface has two methods, one of which is sessionDestroyed(HttpSessionEvent) that gets called when the container is about to destroy a session, in which I would put any session specific clean-up code if required. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using Struts Tag to create HTML tag
Hi I'm using the s:iterator tag with the status attribute to get the iterator count. From this I want to dynamically construct an HTML tag div class=columnX/ where X is the value of the iterator status count. Can I actually do this and if so, how or do I need to provide this information from my action class Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Struts Tag to create HTML tag
On 28/02/07, Dave Newton [EMAIL PROTECTED] wrote: --- Roger Varley [EMAIL PROTECTED] wrote: I'm using the s:iterator tag with the status attribute to get the iterator count. From this I want to dynamically construct an HTML tag div class=columnX/ where X is the value of the iterator status count. Can I actually do this and if so, how or do I need to provide this information from my action class See the bottom of http://cwiki.apache.org/WW/iterator.html I think I must be having a particularly dense day today, but I can't see anything there that helps. Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Struts Tag to create HTML tag
Either use JSTL as previous poster mentioned or use the s:property.../ tag to create the div name. Actually after replying to your previous e-mail I had that doh! moment and tried div class=cols:property value=#status.count/ which worked. This, for some reason surprised me that it worked, but I'm getting this sensation with quite a lot of Struts2 as I get into it :-) Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Odd tag behaviour (Newbie)
Hi I'm using Struts 2.0.06 and I have a simple jsp page %@ taglib prefix=s uri=/struts-tags % html body s:iterator value=servers s:label value=HostName cssClass=serverlabel/ s:property value=hostName/br s:label key=server.bootTime cssClass=serverlabel/ s:property value=bootTime/br /s:iterator /body /html which is rendering as html body tr td class=tdLabel/td tdlabel id= class=serverlabelHostName/label/td /tr frozen.brake.co.uk tr td class=tdLabellabel for=server_bootTime class=labelStart Time:/label/td tdlabel id=server_bootTime class=serverlabel/label/td /tr 2/26/07 tr td class=tdLabel/td tdlabel id= class=serverlabelHostName/label/td /tr grocery.brake.co.ukbr tr td class=tdLabellabel for=server_bootTime class=labelStart Time:/label/td tdlabel id=server_bootTime class=serverlabel/label/td /tr 2/26/07 /body /html It appears that when I use the value attribute on the s:label tag, my defined ccClass attribute gets attached to the text value of the tag (class=serverlabel). However, when I use the key attribute to refer to a .properties file, it appears that the tag is generating it's own class reference for the text (class=label) and adds my class definition in a seperate table column. I'd guess that I'm not understanding something about the tag library behaviour, but I don't know enough to know where to start, Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Equivalent of Servlet init() method?
Hi I'm a struts2 newbie I've just got the hello world app running. I'm now trying to convert a simple servlet app to struts2. In the original servlet I use a singleton factory class which I initialise/setup in the servlets init() method and use it in the servlet service() method. What is the equivalent means of achieving this on Struts2 so that I can set up the factory once and simply use it in my action class. In addition, other than the wiki I'd be grateful if anyone could recommend other documentation/tutorial sources. Should I also be reading up on WebWork /or Struts 1? Regards Roger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Workflow
Hi I'm looking at the possibilty of using Struts for my next project, which is to replace an internal intranet application that uses an applet with a servlet based framework. Among the many challenges is the need, because the applet is basically a multi-screen data entry program, to have absolute control over the sequence flow of the application - ignore browser back/forward, bookmarking etc and I probably need some way of telling if a user navigates away/closes the browser mid-session. Can I do this with Struts (and if so, how) or do I need a more generic worklfow type of framework? Sorry if this all sounds a bit vague, but I'm just at the start of trying to sort all this out. Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]