Re: Initializing Actions from Spring
Every thing works perfectly if I do not use annotations but use configuration xml files. My annotation part is as follows: @Result( name="success", value="mainpage.page", type=TilesResult.class) I use the following configuration in an xml file and it works: mainpage.page Using annotations I have error message (look below) >From the error message I think that Struts is trying to create my Action object and it fails because I do not have a default constructor. It could be the case, thought, that Spring managed to successfully create the object but I do not refer to it the right way. In my applicationContext.xml I have: Buenos Dias! Does my id have the right value (id=”mainpageAction”)? ERROR: === type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Unable to intantiate Action! org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) root cause Unable to intantiate Action! com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:277) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) root cause java.lang.InstantiationException: com.gbsoft.belfin.communitypages.actions.mainpage.MainpageAction java.lang.Class.newInstance0(Class.java:335) java.lang.Class.newInstance(Class.java:303) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:148) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:128) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs. JBossWeb/2.0.1.GA -- View this message in context: http://www.nabble.com/Initializing-Actions-from-Spring-tp16377674p16392737.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s:url escaping "+" character
Hello there, I've got a parameter, rendered by tag, that needs to be escaped of "+" character, because I can't get my action to work properly (I receive a space character instead of that "+" character). I guess I need to escape that character using HTML escape codes, but I don't know if Struts allows a way for doing it automatically (I'm in web development only for 1 month). Do I need to implement a "manual" escaping using something like java.net.URLEncoder.encode() in the prepare() method? I noticed there's an option in tag, but it only escapes "&" characters. Thanks in advance. -- The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:url escaping "+" character
Did the recent release of struts 2.0.11.1 fix this? http://struts.apache.org/2.0.11.1/docs/release-notes-20111.html See the JIRA details. Blanco Emanuele wrote: Hello there, I've got a parameter, rendered by tag, that needs to be escaped of "+" character, because I can't get my action to work properly (I receive a space character instead of that "+" character). I guess I need to escape that character using HTML escape codes, but I don't know if Struts allows a way for doing it automatically (I'm in web development only for 1 month). Do I need to implement a "manual" escaping using something like java.net.URLEncoder.encode() in the prepare() method? I noticed there's an option in tag, but it only escapes "&" characters. Thanks in advance. -- The information transmitted is intended for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. - 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]
struts-dojo-plugin-2.1.0 and googlemaps-tags
I'm trying to use googlemaps-tags http://www.lamatek.com/GoogleMaps/ with struts-dojo, but when I load in a div the action that returns googlemaps jsp, googlemaps-javascript is missing and obviously it doesn't work. If I call the action directly from navigator all is ok. I've try to use executeScript param but then the div shows the transport text error "Error loading '/./.../list.action (200 OK)". Really, javascript is missing allways when I load actions using dojo tags. Any idea? Thanks -- View this message in context: http://www.nabble.com/struts-dojo-plugin-2.1.0-and-googlemaps-tags-tp16395593p16395593.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Client Side Validation with Struts
> Hello. I am using Struts 1.3.8. The issue is not one of making the > Javascript work (it is working correctly), but rather preventing a > Struts action from being called. Is this possible given that the > action of a form is a Struts action? I'm not sure if I understand you, but all you have to do is return true or false from your JavaScript function (as you doing), and that will prevent a web browser to submit form and send them to a www server. And if there be no request from web browser, there be no action called. Please copy/paste the web page content you had got when you started your form. Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ant based Struts2 application
Hi. Struts2 prefers Maven as the building tool, do know any on line sample Struts2 application that uses Ant instead of Maven? I can write one by hand but I'm looking for Ant script that is production aware. Thanks. -- View this message in context: http://www.nabble.com/Ant-based-Struts2-application-tp16396285p16396285.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation
hey! you can use theme="simple". This would generate the tags as a simple text box etc with out any trs and tds around. positioning the errors: fieldname would display the erriors related to fieldname only. I think u can do the similar way with action errors and actino messages. Give a try ;) Hope I answered your question. cheers, ravi Rodrigo Pereira wrote: > > Hi, > the problem is that I have a lot of fields and I'd like to position 2 > fields > in a row, but xhrml theme is not letting me do that. Also, some of the > fields are poputated by an action based on the value of one of the fields > in > the form (using xhtml triggers form's action vs link's). I was wondering > if > there is another option. > > Thanks, > Rodrigo Pereira > > - Original Message - > From: "Nuwan Chandrasoma" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Saturday, March 29, 2008 6:12 PM > Subject: Re: Validation > > >> Hi, >> >> Simple theme doesn't support Validation and error reporting. you may have >> to use some other theme like xhtml theme >> >> http://struts.apache.org/2.x/docs/xhtml-theme.html >> >> Thanks, >> >> Nuwan >> >> Rodrigo Pereira wrote: >>> Hi, >>> how can I position validation message on the screen? Also, when I have >>> a simple theme form I am getting JS error alert message "[object >>> Error]", does anybody know how to fix that? >>> >>> form: >>> >>> >>> >>> > class="required">*: >>> >> theme="simple"/> >>> >>> >>> >>> >>> validation.xml: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Thanks, >>> Rodrigo Pereira >>> >>> - >>> 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] >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Validation-tp16373207p16396501.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2: Including Freemarker templates from JSP
Thanks. It is indeed almost sufficient. The docs had led to me think the "params" were the only way to pass parameters to the template, but in fact it works as it should without any parameters, seeking the values in the value stack. That's fine. The only inconvenience is the rigid scheme for specifying the file path: ${templateDir}/${theme}/${template}. And it doesnt accept an empty theme. Hernán J. González http://hjg.com.ar/ On Sun, Mar 30, 2008 at 7:40 PM, Jeromy Evans <[EMAIL PROTECTED]> wrote: > The Struts2 Component tag may be sufficient: > http://struts.apache.org/2.x/docs/component.html > > > > hernan gonzalez wrote: > > I have some freemarker templates (general purpose, i.e. not > > specifically for struts2) that generate html fragments, which I would > > like to include in some jsp pages (in a struts2 environment). > > > > Which are my alternatives? At first I tought of making a general jsp > > > > > > > > > > > > where includeFreemarkerS2.jsp invokes (with Java scriptlet) my already > > working aplication logic that finds-parses-fills the template, getting > > the datamodel from the corresponding scope. But I am not sure of how > > to pass some datamodel that wraps the ValueStack to Freemarker. And I > > suspect there must be a simpler and nicer solution. > > Suggestions? > > > > Hernán > > > > - > > 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] > > -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2: Including Freemarker templates from JSP
Thanks. It is indeed almost sufficient. The docs had led to me think the "params" were the only way to pass parameters to the template, but in fact it works as it should without any parameters, seeking the values in the value stack. That's fine. The only inconvenience is the rigid scheme for specifying the file path: ${templateDir}/${theme}/${template}. And it doesnt accept an empty theme. Hernán J. González http://hjg.com.ar/ On Sun, Mar 30, 2008 at 7:40 PM, Jeromy Evans <[EMAIL PROTECTED]> wrote: > The Struts2 Component tag may be sufficient: > http://struts.apache.org/2.x/docs/component.html > > > > hernan gonzalez wrote: > > I have some freemarker templates (general purpose, i.e. not > > specifically for struts2) that generate html fragments, which I would > > like to include in some jsp pages (in a struts2 environment). > > > > Which are my alternatives? At first I tought of making a general jsp > > > > > > > > > > > > where includeFreemarkerS2.jsp invokes (with Java scriptlet) my already > > working aplication logic that finds-parses-fills the template, getting > > the datamodel from the corresponding scope. But I am not sure of how > > to pass some datamodel that wraps the ValueStack to Freemarker. And I > > suspect there must be a simpler and nicer solution. > > Suggestions? > > > > Hernán > > > > - > > 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] > > -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator: validatorResult memory issue
Hi everybody, We wonder if it is possible to safely null validatorResult in ValidatorForm after succesfull validation. It could bring our application big memory effort as all our form are session scope. And validatorResult for some pages have 40K!!. As we found this structure is already nulled in reset() method of ValidatorForm and build again so IMHO should be safe. But aren't we missing something? We still question ourselves Why then isn't struts doing something like that automatically. Thanks for all yout comments. (We are using struts 1.2.9 for our project and Jakarta Common Validator in version 1.1.4)
testing file uploads
I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. MultiPartRequestWrapper multiWrapper = (MultiPartRequestWrapper) ServletActionContext.getRequest() I'm thinking of using HttpUnit and ServletUnit to set this stuff up. Has anyone set up Struts2 with ServletUnit? By the way, has anyone used Mockito yet, the new mocking framework? http://code.google.com/p/mockito/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ajax layout - how to place 2 submit buttons one after the other?
Hi guys, I've been strugling with this one for a while: How is it possible to place 2 (or more) buttons one after the other? Currently, my buttons looks like this: [update] [test] and I wish to have:[update] [test] my jsp code: -- View this message in context: http://www.nabble.com/ajax-layout---how-to-place-2-submit-buttons-one-after-the-other--tp16397732p16397732.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
--- Adam Hardy <[EMAIL PROTECTED]> wrote: > I need to test an action that is getting uploaded files and piping them > straight into Strings. I don't want to save actual files on server, so I'll > get the multipart request wrapper directly. What, specifically, are you trying to test? I ask because I've never had any particular reason to test file uploads inside the container, because the container itself should have already tested that and verified its operations. Everything else I've ever done with files has been testable outside the container. I may have misunderstood what you're asking, though. Dave - 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?
--- xianwinwin <[EMAIL PROTECTED]> wrote: > I've been strugling with this one for a while: How is it possible to > place 2 (or more) buttons one after the other? > > Currently, my buttons looks like this: > > [update] > [test] > > and I wish to have:[update] [test] 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 (2) and (3) involve extracting one or more themes (a good idea for performance anyway) and either modifying a current theme or creating a new one. Dave - 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?
Check to see if your column is wide enough to hold 2 buttons side by side -Original Message- From: xianwinwin [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2008 10:41 AM To: user@struts.apache.org Subject: ajax layout - how to place 2 submit buttons one after the other? Hi guys, I've been strugling with this one for a while: How is it possible to place 2 (or more) buttons one after the other? Currently, my buttons looks like this: [update] [test] and I wish to have:[update] [test] my jsp code: -- View this message in context: http://www.nabble.com/ajax-layout---how-to-place-2-submit-buttons-one-after- the-other--tp16397732p16397732.html Sent from the Struts - User mailing list archive at Nabble.com. - 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: 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]
Mapped Properties Woes
based on my previous message I want to have multiple-selects named off of a hashmap. I have found and read all the documentation of "Mapped Properties" I could find under Google. I know my form bean is 100% correct based on the documentation, so that is a not a worry there. I have a: HashMap mapValues = null; setMapValues(HashMap mapValues); returns HashMap with getMapValues() setMapValue(String key, Object value) and finally getMapValue(String key) I created the HashMap in my preActionClass: HashMap testMap = new HashMap(); testMap.put("a","value of a"); testMap.put("b","value of b"); testMap.put("c","value of c"); I tested this out in the jsp by using: property="getMapValue(b)" /> This does return "value of b" correctly. I can even use a logic:iterate to loop through these three items and get their key and values correctly!!! Ultimately, I want three selects: So ... now I created manually three selects on my jsp page. I just wanted to see if I could get my HashMap back to the post Action and it constantly comes back null. Can anyone help me deal with mapped properties, I am just not having any luck and I've spent way too much time on this already. Thanks! Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Compile error in JSP after upgrading from servlet specification 2.3 to 2.4
Hi That is all i did, upgraded web.xml to servlet specification 2.4 and tried start the project, i get following jsp compile error The code at line 125 is and the error i get is org.apache.jasper.JasperException: /pages/index.jsp(125,15) According to TLD or attribute directive in tag file, attribute test does not accept any expressions org.apache.jasper.servlet.JspServletWrapper.handleJspException( JspServletWrapper.java:512) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java :377) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java :1054) org.apache.struts.action.RequestProcessor.processForwardConfig( RequestProcessor.java:386) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:412) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java :1054) org.apache.struts.action.RequestProcessor.processForwardConfig( RequestProcessor.java:386) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:412) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.pfizer.maps.servlet.ApprovalsValidFilter.doFilter( ApprovalsValidFilter.java:90) On 3/28/08, Laurie Harper <[EMAIL PROTECTED]> wrote: > > Ashish Kulkarni wrote: > > Hi > > I get compile error in jsp at line > > > > > There's nothing wrong with that line. What is the full error you're > getting? What do the surrounding lines of your JSP look like? > > > > I jsut upgraded web.xml from 2.3 to 2.4, i added following lines in > web.xml > > > > > [...] > > Are you sure that's the *only* thing you changed between the JSP > compiling OK and getting an error? That seems kinda odd... > > L. > > > - > 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?
--- Roger Varley <[EMAIL PROTECTED]> wrote: > > 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. No shooting down, just a reminder that this is what the "css_xhtml" theme attempts to do, sometimes successfully. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
Dave Newton on 31/03/08 18:42, wrote: --- Adam Hardy <[EMAIL PROTECTED]> wrote: I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. What, specifically, are you trying to test? I ask because I've never had any particular reason to test file uploads inside the container, because the container itself should have already tested that and verified its operations. Everything else I've ever done with files has been testable outside the container. The action has to get strings out of the request, work out which file they are from and call the appropriate managers, with the corresponding string as a request. There's logic in the action that basically has nothing to do with how the container handles it (I hope). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Logging Issues
Hello, I am writing an application using Struts (2.0.11), Spring (2.5.1), and Hibernate (3.2.6), running on Tomcat (6.0.13). We have a legacy webapp running on Tomcat that outputs some important information to the default Tomcat logs. We aren't really in a position to change that application, so we're trying to update our new webapp to put all messages in a different log file. I'm trying to do this using log4j (1.2.15). So far, I can add messages to the new log in my java code. I am also getting freemarker.cache debug messages in the new log. However, all other messages are still being put in the default Tomcat logs. For example, if the database I'm trying to access closes its connection and I don't catch the exception that is thrown, it gets printed to the screen, and put in the catalina log. I would like that exception to go in the new log file instead (and yes, eventually I will catch the exception and have struts display a nicer error message for the user). Below are the relevant parts of my web.xml, and my log4j.properties file. Any help would be greatly appreciated! Thanks! Kelly [web.xml] [snip] This context parameter specifies the name and location of the log4j properties file. log4jConfigLocation /WEB-INF/classes/log4j.properties struts2-cleanup org.apache.struts2.dispatcher.ActionContextCleanUp sitemesh com.opensymphony.module.sitemesh.filter.PageFilter struts2 org.apache.struts2.dispatcher.FilterDispatcher struts2-cleanup /* sitemesh /* struts2 /* org.springframework.web.context.ContextLoaderListener org.springframework.web.util.Log4jConfigListener [snip] [log4j.properties] log4j.rootLogger=DEBUG, rollingFileAppender # Rolling file Appender log4j.appender.rollingFileAppender=org.apache.log4j.RollingFileAppender log4j.appender.rollingFileAppender.File=${catalina.home}/logs/lessonDownloader.log log4j.appender.rollingFileAppender.MaxFileSize=1024KB log4j.appender.rollingFileAppender.MaxBackupIndex=10 log4j.appender.rollingFileAppender.layout=org.apache.log4j.PatternLayout log4j.appender.rollingFileAppender.layout.ConversionPattern=%d %p [%c] - %m%n* # Control logging for other packages log4j.logger.org.apache.commons=WARN log4j.logger.org.apache.struts2=WARN log4j.logger.org.springframework=WARN log4j.logger.org.hibernate=WARN log4j.logger.org.apache.jasper=WARN log4j.logger.org.apache.catalina=WARN log4j.logger.com.opensymphony.xwork2=WARN -- View this message in context: http://www.nabble.com/-S2--Logging-Issues-tp16399078p16399078.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
Didn't see that. I might use it. But I don't actually know quite what the MultipartRequestHandler does, so I'm not sure how to mock it :) I figured the ServletUnit framework would teach me. Martin Gainty on 31/03/08 20:55, wrote: Have you looked at using Mock classes of MockHttpServletRequest(), MockHttpServletResponse(), MockServletContext() from org.apache.struts2.ServletActionContextTest.java ? - Original Message - From: "Adam Hardy" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, March 31, 2008 12:04 PM Subject: testing file uploads I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. MultiPartRequestWrapper multiWrapper = (MultiPartRequestWrapper) ServletActionContext.getRequest() I'm thinking of using HttpUnit and ServletUnit to set this stuff up. Has anyone set up Struts2 with ServletUnit? By the way, has anyone used Mockito yet, the new mocking framework? http://code.google.com/p/mockito/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
--- Adam Hardy <[EMAIL PROTECTED]> wrote: > Dave Newton on 31/03/08 18:42, wrote: > > What, specifically, are you trying to test? > > The action has to get strings out of the request, work out which file they > are from and call the appropriate managers, with the corresponding string > as a request. There's logic in the action that basically has nothing to do > with how the container handles it (I hope). You're saying it's reading the file and deciding what to do based on file contents? Well, either way, I'd still test that completely separately from any container/request stuff, but without your understanding of how it's working I'm mostly just babbling ;) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ant based Struts2 application
we here, use ant.. please try it www.sf.net/projects/cimande we use S2, Spring and Hibernte as the core framework. F On Mon, Mar 31, 2008 at 9:37 PM, HHB <[EMAIL PROTECTED]> wrote: > > Hi. > Struts2 prefers Maven as the building tool, do know any on line sample > Struts2 application that uses Ant instead of Maven? > I can write one by hand but I'm looking for Ant script that is production > aware. > Thanks. > -- > View this message in context: > http://www.nabble.com/Ant-based-Struts2-application-tp16396285p16396285.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- -- Frans Thamura Director Meruvian Redefining Civilization Indonesia Education, Consulting, Networking, Profesional Marketplace, OpenSource Development and Implementation Mobile: +62 855 7888 699 Skype: fthamura YM: [EMAIL PROTECTED] GoogleTalk: [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] Sun Java Champion Oracle Ace Director JEDI Indonesia / JENI Team JUG Indonesia Founder jTechnopreneur Community Founder Blogs: http://www.jroller.com/fthamura (English) http://www.nagasakti.or.id/roller/page/fthamura (Indonesia : Motivation Blog Linkedin: http://www.linkedin.com/in/fthamura
Re: Initializing Actions from Spring
Your action mapping has class="mainpage", but your Spring configuration has id="mainpageAction". These should be the same. I'm not quite sure how you're getting the error you are, though, based on that configuration. And I don't see how introducing an @Result annotation would effect it. I suspect you have some out-of-date config files deployed or something, since the error is inconsistent with what you show here. Try doing a clean build/deploy and check that the deployed configuration is what you think it is. One other point to check: do you have the struts2-spring plugin deployed? You need that to allow your actions to be managed by Spring. L. georgievh wrote: Every thing works perfectly if I do not use annotations but use configuration xml files. My annotation part is as follows: @Result( name="success", value="mainpage.page", type=TilesResult.class) I use the following configuration in an xml file and it works: mainpage.page Using annotations I have error message (look below) From the error message I think that Struts is trying to create my Action object and it fails because I do not have a default constructor. It could be the case, thought, that Spring managed to successfully create the object but I do not refer to it the right way. In my applicationContext.xml I have: class="com.gbsoft.belfin.communitypages.actions.mainpage.MainpageAction" autowire="autodetect" singleton="false"> Buenos Dias! Does my id have the right value (id=”mainpageAction”)? ERROR: === type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Unable to intantiate Action! org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) root cause Unable to intantiate Action! com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:277) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) root cause java.lang.InstantiationException: com.gbsoft.belfin.communitypages.actions.mainpage.MainpageAction java.lang.Class.newInstance0(Class.java:335) java.lang.Class.newInstance(Class.java:303) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:123) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:148) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:128) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:143) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:113) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:275) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365) com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38) com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83) com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) com.opensymphony.xwork2.DefaultActionInvocation.(DefaultActionInvocation.java:74) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs. JBossWeb/2.0.1.GA -
Re: Mapped Properties Woes
Tom Holmes Jr. wrote: based on my previous message I want to have multiple-selects named off of a hashmap. I have found and read all the documentation of "Mapped Properties" I could find under Google. I know my form bean is 100% correct based on the documentation, so that is a not a worry there. I have a: HashMap mapValues = null; setMapValues(HashMap mapValues); returns HashMap with getMapValues() setMapValue(String key, Object value) and finally getMapValue(String key) I created the HashMap in my preActionClass: HashMap testMap = new HashMap(); testMap.put("a","value of a"); testMap.put("b","value of b"); testMap.put("c","value of c"); I tested this out in the jsp by using: property="getMapValue(b)" /> This does return "value of b" correctly. I can even use a logic:iterate to loop through these three items and get their key and values correctly!!! Ultimately, I want three selects: So ... now I created manually three selects on my jsp page. I just wanted to see if I could get my HashMap back to the post Action and it constantly comes back null. Can anyone help me deal with mapped properties, I am just not having any luck and I've spent way too much time on this already. I don't think Struts 1 will create the HashMap for you; you need to instantiate it yourself (in your form bean's constructor or reset method, for example). Assuming the map has already been instantiated, Struts should be able to store form inputs into it OK. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mapped Properties Woes
Laurie Harper wrote: Tom Holmes Jr. wrote: based on my previous message I want to have multiple-selects named off of a hashmap. I have found and read all the documentation of "Mapped Properties" I could find under Google. I know my form bean is 100% correct based on the documentation, so that is a not a worry there. I have a: HashMap mapValues = null; setMapValues(HashMap mapValues); returns HashMap with getMapValues() setMapValue(String key, Object value) and finally getMapValue(String key) I created the HashMap in my preActionClass: HashMap testMap = new HashMap(); testMap.put("a","value of a"); testMap.put("b","value of b"); testMap.put("c","value of c"); I tested this out in the jsp by using: property="getMapValue(b)" /> This does return "value of b" correctly. I can even use a logic:iterate to loop through these three items and get their key and values correctly!!! Ultimately, I want three selects: So ... now I created manually three selects on my jsp page. I just wanted to see if I could get my HashMap back to the post Action and it constantly comes back null. Can anyone help me deal with mapped properties, I am just not having any luck and I've spent way too much time on this already. I don't think Struts 1 will create the HashMap for you; you need to instantiate it yourself (in your form bean's constructor or reset method, for example). Assuming the map has already been instantiated, Struts should be able to store form inputs into it OK. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] What I was doing was instantiating the HashMap in the preAction class so the logic:iterate worked on the JSP page. But the information wasn't passing to the post Action class. Thanks for the information again. That kind of information I couldn't find anywhere. I will try it out BTW ... I'm still trying to create: When I loop through the HashMap ... for some reason anything in the property quotes is taken for a literal. I can't seem to make it work with some form of variable. Thanks again. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 with JSON RPC
hi there anyone have an example that work based on JSON RPC i am looking a response mechanism that run well here for POJO to JSON, i did it, using json plugins. F
Re: testing file uploads
Dave Newton on 31/03/08 22:00, wrote: --- Adam Hardy <[EMAIL PROTECTED]> wrote: Dave Newton on 31/03/08 18:42, wrote: What, specifically, are you trying to test? The action has to get strings out of the request, work out which file they are from and call the appropriate managers, with the corresponding string as a request. There's logic in the action that basically has nothing to do with how the container handles it (I hope). You're saying it's reading the file and deciding what to do based on file contents? Well, either way, I'd still test that completely separately from any container/request stuff, but without your understanding of how it's working I'm mostly just babbling ;) I see the multipart http request as a weak point in the servlet spec. Or the http spec. But I want to test it for my own piece of mind, and when I have the test finished, I guess I can work out if it's really necessary. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
--- Adam Hardy <[EMAIL PROTECTED]> wrote: > I see the multipart http request as a weak point in the servlet spec. Or > the http spec. But I want to test it for my own piece of mind, and when > I have the test finished, I guess I can work out if it's really necessary. You want to test multipart HTTP requests? Well, okay; enjoy! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: testing file uploads
Just remembered struts2 isn't a servlet. I just wanted a quick and easy way of giving my action a real multipart request wrapper to run against. So tomorrow I guess I'll have to check out the MockMultipartRequestWrapper. Thanks Adam Martin Gainty on 31/03/08 20:55, wrote: Have you looked at using Mock classes of MockHttpServletRequest(), MockHttpServletResponse(), MockServletContext() from org.apache.struts2.ServletActionContextTest.java ? Martin - Original Message - From: "Adam Hardy" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, March 31, 2008 12:04 PM Subject: testing file uploads I need to test an action that is getting uploaded files and piping them straight into Strings. I don't want to save actual files on server, so I'll get the multipart request wrapper directly. MultiPartRequestWrapper multiWrapper = (MultiPartRequestWrapper) ServletActionContext.getRequest() I'm thinking of using HttpUnit and ServletUnit to set this stuff up. Has anyone set up Struts2 with ServletUnit? By the way, has anyone used Mockito yet, the new mocking framework? http://code.google.com/p/mockito/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using javascript with struts2 tags.
Hi. I am using Struts2. In this I am facing the problem in using the "JavaScript" with the Struts2 tags. If some has the solution for that please help me. Looking forward for help Varun
Help on
Hi all, I've configured a data source at struts-config.xml. This data source use oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the oracle database I'm trying to connect is OK. But I just can't make the data source get the connection. It always throws a SQLException: Timeout awaiting connection. Can anyone give some help? Following is my . -- -- Thanks Talos
Re: Help on
What version of struts? Data-source got deprecated at some point. I forget the version. On 4/1/08, Chen Chunwei <[EMAIL PROTECTED]> wrote: > Hi all, > > I've configured a data source at struts-config.xml. This data source use > oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the > oracle database I'm trying to connect is OK. But I just can't make the data > source get the connection. It always throws a SQLException: Timeout awaiting > connection. Can anyone give some help? Following is my . > -- > > > > > > value="oracle.jdbc.driver.OracleDriver" /> > value="Oracle 9i Database - Struts Test" /> > value="jdbc:oracle:thin:@10.192.225.8:1521:wpsprod" /> > > > > > -- > > Thanks > > Talos -- Sent from Gmail for mobile | mobile.google.com The future is here. It's just not widely distributed yet. -William Gibson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help on
I'm using struts 1.1 - Original Message - From: "Vinny" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, April 01, 2008 2:52 PM Subject: Re: Help on What version of struts? Data-source got deprecated at some point. I forget the version. On 4/1/08, Chen Chunwei <[EMAIL PROTECTED]> wrote: > Hi all, > > I've configured a data source at struts-config.xml. This data source use > oracle thin jdbc driver. And I've already included the ojdbc.jar. Also, the > oracle database I'm trying to connect is OK. But I just can't make the data > source get the connection. It always throws a SQLException: Timeout awaiting > connection. Can anyone give some help? Following is my . > -- > > > > > > value="oracle.jdbc.driver.OracleDriver" /> > value="Oracle 9i Database - Struts Test" /> > value="jdbc:oracle:thin:@10.192.225.8:1521:wpsprod" /> > > > > > -- > > Thanks > > Talos -- Sent from Gmail for mobile | mobile.google.com The future is here. It's just not widely distributed yet. -William Gibson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help on
Please Chen, the next time you post a question, say that you are using Struts 1.1 *always*. See the answers below. 2008/4/1, Chen Chunwei <[EMAIL PROTECTED]>: > > I think this is the problem: specify a value for "minCount" and "maxCount". And remember to close the connection once you used it! Notice that, for default, a commons-dbcp datasource will be used, while I suggest to use the Oracle datasource. And, BTW, as Vinny said, the datasource support in Struts is deprecated, I suggest you to use JNDI and configure the datasource in your container. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]