RE: Overriding Templates
Hi Li / Maurizio, thanks for your replies - i did receive the answer from another user yesterday too, he sent the following Actually, I found the solution, and it works for me: http://old.nabble.com/-S2--2.2.1-possible-freemarker-template-bug-td29462347.html Just add this to your web.xml: context-param param-nametemplatePath/param-name param-valuetemplate/param-value /context-param it seems it has been noted by others (see link) and is a bug of sorts - could be it was supposed to be this way and struts2.0.11 didn't enforce it or it was just changed in later version and developer didn't realise full implications. anyway, the addition of the context-param sorted out my problem. thanks for your responses adam Date: Wed, 20 Oct 2010 12:01:34 +0900 Subject: Re: Overriding Templates From: liying.cn.2...@gmail.com To: user@struts.apache.org Hi Maurizio: In this document: http://struts.apache.org/2.2.1/docs/template-loading.html It says the template should be searched in (in this order): 1, web app folder 2, class path But i have read the Struts2.2.1 source code, it creates TemplateLoader in a different order, as i described in my earlier mail. And, as adam said, the template under web app folder worked correctly in elder version of Struts2. So i think, this is maybe a BUG of Struts2, or lack of updating document. Maybe we should send this issue to the development team of Struts2. 2010/10/20 Maurizio Cucchiara maurizio.cucchi...@gmail.com: @Adam and they were placed into WebContent\template\simple folder you should start to investigate about your path correctness IMHO . Struts usually finds freemarker template inside your classpath. In order to enable struts to find your custom template file, you should ensure that template files reside inside the WEB-INF/classes/template/simple folder Hope this help -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Can't deploy on server
maybe your xml does not match the struts2 DTD (defined at top of struts.xml) - try checking xml in something like XMLSpy for invalid xml as error says. Date: Wed, 20 Oct 2010 10:34:01 +0900 Subject: Re: Can't deploy on server From: liying.cn.2...@gmail.com To: user@struts.apache.org It looks like: 1, Oracle's XML parser is chosen to parse your xml configuration file. 2, And it failed. (Don't know why and don't interest to know) You can try to delete Oracle's XML parser and use another one. See this page: https://issues.apache.org/activemq/browse/SM-169 for more information. It may help. Or you can tell your web app server to use another XML parser instead of Oracle's one. (Don't know how to achieve this, you may need read the docs of your web app server about classpath or class loading etc) 2010/10/20 Rodrigo Esteban Cares Guarda rca...@gmail.com: Hi, I'm trying to deploy an aplication writed in struts 2 and work perfect in my computer but when i put the generated war on the server this can't run and output this messages: 2010-10-19 18:45:07,228 INFO org.apache.tiles.impl.BasicTilesContainer.init:116 - Initializing Tiles2 container. . . 2010-10-19 18:45:07,251 INFO org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory:204 - Tiles2 container initialization complete. 2010-10-19 18:45:07,252 INFO org.apache.tiles.access.TilesAccess.setContainer:95 - Publishing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade 2010-10-19 18:45:07,318 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:68 - Loading action configurations from: struts-default.xml 2010-10-19 18:45:07,325 DEBUG com.opensymphony.xwork2.util.FileManager.debug:68 - Creating revision for URL: jar:file:/usr/local/jakarta-tomcat-5.0.28/webapps/Mavis2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml XSL-1103: (Fatal Error) DOMResult can not be this kind of node. 2010-10-19 18:45:07,347 ERROR org.apache.struts2.dispatcher.Dispatcher.error:38 - Dispatcher initialization failed Unable to load configuration. - Class: oracle.xml.jaxp.JXTransformerHandler File: JXTransformerHandler.java Method: endDocument Line: 141 - oracle/xml/jaxp/JXTransformerHandler.java:141:-1 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349) at org.apache.catalina.core.StandardHostDeployer.start(StandardHostDeployer.java:830) at org.apache.catalina.core.StandardHost.start(StandardHost.java:991) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1322) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:530) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at
Re: Overriding Templates
Just add this to your web.xml: context-param param-nametemplatePath/param-name param-valuetemplate/param-value /context-param The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value template means noting, it will get the same result as setting it to a empty string or anything else. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] 2.2.1 possible freemarker template bug
With a lot of debugging, I think i have found what's wrong. If you use the default setting, In method [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager], Struts will create 3 TemplateLoader which is: 1,ClassTemplateLoader, which will load Template from class url 2,WebappTemplateLoader, which will load Template from WebApp folder 3,StrutsClassTemplateLoader, I don't known what different with ClassTemplateLoader The 3 TemplateLoader will be executed in this order, which means, the ClassTemplateLoader get higher priority than WebappTemplateLoader. (See method [findTemplateSource] of class [freemarker.cache.MultiTemplateLoader]) So, if you simply put your template under the WebApp folder, it will not be used, because the ClassTemplateLoader will load the old template from struts2-core-2.2.1.jar. I think it may be a Struts2 bug, because this result is obviously different from the Struts2 document (http://struts.apache.org/2.2.1/docs/template-loading.html) but I am not very sure about it. Before they fix this bug, i suggest you add this setting in your web.xml: context-param param-nameTemplatePath/param-name param-value/param-value /context-param It will make FreemarkerManager not to create ClassTemplateLoader, so the WebappTemplateLoader will get highest priority. I tested it, and it works in my environment. Or you can set this parameter to: context-param param-nameTemplatePath/param-name param-valueclass://package/param-value /context-param and put your template under the [package]. But i did not test this solution. BTW: The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value template means nothing, it will get the same result as setting it to a empty string or anything else. -- View this message in context: http://old.nabble.com/-S2--2.2.1-possible-freemarker-template-bug-tp29462347p30008153.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't deploy on server
XML parsers are accessed via factories from Java code. Which concrete parser will be used is something that will be decided at runtime by the factory code, which is implemented by the app server. Your app server is using a concrete implementation by Oracle that is causing the exception. Usually, there is a way to tell the app server which concrete XML parser implementation you want to use. In some cases you can specify that you want the app server to look first in the WEB-INF/lib of your app before trying the app server general classpath. In any case, look at the app server docs for the procedure to override how the xml parser is chosen. On 20/10/2010 0:03, Rodrigo Esteban Cares Guarda wrote: Hi, I'm trying to deploy an aplication writed in struts 2 and work perfect in my computer but when i put the generated war on the server this can't run and output this messages: 2010-10-19 18:45:07,228 INFO org.apache.tiles.impl.BasicTilesContainer.init:116 - Initializing Tiles2 container. . . 2010-10-19 18:45:07,251 INFO org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory:204 - Tiles2 container initialization complete. 2010-10-19 18:45:07,252 INFO org.apache.tiles.access.TilesAccess.setContainer:95 - Publishing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade 2010-10-19 18:45:07,318 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:68 - Loading action configurations from: struts-default.xml 2010-10-19 18:45:07,325 DEBUG com.opensymphony.xwork2.util.FileManager.debug:68 - Creating revision for URL: jar:file:/usr/local/jakarta-tomcat-5.0.28/webapps/Mavis2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml XSL-1103: (Fatal Error) DOMResult can not be this kind of node. 2010-10-19 18:45:07,347 ERROR org.apache.struts2.dispatcher.Dispatcher.error:38 - Dispatcher initialization failed Unable to load configuration. - Class: oracle.xml.jaxp.JXTransformerHandler File: JXTransformerHandler.java Method: endDocument Line: 141 - oracle/xml/jaxp/JXTransformerHandler.java:141:-1 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349) at org.apache.catalina.core.StandardHostDeployer.start(StandardHostDeployer.java:830) at org.apache.catalina.core.StandardHost.start(StandardHost.java:991) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1322) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:530) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at
After upgrading from Struts 2.0.x to 2.2.x, static content no longer served...
I recently upgraded from Struts 2.0.x + SmartURLs to Struts 2.2.1 + Convention plugin. However after upgrading all my static content is no longer being served. I read all the release notes along the way that I could find and nothing suggests that my old approach should have stopped working. Can anyone point out what else I need to change/tweak to get static content behaving again? I'm using Maven as the build system. static content is at src/main/webapp/css /javascript /template /WEB-INF Here are my filters from web.xml filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-class /filter filter filter-namesitemesh/filter-name filter-classorg.apache.struts2.sitemesh.FreemarkerPageFilter/filter-class /filter filter filter-nameSpring OpenEntityManagerInViewFilter/filter-name filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFilter/filter-class /filter filter filter-namestruts/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-nameSpring OpenEntityManagerInViewFilter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping Here's the root node and contents of the struts.xml: struts constant name=struts.objectFactory value=spring / constant name=struts.devMode value=true / constant name=struts.action.extension value= / constant name=struts.convention.default.parent.package value=cib-default / package name=cib-default extends=struts-default interceptors interceptor name=reattachment class=com.ballroomregistrar.compinabox.online.web.interceptors.WebSessionReattachmentInterceptor / interceptor name=authentication class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthenticationInterceptor / interceptor name=authorization class=com.ballroomregistrar.compinabox.online.web.interceptors.AuthorizationInterceptor / interceptor-stack name=cibStack interceptor-ref name=reattachment / interceptor-ref name=authentication / interceptor-ref name=authorization / interceptor-ref name=defaultStack / /interceptor-stack /interceptors default-interceptor-ref name=cibStack / global-results result name=login type=redirect/account/login/result result name=access_denied type=redirect/accessDenied/result /global-results /package /struts - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Using FreeMarker (or Velocity) to template emails sent by a struts2 app?
Is there a good/standard way to use FreeMarker (or Velocity) to template emails sent by a Struts2 application? I hacked up something that works, but my solution doesn't know about struts2, so it can't use the taglibs to produce URL. (Ie sending an email for a new account with an activation link). I have to assume this is something everyone has to do, so maybe I'm just overlooking something obvious. Thanks. Eric - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
So you're saying it doesn't work for him? Dave On Wed, Oct 20, 2010 at 5:26 AM, Li Ying liying.cn.2...@gmail.com wrote: Just add this to your web.xml: context-param param-nametemplatePath/param-name param-valuetemplate/param-value /context-param The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value template means noting, it will get the same result as setting it to a empty string or anything else. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
No, I mean it works, but the value template has no meaning. Actually, if you set param [templatePath] (or [TemplatePath]) to any string which not start with class:// or file://, you will get the same result: templates under web root folder will be loaded. If you delete this param from web.xml, Struts2.2.1 will use the default setting (which is class://) to create a ClassTemplateLoader. And this ClassTemplateLoader will get a higher priority than WebappTemplateLoader, that make templates under web root folder not loaded. I think this may be a BUG of Struts2, because this behavior is different from the Struts2 document. And, as adam said, it also different from the old version of Struts2. 2010/10/20 Dave Newton davelnew...@gmail.com: So you're saying it doesn't work for him? Dave On Wed, Oct 20, 2010 at 5:26 AM, Li Ying liying.cn.2...@gmail.com wrote: Just add this to your web.xml: context-param param-nametemplatePath/param-name param-valuetemplate/param-value /context-param The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value template means noting, it will get the same result as setting it to a empty string or anything else. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
It's actually more likely the documentation needs to be updated. Perhaps you could get edit access to the wiki and update them? Dave On Wed, Oct 20, 2010 at 8:47 AM, Li Ying liying.cn.2...@gmail.com wrote: No, I mean it works, but the value template has no meaning. Actually, if you set param [templatePath] (or [TemplatePath]) to any string which not start with class:// or file://, you will get the same result: templates under web root folder will be loaded. If you delete this param from web.xml, Struts2.2.1 will use the default setting (which is class://) to create a ClassTemplateLoader. And this ClassTemplateLoader will get a higher priority than WebappTemplateLoader, that make templates under web root folder not loaded. I think this may be a BUG of Struts2, because this behavior is different from the Struts2 document. And, as adam said, it also different from the old version of Struts2. 2010/10/20 Dave Newton davelnew...@gmail.com: So you're saying it doesn't work for him? Dave On Wed, Oct 20, 2010 at 5:26 AM, Li Ying liying.cn.2...@gmail.com wrote: Just add this to your web.xml: context-param param-nametemplatePath/param-name param-valuetemplate/param-value /context-param The param [templatePath] can start with only class:// or file://. Otherwise, struts will ignore it and do not create a TemplateLoader for it. (See method [init] and [createTemplateLoader] of class [org.apache.struts2.views.freemarker.FreemarkerManager]) So, the value template means noting, it will get the same result as setting it to a empty string or anything else. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Where is the JIRA?
https://issues.apache.org/struts/ gives me a 404 -- Greg Akins http://insomnia-consulting.org http://www.pghcodingdojo.org http://pittjug.dev.java.net http://twitter.com/akinsgre http://www.linkedin.com/in/akinsgre - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Where is the JIRA?
It's been moved to the main Apache JIRA instead of being separate. Dave On Wed, Oct 20, 2010 at 9:09 AM, Greg Akins angryg...@gmail.com wrote: https://issues.apache.org/struts/ gives me a 404 -- Greg Akins http://insomnia-consulting.org http://www.pghcodingdojo.org http://pittjug.dev.java.net http://twitter.com/akinsgre http://www.linkedin.com/in/akinsgre - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Where is the JIRA?
2010/10/20 Greg Akins angryg...@gmail.com: https://issues.apache.org/struts/ gives me a 404 https://issues.apache.org/issues/ Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
If I am the author of this code, i think the priority order of these 3 TemplateLoaders should be: 1, WebappTemplateLoader 2,ClassTemplateLoader (when value of param [templatePath] is string starts with class://) or FileTemplateLoader(when value of param [templatePath] is string starts with file://) 3, StrutsClassTemplateLoader But I don't know what the intention of the author is. Is it a BUG or lack of updating document? I am not sure. So maybe we should send our investigation result to the develop team, see what they say. 2010/10/20 Dave Newton davelnew...@gmail.com: It's actually more likely the documentation needs to be updated. Perhaps you could get edit access to the wiki and update them? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
You know that (a) the dev team reads this list, and (b) I'm on the dev team, right? On Wed, Oct 20, 2010 at 9:19 AM, Li Ying liying.cn.2...@gmail.com wrote: If I am the author of this code, i think the priority order of these 3 TemplateLoaders should be: 1, WebappTemplateLoader 2,ClassTemplateLoader (when value of param [templatePath] is string starts with class://) or FileTemplateLoader(when value of param [templatePath] is string starts with file://) 3, StrutsClassTemplateLoader But I don't know what the intention of the author is. Is it a BUG or lack of updating document? I am not sure. So maybe we should send our investigation result to the develop team, see what they say. 2010/10/20 Dave Newton davelnew...@gmail.com: It's actually more likely the documentation needs to be updated. Perhaps you could get edit access to the wiki and update them? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
Actually I did not know about these, Sorry. And (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. (B)As you can see, my English is not good. 2010/10/20 Dave Newton davelnew...@gmail.com: You know that (a) the dev team reads this list, and (b) I'm on the dev team, right? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
(A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. Honestly, I'd rather see the documentation reflect current behavior, whether or not the behavior itself is correct. And if the documentation is *already* wrong... Plus if something gets in there that isn't well-written, it'll be corrected at some point. (B)As you can see, my English is not good. Better than my Mandarin and Cantonese ;) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
OK, I will do it, But maybe tomorrow, because the local time is over 11PM now. 2010/10/20 Dave Newton davelnew...@gmail.com: (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. Honestly, I'd rather see the documentation reflect current behavior, whether or not the behavior itself is correct. And if the documentation is *already* wrong... Plus if something gets in there that isn't well-written, it'll be corrected at some point. (B)As you can see, my English is not good. Better than my Mandarin and Cantonese ;) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Overriding Templates
All help is greatly appreciated :) Thanks! Dave On Wed, Oct 20, 2010 at 10:26 AM, Li Ying liying.cn.2...@gmail.com wrote: OK, I will do it, But maybe tomorrow, because the local time is over 11PM now. 2010/10/20 Dave Newton davelnew...@gmail.com: (A)I am just a new guy of Struts2 community, if I put some message into the Struts2 docs and it is not right, I will mislead so many users, I will feel so~~~ sorry. Honestly, I'd rather see the documentation reflect current behavior, whether or not the behavior itself is correct. And if the documentation is *already* wrong... Plus if something gets in there that isn't well-written, it'll be corrected at some point. (B)As you can see, my English is not good. Better than my Mandarin and Cantonese ;) Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Auto-Expanding sx:tree
I have found a few resources on the net but none which have seemed to work. I am using the Struts2 DOJO tree control with nested treenode tags. How can I force the tree and all its children nodes to be expanded by default? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: ognl and multdimensional lists
Hello Li, I'm using struts 2. I'm not getting an IndexOutOfBoundsException, instead the list is populated with null values. Dave On Wed, Oct 13, 2010 at 7:20 PM, Li Ying liying.cn.2...@gmail.com wrote: Hi Dave: What version of Struts are you using? A long time ago, i met the similar problem in Struts1. I thought the parameter named cellCosts[0][4].quota should be translated into java code likes: action.getCellCosts().get(0).get(4).setQuota(value); And the method [get] throws a IndexOutOfBoundsException because there were not element in the list yet. My solution was: 1,Create a new List class named [AutoList], which expend from class [ArrayList]. 2,Override the method [get] of [AutoList], create instances of element and insert them into the list before the old [get] method is executed, so we the list can be populated automatically and the method [get] will not throw IndexOutOfBoundsException. 3,In Action/Form class, use the new AutoList instead of ArrayList. In Struts2, I am not sure how OGNL process this case. 2010/10/14 Dave Evans dsevan...@gmail.com: Hello, I've got an action with this property: private ListListCellCost cellCosts; public void setCellCosts(ListListCellCost l) { this.cellCosts = l; } public ListListCellCost getCellCosts() { return this.cellCosts; } The outer list is a list of locations, each of which has a list of cellCosts. These are dynamically sized. The jsp has this in two nested jstl forEach loops: input name=cellCosts[${locationStatus.index}][${cellCostStatus.index}].quota type=text value=${cellCost.quota} / which renders to (as an example): input name=cellCosts[0][4].quota type=text value=10 / Ognl doesn't seem to be populating the cellCosts list. Any suggestions? Thanks, Dave Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Can't get onclick to work with buttons in Struts
I am trying to use buttons to open a URL in another window, and also to execute some JavaScript, and I can't get either to work with onclick. s:form name=joinForm s:submit type=button value=Join onclick=return ibmWebSigninPrelinkaction(this); href=/social/aggregator/signin/s:submit /s:form s:form name=personalizeProfileForm s:submit type=button value=Personalize Your Profile href=# onClick=javascript: window.open('${editProfileUrl}', '_blank', null); return false;/s:submit /s:form Neither of these onclick actions seem to be doing anything. Can someone please tell me what I'm doing wrong, or if there's a better way to do this? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't get onclick to work with buttons in Struts
1) is it rendering as expected? 2) any errors in your JavaScript console? 3) what theme are you using? 4) what version of Struts? Dave On Oct 20, 2010 2:00 PM, Dave Westerman dlwes...@us.ibm.com wrote: I am trying to use buttons to open a URL in another window, and also to execute some JavaScript, and I can't get either to work with onclick. s:form name=joinForm s:submit type=button value=Join onclick=return ibmWebSigninPrelinkaction(this); href=/social/aggregator/signin/s:submit /s:form s:form name=personalizeProfileForm s:submit type=button value=Personalize Your Profile href=# onClick=javascript: window.open('${editProfileUrl}', '_blank', null); return false;/s:submit /s:form Neither of these onclick actions seem to be doing anything. Can someone please tell me what I'm doing wrong, or if there's a better way to do this? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't get onclick to work with buttons in Struts
Never mind, stupid user trick! I messed up, it's working now (NoScript was blocking scripts on localhost, and I didn't notice - DUH!) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't get onclick to work with buttons in Struts
:) That's never happened to me. Honest. No, really. Dave On Wed, Oct 20, 2010 at 2:40 PM, Dave Westerman dlwes...@us.ibm.com wrote: Never mind, stupid user trick! I messed up, it's working now (NoScript was blocking scripts on localhost, and I didn't notice - DUH!) - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't get onclick to work with buttons in Struts
Noscript causing trouble is common enough that my boss calls my configuration Crazyfox! -Brian On Wed, Oct 20, 2010 at 1:55 PM, Dave Newton davelnew...@gmail.com wrote: :) That's never happened to me. Honest. No, really. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't get onclick to work with buttons in Struts
AdBlock often causes woes too; we had to rename one of our divs (that isn't an ad) in order to get by the defaults. On Wed, Oct 20, 2010 at 3:20 PM, Brian Thompson elephant...@gmail.com wrote: Noscript causing trouble is common enough that my boss calls my configuration Crazyfox! -Brian On Wed, Oct 20, 2010 at 1:55 PM, Dave Newton davelnew...@gmail.com wrote: :) That's never happened to me. Honest. No, really. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't deploy on server
Thanks for your answers, i try put next code into web.xml file: !-- xml -- system-property javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl/ system-property javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl/ !-- xslt -- system-property javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl/ but doesn't work, and put a jaxp.properties file into WEB-INF/classes with this code: javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl but with the same result. Other test i do put the next 3 files into META-INF/services directory with respective content: file javax.xml.transform.TransformerFactory with content: org.apache.xalan.processor.TransformerFactoryImpl file javax.xml.parsers.DocumentBuilderFactory with content: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl file javax.xml.parsers.SAXParserFactory with content: org.apache.xerces.jaxp.SAXParserFactoryImpl Resuming, with 3 attemps i get the same result. Thanks to all. El mié, 20-10-2010 a las 11:53 +0200, Jordi Fernandez escribió: XML parsers are accessed via factories from Java code. Which concrete parser will be used is something that will be decided at runtime by the factory code, which is implemented by the app server. Your app server is using a concrete implementation by Oracle that is causing the exception. Usually, there is a way to tell the app server which concrete XML parser implementation you want to use. In some cases you can specify that you want the app server to look first in the WEB-INF/lib of your app before trying the app server general classpath. In any case, look at the app server docs for the procedure to override how the xml parser is chosen. On 20/10/2010 0:03, Rodrigo Esteban Cares Guarda wrote: Hi, I'm trying to deploy an aplication writed in struts 2 and work perfect in my computer but when i put the generated war on the server this can't run and output this messages: 2010-10-19 18:45:07,228 INFO org.apache.tiles.impl.BasicTilesContainer.init:116 - Initializing Tiles2 container. . . 2010-10-19 18:45:07,251 INFO org.apache.tiles.impl.BasicTilesContainer.initializeDefinitionsFactory:204 - Tiles2 container initialization complete. 2010-10-19 18:45:07,252 INFO org.apache.tiles.access.TilesAccess.setContainer:95 - Publishing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade 2010-10-19 18:45:07,318 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:68 - Loading action configurations from: struts-default.xml 2010-10-19 18:45:07,325 DEBUG com.opensymphony.xwork2.util.FileManager.debug:68 - Creating revision for URL: jar:file:/usr/local/jakarta-tomcat-5.0.28/webapps/Mavis2/WEB-INF/lib/struts2-core-2.2.1.jar!/struts-default.xml XSL-1103: (Fatal Error) DOMResult can not be this kind of node. 2010-10-19 18:45:07,347 ERROR org.apache.struts2.dispatcher.Dispatcher.error:38 - Dispatcher initialization failed Unable to load configuration. - Class: oracle.xml.jaxp.JXTransformerHandler File: JXTransformerHandler.java Method: endDocument Line: 141 - oracle/xml/jaxp/JXTransformerHandler.java:141:-1 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415) at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:79) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349) at org.apache.catalina.core.StandardHostDeployer.start(StandardHostDeployer.java:830) at org.apache.catalina.core.StandardHost.start(StandardHost.java:991) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1322) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:530) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
Re: Can't deploy on server
Are you using OC4J? These pages may help: http://forums.oracle.com/forums/thread.jspa?threadID=363566 http://forums.oracle.com/forums/thread.jspa?forumID=46messageID=726074threadID=248962 http://forums.oracle.com/forums/thread.jspa?threadID=367999tstart=0 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Character Encoding Error using new filters
I have set UTF-8 as the default everywhere - struts, tomcat, sitemesh. I had a small breakthrough. It looks like it's a 2.1.6 specific issue. I updated a development version to 2.1.8 and 2.2.1 and both worked fine. I now have to find time to test the updated version for unintended consequences. Are there any issues I should look out for in particular when going from 2.1.6 to 2.2.1? Z. On 19/10/10 2:42 AM, Dave Newton davelnew...@gmail.com wrote: That defines the encoding of the web.xml file itself... On Oct 18, 2010 10:32 AM, Martin Gainty mgai...@hotmail.com wrote: Hi Zoran can you confirm the encoding attribute at the top of your web.xml e.g. ?xml version=1.0 encoding=UTF-8? in which case you *should* be able to map U+00C6Æc3 86LATIN CAPITAL LETTER AE http://www.utf8-chartable.de/ please confirm Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Mon, 18 Oct 2010 12:05:56 +1100 Subject: Character Encoding Error using new filters From: zo...@sparecreative.com To: user@struts.apache.org I have a really strange character encoding error that is appearing when I attempt to change my struts2 filter configuration from: filter filter-namestruts-cleanup/filter-name filter-classorg.apache.struts2.dispatcher.ActionContextCleanUp/filter-c la ss /filter filter filter-namestruts/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-c la ss /filter filter-mapping filter-namestruts-cleanup/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts/filter-name url-pattern/*/url-pattern /filter-mapping To filter filter-namestruts-prepare/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter /f ilter-class /filter filter filter-namesitemesh/filter-name filter-classcom.opensymphony.sitemesh.webapp.SiteMeshFilter/filter-clas s /filter filter filter-namestruts-execute/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter /f ilter-class /filter filter-mapping filter-namestruts-prepare/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher dispatcherINCLUDE/dispatcher /filter-mapping filter-mapping filter-namestruts-execute/filter-name url-pattern/*/url-pattern /filter-mapping With only this change when I enter a 'æ' character (and e together) it appears a A!|! (garbage). Clearly there is a character encoding issue here. The whole app as well as Tomcat is encoded to UTF-8. What am I missing here. Please help!!! Z. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can't deploy on server
Thanks for your answers, i try put next code into web.xml file: !-- xml -- system-property javax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl/ system-property javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl/ !-- xslt -- system-property javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl/ but doesn't work, and put a jaxp.properties file into What version of web.xml are you using? I have read http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd but found nothing about tag [system-property]. And, if your setting is correct in schema, are you sure it is applied to system properties BEFORE the XSL error occurs? If you want to change system-property, maybe you can try: (1) add start-up options like [-DpropName=propValue] in command line which start the web app server. OR (2) add a ServletContextListener to you web-app, make it get executed before anything else. and in method [contextInitialized] of this Listener, you can set system-property as you want, by Java code - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org