Newbie (possibly RTFM) issue
I am using Struts 2.1.6 if I have model like this: public class model { private Boolean testBool; private boolean testbool; ... public getters and setters for both follow ... } I find that in my corresponding jsp page (assumming that both testbool and testBool are initialised to true and that private member 'model' is available through its getter and a setter from within the action class) evaluates to true, while does not I am highly suspicious that I may be doing something fundamentally wrong as there is a complete absence of posts out there complaining about not being able to evaluate Boolean. Is there something I am missing here? Any help is appreciated, Regards, C -- View this message in context: http://www.nabble.com/Newbie-%28possibly-RTFM%29-issue-tp24032216p24032216.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: Newbie (possibly RTFM) issue
Sorry to report but does nothing, also renders nothing in the resulting html page; now I know that testBool is 'true' because I am running it through the debugger. I am also runnning this under Java 1.6 so autoboxing should work as noted in one of the previous posts. I am completely lost for any other ideas.. Any help is greatly appreciated, C. chumbobumbo wrote: > > I am using Struts 2.1.6 > > if I have model like this: > > public class model { > private Boolean testBool; > private boolean testbool; > > ... > public getters and setters for both follow > ... > } > > I find that in my corresponding jsp page (assumming that both testbool and > testBool are initialised to true and that private member 'model' is > available through its getter and a setter from within the action class) > > evaluates to true, while > does not > > I am highly suspicious that I may be doing something fundamentally wrong > as there is a complete absence of posts out there complaining about not > being able to evaluate Boolean. > > Is there something I am missing here? > > Any help is appreciated, > > Regards, > > C > > > -- View this message in context: http://www.nabble.com/Newbie-%28possibly-RTFM%29-issue-tp24032216p24042314.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: Newbie (possibly RTFM) issue
Yeah, it's called isTestBool (but I tried with getTestBool as well) neither work, I enabled the debug console adn if I output the stack values in my browser is says that 'no read method is available, listing testBool as 'String' whereas the testbool (primitive boolean) is reported correctly as 'true' and is (ironically) of the right type 'Boolean' a this stage I thikn it's definitely a Struts/OGNL issue Cheers, C. Paweł Wielgus wrote: > > Hi, > can You verify that getter in action is called? > Add sysout or debug this place, because if it's not beeing called > there will be no result on the page. This would suite to nothing is > rendered in s:textfield, not the s:text! > > Best greetings, > Pawel Wielgus. > > 2009/6/15, chumbobumbo : >> >> Sorry to report but does >> nothing, also >> >> renders nothing in the >> resulting html page; now I know that testBool is 'true' because I am >> running >> it through the debugger. >> >> I am also runnning this under Java 1.6 so autoboxing should work as noted >> in >> one of the previous posts. >> >> I am completely lost for any other ideas.. >> >> Any help is greatly appreciated, >> >> C. >> >> >> >> chumbobumbo wrote: >>> >>> I am using Struts 2.1.6 >>> >>> if I have model like this: >>> >>> public class model { >>> private Boolean testBool; >>> private boolean testbool; >>> >>> ... >>> public getters and setters for both follow >>> ... >>> } >>> >>> I find that in my corresponding jsp page (assumming that both testbool >>> and >>> testBool are initialised to true and that private member 'model' is >>> available through its getter and a setter from within the action class) >>> >>> evaluates to true, while >>> does not >>> >>> I am highly suspicious that I may be doing something fundamentally wrong >>> as there is a complete absence of posts out there complaining about not >>> being able to evaluate Boolean. >>> >>> Is there something I am missing here? >>> >>> Any help is appreciated, >>> >>> Regards, >>> >>> C >>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/Newbie-%28possibly-RTFM%29-issue-tp24032216p24042314.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 >> >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/Newbie-%28possibly-RTFM%29-issue-tp24032216p24064080.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: Newbie (possibly RTFM) issue
Haven't tried it (had to move on) I just reverted to primitives and rely on autoboxing (i.e. not having to make end to end change all the way to the server side) when passing model to my web service. newton.dave wrote: > > chumbobumbo wrote: >> Yeah, it's called isTestBool (but I tried with getTestBool as well) >> neither >> work, I enabled the debug console adn if I output the stack values in my >> browser is says that 'no read method is available, listing testBool as >> 'String' whereas the testbool (primitive boolean) is reported correctly >> as >> 'true' and is (ironically) of the right type 'Boolean' a this stage I >> thikn >> it's definitely a Struts/OGNL issue > > What happens when the methods are changed to isTestbool/isTestBool? > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/Newbie-%28possibly-RTFM%29-issue-tp24032216p24067129.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
Struts Ajax Newbie
This is probably so basic - I'll put my flame proof suit just in case. I have a 2 combos and (yes ;-) I would like the second one to be loaded depending on what's been chosen in the first one, so in my action execute method I have: model.setList(service.getData1()); my struts.xml looks like this (note that I am using spring and I am hitting the same action 'class' (demoAction): jsp/output.jsp jsp/error.jsp jsp/second.jsp jsp/error.jsp in my output jsp I have: . that's all fine and dandy, but when I call loadSecond.action I find that my model is re-initialised anew (i.e. as the action is marked 'prototype' in spring config, the data for the first combo is no longer there) obviously I need data in the 1st combo to be available in the resulting page, as the user should be allowed to change the first selection (that would in turn relaod the second combo again). Is there a way to serialize/cache the data that was retrieved in the first call so that it is available in the subsequent call other than putting it in the session? Thanks, 99-L Blue -- View this message in context: http://www.nabble.com/Struts-Ajax-Newbie-tp22279792p22279792.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: Struts Ajax Newbie
Thanks for your help, however I think I may have miscommunicated, all I was trying to find out is what is the 'currently acceptable' approach for storing (and retrieveing) data between consecutive ajax calls seeing that one always gets a brand new instance for any (and every) given action. Does Struts provide some kind of mechanism other than http sesison to store dependant data? Thanks 99-L Blue Mileidys Gonzalez Prieto wrote: > > Well, for to do actions like that in my code I'm using AjaxTags. > > http://ajaxtags.sourceforge.net/ > > Is really easy to use... > > On Sun, 2009-03-01 at 15:47 -0800, chumbobumbo wrote: >> This is probably so basic - I'll put my flame proof suit just in case. >> >> I have a 2 combos and (yes ;-) I would like the second one to be loaded >> depending on what's been chosen in the first one, so in my action execute >> method I have: >> >> model.setList(service.getData1()); >> >> my struts.xml looks like this (note that I am using spring and I am >> hitting >> the same action 'class' (demoAction): >> >>> method="execute"> >> jsp/output.jsp >> jsp/error.jsp >> >> >> jsp/second.jsp >> jsp/error.jsp >> >> >> in my output jsp I have: >> >> . >> >> > listValue="entry.desc" name="selection.listCode" >> onchange="javascript:load_second_list();return >> false;"> >> >> >> >> >> > action="loadSecond.action" /> >> > href="%{second}" >> theme="ajax" >> listenTopics="load_second_list" >> formId="demo"/> >> >> >> >> that's all fine and dandy, but when I call loadSecond.action I find that >> my >> model is re-initialised anew (i.e. as the action is marked 'prototype' in >> spring config, the data for the first combo is no longer there) >> >> obviously I need data in the 1st combo to be available in the resulting >> page, as the user should be allowed to change the first selection (that >> would in turn relaod the second combo again). >> >> Is there a way to serialize/cache the data that was retrieved in the >> first >> call so that it is available in the subsequent call other than putting it >> in >> the session? >> >> Thanks, >> >> 99-L Blue > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/Struts-Ajax-Newbie-tp22279792p22281426.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
Struts + Dojo problem
This is more of a dojo related question but since struts and dojo combination is relatively common I thought someone may be able to tell me what's going on here. The problem is that dojo.event.connect doesn't like the element that is referred in a second .jsp (namely the line: dojo.event.connect(ListB, 'onChange', 'listBEvent'); does not work as ListB comes in from listb.jsp, that is referred from lista.jsp) - subsequently the 'listB' never fires listBEvent. Is there anything that I am missing here or something that I may have overlooked? Any help is greatly appreciated. 99-L Blue Here is my setup: struts.xml: http://struts.apache.org/dtds/struts-2.0.dtd";> jsp/lista.jsp jsp/error.jsp jsp/listb.jsp jsp/error.jsp jsp/listc.jsp jsp/error.jsp lista.jsp: function listAEvent(event) { alert("listAEvent [" + event.target.name + "]"); dojo.event.topic.publish("listAEvent"); } function listBEvent(event) { alert("listBEvent [" + event.target.name + "]"); dojo.event.topic.publish("listBEvent"); } function init() { var ListA = dojo.byId('ListA'); dojo.event.connect(ListA, 'onchange', 'listAEvent'); var ListB = dojo.byId('ListB'); dojo.event.connect(ListB, 'onChange', 'listBEvent'); } dojo.addOnLoad(init); listb.jsp: <%@ taglib prefix="s" uri="/struts-tags"%> listc.jsp: <%@ taglib prefix="s" uri="/struts-tags"%> resulting html: ListA Selected Code Another Code ListB ListC -- View this message in context: http://www.nabble.com/Struts-%2B-Dojo-problem-tp22365550p22365550.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