Re: dispaytag + Struts 2.1.x: encoding parameters into requestURI
hi Randy, You're right! many thanks! Best regards, Giovanni Randy Burgess wrote: All you should need is a getter in your action for simulationKey and then display:table name=statistics id=statistics defaultorder=descending requestURI=/SimulationReport.action?simulationKey=${simulationKey} Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I validate a composed object in my action?(Struts 2)
Hello! I have to validate a composed object in my action, this is my action: public class UserAction extends ActionSupport{ private User usr; public User getUser() {return usr;} public void setUser(User usr) {this.usr = usr;} } and this is User class: public class User{ private String usrId; public String getUsrId(){ return usrId; } public void setUsrId(String usrId){ this.usrId = usrId; } } How can I validate usrId property with annotations or xml without putting annotations inside User class? Any help would be appreciate! Thanks in advance, Riccardo -- View this message in context: http://www.nabble.com/How-can-I-validate-a-composed-object-in-my-action-%28Struts-2%29-tp15306468p15306468.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: Custom OGNL PropertyAccessor
Thanks a lot for the info, it worked. I saw a Struts bean definition like that somewhere that led me to believe that that was how it was done, but as you said, it appears that the accessor never actually gets registered that way. As for the wisdom of doing thisin my view the real pain is being stuck with the class we're using the PropertyAccessor *for*, but unfortunately that's reality for now. Using the PropertyAccessor just makes our pages much cleaner. http://www.motricity.com Regards, Tommy Becker Jeromy Evans wrote: My guess, and it is just a guess, is that your bean is being instantiated by the Struts2 container but it's not being injected anywhere. Based on my almost-non-existent understanding of OGNL, the OgnlRuntime contains a static synchronized map of Class-PropertyAccessor which you can see being setup in OgnlRuntime.java The static method OgnlRuntime.setPropertyAccessor(Class, PropertyAccessor) looks like what you're after. A quick usage search shows it's not used in Struts2 or XWrok anywhere so I think you'll have to make a static call from you application to register your PropertyAccessor instance yourself. That means you don't need to define a struts2 bean at all (unless you want to access it though the container) Personally, I think you're setting yourself up for a world of pain creating a custom PropertyAccessor. I'd go the simplified bean service façade route so to ensure I'm not locked into any particular expression language/library. cheers, Jeromy Evans Tommy Becker wrote: I have a question about using OGNL PropertyAccessors. We have an object on the value stack that we expose to JSP pages that does not have standard JavaBeans getter/setter methods. From what I can tell, this leaves us 2 options. We can either call the getter methods explicitly via OGNL method calls in the pages, or we can wrap the object in a JavaBean-like object. The second option is unworkable in all but the simplest of cases when you realize that the method calls can themselves return another object that needs to be wrapped, or even a collection of them. So we've been using method calls in the pages (yeah I know). Reading through the OGNL docs, it seems that what we need is a PropertyAccessor that knows how to operate on our object. So we implemented one, and attempted to register it by placing this in our struts.xml: bean type=ognl.PropertyAccessor name=class.we.need.access.to class=our.property.accessor.PropertyAccessor/ Unfortunately it doesn't work. Can someone tell me what we're doing wrong, or even if what we're trying to do is possible? Thanks! http://www.motricity.com NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information of Motricity. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. - 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] NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information of Motricity. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: chaining validation errors
Thanks again, It is not working, sometimes I get NullPointerException Plz show me how to use it. Below is the modified fragment of struts.xml Thanks for the support action name=editLicense class=com.intelligile.lms.webapp.action.LicenseAction method=edit interceptor-ref name=defaultStack / interceptor-ref name=store RETRIEVE /interceptor-ref result/WEB-INF/pages/licenseForm.jsp/result result name=error/WEB-INF/pages/licenseList.jsp/result /action action name=saveLicense class=com.intelligile.lms.webapp.action.LicenseAction method=save interceptor-ref name=defaultStack / interceptor-ref name=store STORE /interceptor-ref result type=redirectlicenses.html/result result name=cancel type=redirectlicenses.html/result result name=delete type=redirectlicenses.html/result result name=input type=redirect-action editLicense.html true ${license.dkey} /result /action -- View this message in context: http://www.nabble.com/chaining-validation-errors-tp15299658p15306663.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]
Problem s:select in IE and Firefox
Hi, I have a s:select tag which behaves different in IE 6.0 and firefox. In Firefox the underlying property in my struts action is filled in IE not. This is my code? s:form id=searchAdvisorIdsForm action=searchAdvisorIds method=post . s:select name=branchSearch headerKey= headerValue=-- Bitte wählen -- list=branchNameList cssClass=medium / s:submit theme=ajax targets=organizersearch key=button.search value=Suchen cssClass=pushbutton / /s:form I have no idea why it works in Firefox and not in IE. Because there is no JavaScript involved (or am I wrong). Best regards. Marc
Re: Struts 2 and Weblogic 9.2 - java.net.ConnectException
I've rearranged your web.xml to the correct order below. Context params come first, then listeners and then filters/filter mappings, servlets/servlet mappings, etc. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Vigneswar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 5 Feb 2008 21:15:38 -0800 (PST) To: user@struts.apache.org Subject: Re: Struts 2 and Weblogic 9.2 - java.net.ConnectException Randy, here is my web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameSample Project/display-name descriptionSample Project to Work with Struts2./description context-param param-namewebmaster/param-name param-value[EMAIL PROTECTED]/param-value description The EMAIL address of the administrator to whom questions and comments about this application should be addressed. /description /context-param context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext.xml/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener !-- Filter Mappings -- !-- Added for Struts 2 testing - Start -- filter filter-nameaction2/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-nameaction2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Added for Struts 2 testing - End -- /web-app Thanks Regards. Vigneswar Nagarathinam Randy Burgess-3 wrote: We need to see your web.xml. I'm running Struts 2 projects on WebLogic 9.2 without any problems. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Vigneswar Nagarathinam [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 5 Feb 2008 17:09:23 +0530 To: user@struts.apache.org Subject: Struts 2 and Weblogic 9.2 - java.net.ConnectException Hi All, I'm trying to implement Struts2 with Weblogic 9.2. I'm getting the following error while running the Weblogic server. Can you please help me by providing a solution: stack trace: --- Feb 5, 2008 3:51:35 PM GMT+05:30 Error HTTP BEA-101165 Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher. Class: weblogic.net.http.HttpClient File: HttpClient.java Method: openServer Line: 320 - weblogic/net/http/HttpClient.java:320:-1 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfig ur ationFiles (XmlConfigurationProvider.java:835) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocumen t s (XmlConfigurationProvider.java:131) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init( XmlConfigurationProvider.java:100) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload( DefaultConfiguration.java:130) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration( ConfigurationManager.java:52) Truncated. see log file for complete stacktrace Tried all: '1' addresses, but could not connect over HTTP to server: ' struts.apache.org', port: '80' - Class: weblogic.net.http.HttpClient File: HttpClient.java Method: openServer Line: 320 - weblogic/net/http/HttpClient.java:320:-1 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfig ur ationFiles (XmlConfigurationProvider.java:830) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocumen t s (XmlConfigurationProvider.java:131) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init( XmlConfigurationProvider.java:100) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload( DefaultConfiguration.java:130) Truncated. see log file for complete stacktrace java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: 'struts.apache.org', port: '80' at weblogic.net.http.HttpClient.openServer(HttpClient.java:320) at weblogic.net.http.HttpClient.openServer(HttpClient.java:375) at weblogic.net.http.HttpClient.init(HttpClient.java:149) at weblogic.net.http.HttpClient.New(HttpClient.java:245) at weblogic.net.http.HttpURLConnection.connect( HttpURLConnection.java:160) Truncated. see log file for complete stacktrace Thanks in advance, Vigneswar Nagarathinam This email and any attachments (Message) may contain legally privileged and/or confidential information. If you are not
STRUTS 2: fail to retrieve values without repost
I only seem to get my values of my form when i repost. CODE %@ taglib prefix=s uri=/struts-tags % html head titleFile Upload Example/title link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ /head body s:actionerror / s:fielderror / s:form action=doUpload method=POST enctype=multipart/form-data tr td colspan=2h1File Upload Example/h1/td /tr s:textfield name=title label=Title id=title/ s:submit / /s:form /body /html s:property value=title //td package name=example extends=struts-default action name=showUpload method=input resultpages/upload.jsp/result /action action name=doUpload class=Upload result name=inputshowUpload/result resultpages/upload-success.jsp/result /action /package I get nothing, until I refresh my page, and then it fills my values. Thx in advance! Nushi -- View this message in context: http://www.nabble.com/STRUTS-2%3A-fail-to-retrieve-values-without-repost-tp15306729p15306729.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: Struts 2 and Weblogic 9.2 - java.net.ConnectException
I just noticed another thing, you are using the 2.3 DTD, I'm using the 2.4 XSD. web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; version=2.4 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; I would use the 2.4 XSD. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Vigneswar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 5 Feb 2008 21:15:38 -0800 (PST) To: user@struts.apache.org Subject: Re: Struts 2 and Weblogic 9.2 - java.net.ConnectException Randy, here is my web.xml !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app display-nameSample Project/display-name descriptionSample Project to Work with Struts2./description context-param param-namewebmaster/param-name param-value[EMAIL PROTECTED]/param-value description The EMAIL address of the administrator to whom questions and comments about this application should be addressed. /description /context-param !-- Filter Mappings -- !-- Added for Struts 2 testing - Start -- filter filter-nameaction2/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping filter-nameaction2/filter-name url-pattern/*/url-pattern /filter-mapping !-- Added for Struts 2 testing - End -- listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext.xml/param-value /context-param /web-app Thanks Regards. Vigneswar Nagarathinam Randy Burgess-3 wrote: We need to see your web.xml. I'm running Struts 2 projects on WebLogic 9.2 without any problems. Regards, Randy Burgess Sr. Web Applications Developer Nuvox Communications From: Vigneswar Nagarathinam [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org Date: Tue, 5 Feb 2008 17:09:23 +0530 To: user@struts.apache.org Subject: Struts 2 and Weblogic 9.2 - java.net.ConnectException Hi All, I'm trying to implement Struts2 with Weblogic 9.2. I'm getting the following error while running the Weblogic server. Can you please help me by providing a solution: stack trace: --- Feb 5, 2008 3:51:35 PM GMT+05:30 Error HTTP BEA-101165 Could not load user defined filter in web.xml: org.apache.struts2.dispatcher.FilterDispatcher. Class: weblogic.net.http.HttpClient File: HttpClient.java Method: openServer Line: 320 - weblogic/net/http/HttpClient.java:320:-1 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfig ur ationFiles (XmlConfigurationProvider.java:835) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocumen t s (XmlConfigurationProvider.java:131) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init( XmlConfigurationProvider.java:100) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload( DefaultConfiguration.java:130) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration( ConfigurationManager.java:52) Truncated. see log file for complete stacktrace Tried all: '1' addresses, but could not connect over HTTP to server: ' struts.apache.org', port: '80' - Class: weblogic.net.http.HttpClient File: HttpClient.java Method: openServer Line: 320 - weblogic/net/http/HttpClient.java:320:-1 at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfig ur ationFiles (XmlConfigurationProvider.java:830) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocumen t s (XmlConfigurationProvider.java:131) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init( XmlConfigurationProvider.java:100) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload( DefaultConfiguration.java:130) Truncated. see log file for complete stacktrace java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: 'struts.apache.org', port: '80' at weblogic.net.http.HttpClient.openServer(HttpClient.java:320) at weblogic.net.http.HttpClient.openServer(HttpClient.java:375) at weblogic.net.http.HttpClient.init(HttpClient.java:149) at weblogic.net.http.HttpClient.New(HttpClient.java:245) at weblogic.net.http.HttpURLConnection.connect( HttpURLConnection.java:160) Truncated. see log file for complete stacktrace Thanks in advance,
Re: Losing Session Attributes
I'm losing the quest-input.jsp form attributes. Probably 3 out of 4 times. Session ID remains the same throughout the process. Here is part of my applicationContext.xml bean id=myInterceptor scope=singleton class=com.helpme.struts.interceptors.billing.MyInterceptor/ I'm not quite sure what you mean by needing to configure in session attributes. mgainty wrote: you'll definitely need configure in session attributes as in interceptor name=sessionAutowiring class=org.apache.struts2.spring.interceptor.SessionContextAutowiringInterce ptor/ which session attributes are you losing? M-- -- View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15306751.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: jQuery plugin for Struts 2?
+1 here. Highly looking forward to using this over current Dojo plugin. Any progress being made? Matt nuwan chandrasoma-2 wrote: i would like to see one :) emartin24 wrote: Ted Husted wrote: On Nov 20, 2007 1:53 PM, name withheld wrote: I've been working with Struts 2 for a few months and have some questions that I was hoping you would be interested in discussing with me. I see that Struts 2 uses Dojo for it's Ajax capabilities. I prefer jQuery and have contemplated making a jQuery plugin for Struts 2, to use instead of Dojo. I'd also like to utilize JSON as the interchange for my Ajax transactions. I checked out your presentation about the YUI plugin...which is why I'm sending this question to you. What all is required to create a plugin? Do you think it is worth the time and effort to create a jQuery plugin? Or, do you think that I'd be better off just using the Dojo for the core stuff and then using jQuery on top of that? I'm just trying to get a feel for what all is involved and if it would be something useful. I know you are a very busy person and I appreciate any input you'd be willing to give. Regards, The Ajax plugin approach is useful when someone wants to keep Ajax at arms-length and let a magical taglib handle the JavaScript vodoo. But, a plugin is NOT required to use Ajax with Struts 2! Struts 2 works just fine with plain Ajax library out-of-the-box. We updated the Ajax page recently to help make this point more clear. * http://struts.apache.org/2.x/docs/ajax.html The bottom line is that if you're savvy enough to even have a Ajax preference, then you probably want to just use JQuery and Struts without the training wheels. -Ted. Thanks Ted. Anyone else out there interested in a jQuery plugin? =) If so, I'd love to hear from you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-jQuery-plugin-for-Struts-2--tp13866994p15306754.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: jQuery plugin for Struts 2?
--- matt.payne [EMAIL PROTECTED] wrote: +1 here. Highly looking forward to using this over current Dojo plugin. Any progress being made? Not really; I'm completely overwhelmed by my TODO list at the moment. It's over at GoogleCode and I'm happy to bring people on board. There's a working example of sq:a.../ which will update a div http://code.google.com/p/s2jquery We ended up writing the bulk of our JavaScript by hand, so my input kinda petered out. I'm scheduling it for a minimum of four hrs/week moving forward, so probably a bit more will be done, including a small pamphlet documenting the process. If there are specific tags you'd like to see or specific functionality file improvements etc. and I'll try to prioritize them as best as I can, with the caveat that if I'm the only one working on it the priorities will look... very suspiciously like mine. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Losing Session Attributes
Laurie Harper wrote: Are you sure? Have you confirmed that the session is the same in both requests? Yes, by checking the session id throughout the process. Laurie Harper wrote: getSession(true) will create a session if one doesn't exist on the request. If the session got lost somehow, this will mask that fault. You might want to use getSession(false) and add a guard to ensure the session is really there. I've tried this with no luck. Laurie Harper wrote: // save input form attributes to session session.setAttribute(PARMS, request.getParameterMap()); Assuming the session really is the same, I'm guessing this is the problem. You're saving a reference to a map owned by the current request. There's no guarantee the underlying HttpServletRequest instance wont have been reused by the time you try to access the map. Try making a copy of the request parameter map and storing that instead. Made copy but didn't solve the problem. Map parameterMap - request.getParameterMap(); session.setAttribute(PARMS, parameterMap); Laurie Harper wrote: Also, you don't show any code that's removing the data you placed in the session. Do you have clean-up code you didn't show and, if so, could it be getting called out of sequence? I haven't implemented it yet. Anymore thoughts would be very helpful! -- View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15306753.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: Losing Session Attributes
In case I wasn't clear... the attribute PARMS exists but loses it value. -- View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15307254.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: Losing Session Attributes
Is the value in the session null or an empty map? If it is an empty map, the reason might be that when you set the value in the session between requests, the request doesn't have any parameters, setting the value to an empty map. musachy On Feb 6, 2008 11:55 AM, daveck [EMAIL PROTECTED] wrote: In case I wasn't clear... the attribute PARMS exists but loses it value. -- View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15307254.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] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Losing Session Attributes
I forgot to say, after trying everything, you can add an HttpSessionAttributeListener to your application and see when the value is nulled out/replaced. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionAttributeListener.html musachy On Feb 6, 2008 12:25 PM, Musachy Barroso [EMAIL PROTECTED] wrote: Is the value in the session null or an empty map? If it is an empty map, the reason might be that when you set the value in the session between requests, the request doesn't have any parameters, setting the value to an empty map. musachy On Feb 6, 2008 11:55 AM, daveck [EMAIL PROTECTED] wrote: In case I wasn't clear... the attribute PARMS exists but loses it value. -- View this message in context: http://www.nabble.com/Losing-Session-Attributes-tp15298791p15307254.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] -- Hey you! Would you help me to carry the stone? Pink Floyd -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Losing Session Attributes
--- daveck [EMAIL PROTECTED] wrote: Try making a copy of the request parameter map and storing that instead. Made copy but didn't solve the problem. Map parameterMap - request.getParameterMap(); session.setAttribute(PARMS, parameterMap); Just for completeness, this isn't making a copy. I've sort of lost track now; is this interceptor running for every request? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
file upload problems
Hi there, I'm a newbie in Struts 2 and in Java EE programming... I tried to search about this but i didn't found any succesfull answer. So I'm trying to ask to this ML :) I need to make a form that permits an user to upload a file. I had the so-well-known MultiWrapper problem, and I managed it by adding the commons-fileupload jar. But... it didn't work!!! I got a s:form action=uploadData ... and a s:file name=upload label=File\. In my struts.xml file, I've got a package who extends struts-jsf-default (we're planning to use JSF) and defined the uploadData action who calls a InsertDataAction class, and in particular a specific method of that class (let's call it insert() ). Of course, this class has got the needed private attributes (File file, String filename, String contentType) and the appropriate getters/setters (afaik, they need to have the name set[filename][attribute], like setUploadFile in my case and so on). I got no exception at runtime, but I can't get that file to be uploaded. In my insert() I try to s.o.p. the attributes, I got everything null. I also watched my server.log (I'm using JBoss as AS), and nothing useful is written out. I wondered if using the struts-jsf-default may corrupt the file upload interceptor, but I'm really not able to answer myself this question. Any help will be kindly appreciated :) Thanks a lot. -- View this message in context: http://www.nabble.com/file-upload-problems-tp15309005p15309005.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]
html:hidden as a collection not String
Is it possible to assign a collection to a html:hidden component, rather than a string? Basically my webapp allows the user to select different options for access control. I would like to add these selections to a collection and pass that to my Action class. Thanks inadvance!! -- Shanna -- -- View this message in context: http://www.nabble.com/html%3Ahidden-as-a-collection-not-String-tp15312178p15312178.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: Problem s:select in IE and Firefox
There's javascript involved as you're using an ajax submit. When your form is posted the submit button shows loading text in your target div. In IE, if the target div contains the form you're posting, it overwrites the form in the DOM prior to posting and the XHR request fails. It's a problem related to the incorrect/inconsistent ordering of events in IE. Add the showLoadingText=false attribute to your ajax submit button(s) and it'll be okay. regards, Jeromy evans Marc Eckart wrote: Hi, I have a s:select tag which behaves different in IE 6.0 and firefox. In Firefox the underlying property in my struts action is filled in IE not. This is my code? s:form id=searchAdvisorIdsForm action=searchAdvisorIds method=post . s:select name=branchSearch headerKey= headerValue=-- Bitte wählen -- list=branchNameList cssClass=medium / s:submit theme=ajax targets=organizersearch key=button.search value=Suchen cssClass=pushbutton / /s:form I have no idea why it works in Firefox and not in IE. Because there is no JavaScript involved (or am I wrong). Best regards. Marc No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.21/1263 - Release Date: 6/02/2008 8:14 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem s:select in IE and Firefox
yep..the showLoadingText param is passed to the ajax-common.ftl specifically.. #if parameters.showLoadingText?exists showLoading=${parameters.showLoadingText?string?html}#rt/ /#if .also be sure to null out loadingText.. M-- - Original Message - From: Jeromy Evans [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, February 06, 2008 6:41 PM Subject: Re: Problem s:select in IE and Firefox There's javascript involved as you're using an ajax submit. When your form is posted the submit button shows loading text in your target div. In IE, if the target div contains the form you're posting, it overwrites the form in the DOM prior to posting and the XHR request fails. It's a problem related to the incorrect/inconsistent ordering of events in IE. Add the showLoadingText=false attribute to your ajax submit button(s) and it'll be okay. regards, Jeromy evans Marc Eckart wrote: Hi, I have a s:select tag which behaves different in IE 6.0 and firefox. In Firefox the underlying property in my struts action is filled in IE not. This is my code? s:form id=searchAdvisorIdsForm action=searchAdvisorIds method=post . s:select name=branchSearch headerKey= headerValue=-- Bitte wählen -- list=branchNameList cssClass=medium / s:submit theme=ajax targets=organizersearch key=button.search value=Suchen cssClass=pushbutton / /s:form I have no idea why it works in Firefox and not in IE. Because there is no JavaScript involved (or am I wrong). Best regards. Marc No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.21/1263 - Release Date: 6/02/2008 8:14 PM - 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 2: File tag problem
Hello, I am using file tag works fine if a file is selected using browse button or the path is entered manually. But if file name/path is rubbish the form is not submitted at all, nothing happens. 1. How do I control this - show error like invalid filename? 2. Or else how to disable manual entry, only browse button works??? 3. I tried javascript options like onKeypress to reset value to null - didnt help. Please help. Regards, Srikanth s:form action = /createEnt2.do method = POST enctype = multipart/form-data validate = true s:form action = /createEnt2.do method = POST enctype = multipart/form-data validate = true s:file name = dc id = dc accept = text/* label = Digital Certificate onkeydown = return reset1(); / s:file name = dc id = dc accept = text/* label = Digital Certificate onkeydown = return reset1(); / / / s:form / / s:form function reset1() reset1() { var thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( sfds ); thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( sfds ); 'all' ; window.alert( sfds ); sfds ); } Java ### private File dc ; private String uploadContentType ; //The content type of the file private File dc ; private String uploadContentType ; //The content type of the file private String uploadContentType ; //The content type of the file private String uploadFileName ; //The uploaded file name /** private String uploadFileName ; //The uploaded file name /** /** * @return the dc * @return the dc */ */ public File getDc() { return dc ; } /** public File getDc() { return dc ; } /** return dc ; } /** /** * @param dc the dc to set * @param dc the dc to set */ */ public void setDc(File dc) { this . dc = dc; } /** public void setDc(File dc) { this . dc = dc; } /** this . dc = dc; } /** /** * @return the uploadContentType * @return the uploadContentType */ */ public String getUploadContentType() { return uploadContentType ; } /** public String getUploadContentType() { return uploadContentType ; } /** return uploadContentType ; } /** /** * @param uploadContentType the uploadContentType to set * @param uploadContentType the uploadContentType to set */ */ public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** this . uploadContentType = uploadContentType; } /** /** * @return the uploadFileName * @return the uploadFileName */ */ public String getUploadFileName() { return uploadFileName ; } /** public String getUploadFileName() { return uploadFileName ; } /** return uploadFileName ; } /** /** * @param uploadFileName the uploadFileName to set * @param uploadFileName the uploadFileName to set */ */ public void setUploadFileName(String uploadFileName) { this . uploadFileName = uploadFileName; } public void setUploadFileName(String uploadFileName) { this . uploadFileName = uploadFileName; } this . uploadFileName = uploadFileName; }
Re: STRUTS 2: File tag problem
Hi Sri so if the config is configured something like /WEB-INF/classes/struts-fileupload.xml action name=doUpload class=org.apache.struts2.showcase.fileupload.FileUploadAction method=upload result name=successuploadSuccess.jsp/result result name=erroruploadError.jsp/result /action and the jsp defines the acceptable content-type and a name to call it.. s:file name=upload accept=text/* / org.apache.struts2.portlet.example.fileupload.FileUploadAction.java { private String fileName;//this is the FULL pathname with filename // since we are using s:file name=upload .../ the file name will be obtained through getter/setter of file-tag-nameFileName public String getUploadFileName() { return fileName; } public void setUploadFileName(String fileName) { this.fileName = fileName; } // since we are using s:file name=upload ... / the File itself will be obtained through getter/setter of file-tag-name public File getUpload() { java.io.File file; try { //try to create the file with the previously provided filename file= new java.io.File( filename ); } catch(java.lang.NullPointerException excp) { return ERROR; } if(file.canRead()) return SUCCESS; else return ERROR; } public void setUpload(File upload) { this.upload = upload; } } I didnt test with the templateDir attribute.. HTH/ M- - Original Message - Wrom: FPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZC To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, February 06, 2008 8:50 PM Subject: STRUTS 2: File tag problem Hello, I am using file tag works fine if a file is selected using browse button or the path is entered manually. But if file name/path is rubbish the form is not submitted at all, nothing happens. 1. How do I control this - show error like invalid filename? 2. Or else how to disable manual entry, only browse button works??? 3. I tried javascript options like onKeypress to reset value to null - didnt help. Please help. Regards, Srikanth s:form action = /createEnt2.do method = POST enctype = multipart/form-data validate = true s:form action = /createEnt2.do method = POST enctype = multipart/form-data validate = true s:file name = dc id = dc accept = text/* label = Digital Certificate onkeydown = return reset1(); / s:file name = dc id = dc accept = text/* label = Digital Certificate onkeydown = return reset1(); / / / s:form / / s:form function reset1() reset1() { var thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( sfds ); thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( sfds ); 'all' ; window.alert( sfds ); sfds ); } Java ### private File dc ; private String uploadContentType ; //The content type of the file private File dc ; private String uploadContentType ; //The content type of the file private String uploadContentType ; //The content type of the file private String uploadFileName ; //The uploaded file name /** private String uploadFileName ; //The uploaded file name /** /** * @return the dc * @return the dc */ */ public File getDc() { return dc ; } /** public File getDc() { return dc ; } /** return dc ; } /** /** * @param dc the dc to set * @param dc the dc to set */ */ public void setDc(File dc) { this . dc = dc; } /** public void setDc(File dc) { this . dc = dc; } /** this . dc = dc; } /** /** * @return the uploadContentType * @return the uploadContentType */ */ public String getUploadContentType() { return uploadContentType ; } /** public String getUploadContentType() { return uploadContentType ; } /** return uploadContentType ; } /** /** * @param uploadContentType the uploadContentType to set * @param uploadContentType the uploadContentType to set */ */ public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** this . uploadContentType = uploadContentType; } /** /** * @return the uploadFileName * @return the uploadFileName */ */ public String getUploadFileName() { return uploadFileName ; } /** public String getUploadFileName() { return uploadFileName ; } /** return uploadFileName ; } /** /** * @param uploadFileName the uploadFileName to set * @param uploadFileName the uploadFileName to set */ */ public void setUploadFileName(String uploadFileName) { this . uploadFileName = uploadFileName; } public void setUploadFileName(String uploadFileName) { this . uploadFileName = uploadFileName; } this . uploadFileName = uploadFileName; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: How can I validate a composed object in my action?(Struts 2)
Create a file With name UserAction-validation.xml and copy the below content go through the struts2 validation frame work validators field name=usr.userId field-validator type=requiredstring messageSchool name required/message /field-validator /field /validators On 2/6/08, slideharmony [EMAIL PROTECTED] wrote: Hello! I have to validate a composed object in my action, this is my action: public class UserAction extends ActionSupport{ private User usr; public User getUser() {return usr;} public void setUser(User usr) {this.usr = usr;} } and this is User class: public class User{ private String usrId; public String getUsrId(){ return usrId; } public void setUsrId(String usrId){ this.usrId = usrId; } } How can I validate usrId property with annotations or xml without putting annotations inside User class? Any help would be appreciate! Thanks in advance, Riccardo -- View this message in context: http://www.nabble.com/How-can-I-validate-a-composed-object-in-my-action-%28Struts-2%29-tp15306468p15306468.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]
struts polish application
I have an application that needs to show messages coming from SAP in polish language. What would be the changes in need to do for my web.xml,struts config.xml and jsp pages.. Certain polish fonts were corrupted and shown question marks.. Please advice
Re: STRUTS 2: fail to retrieve values without repost
I forgot to map my success. That's why it only send information on my repost. Thanks Musachy Barroso wrote: do you have getters/setters(I am guessing the setters are missing) in your action for all the form fields? musachy On Feb 6, 2008 10:29 AM, Nushi [EMAIL PROTECTED] wrote: I only seem to get my values of my form when i repost. CODE %@ taglib prefix=s uri=/struts-tags % html head titleFile Upload Example/title link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ /head body s:actionerror / s:fielderror / s:form action=doUpload method=POST enctype=multipart/form-data tr td colspan=2h1File Upload Example/h1/td /tr s:textfield name=title label=Title id=title/ s:submit / /s:form /body /html s:property value=title //td package name=example extends=struts-default action name=showUpload method=input resultpages/upload.jsp/result /action action name=doUpload class=Upload result name=inputshowUpload/result resultpages/upload-success.jsp/result /action /package I get nothing, until I refresh my page, and then it fills my values. Thx in advance! Nushi -- View this message in context: http://www.nabble.com/STRUTS-2%3A-fail-to-retrieve-values-without-repost-tp15306729p15306729.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] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/STRUTS-2%3A-fail-to-retrieve-values-without-repost-tp15306729p15328266.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]
Struts2 sesionExpired page
Hi, I am having struts2 application with hibernate + mysql.I want to create web app session Expired page,but i am not able to detect weather my application session expired or not. I have given session time out to 1 min also but it still displays active session. session-config session-timeout1/session-timeout /session-config My SessionChecking interceptor looks like:- public class SessionExpired implements Interceptor { public void destroy() { LOG.info(..destroy); } public void init() { LOG.info(..init); } public String intercept(ActionInvocation actionInvocation) throws Exception { Map session = actionInvocation.getInvocationContext().getSession(); if(session == null) { LOG.info(..interce if); } else { LOG.info(..interce else); } return actionInvocation.invoke(); } } After 1..2...3...5 min it still logging (..interce else). Do anyone know how can i detect my application session time out or not ? Thanks regards jignesh -- View this message in context: http://www.nabble.com/Struts2-sesionExpired-page-tp15328299p15328299.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]