Struts 2 parametrized messages
Hello What is the Struts 2.0.1 syntax in JSP-page to render message like Missing.message3 = This feature is STILL ({0}) under construction. Please try ({1}) again in the next interation. 1) The following JSP: CLASS private String cat="Hello from 'cat'"; public String getCat() { return cat; } private String dog="Hello from 'dog'"; public String getDog() { return "HardCoded Dog"; } outputs This feature is STILL () under construction. Please try () again in the next interation 2) JSP like Hardcoded cat Hardcoded dog outputs This feature is STILL (Hardcoded cat) under construction. Please try (Hardcoded dog) again in the next interation (Of course ?)
Re: Spring integration with Struts-2.0.2
Thanks to Tomas and Wendy, it work fine! 2006/12/8, Wendy Smoak <[EMAIL PROTECTED]>: On 12/7/06, liukaipeng <[EMAIL PROTECTED]> wrote: > Is there any change to this short hand name for spring, or I'm missing some configuration point newly added to struts-2.0.2? Try using struts2-core and the struts2-spring-plugin, as Tomas suggested. (I think the 'all' jar will go away, I don't see how it can work with plugins, since each plugin needs a struts-plugin.xml file.) -- Wendy
Re: Spring integration with Struts-2.0.2
On 12/7/06, liukaipeng <[EMAIL PROTECTED]> wrote: Is there any change to this short hand name for spring, or I'm missing some configuration point newly added to struts-2.0.2? Try using struts2-core and the struts2-spring-plugin, as Tomas suggested. (I think the 'all' jar will go away, I don't see how it can work with plugins, since each plugin needs a struts-plugin.xml file.) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Spring integration with Struts-2.0.2
This is a long-shot: org.apache.struts struts2-spring-plugin 2.0.2-SNAPSHOT /tomas On 12/8/06, liukaipeng <[EMAIL PROTECTED]> wrote: Wiki page http://cwiki.apache.org/WW/spring.html demonstrate how to integrate spring with struts2, that in detail, set struts.objectFactory = spring to use spring as the object factory. This works well with the struts-2.0.1 release, but when I switch the jar file to struts2-all-2.0.2-SNAPSHOT.jar(Dec 5), I get the following error message when the server startup: ERROR - StandardContext.filterStart(3638) | Exception starting filter struts Cannot locate the chosen ObjectFactory implementation: spring - [unknown location] at org.apache.struts2.config.BeanSelectionProvider.alias( BeanSelectionProvider.java:198) Is there any change to this short hand name for spring, or I'm missing some configuration point newly added to struts-2.0.2? liukaipeng 2006-12-08
Spring integration with Struts-2.0.2
Wiki page http://cwiki.apache.org/WW/spring.html demonstrate how to integrate spring with struts2, that in detail, set struts.objectFactory = spring to use spring as the object factory. This works well with the struts-2.0.1 release, but when I switch the jar file to struts2-all-2.0.2-SNAPSHOT.jar(Dec 5), I get the following error message when the server startup: ERROR - StandardContext.filterStart(3638) | Exception starting filter struts Cannot locate the chosen ObjectFactory implementation: spring - [unknown location] at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:198) Is there any change to this short hand name for spring, or I'm missing some configuration point newly added to struts-2.0.2? liukaipeng 2006-12-08
Re: Struts2 general availability release date?
On 12/7/06, Mark Menard <[EMAIL PROTECTED]> wrote: On 12/7/06 8:02 AM, "Dave Newton" <[EMAIL PROTECTED]> wrote: > I've been running 2.0.1 and lately some 2.0.2 and while there a few > rough edges overall I've been quite happy with the quality, although I > am currently using a mere fraction of the framework. Basically the same here with me. I started a project with WW and quickly moved to the current Struts built from svn. There are a few rough edges, but overall it's very good. I figure it will GA by time I'm ready to deploy in production. Even if it doesn't make it to GA by time I'm ready to deploy I'm not really worried, because like Dave the parts I'm using work. And, when the time comes, please feel free to cast your own vote as to the quality of subsequent releases. The votes may not be "binding", but they do matter and can help us make the determination of whether a release is "ready for primetime" or not. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator FrameWork
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thomas, Thomas Thomas wrote: > (*this* == password) > > But it still doesn't work This is exactly what I have in my setup, and it works like a charm: test ( (password == null) or (*this* == password) ) Make sure that your config file is being re-loaded. You will have to reload the webapp in order to make that happen... changing the file will not trigger a reload. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFeJ929CaO5/Lv0PARAp7nAKCsGhwmlzurFklQmTLBH9cvgS85VgCgpqP5 hQ76T7r5u++UL5P4X8M1Q/Q= =4/iJ -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Still Ajax and Struts 2
thanks, but I get an error with the code you gave me : SEVERE: Error setting expr 'dojo.transport' with value '[Ljava.lang.String;@179567c' ognl.OgnlException: target is null for setProperty(null, "transport", [Ljava.lang.String;@179567c) thanks Musachy Barroso-2 wrote: > > I think you should take a look at the Struts2/Webwork tutorials > http://www.opensymphony.com/webwork/wikidocs/Tutorial.html and > http://struts.apache.org/2.x/docs/tutorials.html > > If you look at the showcase code you will see this for the AjaxTest > action: > > in struts-ajax.xml: > > class="org.apache.struts2.showcase.ajax.AjaxTestAction"> > /ajax/AjaxResult.jsp > > > in AjaxTestAction.java: > > public class AjaxTestAction implements Action, Serializable { > > private static int counter = 0; > private String data; > > public long getServerTime() { > return System.currentTimeMillis(); > } > > public int getCount() { > return ++counter; > } > > public String getData() { > return data; > } > > public void setData(String data) { > this.data = data; > } > > public String execute() throws Exception { > return SUCCESS; > } > } > > and AjaxResult.jsp: > > <%@ taglib prefix="s" uri="/struts-tags" %> > > <% > request.setAttribute("decorator", "none"); > response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 > response.setHeader("Pragma","no-cache"); //HTTP 1.0 > response.setDateHeader ("Expires", 0); //prevents caching at the > proxy server > %> > > Result: @ > > > > musachy > > walidito wrote: >> I, >> I wanna run this type of example app : >> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/remotediv/example1.jsp >> >> : >> > 13: id="once" >> 14: theme="ajax" >> 15: cssStyle="border: 1px solid yellow;" >> 16: href="/AjaxTest.action" >> 17: delay="5000" >> 18: loadingText="loading..."> >> 19: Initial Content >> >> >> In other word, a basic ajax component that allows a refreshment of only a >> part of my page. >> >> But I didn't get how to write the corresonding action and action mapping. >> For the moment I've tried to put a "success" return in my action ( is it >> enough ?), but I don't see what to put in my action mapping (i mean >> inside >> the tag. If I put nothing, of course it's >> wrong. >> If I only put a success-type result, It creates an infinite loop (always >> displays "loading"). >> Can sobdy help please? >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Still-Ajax-and-Struts-2-tf2776835.html#a7748842 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: Validator FrameWork
Instead of : (passwordCheck == password) I put : (*this* == password) But it still doesn't work
Re: Validator FrameWork
Dear Sean, thank u for your precious support. I added this : test (passwordCheck == password) But it's not working :-(
Re: Still Ajax and Struts 2
I think you should take a look at the Struts2/Webwork tutorials http://www.opensymphony.com/webwork/wikidocs/Tutorial.html and http://struts.apache.org/2.x/docs/tutorials.html If you look at the showcase code you will see this for the AjaxTest action: in struts-ajax.xml: class="org.apache.struts2.showcase.ajax.AjaxTestAction"> /ajax/AjaxResult.jsp in AjaxTestAction.java: public class AjaxTestAction implements Action, Serializable { private static int counter = 0; private String data; public long getServerTime() { return System.currentTimeMillis(); } public int getCount() { return ++counter; } public String getData() { return data; } public void setData(String data) { this.data = data; } public String execute() throws Exception { return SUCCESS; } } and AjaxResult.jsp: <%@ taglib prefix="s" uri="/struts-tags" %> <% request.setAttribute("decorator", "none"); response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %> Result: @ musachy walidito wrote: I, I wanna run this type of example app : http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/remotediv/example1.jsp : 19: Initial Content In other word, a basic ajax component that allows a refreshment of only a part of my page. But I didn't get how to write the corresonding action and action mapping. For the moment I've tried to put a "success" return in my action ( is it enough ?), but I don't see what to put in my action mapping (i mean inside the tag. If I put nothing, of course it's wrong. If I only put a success-type result, It creates an infinite loop (always displays "loading"). Can sobdy help please? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Fwd: HELP with switching modules in Struts 1.2.x]
Please ignore my previous mail. I found the issue. I was trying to forward from a local forward to a global forward. I started forwarding to the global forward directly and everthing started working fine. thanks, robin --- Begin Message --- Hi All, I am trying to switch modules in Struts 1.2.x webapp using a global forward. Here's the global forward path="/MODULE2/action.do" redirect="true"/> Here's the action Mapping that wants to switch to MODULE2 when an actionForward "toAccMain_CustomerProfilePage" is returned by "ProcessLoyaltyPageAction" contextRelative="true"> - Looks like, there's something wrong with my action mapping's forward. Everytime, the above actionForward is returned by the action, my .log file shows the following forwardconfig being processed 2006-12-07 12:19:41,788 435579 DEBUG [ExecuteThread: '9' for queue: 'default'] action.RequestProcessor - processForwardConfig(ForwardConfig[name=toAccMain_CustomerProfilePage,path=/backTOMODULE2,redirect=false,contextRelative=true]) but nothing happens. Browser address bar shows - http://localhost:7001/rdas107/MODULE1/processLoyalty.do and ends up giving "Error 404 Not found Error" No other exception, error in the logs or server console. Any help would be much appreciated, regards, robin --- End Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Still Ajax and Struts 2
I, I wanna run this type of example app : http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/remotediv/example1.jsp : 19: Initial Content In other word, a basic ajax component that allows a refreshment of only a part of my page. But I didn't get how to write the corresonding action and action mapping. For the moment I've tried to put a "success" return in my action ( is it enough ?), but I don't see what to put in my action mapping (i mean inside the tag. If I put nothing, of course it's wrong. If I only put a success-type result, It creates an infinite loop (always displays "loading"). Can sobdy help please? -- View this message in context: http://www.nabble.com/Still-Ajax-and-Struts-2-tf2776835.html#a7746954 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: Validator FrameWork
Use the validWhen validator for the password and the passwordCheck fields: http://struts.apache.org/1.2.x/userGuide/dev_validator.html You'll need to add the passwordCheck field to your registerForm. I've found these links useful when investigating commons-validator: * commons validator examples: http://wiki.apache.org/jakarta-commons/ValidatorExamples * Struts and commons-validator tutorial: http://struts.apache.org/1.1/userGuide/dev_validator.html * Struts validation framework tutorial: http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html * Oracle article on Struts validation framework: http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html * Very simple Struts validation example: http://wiki.apache.org/struts/StrutsBeginnerValidatorFramework?highlight =%28validator%29 * Helpful Struts validation site: http://www.niallp.pwp.blueyonder.co.uk/ * Validation of lists: http://wiki.apache.org/struts/StrutsCatalogLazyList * Useful validator tip for extends: http://wiki.apache.org/jakarta-commons/ValidatorVersion120 Sean -Original Message- From: Thomas Thomas [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 2006 3:05 PM To: Struts Users Mailing List Subject: Validator FrameWork Hi, I'm using Validator Framework with Struts, Here I want to validate a registration form. I want to add a field property passwordCheck, (the user needs to enters his password twice : the first password will be in property password, the second in passwordCheck) I want to check if value of password and passwordCheck are the same. How can I do this ? Thank u. Here is my code from now on without the field property passwordCheck : (In addition to that, I have a lot of difficulties to find information myself about validator framework, do u have any link for a full documentation ?) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator FrameWork
Hi, I'm using Validator Framework with Struts, Here I want to validate a registration form. I want to add a field property passwordCheck, (the user needs to enters his password twice : the first password will be in property password, the second in passwordCheck) I want to check if value of password and passwordCheck are the same. How can I do this ? Thank u. Here is my code from now on without the field property passwordCheck : (In addition to that, I have a lot of difficulties to find information myself about validator framework, do u have any link for a full documentation ?)
RE: Struts2 and Ajax pb
Ok ok, I begin to see what is the exact pb : I my action mapping I've putted : /JSPs/Error.jsp /JSPs/Menu.jsp so it must create an ugly loop... By the way, what should I put it this action mapping ? nothing ? thank you. walidito wrote: > > Thank you ! > Actually I had a mapping, but this mapping was wrong. > now I' m facing a new pb, > my "div" zone is continuously showing an error message (the error messages > adds at the end of the page, and doesn't replace the previous one, which > make it a real mess...) > this is the message : > widget ID collision on ID: twoseconds > > > > Dave Newton-3 wrote: >> >> walidito [mailto:[EMAIL PROTECTED] >>> href="/dashboard/actions/AjaxTest.action" >> >> Do you have a mapping to that action? >> >> Dave >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > -- View this message in context: http://www.nabble.com/Struts2-and-Ajax-pb-tf2776562.html#a7746431 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: Struts2 and Ajax pb
Thank you ! Actually I had a mapping, but this mapping was wrong. now I' m facing a new pb, my "div" zone is continuously showing an error message (the error messages adds at the end of the page, and doesn't replace the previous one, which make it a real mess...) this is the message : widget ID collision on ID: twoseconds Dave Newton-3 wrote: > > walidito [mailto:[EMAIL PROTECTED] >> href="/dashboard/actions/AjaxTest.action" > > Do you have a mapping to that action? > > Dave > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts2-and-Ajax-pb-tf2776562.html#a7746317 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: Struts2 and Ajax pb
First try putting the full url for your action on your browser , and make sure you are getting the expected page, just to get any ajax problem out of the way. After you get that working, try the div, which should work. regards musachy walidito wrote: Hi, I hava followed one of the "showcase" example ( http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/remotediv/example1.jsp ) tu run a first an independently-refreshed zone of my webpage. As the example doen't provide with the corresponding Action Class, i didn't succeed in making interact any action with my new ajax element (div tag). For information, I had put this in the header of my jsp. and this code in my And the sample action is : public class AjaxTestAction { String message; public String execute() throws Exception { setMessage("hello !!!"); return SUCCESS; } public void setMessage(String message){ this.message = message; } } So, as a result, I see well the refreshment, but always the "there was an error message". Can anyone help please ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts2 and Ajax pb
walidito [mailto:[EMAIL PROTECTED] > href="/dashboard/actions/AjaxTest.action" Do you have a mapping to that action? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 and Ajax pb
Hi, I hava followed one of the "showcase" example ( http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/remotediv/example1.jsp ) tu run a first an independently-refreshed zone of my webpage. As the example doen't provide with the corresponding Action Class, i didn't succeed in making interact any action with my new ajax element (div tag). For information, I had put this in the header of my jsp. and this code in my And the sample action is : public class AjaxTestAction { String message; public String execute() throws Exception { setMessage("hello !!!"); return SUCCESS; } public void setMessage(String message){ this.message = message; } } So, as a result, I see well the refreshment, but always the "there was an error message". Can anyone help please ? -- View this message in context: http://www.nabble.com/Struts2-and-Ajax-pb-tf2776562.html#a7745973 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HELP with switching modules in Struts 1.2.x
Hi All, I am trying to switch modules in Struts 1.2.x webapp using a global forward. Here's the global forward path="/MODULE2/action.do" redirect="true"/> Here's the action Mapping that wants to switch to MODULE2 when an actionForward "toAccMain_CustomerProfilePage" is returned by "ProcessLoyaltyPageAction" contextRelative="true"> - Looks like, there's something wrong with my action mapping's forward. Everytime, the above actionForward is returned by the action, my .log file shows the following forwardconfig being processed 2006-12-07 12:19:41,788 435579 DEBUG [ExecuteThread: '9' for queue: 'default'] action.RequestProcessor - processForwardConfig(ForwardConfig[name=toAccMain_CustomerProfilePage,path=/backTOMODULE2,redirect=false,contextRelative=true]) but nothing happens. Browser address bar shows - http://localhost:7001/rdas107/MODULE1/processLoyalty.do and ends up giving "Error 404 Not found Error" No other exception, error in the logs or server console. Any help would be much appreciated, regards, robin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
On 12/7/06, Urso Wieske <[EMAIL PROTECTED]> wrote: I completely agree with you about how HTTP handles requestparameter. If this is the only solution, then I will have to do some reengineering work in my porblem area to deal with ordering. :-( This is really annoying. I can't imagine I am the first person with this problem. I don;t really see the problem with Struts handling this issue. I don't see it as one as I use lazy dyna beans - but I am biased towards them :-) At form creation/instantiation time by Struts framwork, you always know the amount of indexed parameters. You just count them! :-) Well the only ready made solution Struts provides is the "Lazy" action form (or LazyDynaBean) link I gave you. The alternative is to use either the solution I gave you or one of the other style "lazy list" techniques listed on the wiki I provided. Other than that you could customize the request processor in between the form being created and populated. Niall So, you the size of the array to be created. The only thing left to do is to put the elements in their proper order. Example: RequestString on submit . someWrapper[0].name=blabla1&someWrapper[1].name=blabla2&someWrapper[2].name=blabla3.. Voila, you have created a array of size 3, because there three occurrences of indexed property "someWrapper[x].name". Kind Regards, Urso -Oorspronkelijk bericht- Van: Niall Pemberton [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 december 2006 14:16 Aan: Struts Users Mailing List Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope On 12/7/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > Hi Niall, > > Thanks for the reply! Apparantly this problem is quite difficult to get answer upon. You're the only one until now. > > Well, I was getting different exception in different scenario. > - When I put an array initialization (someWrappers = )in myForm's default constructor, I would get Array Out Of Bound exceptions. > - When I don't do an array initialization for myForm (on REQUEST scope), I would get a method invocation exception from BeanUtils.poulate() due to some getter property descriptor that can't be found. (?) But I have declared all my getters and setters (see fot your self below). > > I checked my generated HTML sources (from JSP), but they are all rendered as expected. That is, like you have specified below. > Weird, huh? > > When I chang my scope to session... it seems to work. But I don't want my form in sessin scope. (And if this is working indeed in session scope why not for requests scope?) > > The solution that you propose... I have seen it too on the internet. But this solution does not guarantee the right order of the array elements. And order IS a Requirement for my problem area. You can't control which order http sends the request parameters in - but theres no reason why you can't just "grow" your array to cope with whatever size the indexed getter is asking for. public SomeWrapper getSomeWrapper(int index) { if (wrappers == null) { wrappers = new SomeWrapper[index + 1]; } // Grow the array if (wrappers.length < index + 1) { newWrappers = new SomeWrapper[index + 1]; System.arraycopy(wrappers, 0, newWrappers, 0, wrappers.length); wrappers = newWrappers; } if (wrappers[index] == null) { wrappers[index] = new SomeWrapper(); } return wrappers[index]; } LazyDynaBeans do this for you: http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes Also more info on "lazy" index growth is here on the wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList Niall > Any hints? > > > Kind regards, > > Urso Wieske > > > > -Oorspronkelijk bericht- > Van: Niall Pemberton [mailto:[EMAIL PROTECTED] > Verzonden: donderdag 7 december 2006 9:40 > Aan: Struts Users Mailing List > Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on > REQUEST scope > > > So what BeanUtils exception are you getting? > > Your jsp should be generating the following? > > > > BeanUtils will try and access the indexed getter - getSomeWrapper(0) > and then call setPropA(...) - presumably its one of these methods ist > having problems with? > > Anyway the problem usually with request scope beans is that when it > calls the getSomeWrapper(index) method the array isn't initialized and > it returns null - if you put logic to "automatically" grow your array > in the getSomeWrapper(index) method then it should solve this. > > Niall > > On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > > Hi folks, > > > > I have problem with the scenario "Indexed Properties, BeanUtils and Form on REQUEST scope". > > When I select a a value from (1 or 2) from the dropdownlist and submit the form, I get an exception from BeanUtils.populate method about some getter which can be found!?? > > IF change the scope of m
Re: Struts2 general availability release date?
On 12/7/06 8:02 AM, "Dave Newton" <[EMAIL PROTECTED]> wrote: > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of >> The general feeling is that we are very close, and some of us are >> thinking that a GA would make a nice Chrismas present, but only if >> it's actually up to production standards. > > As another data point (and something to keep in mind) is that a lot of > the S2 code is re-branded WW code, which has been around awhile. > > I've been running 2.0.1 and lately some 2.0.2 and while there a few > rough edges overall I've been quite happy with the quality, although I > am currently using a mere fraction of the framework. Basically the same here with me. I started a project with WW and quickly moved to the current Struts built from svn. There are a few rough edges, but overall it's very good. I figure it will GA by time I'm ready to deploy in production. Even if it doesn't make it to GA by time I'm ready to deploy I'm not really worried, because like Dave the parts I'm using work. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] Radio buttons example
Hi: The Struts 2 Documentation pages seem to have left out radio buttons: http://struts.apache.org/2.x/docs/tag-reference.html http://struts.apache.org/2.x/docs/ui-tag-reference.html There is a page but its example is a little opaque: http://struts.apache.org/2.x/docs/radio.html I couldn't find an example either in the mailreader or in the showcase examples. Any help would be appreciated. Thanks mas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
Guys, Girls, Help. -Oorspronkelijk bericht- Van: Urso Wieske Verzonden: donderdag 7 december 2006 14:29 Aan: Struts Users Mailing List Onderwerp: RE: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope I completely agree with you about how HTTP handles requestparameter. If this is the only solution, then I will have to do some reengineering work in my porblem area to deal with ordering. :-( This is really annoying. I can't imagine I am the first person with this problem. I don;t really see the problem with Struts handling this issue. At form creation/instantiation time by Struts framwork, you always know the amount of indexed parameters. You just count them! :-) So, you the size of the array to be created. The only thing left to do is to put the elements in their proper order. Example: RequestString on submit . someWrapper[0].name=blabla1&someWrapper[1].name=blabla2&someWrapper[2].name=blabla3.. Voila, you have created a array of size 3, because there three occurrences of indexed property "someWrapper[x].name". Kind Regards, Urso -Oorspronkelijk bericht- Van: Niall Pemberton [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 december 2006 14:16 Aan: Struts Users Mailing List Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope On 12/7/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > Hi Niall, > > Thanks for the reply! Apparantly this problem is quite difficult to get > answer upon. You're the only one until now. > > Well, I was getting different exception in different scenario. > - When I put an array initialization (someWrappers = )in myForm's default > constructor, I would get Array Out Of Bound exceptions. > - When I don't do an array initialization for myForm (on REQUEST scope), I > would get a method invocation exception from BeanUtils.poulate() due to some > getter property descriptor that can't be found. (?) But I have declared all > my getters and setters (see fot your self below). > > I checked my generated HTML sources (from JSP), but they are all rendered as > expected. That is, like you have specified below. > Weird, huh? > > When I chang my scope to session... it seems to work. But I don't want my > form in sessin scope. (And if this is working indeed in session scope why > not for requests scope?) > > The solution that you propose... I have seen it too on the internet. But this > solution does not guarantee the right order of the array elements. And order > IS a Requirement for my problem area. You can't control which order http sends the request parameters in - but theres no reason why you can't just "grow" your array to cope with whatever size the indexed getter is asking for. public SomeWrapper getSomeWrapper(int index) { if (wrappers == null) { wrappers = new SomeWrapper[index + 1]; } // Grow the array if (wrappers.length < index + 1) { newWrappers = new SomeWrapper[index + 1]; System.arraycopy(wrappers, 0, newWrappers, 0, wrappers.length); wrappers = newWrappers; } if (wrappers[index] == null) { wrappers[index] = new SomeWrapper(); } return wrappers[index]; } LazyDynaBeans do this for you: http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes Also more info on "lazy" index growth is here on the wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList Niall > Any hints? > > > Kind regards, > > Urso Wieske > > > > -Oorspronkelijk bericht- > Van: Niall Pemberton [mailto:[EMAIL PROTECTED] > Verzonden: donderdag 7 december 2006 9:40 > Aan: Struts Users Mailing List > Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on > REQUEST scope > > > So what BeanUtils exception are you getting? > > Your jsp should be generating the following? > > > > BeanUtils will try and access the indexed getter - getSomeWrapper(0) > and then call setPropA(...) - presumably its one of these methods ist > having problems with? > > Anyway the problem usually with request scope beans is that when it > calls the getSomeWrapper(index) method the array isn't initialized and > it returns null - if you put logic to "automatically" grow your array > in the getSomeWrapper(index) method then it should solve this. > > Niall > > On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > > Hi folks, > > > > I have problem with the scenario "Indexed Properties, BeanUtils and Form on > > REQUEST scope". > > When I select a a value from (1 or 2) from the dropdownlist and submit the > > form, I get an exception from BeanUtils.populate method about some getter > > which can be found!?? > > IF change the scope of myForm to Session in my struts configuration, then I > > don't have a problem with beanutils. But I want my form on request scope! > > > > I have described below my problem scenario. > > > > Is there a solution to this problem?? (for
Re: [s2] servlet 2.4 required ?
OK for JEE version, but none of my customer server is servlet 2.4 compliant (all are servlet 2.3, and sometime java 1.3 !). Is servlet 2.4 dependency required for all features ? Can I run a Struts 2.0webapp with some limitations on tomcat 4.1 : Mailreader 2.0.1 runs fine under my tomcat 4.1.30 Nico. 2006/12/7, Wendy Smoak <[EMAIL PROTECTED]>: On 12/7/06, nicolas de loof <[EMAIL PROTECTED]> wrote: > I'm starting a project based on Java 1.4 and serlet 2.3 (tomcat 4.1). I'd > like to use Struts2 as it includes retro-translated support for java 1.4 . > According to project main page ( > http://struts.apache.org/2.x/#Platform%20Requirements), servlet 2.4 is > required. Yes, Struts 2 requires Servlet 2.4. The Servlet 2.4 spec was finalized over three years ago, and if I've got my versions straight, is part of J2EE 1.4. > Does this mean I will have to wait all my customer to upgrade to > JEE5 prior to using Struts2 ? If so, I'll have to wait 1 or 2 years ... No. Java EE 5 is Servlet 2.5, not 2.4. See: From http://java.sun.com/javaee/technologies/ Java EE 5 Java Platform, Enterprise Edition 5 (Java EE 5) (JSR 244) ... Web Application Technologies Java Servlet 2.5 (JSR 154) JavaServer Faces 1.2 (JSR 252) JavaServer Pages 2.1 (JSR 245) JavaServer Pages Standard Tag Library (JSR 52) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] servlet 2.4 required ?
On 12/7/06, nicolas de loof <[EMAIL PROTECTED]> wrote: I'm starting a project based on Java 1.4 and serlet 2.3 (tomcat 4.1). I'd like to use Struts2 as it includes retro-translated support for java 1.4. According to project main page ( http://struts.apache.org/2.x/#Platform%20Requirements), servlet 2.4 is required. Yes, Struts 2 requires Servlet 2.4. The Servlet 2.4 spec was finalized over three years ago, and if I've got my versions straight, is part of J2EE 1.4. Does this mean I will have to wait all my customer to upgrade to JEE5 prior to using Struts2 ? If so, I'll have to wait 1 or 2 years ... No. Java EE 5 is Servlet 2.5, not 2.4. See: From http://java.sun.com/javaee/technologies/ Java EE 5 Java Platform, Enterprise Edition 5 (Java EE 5) (JSR 244) ... Web Application Technologies Java Servlet 2.5 (JSR 154) JavaServer Faces 1.2 (JSR 252) JavaServer Pages 2.1 (JSR 245) JavaServer Pages Standard Tag Library (JSR 52) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form action mapping
On 12/7/06, chuanjiang lo <[EMAIL PROTECTED]> wrote: Hi all i have this jsp page with a form and the corresponding mapping in the struts config is When i view the source code of the jsp it shows Why is the action mapping to my context path? Appreciate any advice found the error mess up some mappings in web.xml hence causing this problem.
RE: Formatting numbers in text field
Have you tried the JSTL tag? > -Original Message- > From: chamal desilva [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 07, 2006 3:35 AM > To: Struts Users Mailing List > Subject: RE: Formatting numbers in text field > > > Thanks Richard > > But if do it uing getter methods I will have to write > a lot of getters since I have many properties. > > Is n't there an another way. Can't we control the > formatting through a common place in Struts. > > Best Regards, > Chamal. > > > --- "Gundersen, Richard" > <[EMAIL PROTECTED]> wrote: > > > If you are using an ActionForm, you could modify > > your getter to do the > > formatting. Or, have an additional getter method > > e.g. > > > > Double amount; > > > > Double getAmount() { > > // bog standard method > > } > > String getFormattedAmount() { > > // do some formatting > > } > > > > Then, in the form, do something like > property="formattedAmount"/> > > > > You can manipulate the setters in a similar way to > > accept the formatted > > text submitted by the form. > > > > There are probably other ways for dealing with the > > same problem in > > DynaActionForms that I don't know of. > > > > Hope this helps > > > > Richard > > > > -Original Message- > > From: chamal desilva [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, December 05, 2006 8:52 AM > > To: user@struts.apache.org > > Subject: Formatting numbers in text field > > > > Hi, > > > > Is there a way display numbers in a text field in a > > formatted way. > > > > For example I want to display 100 as 1,000 in a text > > field. > > > > My form field attribute type is Double. > > > > > > Thanking You, > > Chamal. > > > > > > > > > __ > __ > > > > Do you Yahoo!? > > Everyone is raving about the all-new Yahoo! Mail > > beta. > > http://new.mail.yahoo.com > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > __ > > This email has been scanned by the MessageLabs Email > > Security System. > > For more information please visit http://www.messagelabs.com/email > > > __ > > > > *** Disclaimer *** > > > > This electronic communication is confidential and > > for the exclusive use of the addressee. It may > > contain private and confidential information. The information, > > attachments and opinions contained in this E-mail are those of its > > author only and do not necessarily represent those of > London Scottish > > Bank PLC or any other members of the London Scottish > > Group. > > > > If you are not the intended addressee, you are > > prohibited from any disclosure, distribution or > > further copying or use of this communication or the > information in it > > or taking any action in reliance on it. If you have received this > > communication in error please notify the Information > Security Manager > > at [EMAIL PROTECTED] as soon as possible and > > delete the message from all places in your computer > > where it is stored. > > > > We utilise virus scanning software but we cannot > > guarantee the security of electronic communications > > and you are advised to check any attachments for > > viruses. We do not accept liability for any loss > > resulting from any corruption or alteration of data > > or importation of any virus as a result of receiving > > this electronic communication. > > > > Replies to this E-mail may be monitored for > > operational or business reasons. London Scottish > > Bank PLC is regulated by the Financial Services > > Authority. > > > __ > > This email has been scanned by the MessageLabs Email > > Security System. > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > __ > __ > Cheap talk? > Check out Yahoo! Messenger's low PC-to-Phone call rates. > http://voice.yahoo.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: file download without opening a window
You need to serve the XML file, itself--not forward to a JSP. In your action class, one of the parameters is an HttpServletResponse instance. Call addHeader() on that object. Then copy the file contents to the OutputStream returned by getOutputStream() on that object. Finally, the action class should return null, indicating that it has taken care of responding to the request. Hope that helps, George http://idiacomputing.com/ > -Original Message- > From: Søren Blidorf [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 06, 2006 5:06 PM > To: Struts Users Mailing List > Subject: Re: file download without opening a window > > > Thanks. > > How can I add a header without opening a new window or redirect? > > - Original Message - > From: <[EMAIL PROTECTED]> > To: > Sent: Wednesday, December 06, 2006 11:02 PM > Subject: RE: file download without opening a window > > > add a header "Content-Disposition attachment; > filename=myFile.xml" using > response.addHeader() > > > -Original Message- > > From: Søren Blidorf [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 06, 2006 4:56 PM > > To: Struts Users Mailing List > > Subject: OT: file download without opening a window > > > > > > Does anybody know how to make a form button, that starts > downloading > > myFile.xml > > > > What I want is to make an onclick = "Save target as" > > > > > > Med venlig hilsen > > > > Søren Blidorf > > Nolas Consulting > > Web: http://www.nolas.dk > > Mobil: +45 61676513 > > > > - > 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: Using tiles and validator framework
Hi, But it is a component (or portlet) in my main.jsp page. The poll may appear in any jsp page, so I cannot specify a fixed page to forward inside struts-config.xml. Thanks for your answer! Best Regards, Guang Sheng On 12/7/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: On 12/5/06, Deep Blue <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using tiles component in my .jsp page (eg. main.jsp). It is a poll > component, which user can submit the vote. > Commons validator framework is used to validate the poll submission. > When the validation failed on the tiles component, the tiles component's jsp > (e.g. poll.jsp) is showed, instead of the original jsp page (main.jsp). > > Is there anyway I can return to main.jsp when the validation failed? Validation forwards to what you specify in the "input" attribute of the action mapping in your struts-config.xml Niall > Thanks! > > Best Regards, > Deep Blue - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2: How can I make a Filter redirecting to struts actions
Ove- in your jsp You can hook redirect-action to yout submit button as in http://struts.apache.org/WW/actionmapper.html code in your Action class execute method mapping.findForward("someAction") where struts.xml has someAction.jsp bistå ? Martin -- This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Thursday, December 07, 2006 3:32 AM Subject: Struts2: How can I make a Filter redirecting to struts actions Hi everybody, I have experimented with a filter that triggers for keywords on the request URL and when found it should redirect to a struts action that processes the keyword. My dilemma is that I don't want to use: response.sendRedirect("/some.action"); becoz redirect should be done internally in the servlet container, not via browser. I have tested: request.getRequestDispatcher("/some.action").forward(request, response); and it don't work. I guess becoz an action mapping is not a servlet, an JSP page is. Does anyone have an idea how to solve this? Any input welcome! One approach could be to inherit: org.apache.struts2.dispatcher.FilterDispatcher and override doFilter() method and insert my keyword code. Kinda ugly thou. Regardings, Ove Oldberg, Sweden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
creating custom tags
Hi all, I have a requirement to create custom tag which embeds struts tags.see below, 1999 ...available can have html:option, html:options, html:optionsCollection... 2000 ...selected can have html:option, html:options, html:optionsCollection... can anyone guide me how to do it. thanks in advance, anil. -- View this message in context: http://www.nabble.com/creating-custom-tags-tf2774574.html#a7739712 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: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
I completely agree with you about how HTTP handles requestparameter. If this is the only solution, then I will have to do some reengineering work in my porblem area to deal with ordering. :-( This is really annoying. I can't imagine I am the first person with this problem. I don;t really see the problem with Struts handling this issue. At form creation/instantiation time by Struts framwork, you always know the amount of indexed parameters. You just count them! :-) So, you the size of the array to be created. The only thing left to do is to put the elements in their proper order. Example: RequestString on submit . someWrapper[0].name=blabla1&someWrapper[1].name=blabla2&someWrapper[2].name=blabla3.. Voila, you have created a array of size 3, because there three occurrences of indexed property "someWrapper[x].name". Kind Regards, Urso -Oorspronkelijk bericht- Van: Niall Pemberton [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 december 2006 14:16 Aan: Struts Users Mailing List Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope On 12/7/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > Hi Niall, > > Thanks for the reply! Apparantly this problem is quite difficult to get > answer upon. You're the only one until now. > > Well, I was getting different exception in different scenario. > - When I put an array initialization (someWrappers = )in myForm's default > constructor, I would get Array Out Of Bound exceptions. > - When I don't do an array initialization for myForm (on REQUEST scope), I > would get a method invocation exception from BeanUtils.poulate() due to some > getter property descriptor that can't be found. (?) But I have declared all > my getters and setters (see fot your self below). > > I checked my generated HTML sources (from JSP), but they are all rendered as > expected. That is, like you have specified below. > Weird, huh? > > When I chang my scope to session... it seems to work. But I don't want my > form in sessin scope. (And if this is working indeed in session scope why > not for requests scope?) > > The solution that you propose... I have seen it too on the internet. But this > solution does not guarantee the right order of the array elements. And order > IS a Requirement for my problem area. You can't control which order http sends the request parameters in - but theres no reason why you can't just "grow" your array to cope with whatever size the indexed getter is asking for. public SomeWrapper getSomeWrapper(int index) { if (wrappers == null) { wrappers = new SomeWrapper[index + 1]; } // Grow the array if (wrappers.length < index + 1) { newWrappers = new SomeWrapper[index + 1]; System.arraycopy(wrappers, 0, newWrappers, 0, wrappers.length); wrappers = newWrappers; } if (wrappers[index] == null) { wrappers[index] = new SomeWrapper(); } return wrappers[index]; } LazyDynaBeans do this for you: http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes Also more info on "lazy" index growth is here on the wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList Niall > Any hints? > > > Kind regards, > > Urso Wieske > > > > -Oorspronkelijk bericht- > Van: Niall Pemberton [mailto:[EMAIL PROTECTED] > Verzonden: donderdag 7 december 2006 9:40 > Aan: Struts Users Mailing List > Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on > REQUEST scope > > > So what BeanUtils exception are you getting? > > Your jsp should be generating the following? > > > > BeanUtils will try and access the indexed getter - getSomeWrapper(0) > and then call setPropA(...) - presumably its one of these methods ist > having problems with? > > Anyway the problem usually with request scope beans is that when it > calls the getSomeWrapper(index) method the array isn't initialized and > it returns null - if you put logic to "automatically" grow your array > in the getSomeWrapper(index) method then it should solve this. > > Niall > > On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > > Hi folks, > > > > I have problem with the scenario "Indexed Properties, BeanUtils and Form on > > REQUEST scope". > > When I select a a value from (1 or 2) from the dropdownlist and submit the > > form, I get an exception from BeanUtils.populate method about some getter > > which can be found!?? > > IF change the scope of myForm to Session in my struts configuration, then I > > don't have a problem with beanutils. But I want my form on request scope! > > > > I have described below my problem scenario. > > > > Is there a solution to this problem?? (form on request scope) > > I have looked in diffenrent aspects but I am not sure what is happening > > here with BeanUtils: > > - commons BeanUtil JAR version issue? > > - scope (request/session) issue? > > - JRE/Beanutil issue? > > - progra
RE: [s2] servlet 2.4 required ?
> I'm starting a project based on Java 1.4 and serlet 2.3 (tomcat 4.1). > I'd like to use Struts2 as it includes retro-translated support for > java 1.4. Another potential gotcha I just ran in to and have not gotten a response about it whether or not S2 2.0.2 can be successfully retro'd due to a Java 1.5-specific ThreadLocal method call. If anybody has info about that let me know! I'll be deploying on 1.5 so it doesn't matter but I still need to know :/ Thanks, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
On 12/7/06, Urso Wieske <[EMAIL PROTECTED]> wrote: Hi Niall, Thanks for the reply! Apparantly this problem is quite difficult to get answer upon. You're the only one until now. Well, I was getting different exception in different scenario. - When I put an array initialization (someWrappers = )in myForm's default constructor, I would get Array Out Of Bound exceptions. - When I don't do an array initialization for myForm (on REQUEST scope), I would get a method invocation exception from BeanUtils.poulate() due to some getter property descriptor that can't be found. (?) But I have declared all my getters and setters (see fot your self below). I checked my generated HTML sources (from JSP), but they are all rendered as expected. That is, like you have specified below. Weird, huh? When I chang my scope to session... it seems to work. But I don't want my form in sessin scope. (And if this is working indeed in session scope why not for requests scope?) The solution that you propose... I have seen it too on the internet. But this solution does not guarantee the right order of the array elements. And order IS a Requirement for my problem area. You can't control which order http sends the request parameters in - but theres no reason why you can't just "grow" your array to cope with whatever size the indexed getter is asking for. public SomeWrapper getSomeWrapper(int index) { if (wrappers == null) { wrappers = new SomeWrapper[index + 1]; } // Grow the array if (wrappers.length < index + 1) { newWrappers = new SomeWrapper[index + 1]; System.arraycopy(wrappers, 0, newWrappers, 0, wrappers.length); wrappers = newWrappers; } if (wrappers[index] == null) { wrappers[index] = new SomeWrapper(); } return wrappers[index]; } LazyDynaBeans do this for you: http://struts.apache.org/1.x/userGuide/building_controller.html#lazy_action_form_classes Also more info on "lazy" index growth is here on the wiki: http://wiki.apache.org/struts/StrutsCatalogLazyList Niall Any hints? Kind regards, Urso Wieske -Oorspronkelijk bericht- Van: Niall Pemberton [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 december 2006 9:40 Aan: Struts Users Mailing List Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope So what BeanUtils exception are you getting? Your jsp should be generating the following? BeanUtils will try and access the indexed getter - getSomeWrapper(0) and then call setPropA(...) - presumably its one of these methods ist having problems with? Anyway the problem usually with request scope beans is that when it calls the getSomeWrapper(index) method the array isn't initialized and it returns null - if you put logic to "automatically" grow your array in the getSomeWrapper(index) method then it should solve this. Niall On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have problem with the scenario "Indexed Properties, BeanUtils and Form on REQUEST scope". > When I select a a value from (1 or 2) from the dropdownlist and submit the form, I get an exception from BeanUtils.populate method about some getter which can be found!?? > IF change the scope of myForm to Session in my struts configuration, then I don't have a problem with beanutils. But I want my form on request scope! > > I have described below my problem scenario. > > Is there a solution to this problem?? (form on request scope) > I have looked in diffenrent aspects but I am not sure what is happening here with BeanUtils: > - commons BeanUtil JAR version issue? > - scope (request/session) issue? > - JRE/Beanutil issue? > - program issue of in my scenario? > - array issue? > > > Thanks > Urso Wieske > > > Scenario abstraction of my problem: > 1.PrepareAction/myForm {forward}> 2.viewJSP -{submit}---> 3.ProcessAction/myForm > > > Action Mapping Configuration relevant settings: > 1) myForm (MyForm class) is on request scope > 3) myForm(MyForm class) is on request scope > > > MyForm considerations: > I have a property "someWrappers" of type array of SomeWrapper (thus, not a List type!) > properties: > - SomeWrapper [] getSomeWrappers() { return someWrappers;} > - void getSomeWrappers(SomeWrapper [] someWrapper) {this.someWrappers = someWrapper;} > - SomeWrapper getSomeWrapper(int index) {return someWrappers[index];} > - void setSomeWrapper(int index, SomeWrapper someWrapper) {this.someWrappers[index] = someWrapper;} > > I have changed the name of the indexed property from plural to single noun (someWrapper,... to bypass the JRE1.3/1.4 - JavaBeans specs - BeanUtils issue. > My Target runtime is JRE5. > > viewJSP is a JSP file which has the following structure: > > > . > > > > 1 > 2 > > >
Struts1: CHALLENGE "Indexed Properties can not be used with FORMS on REQUEST scope!" TRUE or NOT TRUE?
Hi folks, Very low reactions on my posting about indexed properties, form, beanutils and request scope. I therefore impose the following CHALLENGE STATEMENT: "Indexed Properties can not be used with FORMS on REQUEST scope!" I am curious to know who is able to support or reject this statement, beceause until now I was not able do implement this scenario without exceptions. Ted Husted: I would really like your view on the above... :-) Kind regards Urso Wieske - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts2 general availability release date?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of > The general feeling is that we are very close, and some of us are > thinking that a GA would make a nice Chrismas present, but only if > it's actually up to production standards. As another data point (and something to keep in mind) is that a lot of the S2 code is re-branded WW code, which has been around awhile. I've been running 2.0.1 and lately some 2.0.2 and while there a few rough edges overall I've been quite happy with the quality, although I am currently using a mere fraction of the framework. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form action mapping
Hi all i have this jsp page with a form and the corresponding mapping in the struts config is When i view the source code of the jsp it shows Why is the action mapping to my context path? Appreciate any advice
RE: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
Hi Niall, Thanks for the reply! Apparantly this problem is quite difficult to get answer upon. You're the only one until now. Well, I was getting different exception in different scenario. - When I put an array initialization (someWrappers = )in myForm's default constructor, I would get Array Out Of Bound exceptions. - When I don't do an array initialization for myForm (on REQUEST scope), I would get a method invocation exception from BeanUtils.poulate() due to some getter property descriptor that can't be found. (?) But I have declared all my getters and setters (see fot your self below). I checked my generated HTML sources (from JSP), but they are all rendered as expected. That is, like you have specified below. Weird, huh? When I chang my scope to session... it seems to work. But I don't want my form in sessin scope. (And if this is working indeed in session scope why not for requests scope?) The solution that you propose... I have seen it too on the internet. But this solution does not guarantee the right order of the array elements. And order IS a Requirement for my problem area. Any hints? Kind regards, Urso Wieske -Oorspronkelijk bericht- Van: Niall Pemberton [mailto:[EMAIL PROTECTED] Verzonden: donderdag 7 december 2006 9:40 Aan: Struts Users Mailing List Onderwerp: Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope So what BeanUtils exception are you getting? Your jsp should be generating the following? BeanUtils will try and access the indexed getter - getSomeWrapper(0) and then call setPropA(...) - presumably its one of these methods ist having problems with? Anyway the problem usually with request scope beans is that when it calls the getSomeWrapper(index) method the array isn't initialized and it returns null - if you put logic to "automatically" grow your array in the getSomeWrapper(index) method then it should solve this. Niall On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: > Hi folks, > > I have problem with the scenario "Indexed Properties, BeanUtils and Form on > REQUEST scope". > When I select a a value from (1 or 2) from the dropdownlist and submit the > form, I get an exception from BeanUtils.populate method about some getter > which can be found!?? > IF change the scope of myForm to Session in my struts configuration, then I > don't have a problem with beanutils. But I want my form on request scope! > > I have described below my problem scenario. > > Is there a solution to this problem?? (form on request scope) > I have looked in diffenrent aspects but I am not sure what is happening here > with BeanUtils: > - commons BeanUtil JAR version issue? > - scope (request/session) issue? > - JRE/Beanutil issue? > - program issue of in my scenario? > - array issue? > > > Thanks > Urso Wieske > > > Scenario abstraction of my problem: > 1.PrepareAction/myForm {forward}> 2.viewJSP > -{submit}---> 3.ProcessAction/myForm > > > Action Mapping Configuration relevant settings: > 1) myForm (MyForm class) is on request scope > 3) myForm(MyForm class) is on request scope > > > MyForm considerations: > I have a property "someWrappers" of type array of SomeWrapper (thus, not a > List type!) > properties: > - SomeWrapper [] getSomeWrappers() { return someWrappers;} > - void getSomeWrappers(SomeWrapper [] someWrapper) {this.someWrappers = > someWrapper;} > - SomeWrapper getSomeWrapper(int index) {return someWrappers[index];} > - void setSomeWrapper(int index, SomeWrapper someWrapper) > {this.someWrappers[index] = someWrapper;} > > I have changed the name of the indexed property from plural to single noun > (someWrapper,... to bypass the JRE1.3/1.4 - JavaBeans specs - BeanUtils issue. > My Target runtime is JRE5. > > viewJSP is a JSP file which has the following structure: > > > . > > > indexed="true"> > 1 > 2 > > > > > . > > > > > > - 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: to format a date
I am not sure if I understood you correctly. I am formatting dates using jstl: <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %> Dariusz Wojtas On 12/7/06, Nabil ALI-MOUSSA <[EMAIL PROTECTED]> wrote: Hi, I have data dates that I would like to transform into format dates in my page JSP . there is my code JSP : Date de naissance somebody can help me, please, thank you. nam. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
to format a date
Hi, I have data dates that I would like to transform into format dates in my page JSP . there is my code JSP : Date de naissance value="dateNaissancePorteur" /> somebody can help me, please, thank you. nam. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] servlet 2.4 required ?
Hello, I'm starting a project based on Java 1.4 and serlet 2.3 (tomcat 4.1). I'd like to use Struts2 as it includes retro-translated support for java 1.4. According to project main page ( http://struts.apache.org/2.x/#Platform%20Requirements), servlet 2.4 is required. Does this mean I will have to wait all my customer to upgrade to JEE5 prior to using Struts2 ? If so, I'll have to wait 1 or 2 years ... Nico
Re: Struts1: Indexed Properties, BeanUtils populate, Form on REQUEST scope
So what BeanUtils exception are you getting? Your jsp should be generating the following? BeanUtils will try and access the indexed getter - getSomeWrapper(0) and then call setPropA(...) - presumably its one of these methods ist having problems with? Anyway the problem usually with request scope beans is that when it calls the getSomeWrapper(index) method the array isn't initialized and it returns null - if you put logic to "automatically" grow your array in the getSomeWrapper(index) method then it should solve this. Niall On 12/6/06, Urso Wieske <[EMAIL PROTECTED]> wrote: Hi folks, I have problem with the scenario "Indexed Properties, BeanUtils and Form on REQUEST scope". When I select a a value from (1 or 2) from the dropdownlist and submit the form, I get an exception from BeanUtils.populate method about some getter which can be found!?? IF change the scope of myForm to Session in my struts configuration, then I don't have a problem with beanutils. But I want my form on request scope! I have described below my problem scenario. Is there a solution to this problem?? (form on request scope) I have looked in diffenrent aspects but I am not sure what is happening here with BeanUtils: - commons BeanUtil JAR version issue? - scope (request/session) issue? - JRE/Beanutil issue? - program issue of in my scenario? - array issue? Thanks Urso Wieske Scenario abstraction of my problem: 1.PrepareAction/myForm {forward}> 2.viewJSP -{submit}---> 3.ProcessAction/myForm Action Mapping Configuration relevant settings: 1) myForm (MyForm class) is on request scope 3) myForm(MyForm class) is on request scope MyForm considerations: I have a property "someWrappers" of type array of SomeWrapper (thus, not a List type!) properties: - SomeWrapper [] getSomeWrappers() { return someWrappers;} - void getSomeWrappers(SomeWrapper [] someWrapper) {this.someWrappers = someWrapper;} - SomeWrapper getSomeWrapper(int index) {return someWrappers[index];} - void setSomeWrapper(int index, SomeWrapper someWrapper) {this.someWrappers[index] = someWrapper;} I have changed the name of the indexed property from plural to single noun (someWrapper,... to bypass the JRE1.3/1.4 - JavaBeans specs - BeanUtils issue. My Target runtime is JRE5. viewJSP is a JSP file which has the following structure: . 1 2 . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2: How can I make a Filter redirecting to struts actions
Hi, If your filter is called before the struts filter, then what about preparing your own HttpServletRequest instance (some wrapper) and passing it deeper into doFilter(..)? You could copy all properties of the original request but change the URI (or whatever property is responsible for it). The next filter/servlet would be fooled by this switch and their calculations (ie. finding what action should be executed) would be done on data prepared by you. Best regards Dariusz Wojtas, Poland On 12/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi everybody, I have experimented with a filter that triggers for keywords on the request URL and when found it should redirect to a struts action that processes the keyword. My dilemma is that I don't want to use: response.sendRedirect("/some.action"); becoz redirect should be done internally in the servlet container, not via browser. I have tested: request.getRequestDispatcher("/some.action").forward(request, response); and it don't work. I guess becoz an action mapping is not a servlet, an JSP page is. Does anyone have an idea how to solve this? Any input welcome! One approach could be to inherit: org.apache.struts2.dispatcher.FilterDispatcher and override doFilter() method and insert my keyword code. Kinda ugly thou. Regardings, Ove Oldberg, Sweden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OT: file download without opening a window
Hi, As per my knowledge, what you have to do is opening an out stream from your action. Something like... response.setContentType("application/x-file-download"); response.setHeader( "Content-disposition", "attachment; filename=" + "Appfile.xml); response.setHeader("Cache-Control", "max-age=" + 2); ServletOutputStream outStream = null; try { outStream = response.getOutputStream(); } catch (IOException e1) { e1.printStackTrace(); } //call to your backend to get the real out stream for this file.. try { getFileData(outStream); //write the outstraem here.. } catch (FileNotFoundException e2) { e2.printStackTrace(); } //and finally try { outStream.flush(); } catch (IOException e3) { e3.printStackTrace(); } return null; //return Null...so that user will see a Download popup... Thanks & regards, Mano -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 2006 1:06 PM To: Martin Gainty; Struts Users Mailing List Subject: Re: OT: file download without opening a window What I need is for system users to be able to download a specifik xml file on my server. The download should start when the user clicks on a button. The click on the button should copy the action of right-clicking on a link to the xml file and choosing "Save target as". I dont want a new window to open or a redirect off the page. Please let me know if I need to explain againg Br. Soren - Original Message - From: "Martin Gainty" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 07, 2006 2:30 AM Subject: Re: OT: file download without opening a window > Goddag Søren > > forsøge- > > http://upload.thinfile.com/put/ > > med venlig hilsen > > Martin -- > > This e-mail communication and any attachments may contain confidential and privileged information for the use of the > designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received > this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its > contents > - Original Message - > From: "Mitchell James" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Wednesday, December 06, 2006 7:23 PM > Subject: Re: OT: file download without opening a window > > > Can you restate what you want? It's not exactly clear what you are > asking. > > > -- > James Mitchell > 678.910.8017 > > > > > On Dec 6, 2006, at 4:56 PM, Søren Blidorf wrote: > > > Does anybody know how to make a form button, that starts > > downloading myFile.xml > > > > What I want is to make an onclick = "Save target as" > > > > > > Med venlig hilsen > > > > Søren Blidorf > > Nolas Consulting > > Web: http://www.nolas.dk > > Mobil: +45 61676513 > > > - > 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: Formatting numbers in text field
Thanks Richard But if do it uing getter methods I will have to write a lot of getters since I have many properties. Is n't there an another way. Can't we control the formatting through a common place in Struts. Best Regards, Chamal. --- "Gundersen, Richard" <[EMAIL PROTECTED]> wrote: > If you are using an ActionForm, you could modify > your getter to do the > formatting. Or, have an additional getter method > e.g. > > Double amount; > > Double getAmount() { > // bog standard method > } > String getFormattedAmount() { > // do some formatting > } > > Then, in the form, do something like property="formattedAmount"/> > > You can manipulate the setters in a similar way to > accept the formatted > text submitted by the form. > > There are probably other ways for dealing with the > same problem in > DynaActionForms that I don't know of. > > Hope this helps > > Richard > > -Original Message- > From: chamal desilva [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 05, 2006 8:52 AM > To: user@struts.apache.org > Subject: Formatting numbers in text field > > Hi, > > Is there a way display numbers in a text field in a > formatted way. > > For example I want to display 100 as 1,000 in a text > field. > > My form field attribute type is Double. > > > Thanking You, > Chamal. > > > > > > Do you Yahoo!? > Everyone is raving about the all-new Yahoo! Mail > beta. > http://new.mail.yahoo.com > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > __ > This email has been scanned by the MessageLabs Email > Security System. > For more information please visit > http://www.messagelabs.com/email > __ > > *** Disclaimer *** > > This electronic communication is confidential and > for the exclusive use of the addressee. It may > contain private and confidential information. The > information, attachments and opinions contained in > this E-mail are those of its author only and do not > necessarily represent those of London Scottish Bank > PLC or any other members of the London Scottish > Group. > > If you are not the intended addressee, you are > prohibited from any disclosure, distribution or > further copying or use of this communication or the > information in it or taking any action in reliance > on it. If you have received this communication in > error please notify the Information Security Manager > at [EMAIL PROTECTED] as soon as possible and > delete the message from all places in your computer > where it is stored. > > We utilise virus scanning software but we cannot > guarantee the security of electronic communications > and you are advised to check any attachments for > viruses. We do not accept liability for any loss > resulting from any corruption or alteration of data > or importation of any virus as a result of receiving > this electronic communication. > > Replies to this E-mail may be monitored for > operational or business reasons. London Scottish > Bank PLC is regulated by the Financial Services > Authority. > __ > This email has been scanned by the MessageLabs Email > Security System. > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2: How can I make a Filter redirecting to struts actions
Hi everybody, I have experimented with a filter that triggers for keywords on the request URL and when found it should redirect to a struts action that processes the keyword. My dilemma is that I don't want to use: response.sendRedirect("/some.action"); becoz redirect should be done internally in the servlet container, not via browser. I have tested: request.getRequestDispatcher("/some.action").forward(request, response); and it don't work. I guess becoz an action mapping is not a servlet, an JSP page is. Does anyone have an idea how to solve this? Any input welcome! One approach could be to inherit: org.apache.struts2.dispatcher.FilterDispatcher and override doFilter() method and insert my keyword code. Kinda ugly thou. Regardings, Ove Oldberg, Sweden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filter problem
On 12/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: How are you inserting your XML/HTML into the JSP? I don't think the filter method is causing your problem. I think you're not expressing that the output should not be filtered. If you're using you might want to add 'escapeXml="false"', for example. or if you're using the Struts tag there is a "filter" attribute - so you can do(true is default) Niall > -Original Message- > From: Hehl, Thomas [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 05, 2006 12:08 PM > To: 'Struts Users Mailing List' > Subject: RE: Filter problem > > > Nope. This is a struts 2 thing and I'm on 1.2.x. > > -Original Message- > From: Martin Gainty [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 05, 2006 11:21 AM > To: Struts Users Mailing List > Subject: Re: Filter problem > > > Hi Thomas- > Perhaps an implementation where you register your own > listener (example located at) > http://struts.apache.org/2.x/docs/can-we-access-an-actions-result.html > > Anyone else? > M- > This e-mail communication and any attachments may contain > confidential and privileged information for the use of the > designated recipients named above. If you are not the > intended recipient, you are hereby notified that you have > received this communication in error and that any review, > disclosure, dissemination, distribution or copying of it or its > contents > - Original Message - > From: "Hehl, Thomas" <[EMAIL PROTECTED]> > To: > Sent: Tuesday, December 05, 2006 10:05 AM > Subject: Filter problem > > > > OK, I've collided with struts over an issue and would like > to know if > people > > have suggestions on how to solve. > > > > I am reading stuff from an XML file and building parts of > my UI from > > for > use > > in a JSP. I thought it would be good for some of them to have HTML > > markup > in > > them, so I put <, etc in the html file. It goes all the way to > > struts > as > > "<" and then struts converts it at the last second so that > what gets > > displayed is .:( > > > > So how do I stop struts from doing this? So far, I dunno. > Here's the > > code that causes the problem in ResourceUtils(1.3.5): > > > > > >/** > > * Filter the specified string for characters that are > senstive to HTML > > * interpreters, returning the string with these > characters replaced by > > * the corresponding character entities. > > * > > * @param value The string to be filtered and returned > > */ > >public static String filter(String value) { > >if ((value == null) || (value.length() == 0)) { > >return value; > >} > > > >StringBuffer result = null; > >String filtered = null; > > > >for (int i = 0; i < value.length(); i++) { > >filtered = null; > > > >switch (value.charAt(i)) { > >case '<': > >filtered = "<"; > > > >break; > > > >case '>': > >filtered = ">"; > > > >break; > > > >case '&': > >filtered = "&"; > > > >break; > > > >case '"': > >filtered = """; > > > >break; > > > >case '\'': > >filtered = "'"; > > > >break; > >} > > > >if (result == null) { > >if (filtered != null) { > >result = new StringBuffer(value.length() + 50); > > > >if (i > 0) { > >result.append(value.substring(0, i)); > >} > > > >result.append(filtered); > >} > >} else { > >if (filtered == null) { > >result.append(value.charAt(i)); > >} else { > >result.append(filtered); > >} > >} > >} > > > >return (result == null) ? value : result.toString(); > >} > > > > I think it is uncharitable for struts to change these with > no option > > to prevent it. I am thinking about adding &open; and &close; and > > resolving > them > > here to turn them back into < and > respectively. Any other ideas, > comments, > > suggestions? > > > > Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validate length of array
On 12/5/06, O'Shea, Sean wrote: Hi all, I'm using struts 1.2.7 with commons-validator 1.1.4 I've this DynaValidatorActionForm which has the following properties: I have the corresponding rules defined: minlength 3 maxlength 20 minlength 3 maxlength 20 From my understanding, these validations will validate the noOfShares and fundName properties which are part of the com.myform.Transfer POJO. In addition to these individual validations I also need to ensure that the user has entered at least one com.myform.Transfer bean. ie. I need to make sure that the fundsTransfer array has a size of greater than 1. Is there a way to include this type of validation in XML format? What you have looks OK - best way is to try it and see. There isn't a "minimum indexed/array size validator shipped with any version of Struts at the moment. You could write a custom one and "configure" it through the validator's XML. If you do then the best way is to look at the struts FieldChecks class to see how validators have been implemented there. Niall Hope someone has come across this problem before and can offer some help Thanks Sean O Shea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using tiles and validator framework
On 12/5/06, Deep Blue <[EMAIL PROTECTED]> wrote: Hi, I'm using tiles component in my .jsp page (eg. main.jsp). It is a poll component, which user can submit the vote. Commons validator framework is used to validate the poll submission. When the validation failed on the tiles component, the tiles component's jsp (e.g. poll.jsp) is showed, instead of the original jsp page (main.jsp). Is there anyway I can return to main.jsp when the validation failed? Validation forwards to what you specify in the "input" attribute of the action mapping in your struts-config.xml Niall Thanks! Best Regards, Deep Blue - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]