validations with selected option
Hi, Iam writing validations in className-validation.xml file it is working fine. But in the form there are two radio buttons 1. If one is selected a new table appear on the form with 5 or 6 fields and vice versa. I written the validaions for all the fields including the table which is appending on selecting one of the option.So,these validations are fired automatically when user clicks on next button. Know my question how to stop firing validations for the table(with 5 or 6 fields)when the user has not selected the paritcular option. Srikanth -- View this message in context: http://www.nabble.com/validations-with-selected-option-tp21885572p21885572.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: How to use "s:include" param in s:if
On Friday 06 February 2009 18:27:18 Struts Two wrote: > Wes , > > Thank you for your reply, Unfortunately that does not work. The if > statement return false [I print ${param.tab1} on the page and it has the > value 'tab1' yet if statement is false]. I am using struts 2.0.14. > Hmm... Strange. I don't know if it matters, but ${param.tab1} probably works because it's a legit EL expression. Your include points directly to a JSP, rather than an action. Try doing the whole thing in EL, you might be able to accomplish what you're looking for with less hassle. -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] s:action in value stack?
Hi Musachy, what you say makes sense, but then I think one thing is missing in the doc for s:action (http://struts.apache.org/2.1.6/docs/action.html): I suggest something like this: "The action is never placed on the value stack like an action called by URL, so that accessing fields of it with a syntax "value="actionfield"/> is NOT possible. Declare a variable instead". This would avoid my misunderstanding. Thanks Wolfgang Musachy Barroso wrote: Didn't my previous email answer your questions? "Ok, let me try to clarify this, if the result of some action, lets call it "firstAction" contains: while the result of "secondAction" is executed, "secondAction" will be on top of the stack, and it is not available by name in the stack. Inside the tag content, "firstAction" is on top of the stack. Outside the action tag, "firstAction" is on top of the stack, and "secondAction" can be referenced by name. " That says what is on the stack at every moment. musachy - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to use "s:include" param in s:if
Wes , Thank you for your reply, Unfortunately that does not work. The if statement return false [I print ${param.tab1} on the page and it has the value 'tab1' yet if statement is false]. I am using struts 2.0.14. --- On Fri, 2/6/09, Wes Wannemacher wrote: > From: Wes Wannemacher > Subject: Re: How to use "s:include" param in s:if > To: "Struts Users Mailing List" > Received: Friday, February 6, 2009, 11:07 PM > On Friday 06 February 2009 17:35:56 Struts Two wrote: > > I have run out of options and I was hoping if someone > can help me. I have > > an include tag as follows: > > > > value="./includes/tabs.jsp"> > > value="%{'tab1'}" /> > > > > > > In my tabs.jsp, I tried to do the following: > > > > class="on" > > > class="off" > > > > > > But of no avail. Using ${param.tabId}, I can see the > value of tablId. I > > even tried [crazy ideas like]: > > > > class="on" > > > class="off" > > > > > > class="on" > > > class="off" > > > > > > Refering to "Struts 2 in action" and > "Struts 2 Design and programming" was > > of no help. > > > > I would appreciate if anybody helps me on that. > > > > regards, > > > > Try - > > > > -Wes > > -- > > Wes Wannemacher > Author - Struts 2 In Practice > Includes coverage of Struts 2.1, Spring, JPA, JQuery, > Sitemesh and more > http://www.manning.com/wannemacher > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: > user-h...@struts.apache.org __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can I use a Parameter in result definition?
Musachy Barroso wrote: Should we change the documentation? (Is it documented anywhere other than the javadocs?) Should we include that change in the upgrade instructions? Feel free to update the wiki. I added a bit to the upgrade instructions. Changing the javadoc requires svn commit privileges, though... -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can I use a Parameter in result definition?
Griffith, Michael * wrote: Cool, but looking at the doc, it looks like the only place I can declare a parm is in the result tag? It looked like the only place you wanted to use this substitution was in a result tag. I didn't notice what value it was you wanted until now. The action is on top of the value stack when that's evaluated, and there should be some way to get to that info from there...so if you make your BaseAction class include a getNamespace() method that does the right thing, you can say %{namespace} in the struts.xml like you asked. I've got to sign off, so I'm not providing the magic incantation to get this from the action, but I bet there's some way to get it. I don't see it right now, but I thought there used to be an ActionMappingAware interface, for example... -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: How to use "s:include" param in s:if
On Friday 06 February 2009 17:35:56 Struts Two wrote: > I have run out of options and I was hoping if someone can help me. I have > an include tag as follows: > > > > > > In my tabs.jsp, I tried to do the following: > > class="on" > class="off" > > > But of no avail. Using ${param.tabId}, I can see the value of tablId. I > even tried [crazy ideas like]: > > class="on" > class="off" > > > class="on" > class="off" > > > Refering to "Struts 2 in action" and "Struts 2 Design and programming" was > of no help. > > I would appreciate if anybody helps me on that. > > regards, > Try - -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can I use a Parameter in result definition?
On Fri, Feb 6, 2009 at 5:51 PM, Dale Newfield wrote: > Musachy Barroso wrote: >>> >>> Yes. You can include OGNL there (except it uses the JSTL ${} syntax >>> instead >>> of OGNL %{} syntax for a reason I've never understood): >> >> I think we fixed that already. > > I just looked in the source and see that it should now work with either. I > changed my current app and it worked! > > Should we change the documentation? (Is it documented anywhere other than > the javadocs?) Should we include that change in the upgrade instructions? > Feel free to update the wiki. > Now that you've looked at this in more detail, assuming anyone ever gets > alternative scripting languages working, does the possibility of making them > all work and be selectable based on the character %{} for ognl, ${} for > jstl, #{} for mvel, etc. seem possible? That wouldn't be hard. musachy -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can I use a Parameter in result definition?
Musachy Barroso wrote: Yes. You can include OGNL there (except it uses the JSTL ${} syntax instead of OGNL %{} syntax for a reason I've never understood): I think we fixed that already. I just looked in the source and see that it should now work with either. I changed my current app and it worked! Should we change the documentation? (Is it documented anywhere other than the javadocs?) Should we include that change in the upgrade instructions? Now that you've looked at this in more detail, assuming anyone ever gets alternative scripting languages working, does the possibility of making them all work and be selectable based on the character %{} for ognl, ${} for jstl, #{} for mvel, etc. seem possible? -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How to use "s:include" param in s:if
I have run out of options and I was hoping if someone can help me. I have an include tag as follows: In my tabs.jsp, I tried to do the following: class="on" class="off" > But of no avail. Using ${param.tabId}, I can see the value of tablId. I even tried [crazy ideas like]: class="on" class="off" > class="on" class="off" > Refering to "Struts 2 in action" and "Struts 2 Design and programming" was of no help. I would appreciate if anybody helps me on that. regards, __ Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! Canada Messenger at http://ca.beta.messenger.yahoo.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Can I use a Parameter in result definition?
> Yes. You can include OGNL there (except it uses the JSTL ${} syntax instead > of OGNL %{} syntax for a reason I've never understood): > I think we fixed that already. musachy -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Can I use a Parameter in result definition?
Cool, but looking at the doc, it looks like the only place I can declare a parm is in the result tag? Something like this: view-{packageName}.panel How do I declare the variable at the package level so I don't have to redeclare each action and result? MG -Original Message- From: Dale Newfield [mailto:d...@newfield.org] Sent: Friday, February 06, 2009 2:25 PM To: Struts Users Mailing List Subject: Re: Can I use a Parameter in result definition? Griffith, Michael * wrote: > Does anyone know if it is possible to use a parameter in my > action/result definition: Yes. You can include OGNL there (except it uses the JSTL ${} syntax instead of OGNL %{} syntax for a reason I've never understood): http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/d ispatcher/StrutsResultSupport.html -Dale - 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 I use a Parameter in result definition?
Griffith, Michael * wrote: Does anyone know if it is possible to use a parameter in my action/result definition: Yes. You can include OGNL there (except it uses the JSTL ${} syntax instead of OGNL %{} syntax for a reason I've never understood): http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/StrutsResultSupport.html -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Can I use a Parameter in result definition?
Hello all... Does anyone know if it is possible to use a parameter in my action/result definition: I want to use the package name in the result definition view-{0).panel Would become: view-component.panel Is this possible? Thanks in advance, MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: trouble deploying struts2 app to tomcat 1.5.0.05
Ok, to make the problem more simplified...I took the struts2-blank-2.0.12.war application & deployed it to my local tomcat. That works. Took the same war & deployed it to my server environment tomcat - FAILS. Note that I have commented out every other application running there, so it's a 1 to 1 comparison between local & server. Difference between server & local is: Local Tomcat: 5.5.17 Local JVM: 1.5.0_13 --- Server Tomcat: 5.5.20 Server JVM: 1.5.0.05-_17_oct_2006_02_15 Does anyone know the differences between these versions well? What could be the culprit!?! Stack for struts-blank on the server is: Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Unknown Source) at org.apache.catalina.core.ApplicationFilterConfig.(Unknown Source) at org.apache.catalina.core.StandardContext.filterStart(Unknown Source) at org.apache.catalina.core.StandardContext.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardHost.start(Unknown Source) at org.apache.catalina.core.ContainerBase.start(Unknown Source) at org.apache.catalina.core.StandardEngine.start(Unknown Source) at org.apache.catalina.core.StandardService.start(Unknown Source) at org.apache.catalina.core.StandardServer.start(Unknown Source) at org.apache.catalina.startup.Catalina.start(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Unknown Source) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Feb 6, 2009 1:15:49 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/blank] startup failed due to previous errors Feb 6, 2009 1:15:50 PM org.apache.catalina.core.ApplicationCont Looks very familiar...in fact exactly the same stack I get with my app. Any suggestions on where to go from here! --Dan - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[s2] file upload size validation indiced problems
I have a form that has an element. When the upload exceeds that size, the input page is returned. Log4j records show this log message: org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (xxx) exceeds the configured maximum (yyy) All other form elements are blank; required fields show field errors. The upload element does not show any field errors. The action never receives the request. Everything works as expected when the max file size is not exceeded. Why don't I see the upload field's error? What happened to all of the other field values? How can this be fixed? I'm using struts 2.1.2 w/ xwork 2.1.1 My action uses the default stack. The application does not have a struts.properties file I've tried adding a validate( ) method to my action class but that did not change things, so I removed it. === STRUTS.XML (edited for brevity) === === /admin/siterequest/request_form_thanks.jsp /admin/siterequest/request_form.jsp === JSP PAGE (edited for brevity) = === <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> === ACTION CLASS (edited for brevity) = === public class SiteRequestAction extends ActionSupport implements Preparable, SessionAware { public String save() { try { this.siteRequestFacade.save(this.siteRequest); return "success"; } catch (Throwable exception) { logger.error("Unable to save SiteRequest: ", exception); return "input"; } } Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: What's the correct expression syntax?
Ah, thanks for the reply and to Richard as well. It's insane how much time it is easy to waste on small things like that. Thanks guys! -Original Message- From: Dale Newfield [mailto:d...@newfield.org] Sent: Friday, February 06, 2009 1:32 PM To: Struts Users Mailing List Subject: Re: What's the correct expression syntax? Griffith, Michael * wrote: > > ... Do work > Is the correct one, except for the one-character-string gotcha: http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-c har-string.html -Dale - 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: What's the correct expression syntax?
I think it's because you're comparing a single character string, which OGNL treats as a bit of a special case for some reason. I dont have my code with me now but I'm pretty sure I had the same problem. Google 'comparing single character string in ognl' for some pointers (sorry, I cant verify myself right now) -Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Fri 06/02/2009 19:27 To: Struts Users Mailing List Subject: What's the correct expression syntax? Hi, I don't think I fully understand OGNL and I need some help with an expression... I have a param that I am passing to an action. the parameter is called selectedType, and it has a getter and setter on the action. It is getting set correctly. When I try to evaluate the expression using the tag, it never evaluates correctly. The action parameter is as follows; ./component/new.action?selectedType=C I've tried the following expressions ... Do work ... Do work ... Do work None of which seem to work. Can someone clear this up? Thanks in advance, MG - 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: What's the correct expression syntax?
Griffith, Michael * wrote: ... Do work Is the correct one, except for the one-character-string gotcha: http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
What's the correct expression syntax?
Hi, I don't think I fully understand OGNL and I need some help with an expression... I have a param that I am passing to an action. the parameter is called selectedType, and it has a getter and setter on the action. It is getting set correctly. When I try to evaluate the expression using the tag, it never evaluates correctly. The action parameter is as follows; ./component/new.action?selectedType=C I've tried the following expressions ... Do work ... Do work ... Do work None of which seem to work. Can someone clear this up? Thanks in advance, MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: TypeConverter needs Spring Bean
Thanks for the suggestion. Maybe this should be considered as a future feature enhancement. MG -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Friday, February 06, 2009 9:12 AM To: Struts Users Mailing List Subject: Re: TypeConverter needs Spring Bean The converters are created by the internal IOC container, so the Spring beans wont be injected. A "hack" I can think of is to add something like this to the converter: @Inject(StrutsConstants.STRUTS_OBJECTFACTORY) public void setObjectFactory(ObjectFactory factory) { //save the factory for later } that factory will be the Spring object factory, which you can use to lookup the beans that you need. Not much of "inversion of control" but it should work. musachy On Fri, Feb 6, 2009 at 9:59 AM, Griffith, Michael * wrote: > How can you tell? This is handed by the plug-in, right? From my > struts.properties file: > > struts.objectFactory = spring > struts.objectFactory.spring.autoWire = name > struts.objectFactory.spring.useClassCache = true > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Friday, February 06, 2009 8:54 AM > To: Struts Users Mailing List > Subject: Re: TypeConverter needs Spring Bean > > Are the converters created by the object factory? if not, then it will > not work. > > musachy > > On Fri, Feb 6, 2009 at 9:46 AM, Griffith, Michael * > wrote: >> I also tried adding the @Autowired annotation to the dependency, but >> it did not work. Can anyone clarify how this is supposed to work? >> MG >> >> -Original Message- >> From: Steven Yang [mailto:kenshin...@gmail.com] >> Sent: Thursday, February 05, 2009 8:15 PM >> To: Struts Users Mailing List >> Subject: Re: TypeConverter needs Spring Bean >> >> Hi >> I also need my Converter to be handled by Spring however I could not >> get it to work as well. >> From my observation is that the Converter is set to X-Work but not to >> Struts, there for the Spring plugin may not work there. >> Please correct me if I am wrong. >> Or is there a correct way to set it up? >> >> Thanks >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > 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 > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - 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: TypeConverter needs Spring Bean
The converters are created by the internal IOC container, so the Spring beans wont be injected. A "hack" I can think of is to add something like this to the converter: @Inject(StrutsConstants.STRUTS_OBJECTFACTORY) public void setObjectFactory(ObjectFactory factory) { //save the factory for later } that factory will be the Spring object factory, which you can use to lookup the beans that you need. Not much of "inversion of control" but it should work. musachy On Fri, Feb 6, 2009 at 9:59 AM, Griffith, Michael * wrote: > How can you tell? This is handed by the plug-in, right? From my > struts.properties file: > > struts.objectFactory = spring > struts.objectFactory.spring.autoWire = name > struts.objectFactory.spring.useClassCache = true > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Friday, February 06, 2009 8:54 AM > To: Struts Users Mailing List > Subject: Re: TypeConverter needs Spring Bean > > Are the converters created by the object factory? if not, then it will > not work. > > musachy > > On Fri, Feb 6, 2009 at 9:46 AM, Griffith, Michael * > wrote: >> I also tried adding the @Autowired annotation to the dependency, but >> it did not work. Can anyone clarify how this is supposed to work? >> MG >> >> -Original Message- >> From: Steven Yang [mailto:kenshin...@gmail.com] >> Sent: Thursday, February 05, 2009 8:15 PM >> To: Struts Users Mailing List >> Subject: Re: TypeConverter needs Spring Bean >> >> Hi >> I also need my Converter to be handled by Spring however I could not >> get it to work as well. >> From my observation is that the Converter is set to X-Work but not to >> Struts, there for the Spring plugin may not work there. >> Please correct me if I am wrong. >> Or is there a correct way to set it up? >> >> Thanks >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > 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 > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: TypeConverter needs Spring Bean
How can you tell? This is handed by the plug-in, right? From my struts.properties file: struts.objectFactory = spring struts.objectFactory.spring.autoWire = name struts.objectFactory.spring.useClassCache = true -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Friday, February 06, 2009 8:54 AM To: Struts Users Mailing List Subject: Re: TypeConverter needs Spring Bean Are the converters created by the object factory? if not, then it will not work. musachy On Fri, Feb 6, 2009 at 9:46 AM, Griffith, Michael * wrote: > I also tried adding the @Autowired annotation to the dependency, but > it did not work. Can anyone clarify how this is supposed to work? > MG > > -Original Message- > From: Steven Yang [mailto:kenshin...@gmail.com] > Sent: Thursday, February 05, 2009 8:15 PM > To: Struts Users Mailing List > Subject: Re: TypeConverter needs Spring Bean > > Hi > I also need my Converter to be handled by Spring however I could not > get it to work as well. > From my observation is that the Converter is set to X-Work but not to > Struts, there for the Spring plugin may not work there. > Please correct me if I am wrong. > Or is there a correct way to set it up? > > Thanks > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - 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
Struts2 + tiles + i18n, getText issue
Hi, I've come across a problem I can't figure out it seems similar to http://www.mail-archive.com/user@struts.apache.org/msg76063.html These two statements give different results when the language is changed With s:text giving the correct language text but getText always gives the default language text. The tiles definition I have is They both work correctly if there's only one tile i.e. So it seems to be something to do with having multiple tiles but since s:text works the i18n interceptor must be working. Anyone any idea why getText is ignoring the language? I came across this when using tabbedPanel and adding i18n to the tab titles. I'm using Struts struts-2.0.14 and the tiles bundle that comes with it I change language using the code from HelloWorld.action Languages en English ga Irish Thanks Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: TypeConverter needs Spring Bean
Are the converters created by the object factory? if not, then it will not work. musachy On Fri, Feb 6, 2009 at 9:46 AM, Griffith, Michael * wrote: > I also tried adding the @Autowired annotation to the dependency, but it > did not work. Can anyone clarify how this is supposed to work? > MG > > -Original Message- > From: Steven Yang [mailto:kenshin...@gmail.com] > Sent: Thursday, February 05, 2009 8:15 PM > To: Struts Users Mailing List > Subject: Re: TypeConverter needs Spring Bean > > Hi > I also need my Converter to be handled by Spring however I could not get > it to work as well. > From my observation is that the Converter is set to X-Work but not to > Struts, there for the Spring plugin may not work there. > Please correct me if I am wrong. > Or is there a correct way to set it up? > > Thanks > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: getter for a property problem
in fact, CAjustComment can be null (the null problem i got it only with nested property, does this cause an exception with string property) Regards Elyes 2009/2/6 mitch gorman > elyes sallem wrote: > > Hello, > > i use a property in a jsp , "shortcomment" , which depend of another > > property, "CAjustComment": > > > > public String getShortcomment() { > > if (CAjustComment.length()>15) > > return CAjustComment.substring(0,14); > > else > > return CAjustComment; > > } > > > > but i got this error, any one has an idea? > > > > start with the simple stuff: is CAjustComment definitely non-null, > at that point? > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Elyes.
RE: TypeConverter needs Spring Bean
I also tried adding the @Autowired annotation to the dependency, but it did not work. Can anyone clarify how this is supposed to work? MG -Original Message- From: Steven Yang [mailto:kenshin...@gmail.com] Sent: Thursday, February 05, 2009 8:15 PM To: Struts Users Mailing List Subject: Re: TypeConverter needs Spring Bean Hi I also need my Converter to be handled by Spring however I could not get it to work as well. >From my observation is that the Converter is set to X-Work but not to Struts, there for the Spring plugin may not work there. Please correct me if I am wrong. Or is there a correct way to set it up? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: getter for a property problem
elyes sallem wrote: > Hello, > i use a property in a jsp , "shortcomment" , which depend of another > property, "CAjustComment": > > public String getShortcomment() { > if (CAjustComment.length()>15) > return CAjustComment.substring(0,14); > else > return CAjustComment; > } > > but i got this error, any one has an idea? > start with the simple stuff: is CAjustComment definitely non-null, at that point? - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[S2][Convention] how to intercept all my actions
Hi All, some time ago, before 2.1.6 GA, i was wondering about how to intercept all my actions, but it was unclear how to do it. After I upgraded to 2.1.6 i finally did it. So in case someone is interested in intercepting all actions without need to modify them, here [1] is my post about it. 1. http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html Best greetings, Paweł Wielgus. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Get an InputStream for a file in my webapp
You can implement the ServletContextAware interface in your action, and Struts will set the ServletContext which has a "getPath" method, or something like that. musachy On Fri, Feb 6, 2009 at 9:03 AM, Security Management wrote: > I have an action that returns an image, and the getImageStream method > returns the stream associated with the blob in the database that I'm > pulling. > > That works great, and displays/exports the image exactly like I want to. > > However, there are cases where there is no image, and I want to display a > "No Image Found" image. > > So, the getImageStream is: > > public InputStream getImageStream() >{ >if(this.imageStream != null) >{ >return this.imageStream; >} >else >{ >return new FileInputStream("no_image.jpg"); >} >} > > My questions is how do I get the path to no_image.jpg? Here is its location > in the war file. It is not on the classpath. > > -rw-r--r-- 4827 29-Oct-2008 19:47:26 images/no_image.jpg > > Thanks, > Mike. > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Get an InputStream for a file in my webapp
Using a FileInputStream like that won't work if the war is packaged. Take a look at the getResourceAsStream method in the ServletContext interface instead. Nils-H On Fri, Feb 6, 2009 at 3:03 PM, Security Management wrote: > I have an action that returns an image, and the getImageStream method > returns the stream associated with the blob in the database that I'm > pulling. > > That works great, and displays/exports the image exactly like I want to. > > However, there are cases where there is no image, and I want to display a > "No Image Found" image. > > So, the getImageStream is: > > public InputStream getImageStream() >{ >if(this.imageStream != null) >{ >return this.imageStream; >} >else >{ >return new FileInputStream("no_image.jpg"); >} >} > > My questions is how do I get the path to no_image.jpg? Here is its location > in the war file. It is not on the classpath. > > -rw-r--r-- 4827 29-Oct-2008 19:47:26 images/no_image.jpg > > Thanks, > Mike. > > > > - > 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
Get an InputStream for a file in my webapp
I have an action that returns an image, and the getImageStream method returns the stream associated with the blob in the database that I'm pulling. That works great, and displays/exports the image exactly like I want to. However, there are cases where there is no image, and I want to display a "No Image Found" image. So, the getImageStream is: public InputStream getImageStream() { if(this.imageStream != null) { return this.imageStream; } else { return new FileInputStream("no_image.jpg"); } } My questions is how do I get the path to no_image.jpg? Here is its location in the war file. It is not on the classpath. -rw-r--r-- 4827 29-Oct-2008 19:47:26 images/no_image.jpg Thanks, Mike. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
getter for a property problem
Hello, i use a property in a jsp , "shortcomment" , which depend of another property, "CAjustComment": public String getShortcomment() { if (CAjustComment.length()>15) return CAjustComment.substring(0,14); else return CAjustComment; } but i got this error, any one has an idea? javax.servlet.jsp.JspException: Exception thrown by getter for property ajustContrat[0].shortcomment of bean saisiAjustContratEditForm at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:968) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:225) at org.apache.struts.taglib.nested.bean.NestedWriteTag.doStartTag(NestedWriteTag.java:51) at org.apache.jsp.pages.CPFA_005fMensuel.saisi_005fajustement.ajust_005fcontrat_jsp._jspx_meth_nested_005fwrite_005f15(ajust_005fcontrat_jsp.java:2252) at org.apache.jsp.pages.CPFA_005fMensuel.saisi_005fajustement.ajust_005fcontrat_jsp._jspService(ajust_005fcontrat_jsp.java:550) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) Regards Elyes.
Re: Struts2 + tiles +OC4J
2009/2/5 hesham : > java.lang.IllegalArgumentException: Resource > /portalframework/renderContents.action not found Does this resource exist? Antonio - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org