RE: Struts2 on Websphere portal 6.1.0.0
The problem is the URI parameter in your display tag table. This is how DT invokes the action/HTTP request that originally got the request for the table in the table. It should be something like: requestURI="search.action" where the value is the action of the page. MG -Original Message- From: Prabahar [mailto:prabahar.durais...@lntinfotech.com] Sent: Monday, April 19, 2010 3:17 AM To: user@struts.apache.org Subject: Re: Struts2 on Websphere portal 6.1.0.0 I am facing an issue with Struts 2 portlet which uses Display Tag. I have implemented a code to display a list using Display Table and also implemented Sorting option. It is working fine with IBM WAS 7.0 and the same code is not working with IBM Portal Server 6.1 It is displaying the data, but when i click on the pagination link (First, Last, Next..) and the column header (to sort) then i am getting page can not be found. I have even mentioned page cotext, but still i am facing this issue. I have also added the display tag portlet support jar (displaytag-portlet-1.2.jar) along with displaytag-1.2.jar and its supporting jars. I have a doubt in the requestURI parameter... what exactly i should give to that parameter. I have also used requestURIContext as well, but no improvement. Nils-Helge Garli wrote: > > Thanks for the summary, although I disagree with your conclusion ;) > > Nils-H > > On Fri, Aug 1, 2008 at 2:21 AM, Struts Two wrote: >> I am running Struts2.0.11.1 on Websphere 6.1.0.17 NOT THE WEBSPHERE >> PORTAL. You need to keep the followings in mind: >> 1- You need to have at least fixpack 13 or 15 ( I am not sure which >> one, otherwise you CAN NOT RUN STRUTS 2 ON WAS) >> 2- Struts 2.0.11.2 has problems running on Websphere 6.1 (it is >> missing a patch), so you need to downgrade to 2.0.11.1 till next >> release (2.0.11.3 or 2.0.12) >> 3- Once the above you are done with above steps, you need to set the >> following custom property for WAS server: >> com.ibm.ws.webcontainer.invokefilterscompatibility = true >> If you do not set the above property, you can not run struts 2 on WAS >> as well. >> However; I did a project using struts on Websphere portal 6.0. IBM >> provides its own customized struts that works with portal (which is >> based on struts1), and it is pretty good. I recommend use the IBM's >> struts that comes with Portal server as you would have a hard time >> using struts 2 with websphere portal. >> Hope this helps, >> >> >> >> - Original Message >> From: Dinesh Narayanan >> To: user@struts.apache.org >> Sent: Thursday, July 31, 2008 3:26:20 PM >> Subject: Struts2 on Websphere portal 6.1.0.0 >> >> Has Anybody tried Struts2 (Struts-2.0.11.2) on Websphere portal 6.1.0..0? >> I >> am running into issues when I tried a very simple JSR168 example. >> Any help would be appreciated. Is there some example of struts2 >> sample in websphere portal 6.1? >> >> A) My portlet.xml contains the following entries >> viewNamespace >> /view >> >> >> >> >> defaultViewAction >> index >> >> >> >> B) My struts.xml is >> >> >> >> /WEB-INF/view/index.jsp >> >> >> >> >> >> Thanks >> Dinesh >> >> >> >> >> __ >> Be smarter than spam. See how smart SpamGuard is at giving junk email >> the boot with the All-new Yahoo! Mail. Click on Options in Mail and >> switch to New Mail today or register for free at http://mail.yahoo.ca >> >> >> - >> 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://old.nabble.com/Struts2-on-Websphere-portal-6.1.0.0-tp18761735p282 87622.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
RE: How to reuse field validators?
>> you must expose you model directly. I'm not sure what you mean by that... Can you restate? MG -Original Message- From: Lukasz Lenart [mailto:lukasz.len...@googlemail.com] Sent: Friday, April 16, 2010 9:53 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How to reuse field validators? W dniu 16 kwietnia 2010 16:27 użytkownik Griffith, Michael * napisał: > Currently the xml file is in the package with the struts action. I this this > is where my problem lies, should it be in the model package? Yes, and you must expose you model directly. Regards -- Łukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: How to reuse field validators?
Currently the xml file is in the package with the struts action. I this this is where my problem lies, should it be in the model package? MG -Original Message- From: Lukasz Lenart [mailto:lukasz.len...@googlemail.com] Sent: Friday, April 16, 2010 9:26 AM To: Griffith, Michael * Subject: Re: How to reuse field validators? W dniu 16 kwietnia 2010 14:51 użytkownik Griffith, Michael * napisał: > I want to reuse the field validations in -validator.xml in two > different Action classes in two different packages and different namespaces. > Is there a way to do that without copying the XML file? Your model validation should work, if you are using the same model in different actions. Maybe the name is wrong -> -validation.xml? Regards -- Łukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: How to reuse field validators?
Maybe I didn't express my problem correctly. The @SkipValidation annotation marks an Action method not to be validated. I want to reuse the field validations in -validator.xml in two different Action classes in two different packages and different namespaces. Is there a way to do that without copying the XML file? MG -Original Message- From: Lukasz Lenart [mailto:lukasz.len...@googlemail.com] Sent: Friday, April 16, 2010 12:13 AM To: Struts Users Mailing List Subject: Re: How to reuse field validators? 2010/4/16 Griffith, Michael * : > Hello all, > > I am not clear on how to reuse a field validator that doesn't share a > common package or action/alias. I have package > > ...struts.admin/ > ...struts/application/ > > with namespaces /admin and /application respectively. I have a model > object with a validator -validator.xml in the /application > package that I need to reuse in the admin package. What's the best > way to reuse the validator without repeating it? You can add annotation @SkipValidation Regards -- Łukasz http://www.lenart.org.pl/ Kapituła Javarsovia 2010 http://javarsovia.pl - 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
How to reuse field validators?
Hello all, I am not clear on how to reuse a field validator that doesn't share a common package or action/alias. I have package ...struts.admin/ ...struts/application/ with namespaces /admin and /application respectively. I have a model object with a validator -validator.xml in the /application package that I need to reuse in the admin package. What's the best way to reuse the validator without repeating it? Thanks in Advance, MG
RE: How can I insert a table into a struts form?
Awesome! You just improved my understanding of how the theme works. I appreciate the input from you and Dave. Best Regards, MG -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Tuesday, June 09, 2009 3:59 PM To: Struts Users Mailing List Subject: Re: How can I insert a table into a struts form? On Tue, Jun 9, 2009 at 4:51 PM, Griffith, Michael * wrote: > Thanks Dave! That was too easy. Here I thought I would have to edit > the template. I'm always over thinking S2. > > How can I make my submit buttons show up next to each other, rather > than on separate rows (using xhtml template) > > onclick="javascript:setMethod('cancel');" tabindex="2" /> tabindex="3" onclick="javascript:setMethod('submit');" /> > Really, the xhtml theme only creates a two column table, don't over think it ;) -Wes > Cheers! > mg > > -Original Message- > From: Dave Newton [mailto:newton.d...@yahoo.com] > Sent: Tuesday, June 09, 2009 3:35 PM > To: Struts Users Mailing List > Subject: Re: How can I insert a table into a struts form? > > Griffith, Michael * wrote: >>>> Create a ... >> Do this in my form, or change the template? > > > > On your page. > > - > 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 > > -- 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: How can I insert a table into a struts form?
Thanks Dave! That was too easy. Here I thought I would have to edit the template. I'm always over thinking S2. How can I make my submit buttons show up next to each other, rather than on separate rows (using xhtml template) Cheers! mg -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Tuesday, June 09, 2009 3:35 PM To: Struts Users Mailing List Subject: Re: How can I insert a table into a struts form? Griffith, Michael * wrote: >>> Create a ... > Do this in my form, or change the template? On your page. - 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: How can I insert a table into a struts form?
Dave, Thanks for the reply. >> Create a ... Do this in my form, or change the template? MG -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Tuesday, June 09, 2009 3:27 PM To: Struts Users Mailing List Subject: Re: How can I insert a table into a struts form? Griffith, Michael * wrote: > I'm wondering is there a way I can insert a displayTag table into my > struts form? I want the table to appear under form edit controls, but > before the buttons, like a master detail type of view. I'd like to > know if there is a way to do this without making changes to the > default templates? Create a ... and put it in there? Depends on what theme you're using and what DisplayTag outputs. Dave - 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 insert a table into a struts form without changing the template?
It would be a nice feature to have as a struts tag to allow other tags or HTML into the form without mucking about with the template. Something like: -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Tuesday, June 09, 2009 2:33 PM To: Struts Users Mailing List Subject: Re: Can I insert a table into a struts form without changing the template? I don't think there is a really great way to do it. If you really want to get a solid handle on it, look through template/xhtml/controlheader*.ftl and template/xhtml/controlfooter*.ftl do. To summarize it, they create a two-column row in the table :) I think you can pretty easily add your element by doing - your stuff But, if it doesn't work, just take a look at the generated HTML, it'll probably be pretty obvious what you need to change. If you are really looking to build something reusable, then try to build a tag out of it. It's easier than it sounds. IMO, if this is for one page, just add the HTML. If you are planning on making something like this for each form in your app, then build a tag out of it. -Wes On Tue, Jun 9, 2009 at 3:23 PM, Griffith, Michael * wrote: > Sorry, yes -- Struts 2 (2.1.6). > > -Original Message- > From: Wes Wannemacher [mailto:w...@wantii.com] > Sent: Tuesday, June 09, 2009 2:21 PM > To: Struts Users Mailing List > Subject: Re: Can I insert a table into a struts form without changing > the template? > > Michael, which version of struts? (assuming Struts 2 since you mention > templates, but want to be sure) > > -Wes > > On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael > * wrote: >> Hello everyone, >> >> I'm wondering is there a way I can insert a displayTag table into my >> struts form? I want the table to appear under form edit controls, but >> before the buttons, like a master detail type of view. I'd like to >> know if there is a way to do this without making changes to the >> default templates? >> >> Any reply is appreciated, >> >> Best Regards, >> MG >> > > > > -- > 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 > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Can I insert a table into a struts form without changing the template?
Sorry, yes -- Struts 2 (2.1.6). -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Tuesday, June 09, 2009 2:21 PM To: Struts Users Mailing List Subject: Re: Can I insert a table into a struts form without changing the template? Michael, which version of struts? (assuming Struts 2 since you mention templates, but want to be sure) -Wes On Tue, Jun 9, 2009 at 3:17 PM, Griffith, Michael * wrote: > Hello everyone, > > I'm wondering is there a way I can insert a displayTag table into my > struts form? I want the table to appear under form edit controls, but > before the buttons, like a master detail type of view. I'd like to > know if there is a way to do this without making changes to the > default templates? > > Any reply is appreciated, > > Best Regards, > MG > -- 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How can I insert a table into a struts form?
Hello everyone, I'm wondering is there a way I can insert a displayTag table into my struts form? I want the table to appear under form edit controls, but before the buttons, like a master detail type of view. I'd like to know if there is a way to do this without making changes to the default templates? Any reply is appreciated, Best Regards, MG PS: My apologies if this hits the list twice, the first message looks like it was rejected by the list. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Can I insert a table into a struts form without changing the template?
Hello everyone, I'm wondering is there a way I can insert a displayTag table into my struts form? I want the table to appear under form edit controls, but before the buttons, like a master detail type of view. I'd like to know if there is a way to do this without making changes to the default templates? Any reply is appreciated, Best Regards, MG
RE: What is wrong with my with OGNL Map expression??
Ding! Sorry I didn't see this reply earlier when I repeated how do I get the map value. Again, thanks Dave! Is there such a thing as an OGNL expression validator? It would be nice to be able to fool around with the expression interactively until I am able to get to the correct expression. Cheers~ MG -Original Message- From: Dale Newfield [mailto:d...@newfield.org] Sent: Thursday, April 30, 2009 9:07 AM To: Struts Users Mailing List Subject: Re: What is wrong with my with OGNL Map expression?? Michael Griffith wrote: > I have a Map in the HttpSession > The map is stored in the session as an attribute named > genieProperties... Kishan G. Chellap Paandy wrote: > Assuming there's an attribute with name 'mySessionAttribute' in the > Session scope Which gets you half way there. It gets you the Map. To get the value you want from it, just call it's get method: The %{} are often left out by people, but they're critical. That's what says "this is an OGNL expression". Musachy's response illustrates the potential confusion as to what EL you're using when it's not specified. -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 is wrong with my with OGNL Map expression??
Assuming the attribute in the session scope is a map, how would I get the value for the map entry called url? Would it be something like this: MG -Original Message- From: Kishan G. Chellap Paandy [mailto:kishanchellapaand...@spanservices.com] Sent: Thursday, April 30, 2009 7:14 AM To: Struts Users Mailing List Subject: RE: What is wrong with my with OGNL Map expression?? Hi Griffith, Assuming there's an attribute with name 'mySessionAttribute' in the Session scope and you can access the same in you jsp as below: May be this will help. Thank you. Regards, Kishan.G Senior Software Engineer. www.spansystems.com -Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Thursday, April 30, 2009 1:04 AM To: Struts Users Mailing List Subject: What is wrong with my with OGNL Map expression?? Hello all, It seems as if I am always at odds with trying to figure out the correct OGNL syntax. I have a Map in the HttpSession, and I'm trying to use one of the values in the map as an anchor tag in a link. The map is stored in the session as an attribute named genieProperties... None of these expressions work... Am I at least close? Any assistance would be appreciated. Best Regards, 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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
What is wrong with my with OGNL Map expression??
Hello all, It seems as if I am always at odds with trying to figure out the correct OGNL syntax. I have a Map in the HttpSession, and I'm trying to use one of the values in the map as an anchor tag in a link. The map is stored in the session as an attribute named genieProperties... None of these expressions work... Am I at least close? Any assistance would be appreciated. Best Regards, MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Required field only works with text fields?
Dave, Thanks for the suggestion, I changed the validator to read as: @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER) @JoinColumn(name = "STATUS") @FieldExpressionValidator(message = "Default message", key="validate.status", expression = "status != null") public Status getStatus() { return status; } The validation is applied, but no message is displayed. With: @ExpressionValidator(message = "Default message", key="validate.status", expression = "status != null") The validation is applied and the validation message appears at the top of my page where I have an tag. Is there something else I need to do to make the FieldExpressionValidator work? MG -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Tuesday, March 17, 2009 6:01 PM To: Struts Users Mailing List Subject: Re: Required field only works with text fields? Griffith, Michael * wrote: > The following validation annotation seems to work: > > @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, > fetch=FetchType.EAGER) > @JoinColumn(name = "STATUS") > @ExpressionValidator(message = "Default message", > key="validate.status", expression = "status != null" ) public Status > getStatus() { > return status; > } > > However, the validation message appears in block, > not nicely next to the field that failed validation as does the other > validators. You'd probably need a @FieldExpressionValidator in order for it to be associated with a field, but this is just a guess. > I might have expected this if I had specified shortCircut=true, but I > don't. I'm not really sure what the shortCircuit flag is supposed to do. IIRC its intent is to prevent multiple validation errors for the same field. Dave - 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: Required field only works with text fields?
Dave, Thanks for the reply. I've had some success...tinkering... The following validation annotation seems to work: @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER) @JoinColumn(name = "STATUS") @ExpressionValidator(message = "Default message", key="validate.status", expression = "status != null" ) public Status getStatus() { return status; } However, the validation message appears in block, not nicely next to the field that failed validation as does the other validators. I might have expected this if I had specified shortCircut=true, but I don't. I'm not really sure what the shortCircuit flag is supposed to do. Is there a way to make the validator work as the @RequiredString validator where the message appears above the label? Could this be a bug? Again, thanks for your help, I really appreciate it. Cheers! MG -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Tuesday, March 17, 2009 3:42 PM To: Struts Users Mailing List Subject: Re: Required field only works with text fields? Griffith, Michael * wrote: > Can anyone help me with this? > > By adding the @RequiredField annotation to the relationship field > (status in my example below) the form did not submit, which is good > because the status had not been specified from the list. However, the > form did not present a message too the user saying why the form > submission failed. I have the field annotated as: > > > @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, > fetch=FetchType.EAGER) > @JoinColumn(name = "STATUS") > @RequiredFieldValidator(message="Validation > Error",key="validate.notEmpty") > public Status getStatus() { > return status; > } > > Any reply would be appreciated. My first assumption would be that you'd need to have a custom validator, depending on how Status objects are initialized/created. AFAIK "required" will only check for nullness. I'm not sure if a Status object will be created if no status properties are set, but if it is, then it probably won't work with a simple "required". If any status properties are set then it definitely won't--empty string fields aren't null; they're blank. I'm a little surprised "required" works with your textfields, since strings normally need a "requiredstring" validator to function properly. Dave - 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: Required field only works with text fields?
Can anyone help me with this? By adding the @RequiredField annotation to the relationship field (status in my example below) the form did not submit, which is good because the status had not been specified from the list. However, the form did not present a message too the user saying why the form submission failed. I have the field annotated as: @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER) @JoinColumn(name = "STATUS") @RequiredFieldValidator(message="Validation Error",key="validate.notEmpty") public Status getStatus() { return status; } Any reply would be appreciated. Best Regards, MG -----Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Monday, March 16, 2009 1:18 PM To: Struts Users Mailing List Subject: RE: Required field only works with text fields? Ok, So I am being a bone-head. When I added the @RequiredStringValidator to the model, the validation is in sync with what is being required on the form. That makes sense to me, but... How are relationships handled? I have a form control as such: And the relationship is being managed via a JPA @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER) @JoinColumn(name = "STATUS") public Status getStatus() { return status; } What sort of annotation should I use to validate the user selected an item from the list? Any reply is appreciated... MG -Original Message- From: stanl...@gmail.com [mailto:stanl...@gmail.com] Sent: Friday, March 13, 2009 6:01 PM To: Struts Users Mailing List Subject: Re: Required field only works with text fields? The required attribute only paints the asterisk -- it has nothing to do with actually "requiring" input. Nice huh? Peace, Scott On Fri, Mar 13, 2009 at 4:14 PM, Griffith, Michael * < michael.griff...@fda.hhs.gov> wrote: > Hi all, > > I just noticed that the only required field validations that seem to > be working in my form are text field validations. > > Any HTML tag that renders a list, check box or radio button doesn't > validate, even though the template shows the field as required. > > In other words, this tag: > list="#{'Y':'Yes', 'N':'No'}" required="true" tabindex="7"/> > > Shows a radio button with the "*" required indicator, but the form is > allowed to be submitted without a button selected, which of course > breaks my request/response cycle... > > Do I need to do something special to make the required non-text inputs > to behave as I expect? > > Any help is appreciated. > > Best Regards, > > 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: Web Services
Spring has excellent remoting abilities. If you are already using Spring, I'd check out Spring Remoting as my first option. -Original Message- From: Rafael Taboada [mailto:kaliman.fore...@gmail.com] Sent: Tuesday, March 17, 2009 7:39 AM To: user@struts.apache.org Subject: Web Services Hi list! I have a Struts2+Dojo+JPA+Spring project working fine in a production environment, but suddenly I have the requirement of exposing web services from my project. I mean, I need to implement web services about my project funcionality which other systems can consume. I'm completely new at web services. Please can you guide me how I can implement web services? Would Spring Web Services be a good point to start? Thanks in advance for your help! -- Rafael Taboada - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Required field only works with text fields?
Ok, So I am being a bone-head. When I added the @RequiredStringValidator to the model, the validation is in sync with what is being required on the form. That makes sense to me, but... How are relationships handled? I have a form control as such: And the relationship is being managed via a JPA @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER) @JoinColumn(name = "STATUS") public Status getStatus() { return status; } What sort of annotation should I use to validate the user selected an item from the list? Any reply is appreciated... MG -Original Message- From: stanl...@gmail.com [mailto:stanl...@gmail.com] Sent: Friday, March 13, 2009 6:01 PM To: Struts Users Mailing List Subject: Re: Required field only works with text fields? The required attribute only paints the asterisk -- it has nothing to do with actually "requiring" input. Nice huh? Peace, Scott On Fri, Mar 13, 2009 at 4:14 PM, Griffith, Michael * < michael.griff...@fda.hhs.gov> wrote: > Hi all, > > I just noticed that the only required field validations that seem to > be working in my form are text field validations. > > Any HTML tag that renders a list, check box or radio button doesn't > validate, even though the template shows the field as required. > > In other words, this tag: > list="#{'Y':'Yes', 'N':'No'}" required="true" tabindex="7"/> > > Shows a radio button with the "*" required indicator, but the form is > allowed to be submitted without a button selected, which of course > breaks my request/response cycle... > > Do I need to do something special to make the required non-text inputs > to behave as I expect? > > Any help is appreciated. > > Best Regards, > > MG > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Required field only works with text fields?
Hi all, I just noticed that the only required field validations that seem to be working in my form are text field validations. Any HTML tag that renders a list, check box or radio button doesn't validate, even though the template shows the field as required. In other words, this tag: Shows a radio button with the "*" required indicator, but the form is allowed to be submitted without a button selected, which of course breaks my request/response cycle... Do I need to do something special to make the required non-text inputs to behave as I expect? Any help is appreciated. Best Regards, MG
Check Field Value in list using Annotation/Validation?
Hello all, Is it possible to check a field value against a list using the @ConditionalVisitorFieldValidator annotation? I'm thinking of something like this: @Column(name="VENDOR_TYPE", nullable=false) @ConditionalVisitorFieldValidator (expression="vendorType == 'COTS'&& vendorType == 'GOTS' && vendorType == 'MOTS'", key="invalid.vendortype") public String getVendorType() { return vendorType; } Is there a better way to handle this type of validation? Thanks in advance, MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Namespace Expression?
Swift! Thanks Musachy. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Wednesday, February 25, 2009 2:38 PM To: Struts Users Mailing List Subject: Re: Namespace Expression? Nothing wrong with it syntactically, but I think this is what you are looking for: musachy On Wed, Feb 25, 2009 at 3:34 PM, Griffith, Michael * wrote: > -- "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
Namespace Expression?
Hi Everyone, What's wrong with this expression? Namespace is a private field, but has a public accessor...? Thanks in advance, MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Out of date documentation?
Ah, that makes sense. I'll try that! Thanks Chris. MG -Original Message- From: Chris Pratt [mailto:thechrispr...@gmail.com] Sent: Tuesday, February 10, 2009 6:41 PM To: Struts Users Mailing List Subject: Re: Out of date documentation? Reading that page it would seem you need something more like: dojo\..*,^struts\..*,d-\d*-s (*Chris*) On Tue, Feb 10, 2009 at 4:21 PM, Griffith, Michael * < michael.griff...@fda.hhs.gov> wrote: > Really, is that true? I thought there was a way to override the > interceptor just for this action/result > > http://struts.apache.org/2.1.6/docs/interceptors.html#Interceptors-Int > er > ceptorParameterOverriding > > Referring to Method 2 on the above page... > > MG > > -Original Message- > From: Chris Pratt [mailto:thechrispr...@gmail.com] > Sent: Tuesday, February 10, 2009 6:06 PM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > Shouldn't that be: > > >dojo\..*,^struts\..*,d-\d*-s > > > And remember, the way you have it configured, none of the other > interceptors are going to run, only your special params interceptor. > (*Chris*) > > > On Tue, Feb 10, 2009 at 3:32 PM, Griffith, Michael * < > michael.griff...@fda.hhs.gov> wrote: > > > Ok, here's what is happening... > > > > If I don't try to ignore the DisplayTag parameters, I get: > > 17:23:58,833 INFO [STDOUT] WARN - CommonsLogger.warn(49) | Error > > setting value > > ognl.InappropriateExpressionException: Inappropriate OGNL expression: > > (d > > - 1341904) - p > >at ognl.SimpleNode.setValueBody(SimpleNode.java:257) > > > > If I configure my action is configured as such: > > > class="..web.struts.action.ArtifactAction"> > >link-project.panel > >P > > > > > name="excludeParams">dojo\..*,^struts\..*,d-\..* > > > > > > > > The interceptor doesn't seemt to allow any desireable parameters > > (such > > > as the configured selectedType param) to pass. > > > > Surely I'm not the only person using DisplayTag with Struts 2? ;-) > > Can > > > anyone point out what's wrong with this picture? > > > > Thanks in advance, > > > > MG > > > > > > -Original Message- > > From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] > > Sent: Tuesday, February 10, 2009 11:11 AM > > To: Struts Users Mailing List > > Subject: RE: Out of date documentation? > > > > Thanks, I'll give it a try. > > > > Cheers! > > mg > > > > -Original Message- > > From: Musachy Barroso [mailto:musa...@gmail.com] > > Sent: Tuesday, February 10, 2009 11:09 AM > > To: Struts Users Mailing List > > Subject: Re: Out of date documentation? > > > > Assuming that only the number changes, this should do: d-\d*-s > > > > musachy > > > > On Tue, Feb 10, 2009 at 12:03 PM, Griffith, Michael * > > wrote: > > > Can you help me out with the expression? I am terrible with RE. > > > > > > -Original Message- > > > From: Musachy Barroso [mailto:musa...@gmail.com] > > > Sent: Tuesday, February 10, 2009 10:59 AM > > > To: Struts Users Mailing List > > > Subject: Re: Out of date documentation? > > > > > > The params interceptor takes regular expressions, for both > > > accepted and excluded params. > > > > > > musachy > > > > > > On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * > > > wrote: > > >> Is there any way to exclude a parameter using a wildcard > expression? > > >> I want to block certain parameters generated by displayTag. > > >> > > >> DisplayTag generates parameters like this: > > >> > > >> d-1341904-s > > >> > > >> The actual name of the parameter may vary, but it is always > d-*-s... > > >> > > >> MG > > >> -Original Message- > > >> From: Musachy Barroso [mailto:musa...@gmail.com] > > >> Sent: Tuesday, February 10, 2009 10:34 AM > > >> To: Struts Users Mailing List > > >> Subject: Re: Out of date documentation? > > >> > > >> That interceptor does exist, but its functionality is also in the > > >> params interceptor. True to our motto "if there aren't three > > >> different > > > > > >> ways of
RE: Out of date documentation?
Really, is that true? I thought there was a way to override the interceptor just for this action/result http://struts.apache.org/2.1.6/docs/interceptors.html#Interceptors-Inter ceptorParameterOverriding Referring to Method 2 on the above page... MG -Original Message- From: Chris Pratt [mailto:thechrispr...@gmail.com] Sent: Tuesday, February 10, 2009 6:06 PM To: Struts Users Mailing List Subject: Re: Out of date documentation? Shouldn't that be: dojo\..*,^struts\..*,d-\d*-s And remember, the way you have it configured, none of the other interceptors are going to run, only your special params interceptor. (*Chris*) On Tue, Feb 10, 2009 at 3:32 PM, Griffith, Michael * < michael.griff...@fda.hhs.gov> wrote: > Ok, here's what is happening... > > If I don't try to ignore the DisplayTag parameters, I get: > 17:23:58,833 INFO [STDOUT] WARN - CommonsLogger.warn(49) | Error > setting value > ognl.InappropriateExpressionException: Inappropriate OGNL expression: > (d > - 1341904) - p >at ognl.SimpleNode.setValueBody(SimpleNode.java:257) > > If I configure my action is configured as such: > class="..web.struts.action.ArtifactAction"> >link-project.panel >P > > name="excludeParams">dojo\..*,^struts\..*,d-\..* > > > > The interceptor doesn't seemt to allow any desireable parameters (such > as the configured selectedType param) to pass. > > Surely I'm not the only person using DisplayTag with Struts 2? ;-) Can > anyone point out what's wrong with this picture? > > Thanks in advance, > > MG > > > -Original Message- > From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] > Sent: Tuesday, February 10, 2009 11:11 AM > To: Struts Users Mailing List > Subject: RE: Out of date documentation? > > Thanks, I'll give it a try. > > Cheers! > mg > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Tuesday, February 10, 2009 11:09 AM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > Assuming that only the number changes, this should do: d-\d*-s > > musachy > > On Tue, Feb 10, 2009 at 12:03 PM, Griffith, Michael * > wrote: > > Can you help me out with the expression? I am terrible with RE. > > > > -Original Message- > > From: Musachy Barroso [mailto:musa...@gmail.com] > > Sent: Tuesday, February 10, 2009 10:59 AM > > To: Struts Users Mailing List > > Subject: Re: Out of date documentation? > > > > The params interceptor takes regular expressions, for both accepted > > and excluded params. > > > > musachy > > > > On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * > > wrote: > >> Is there any way to exclude a parameter using a wildcard expression? > >> I want to block certain parameters generated by displayTag. > >> > >> DisplayTag generates parameters like this: > >> > >> d-1341904-s > >> > >> The actual name of the parameter may vary, but it is always d-*-s... > >> > >> MG > >> -Original Message- > >> From: Musachy Barroso [mailto:musa...@gmail.com] > >> Sent: Tuesday, February 10, 2009 10:34 AM > >> To: Struts Users Mailing List > >> Subject: Re: Out of date documentation? > >> > >> That interceptor does exist, but its functionality is also in the > >> params interceptor. True to our motto "if there aren't three > >> different > > > >> ways of doing it, it ain't Struts 2" :) > >> > >> musachy > >> > >> On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * > >> wrote: > >>> It is possible that the following page is out of date: > >>> > >>> http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.h > >>> tm > >>> l > >>> > >>> It should reference the params interceptor, right? > >>> > >> > >> > >> > >> -- > >> "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
RE: Struts2.1.6 & Tiles 2.1.
Gotcha, sorry I couldn't be more help. MG -Original Message- From: Jaarthy [mailto:aarthyj...@yahoo.com] Sent: Tuesday, February 10, 2009 6:14 PM To: user@struts.apache.org Subject: RE: Struts2.1.6 & Tiles 2.1. the same was working fine with Struts2.0.6 and Tiles 2.0. Griffith, Michael * wrote: > > Jaarthy, > > It looks like your tag is trying to point to a tile, vs. an > action that returns the tile result. > > Here's an example: > > href="%{projectList}"> > > > > >type="tiles">list-project.panel > > > > > > > > > >value="/component/search-results.jsp"/> > > > HTH, > > MG > > > -Original Message- > From: Jaarthy [mailto:aarthyj...@yahoo.com] > Sent: Tuesday, February 10, 2009 3:40 PM > To: user@struts.apache.org > Subject: Re: Struts2.1.6 & Tiles 2.1. > > > Here is my > > web.xml > -- > > > > xmlns="http://java.sun.com/xml/ns/j2ee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > Struts 2 > Struts 2 > > > This context parameter specifies the name and location > of the Spring root application context file. > contextConfigLocation > > classpath*:applicationContext*.xml > > > > This context parameter specifies the name and location > of the Tiles Definitions file. > > org.apache.tiles.DEFINITIONS_CONFIG > > /WEB-INF/classes/tiles-defs.xml > > > > > org.apache.tiles.evaluator.AttributeEvaluator > > > > org.apache.tiles.evaluator.el.ELAttributeEvaluator > > > > > > struts2 > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAnd > Ex > ecuteFilter > > > > openSessionInViewFilter > /* > > > struts2 > /* > > > > > struts2 > > org.apache.struts2.dispatcher.FilterDispatcher la > ss> > > actionPackages > com.as.sample.webapp.action > > > > > > > org.apache.struts2.tiles.StrutsTilesListener > > > > > struts.xml > -- > > > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" > "http://struts.apache.org/dtds/struts-2.0.dtd";> > > > >class="org.apache.struts2.views.tiles.TilesResult" default="true" /> > > > > login > > > > > tiles-defs.xml > -- > > > Foundation//DTD Tiles Configuration 2.0//EN" > "http://tiles.apache.org/dtds/tiles-config_2_0.dtd";> > > > > > > > > > > > > In my home page,when i click on the login link "title="login">Login I get an error page,In the logs I see a warning > message WARN:"Unable to find the definition 'login'. > > Where am I going wrong? > > Aarthy > > > Lukasz Lenart wrote: >> >> 2009/2/10 Jaarthy : >>> I am trying to integrate Struts2.1.6 with tiles2.1.1. When I click >>> on > >>> the login link,I am getting "Unable to find the definition"warning >>> Message in my logs.Any help on this issue will be appreciated. >> >> Sorry, I loose my magic ball, you will have to provide more details. >> >> >> Regards >> -- >> Lukasz >> http://www.lenart.org.pl/ >> >> - >> 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/Struts2.1.6---
RE: Out of date documentation?
One solution is to turn down the volume on the logger for OGNL, but that hardly seems like the right idea. I've temporarily solved the problem by setting the logging level to ERROR, but I'd be interested in knowing how this should really work if someone knows the answer. -Original Message----- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Tuesday, February 10, 2009 5:32 PM To: Struts Users Mailing List Subject: RE: Out of date documentation? Ok, here's what is happening... If I don't try to ignore the DisplayTag parameters, I get: 17:23:58,833 INFO [STDOUT] WARN - CommonsLogger.warn(49) | Error setting value ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d - 1341904) - p at ognl.SimpleNode.setValueBody(SimpleNode.java:257) If I configure my action is configured as such: link-project.panel P dojo\..*,^struts\..*,d-\..* The interceptor doesn't seemt to allow any desireable parameters (such as the configured selectedType param) to pass. Surely I'm not the only person using DisplayTag with Struts 2? ;-) Can anyone point out what's wrong with this picture? Thanks in advance, MG -Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Tuesday, February 10, 2009 11:11 AM To: Struts Users Mailing List Subject: RE: Out of date documentation? Thanks, I'll give it a try. Cheers! mg -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, February 10, 2009 11:09 AM To: Struts Users Mailing List Subject: Re: Out of date documentation? Assuming that only the number changes, this should do: d-\d*-s musachy On Tue, Feb 10, 2009 at 12:03 PM, Griffith, Michael * wrote: > Can you help me out with the expression? I am terrible with RE. > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Tuesday, February 10, 2009 10:59 AM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > The params interceptor takes regular expressions, for both accepted > and excluded params. > > musachy > > On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * > wrote: >> Is there any way to exclude a parameter using a wildcard expression? >> I want to block certain parameters generated by displayTag. >> >> DisplayTag generates parameters like this: >> >> d-1341904-s >> >> The actual name of the parameter may vary, but it is always d-*-s... >> >> MG >> -Original Message- >> From: Musachy Barroso [mailto:musa...@gmail.com] >> Sent: Tuesday, February 10, 2009 10:34 AM >> To: Struts Users Mailing List >> Subject: Re: Out of date documentation? >> >> That interceptor does exist, but its functionality is also in the >> params interceptor. True to our motto "if there aren't three >> different > >> ways of doing it, it ain't Struts 2" :) >> >> musachy >> >> On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * >> wrote: >>> It is possible that the following page is out of date: >>> >>> http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.htm >>> l >>> >>> It should reference the params interceptor, right? >>> >> >> >> >> -- >> "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 > > -- "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: Struts2.1.6 & Tiles 2.1.
Jaarthy, It looks like your tag is trying to point to a tile, vs. an action that returns the tile result. Here's an example: list-project.panel HTH, MG -Original Message- From: Jaarthy [mailto:aarthyj...@yahoo.com] Sent: Tuesday, February 10, 2009 3:40 PM To: user@struts.apache.org Subject: Re: Struts2.1.6 & Tiles 2.1. Here is my web.xml -- http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> Struts 2 Struts 2 This context parameter specifies the name and location of the Spring root application context file. contextConfigLocation classpath*:applicationContext*.xml This context parameter specifies the name and location of the Tiles Definitions file. org.apache.tiles.DEFINITIONS_CONFIG /WEB-INF/classes/tiles-defs.xml org.apache.tiles.evaluator.AttributeEvaluator org.apache.tiles.evaluator.el.ELAttributeEvaluator struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndEx ecuteFilter openSessionInViewFilter /* struts2 /* struts2 org.apache.struts2.dispatcher.FilterDispatcher actionPackages com.as.sample.webapp.action org.apache.struts2.tiles.StrutsTilesListener struts.xml -- http://struts.apache.org/dtds/struts-2.0.dtd";> login tiles-defs.xml -- http://tiles.apache.org/dtds/tiles-config_2_0.dtd";> In my home page,when i click on the login link Login I get an error page,In the logs I see a warning message WARN:"Unable to find the definition 'login'. Where am I going wrong? Aarthy Lukasz Lenart wrote: > > 2009/2/10 Jaarthy : >> I am trying to integrate Struts2.1.6 with tiles2.1.1. When I click on >> the login link,I am getting "Unable to find the definition"warning >> Message in my logs.Any help on this issue will be appreciated. > > Sorry, I loose my magic ball, you will have to provide more details. > > > Regards > -- > Lukasz > http://www.lenart.org.pl/ > > - > 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/Struts2.1.6---Tiles-2.1.1-tp21928113p21943239.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
RE: Out of date documentation?
Ok, here's what is happening... If I don't try to ignore the DisplayTag parameters, I get: 17:23:58,833 INFO [STDOUT] WARN - CommonsLogger.warn(49) | Error setting value ognl.InappropriateExpressionException: Inappropriate OGNL expression: (d - 1341904) - p at ognl.SimpleNode.setValueBody(SimpleNode.java:257) If I configure my action is configured as such: link-project.panel P dojo\..*,^struts\..*,d-\..* The interceptor doesn't seemt to allow any desireable parameters (such as the configured selectedType param) to pass. Surely I'm not the only person using DisplayTag with Struts 2? ;-) Can anyone point out what's wrong with this picture? Thanks in advance, MG -Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Tuesday, February 10, 2009 11:11 AM To: Struts Users Mailing List Subject: RE: Out of date documentation? Thanks, I'll give it a try. Cheers! mg -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, February 10, 2009 11:09 AM To: Struts Users Mailing List Subject: Re: Out of date documentation? Assuming that only the number changes, this should do: d-\d*-s musachy On Tue, Feb 10, 2009 at 12:03 PM, Griffith, Michael * wrote: > Can you help me out with the expression? I am terrible with RE. > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Tuesday, February 10, 2009 10:59 AM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > The params interceptor takes regular expressions, for both accepted > and excluded params. > > musachy > > On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * > wrote: >> Is there any way to exclude a parameter using a wildcard expression? >> I want to block certain parameters generated by displayTag. >> >> DisplayTag generates parameters like this: >> >> d-1341904-s >> >> The actual name of the parameter may vary, but it is always d-*-s... >> >> MG >> -Original Message- >> From: Musachy Barroso [mailto:musa...@gmail.com] >> Sent: Tuesday, February 10, 2009 10:34 AM >> To: Struts Users Mailing List >> Subject: Re: Out of date documentation? >> >> That interceptor does exist, but its functionality is also in the >> params interceptor. True to our motto "if there aren't three >> different > >> ways of doing it, it ain't Struts 2" :) >> >> musachy >> >> On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * >> wrote: >>> It is possible that the following page is out of date: >>> >>> http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.htm >>> l >>> >>> It should reference the params interceptor, right? >>> >> >> >> >> -- >> "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 > > -- "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 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Out of date documentation?
Thanks, I'll give it a try. Cheers! mg -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, February 10, 2009 11:09 AM To: Struts Users Mailing List Subject: Re: Out of date documentation? Assuming that only the number changes, this should do: d-\d*-s musachy On Tue, Feb 10, 2009 at 12:03 PM, Griffith, Michael * wrote: > Can you help me out with the expression? I am terrible with RE. > > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Tuesday, February 10, 2009 10:59 AM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > The params interceptor takes regular expressions, for both accepted > and excluded params. > > musachy > > On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * > wrote: >> Is there any way to exclude a parameter using a wildcard expression? >> I want to block certain parameters generated by displayTag. >> >> DisplayTag generates parameters like this: >> >> d-1341904-s >> >> The actual name of the parameter may vary, but it is always d-*-s... >> >> MG >> -Original Message- >> From: Musachy Barroso [mailto:musa...@gmail.com] >> Sent: Tuesday, February 10, 2009 10:34 AM >> To: Struts Users Mailing List >> Subject: Re: Out of date documentation? >> >> That interceptor does exist, but its functionality is also in the >> params interceptor. True to our motto "if there aren't three >> different > >> ways of doing it, it ain't Struts 2" :) >> >> musachy >> >> On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * >> wrote: >>> It is possible that the following page is out of date: >>> >>> http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.htm >>> l >>> >>> It should reference the params interceptor, right? >>> >> >> >> >> -- >> "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 > > -- "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: Out of date documentation?
Can you help me out with the expression? I am terrible with RE. -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, February 10, 2009 10:59 AM To: Struts Users Mailing List Subject: Re: Out of date documentation? The params interceptor takes regular expressions, for both accepted and excluded params. musachy On Tue, Feb 10, 2009 at 11:56 AM, Griffith, Michael * wrote: > Is there any way to exclude a parameter using a wildcard expression? > I want to block certain parameters generated by displayTag. > > DisplayTag generates parameters like this: > > d-1341904-s > > The actual name of the parameter may vary, but it is always d-*-s... > > MG > -Original Message- > From: Musachy Barroso [mailto:musa...@gmail.com] > Sent: Tuesday, February 10, 2009 10:34 AM > To: Struts Users Mailing List > Subject: Re: Out of date documentation? > > That interceptor does exist, but its functionality is also in the > params interceptor. True to our motto "if there aren't three different > ways of doing it, it ain't Struts 2" :) > > musachy > > On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * > wrote: >> It is possible that the following page is out of date: >> >> http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.html >> >> It should reference the params interceptor, right? >> > > > > -- > "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: Out of date documentation?
Is there any way to exclude a parameter using a wildcard expression? I want to block certain parameters generated by displayTag. DisplayTag generates parameters like this: d-1341904-s The actual name of the parameter may vary, but it is always d-*-s... MG -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Tuesday, February 10, 2009 10:34 AM To: Struts Users Mailing List Subject: Re: Out of date documentation? That interceptor does exist, but its functionality is also in the params interceptor. True to our motto "if there aren't three different ways of doing it, it ain't Struts 2" :) musachy On Tue, Feb 10, 2009 at 11:25 AM, Griffith, Michael * wrote: > It is possible that the following page is out of date: > > http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.html > > It should reference the params interceptor, right? > -- "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
Out of date documentation?
It is possible that the following page is out of date: http://struts.apache.org/2.1.6/docs/parameter-filter-interceptor.html It should reference the params interceptor, right?
RE: Can I use a Parameter in result definition?
Dave, Thanks for the reply, and the suggestion~ Cheers! MG -Original Message- From: Dale Newfield [mailto:d...@newfield.org] Sent: Friday, February 06, 2009 5:23 PM To: Struts Users Mailing List Subject: 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 - 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
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: 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
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
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
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
TypeConverter needs Spring Bean
Hello everyone, I have a type converter that needs to get access to my Spring managed service so it can do a DB lookup. I was under the impression that the struts-spring plug-in handled DI for the converter. However, when the convertFromString method tries to access the service called statusService, I get a NPE. What am I doing wrong? Any reply would be appreciated, Cheers! MG public class StatusTypeConverter extends StrutsTypeConverter { StatusService statusService; @Override public Object convertFromString(Map context, String[] values, Class toClass) { Status retVal = null; if (values != null && values.length > 0 && values[0] != null && values[0].length() > 0) { String[] ids = (String[]) values; Integer id = new Integer(ids[0]); retVal = statusService.getStatus(id); // NPE thrown here!! } return retVal; } @Override public String convertToString(Map arg0, Object object) { String retVal = ""; if (object instanceof Status) { Status s = (Status) object; retVal = s.getDescription(); } return retVal; } public void setStatusService(StatusService statusService) { this.statusService = statusService; } } - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Why is Validation not firing?
I hate it when I do this kind of thing. My input result was pointing to the wrong result. Me <-- My own worst enemy. -Original Message- From: Griffith, Michael * [mailto:michael.griff...@fda.hhs.gov] Sent: Wednesday, February 04, 2009 11:13 AM To: Struts Users Mailing List Subject: Why is Validation not firing? Hello all, I must be missing something subtle about my configuration. I'm using Struts 2.0.11 and want to use annotation based validation, but can't seem to get it working. My action class has an update method as such: @Validation public class ArtifactAction extends BaseAction implements ModelDriven, Preparable, ServletRequestAware { ... @Validations( visitorFields = {...@visitorfieldvalidator(message = "Validation Error", fieldName = "model", appendPrefix = false)}) public String update() throws Exception { artifactService.saveArtifact(artifact); return SUCCESS; } } The model class is marked as such: @Entity @Table(name = "ART", schema = "x") @Validation public class Artifact implements Identifiable, java.io.Serializable { ... @Lob @Column(name = "DESCRIPTION", nullable = false) @RequiredStringValidator(message="Validation Error",key="validate.notEmpty", trim=true) public String getDescription() { return this.description; } } And my struts.xml is configured to use an interceptor stack that should include validations: true When I submit the form: No validations fire. The update action does have an input result defined. What am I missing? Any help would be appreciated! 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
Why is Validation not firing?
Hello all, I must be missing something subtle about my configuration. I'm using Struts 2.0.11 and want to use annotation based validation, but can't seem to get it working. My action class has an update method as such: @Validation public class ArtifactAction extends BaseAction implements ModelDriven, Preparable, ServletRequestAware { ... @Validations( visitorFields = {...@visitorfieldvalidator(message = "Validation Error", fieldName = "model", appendPrefix = false)}) public String update() throws Exception { artifactService.saveArtifact(artifact); return SUCCESS; } } The model class is marked as such: @Entity @Table(name = "ART", schema = "x") @Validation public class Artifact implements Identifiable, java.io.Serializable { ... @Lob @Column(name = "DESCRIPTION", nullable = false) @RequiredStringValidator(message="Validation Error",key="validate.notEmpty", trim=true) public String getDescription() { return this.description; } } And my struts.xml is configured to use an interceptor stack that should include validations: true When I submit the form: No validations fire. The update action does have an input result defined. What am I missing? Any help would be appreciated! MG - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: redirect does not work with Tiles.
Jeromy, Thanks for the replies. >>In cases where I've needed this behaviour I've referenced the JSP >>instead of a Tile. Do you mean your result redirects to a JSP instead of a struts action? MG -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2008 6:40 AM To: Struts Users Mailing List Subject: Re: redirect does not work with Tiles. Griffith, Michael * wrote: > Hello All, > > > > I cannot make result go to a new page. Chaining the result > does work, but the response shows my entire tile set showing up in the > inside tile, which is not what I want either. > > Assuming Struts2, the s:action tag can only execute an action and execute where that result can be included within the current outputstream (eg. including a JSP fragment). I redirect result makes no sense in this context as the output stream is already open and written to. I can confirm that a Tiles result (Struts2 result of type tiles) does not work in this context either as it throws an exception that the outputstream has already been opened (or something like that; I can't recall exactly but it's in JIRA somewhere under the Tiles2 plugin). In cases where I've needed this behaviour I've referenced the JSP instead of a Tile. Hope that helps, Jeromy Evans - 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: redirect does not work with Tiles.
Struts 2.0.11 Tiles 2.0.6 -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2008 1:37 AM To: Struts Users Mailing List Subject: Re: redirect does not work with Tiles. 2008/8/7 Griffith, Michael * <[EMAIL PROTECTED]>: > I cannot make result go to a new page. Chaining the result > does work, but the response shows my entire tile set showing up in the > inside tile, which is not what I want either. Version of Struts and Tiles? Antonio - 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]
redirect does not work with Tiles.
Hello All, I cannot make result go to a new page. Chaining the result does work, but the response shows my entire tile set showing up in the inside tile, which is not what I want either. Here is my scenario: I have a JSP that includes a struts action as such... ]--- begin edit.jsp ---[ ]--- end edit.jsp ---[ This JSP is a tile, (using Tiles 2) and the action form maps to an action like this: ... document /WEB-INF/xsl/question.xsl list /respond The form action renders an html fragment, using XML/XSL result type, but it is nested inside of a tiled result. The form basically is like a questionnaire wizard that presents an ordered list of questions and allows a user to answer them, moving forward and back in the sequence. In my ResponseForm action class I look for a parameter passed via the http post, and if the parameter is "Quit" or "Finish" I want to execute my finish result, and redirect to the list where I started. ResponseForm.execute ... } else if (method != null && (method.equalsIgnoreCase("Quit") || method.equalsIgnoreCase("Finish"))) { return "finish"; } ... This does not work - and it doesn't throw any exceptions. If I try to use the result type chain instead of redirect-action, I am directed back to the list, but the entire action (including the outermost tiles) show up in the body tile - so it's like the website shows an entire HTML response in the body tile, which is not correct either. Any insight as to how to overcome this would be much appreciated... Best regards, Michael Griffith
and redirect problem
Hello All, I have a JSP that includes a struts action as such: ]--- begin edit.jsp ---[ <%@ include file="../fragments/taglibs.jsp"%> ]--- end edit.jsp ---[ This JSP is a tile, (using Tiles 2) and the action form maps to an action like this: ... document /WEB-INF/xsl/question.xsl list /respond list /respond --> The reason this is setup this way is that the form action renders an html fragment, using XML/XSL result type, but it is nested inside of a tiled result. The form basically is like a questionnaire wizard, that presents an ordered list of questions and allows a user to answer them, moving forward and back in the sequence. In my ResponseForm action class I look for a parameter passed via the http post, and if the parameter is "Quit" or "Finish" I want to execute my finish result, and redirect to the list where I started. ResponseForm.execute ... } else if (method != null && (method.equalsIgnoreCase("Quit") || method.equalsIgnoreCase("Finish"))) { return "finish"; } ... This does not work - and it doesn't throw any exceptions. If I try to use the result type chain instead of redirect-action, I am directed back to the list, but the entire action (including the outermost tiles) show up in the body tile - so it's like the website shows an entire HTML response in the body tile, which is not correct either. Any insight as to how to overcome this would be much appreciated... Best regards, Michael Griffith
Spring Struts Plugin workaround for Session Scoped Beans
Hi, >From the docs, I found this link/note: To use session-scoped components with Spring and Struts, see the Spring Session Components Workarounds analysis. That led to confluence page that doesn't yet exist. I am using a session scoped spring bean in a struts 2 action, and it seems to be working OK, but is there something I might be missing? My bean is defined as such: I have the RequestContextListener listener declared as per the Spring documentation as well. I'm just wondering what the work around documentation was supposed to be? Also, if I have a method getValueObject() on my action that returns a model, how do I get Spring to use that method to inject my service on the constructor? I want something like: ... QuestionSequenceImpl( ValueObject vo ){ this.vo= vo; } Thanks in advance! Michael Griffith
RE: Clarification on Type Conversion?
Martin, First of all, thanks for the reply. The full action is listed below: I guess what is not clear to me is whether I need to create a StrutsTypeConverter to convert the selected item from the list back to a model. As I have been thrashing about trying to get this to work, I have tried creating a converter to convert the id passed back to an object... public class StatusConverter extends StrutsTypeConverter { private static final Log _log = LogFactory.getLog(StatusConverter.class); @Override public Object convertFromString(Map context, String[] values, Class toClass) { if (values.length > 0 && values[0] != null && values[0].trim().length() > 0) { Status status= new Status(); status.setId(new Integer(values[0])); return status; } return null; } @Override public String convertToString(Map context, Object status) { if (status instanceof Status) { return ((Status)status).getId().toString(); } return ""; } } This seems to work, but only the ID is passed to the converter, which means I have to look up the reference to the Status object in the database. This just feels as if I am going down the wrong path. Again, below is my action. Thanks for any suggestions you might have. Best Regards, MG ... public class CallAction extends BaseCallAction implements ServletRequestAware, ModelDriven, Preparable { /** * */ private static final long serialVersionUID = 9001475066131203883L; private Call Call; private HttpServletRequest request; CallService CallService; UserService userService; StatusService statusService; Integer id; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getView() throws Exception{ return SUCCESS; } public String list() throws Exception { List results= CallService.getCalls(); request.setAttribute(SEARCH_RESULTS, results); return SUCCESS; } public String execute() throws Exception { return SUCCESS; } public Call getModel() { return Call; } public void prepare() throws Exception { if(id == null || id.intValue() == 0){ PermissionedUser permissionedUser= this.getAuthenticatedUser(); Call= new Call(); Call.setRequestor(permissionedUser.getUser()); }else{ Call= CallService.getCall(id); } request.getSession().setAttribute("Call", Call); } public String update() throws Exception{ CallService.update(Call); return SUCCESS; } public void setServletRequest(HttpServletRequest request) { this.request= request; } public void setCallService(CallService CallService) { this.CallService = CallService; } public void setUserService(UserService userService) { this.userService = userService; } public void setStatusService(StatusService statusService){ this.statusService= statusService; } public List getStatusList(){ return statusService.findAll(); } } -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Friday, April 18, 2008 12:22 PM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: Clarification on Type Conversion? Good Afternoon Mike- Tough to diagnose without seeing the service interface defined in your action e.g. public class HHSAction implements Preparable { private HHSService service; } package quickstart.service; import java.util.List; import quickstart.model.Person; public interface HHSService { public List findAll(); public void save(Person person); public Person find(int id); } ? Martin- ----- Original Message - From: "Griffith, Michael *" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Friday, April 18, 2008 10:33 AM Subject: Clarification on Type Conversion? Hello All, I am having a problem with Struts 2 form submission, because I believe a related field is not being converted correctly. I have read the documentation at: http://struts.apache.org/2.x/docs/select.html and http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my understanding that I should not need to provide any custom converter, that this conversion should be automati
RE: Clarification on Type Conversion?
Jukka, First of all, thanks for the reply. I don't think I made my question clear enough. The form isn't editing the model/object called Status, its editing a model on which Status is an associated object. Such as in this example, where I have a class named Call, that has a field called Status, which is a model object. CallStatus - --- id id description description dateCreated status Given, this -- does your comment still hold? Thanks! MG Doesn't your example indicate that it would set the field called id -Original Message- From: Jukka Välimaa [mailto:[EMAIL PROTECTED] Sent: Friday, April 18, 2008 12:12 PM To: Struts Users Mailing List Subject: Re: Clarification on Type Conversion? name="status" means that you are trying to pass the status object itself as a parameter to a method setStatus. That is not possible--you need to pass the id of the status if you want to indicate which status the user chose, like this for example: You also need setId method in the action you submit the form to. On Fri, Apr 18, 2008 at 5:33 PM, Griffith, Michael * < [EMAIL PROTECTED]> wrote: > Hello All, > > > > I am having a problem with Struts 2 form submission, because I believe a > related field is not being converted correctly. I have read > the documentation at: http://struts.apache.org/2.x/docs/select.html and > http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my > understanding that I should not need to provide any custom converter, > that this conversion should be automatic. When I submit the form, I > receive the error: Invalid field value for field "status". > > > > Here is the setup: > > > > I have a form with a field: > > > list="statusList" > > listKey="id" > > listValue="description"/> > > > > The action has the method: > > > >public List getStatusList(){ > >return statusService.findAll(); > >} > > > > The model object that status is mapped to looks like this: > > > > @Entity > > @Table(name="STATUS") > > @Validation > > public class Status implements Identifiable, Serializable { > > > >private static final long serialVersionUID = > -8017026685032314796L; > >private Integer id; > >private String description; > > > >@Id > >@GeneratedValue(strategy = GenerationType.AUTO) > >@Column(name = "ID", unique = true, nullable= false) > >public Integer getId() { > >return id; > >} > > > >public void setId(Integer id){ > >this.id= id; > >} > > > >@Column(name="DESCRIPTION", nullable= false) > >public String getDescription() { > >return description; > >} > > > >@RequiredStringValidator(message="Validation Error", > key="validate.notEmpty", trim=true) > >public void setDescription(String description) { > >this.description = description; > >} > > > > I tried creating a mapping properties file called > actionName-conversion.properties: > > KeyProperty_StatusList=id > > Element_StatusList=Status > > CreateIfNull_statusList=true > > > > No avail. I'm sure my problem is obvious, but I can't see it. Any help > or suggestions would be much appreciated... > > > > Thanks in advance! > > Michael Griffith > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Clarification on Type Conversion?
Hello All, I am having a problem with Struts 2 form submission, because I believe a related field is not being converted correctly. I have read the documentation at: http://struts.apache.org/2.x/docs/select.html and http://struts.apache.org/2.0.11.1/docs/type-conversion.html It is my understanding that I should not need to provide any custom converter, that this conversion should be automatic. When I submit the form, I receive the error: Invalid field value for field "status". Here is the setup: I have a form with a field: The action has the method: public List getStatusList(){ return statusService.findAll(); } The model object that status is mapped to looks like this: @Entity @Table(name="STATUS") @Validation public class Status implements Identifiable, Serializable { private static final long serialVersionUID = -8017026685032314796L; private Integer id; private String description; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID", unique = true, nullable= false) public Integer getId() { return id; } public void setId(Integer id){ this.id= id; } @Column(name="DESCRIPTION", nullable= false) public String getDescription() { return description; } @RequiredStringValidator(message="Validation Error", key="validate.notEmpty", trim=true) public void setDescription(String description) { this.description = description; } I tried creating a mapping properties file called actionName-conversion.properties: KeyProperty_StatusList=id Element_StatusList=Status CreateIfNull_statusList=true No avail. I'm sure my problem is obvious, but I can't see it. Any help or suggestions would be much appreciated... Thanks in advance! Michael Griffith
RE: How is the dependency and dependency conversion list built on struts website?
Ignore my question... I found it... Maven 2 Report, thanks. MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2008 12:50 PM To: Struts Users Mailing List Subject: How is the dependency and dependency conversion list built on struts website? Hello all, I think I know the answer to this, but I am wondering how the dependency and dependency convergence lists are built on the Struts Website? http://struts.apache.org/2.x/struts2-core/dependencies.html http://struts.apache.org/2.x/struts2-core/dependency-convergence.html Is this a Maven 2 feature, or is it done with something like JDepend? I'd like to have the same information for my application using the Ant build system. Thanks in advance, MG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How is the dependency and dependency conversion list built on struts website?
Hello all, I think I know the answer to this, but I am wondering how the dependency and dependency convergence lists are built on the Struts Website? http://struts.apache.org/2.x/struts2-core/dependencies.html http://struts.apache.org/2.x/struts2-core/dependency-convergence.html Is this a Maven 2 feature, or is it done with something like JDepend? I'd like to have the same information for my application using the Ant build system. Thanks in advance, MG
RE: Newbie question
Ed, Last updated Mar 02 2006 -- so this might not be the best list... http://struts.sourceforge.net/community/hosts.html This is current... http://struts.apache.org/2.x/docs/application-servers.html MG -Original Message- From: maitre [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2008 1:42 PM To: user@struts.apache.org Subject: Re: Newbie question I don't want to build the framework from scratch, I just want to use the distribution package and customize it if that's possible. Ed Alex Choi wrote: > > A Java Web Application that uses Apache Struts 2 framework can be written > or > developed using JDK version 1.5. It is possible to use JDK 1.4 but your > Java Software Developers must use the backward compatible Apache Struts 2 > jars for JDK 1.4 for Struts 2 development > > Here are the details you are interested: > > http://struts.apache.org/2.x/docs/building-the-framework-from-source.htm l > > > On 18/03/2008, maitre <[EMAIL PROTECTED]> wrote: >> >> >> Thanks, y'all. >> >> Where can I find the correct JDK and API specs so I can ask my hosting >> company? >> >> Ed >> >> >> >> Griffith, Michael * wrote: >> > >> > Agreed. Look for a provider that offers the correct JDK and API specs. >> > >> > MG >> > >> > -Original Message- >> > From: Alex Choi [mailto:[EMAIL PROTECTED] >> > Sent: Tuesday, March 18, 2008 12:55 PM >> > To: Struts Users Mailing List >> > Subject: Re: Newbie question >> > >> > I think you need to rephrase your question. Apache Struts 2 is a >> > specific >> > Java Web Application framework technology and Java Web Application is >> > the >> > more general and generic term I think you meant to say. In terms of Web >> > Hosting, you would be interested in Web Hosting Providers that allows >> > deployment of Java Web Applications. >> > >> > I hope that helps you to narrow your search. >> > >> > On 18/03/2008, maitre <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> Hi, >> >> >> >> I'm trying to find a decent hosting company that supports STRUTS 2. >> > Are >> >> there any recommendations? >> >> >> >> Thanks, >> >> >> >> Ed >> >> >> >> -- >> >> View this message in context: >> >> http://www.nabble.com/Newbie-question-tp16125218p16125218.html >> >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> >> >> >> - >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > - >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] >> > >> > >> > >> >> >> -- >> View this message in context: >> http://www.nabble.com/Newbie-question-tp16125218p16127371.html >> >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/Newbie-question-tp16125218p16127983.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question
Ed, Additional information here: http://struts.apache.org/primer.html MG -Original Message- From: Alex Choi [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2008 1:27 PM To: Struts Users Mailing List Subject: Re: Newbie question A Java Web Application that uses Apache Struts 2 framework can be written or developed using JDK version 1.5. It is possible to use JDK 1.4 but your Java Software Developers must use the backward compatible Apache Struts 2 jars for JDK 1.4 for Struts 2 development Here are the details you are interested: http://struts.apache.org/2.x/docs/building-the-framework-from-source.htm l On 18/03/2008, maitre <[EMAIL PROTECTED]> wrote: > > > Thanks, y'all. > > Where can I find the correct JDK and API specs so I can ask my hosting > company? > > Ed > > > > Griffith, Michael * wrote: > > > > Agreed. Look for a provider that offers the correct JDK and API specs. > > > > MG > > > > -Original Message- > > From: Alex Choi [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, March 18, 2008 12:55 PM > > To: Struts Users Mailing List > > Subject: Re: Newbie question > > > > I think you need to rephrase your question. Apache Struts 2 is a > > specific > > Java Web Application framework technology and Java Web Application is > > the > > more general and generic term I think you meant to say. In terms of Web > > Hosting, you would be interested in Web Hosting Providers that allows > > deployment of Java Web Applications. > > > > I hope that helps you to narrow your search. > > > > On 18/03/2008, maitre <[EMAIL PROTECTED]> wrote: > >> > >> > >> Hi, > >> > >> I'm trying to find a decent hosting company that supports STRUTS 2. > > Are > >> there any recommendations? > >> > >> Thanks, > >> > >> Ed > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Newbie-question-tp16125218p16125218.html > >> Sent from the Struts - User mailing list archive at Nabble.com. > >> > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > -- > View this message in context: > http://www.nabble.com/Newbie-question-tp16125218p16127371.html > > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question
Agreed. Look for a provider that offers the correct JDK and API specs. MG -Original Message- From: Alex Choi [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2008 12:55 PM To: Struts Users Mailing List Subject: Re: Newbie question I think you need to rephrase your question. Apache Struts 2 is a specific Java Web Application framework technology and Java Web Application is the more general and generic term I think you meant to say. In terms of Web Hosting, you would be interested in Web Hosting Providers that allows deployment of Java Web Applications. I hope that helps you to narrow your search. On 18/03/2008, maitre <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm trying to find a decent hosting company that supports STRUTS 2. Are > there any recommendations? > > Thanks, > > Ed > > -- > View this message in context: > http://www.nabble.com/Newbie-question-tp16125218p16125218.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Struts 1 return stream (documents)
Forgive me if I am on the wrong track here, I think I picked up this thread in the middle... but I think I would answer: > How are we suppose to supply the fileName? By setting a response header: response.setHeader("Content-Disposition", "inline;filename="foo.xyz"); MG -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Tuesday, March 18, 2008 9:48 AM To: user@struts.apache.org Subject: Re: Struts 1 return stream (documents) The techniques shown in the earlier examples would work equally well in the byte stream example. How you determine the source of the data to send back to the browser is really up to you. - configure it statically in struts-config.xml (as per the first two exxamples - take it from a request parameter - derive it from some other user or request data L. bhaarat Sharma wrote: > Quick question > > in all other examples on that page they show how the fileName is > retrieved. But for Byte Array Example they do not mention anything > regarding the fileName. > > How are we suppose to supply the fileName? > > > On Mon, Mar 17, 2008 at 10:41 PM, Dave Newton <[EMAIL PROTECTED]> wrote: >> --- bhaarat Sharma <[EMAIL PROTECTED]> wrote: >> >>> Thanks! I remember you helped me with similar problem in S2 as well >> I'm very good at using the work of others to make me look good ;) >> >> Dave >> >> >> >> >> - >> 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: How to initialize business service objects?
Frank, I would check your struts.properties file: Make sure it has these entries and that it is on your classpath (i.e. in WEB-INF/classes) struts.objectFactory = spring struts.objectFactory.spring.autoWire = name MG -Original Message- From: Frank Fischer [mailto:[EMAIL PROTECTED] Sent: Monday, March 17, 2008 1:35 PM To: 'Struts Users Mailing List' Subject: RE: How to initialize business service objects? Hi Michael Thanks for your answer. > 1) You have included the struts2-spring-pliugin.jar in your classpath Yes, it put it under "WEB-INF/lib/" so it's packaged to the war file and should be available to tomcat it think. I also can't see any error or warning messages while deploying the application, so i guess the package can be resolved. > 2) Your applicationContext.xml file is getting loaded on startup. If > you haven't already done so, check your web.xml for a context > parameter > like this: > > contextConfigLocation > > classpath*:applicationContext*.xml > I did not include that line because i read, that this is the default setting Spring uses when no contextConfigLocation parameter is defined. I just added it but it didn't change anything as far as i see. Thanks again for your help. Frank - 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: How to initialize business service objects?
Frank, Check two things: 1) You have included the struts2-spring-pliugin.jar in your classpath 2) Your applicationContext.xml file is getting loaded on startup. If you haven't already done so, check your web.xml for a context parameter like this: contextConfigLocation classpath*:applicationContext*.xml HTH, MG -Original Message- From: Frank Fischer [mailto:[EMAIL PROTECTED] Sent: Monday, March 17, 2008 11:09 AM To: 'Struts Users Mailing List' Subject: RE: How to initialize business service objects? Hi all first i'd like to thank all of you that have given me valuable feedback to my question. Following the answers from Dave and Jeromy i decided to go the "hard" way with Spring and DI. After reading some manuals (thanks to GF, good reading) i managed to load the Spring ContextLoaderListener and even define an POJO bean that serves as my BusinessLogicService. From the Tomcat logs i can see that an instance of that Service is created. As far as i read/unterstood, i now would only have to create a setter method on my Action class and Spring then would automatically inject the related dependcy to my Action class. So far, this doesn't seem to work, so i guess, i must be missing something. My applicationContext.xml looks quite simple (and seems to work, since the DispatcherService is created on startup): --- http://www.springframework.org/dtd/spring-beans.dtd";> --- The Struts config looks like: --- http://struts.apache.org/dtds/struts-2.0.dtd";> /CustomerLogin.jsp /CustomerChat.jsp /CustomerLogin.jsp /CustomerLogin.jsp /CustomerChat.jsp --- So i guess, i must be missing something. Is there a way i would have to tell Spring which Action classes to inject? Thanks a lot for your help Frank - 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: How can I combine a result (tiles + xslt)?
Antonio, First of all, I'm not saying you are wrong about XSLT closing the result stream -- I don't have enough knowledge to comment on that problem, however... Here's what I did to test this. I copied the source for XSLTResult to a new class, and added a boolean parameter to the result called flush. In my struts.xml file, I set the parameter to false (or let it default) and put an if statement around the out.close() method in XSLTResult.execute, line 357. So the code looks like this: if( getFlush() ){ LOG.debug("Flushing output stream"); out.close(); // ...and flush... } Sure enough, if the flag is true, the stream is closed and the exception occurs. If the flag is false, and the close() gets stepped over, the stream is left open and the remainder of the tiles render. The XSLTResult class isn't really well structured to act as a superclass, so unfortunately, in order to get this to work I have to copy the class to a new class and add this implementation. I would argue this is a bug in XSLTResult. Thanks for your comments and support. MG -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2008 8:31 AM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? 2008/3/11, Griffith, Michael * <[EMAIL PROTECTED]>: > > Would you then agree this is a bug or enhancement that could be made to > the XSLTResult? Maybe a flush parameter could be added to the > configuration of the result? I don't think it is a bug of XSLTResult, since it "closes" (not simply "flushes") the stream. The fact that the parser closes the stream is in the XML specification (yeah, this is *stupid* but they did it). Anyway probably XSLTResult needs a workaround for this feature since we cannot change the specifications. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I combine a result (tiles + xslt)?
Antonio, Would you then agree this is a bug or enhancement that could be made to the XSLTResult? Maybe a flush parameter could be added to the configuration of the result? MG -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2008 2:25 AM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? 2008/3/10, Griffith, Michael * <[EMAIL PROTECTED]>: > > I believe (maybe incorrectly so) that the problem is caused by the > XSLTResult calling close/flush when processing the result. Mmm... It reminds me a thing. When processing an XML file via a XML parser, the parser closes the stream at the end! To work around this problem, I had to wrap the original InputStream into an object that overrides the "close" method, not closing the stream. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I combine a result (tiles + xslt)?
Antonio, Thanks for your help. For some reason, it didn't register to me that the TILES_2_0_X branch would be the 2.0.6 branch... duh. I downloaded the Tiles 2.0.X source and built the 2.0.6 snapshot. It did not fix the IO Stream error previously reported, so I am unsure if the issue is related. I believe (maybe incorrectly so) that the problem is caused by the XSLTResult calling close/flush when processing the result. https://issues.apache.org/struts/browse/WW-2538 MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 4:44 PM To: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Dave, I did. I will try both, easy path first. I'll let you know what I find so that you can close the JIRA incident I opened. I did look at the JIRA ticket Antonio posted, and it seems likely that is the problem. Thanks to all that replied, especially all the extra effort that Martin went to. Cheers! MG -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 12:45 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Did you see Antonio's post about how it's probably a bug in Tiles?! Seems like it would be quite a bit easier to try his idea than all this. --- Martin Gainty <[EMAIL PROTECTED]> wrote: > Good Afternoon Michael > > I just ran thru the scenario you described on a 'healthy' jsp page and see > this debug output: > 03-07 12:58:52,718 DEBUG > (org.apache.struts2.interceptor.validation.AnnotationValidationIntercept or:1 > 34) - Validating /tags/non-ui/actionTag/form with method execute. > 2000-03-07 12:58:52,734 DEBUG > (org.apache.struts2.dispatcher.ServletDispatcherResult:113) - Forwarding to > location /tags/non-ui/iteratorTag/done.jsp > [GC [DefNew: 3968K->0K(4032K), 0.0108816 secs] 49623K->47040K(68568K), > 0.0109704 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0168407 secs] 51008K->48964K(68568K), > 0.0169301 secs] > 2000-03-07 12:58:52,906 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a > 2000-03-07 12:58:52,921 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a.ftl > [GC [DefNew: 3968K->0K(4032K), 0.0051196 secs] 52932K->49117K(68568K), > 0.0052029 secs] > 2000-03-07 12:58:52,937 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a-close > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a-close.ftl > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup > counter=1 > [GC [DefNew: 3966K->0K(4032K), 0.0038605 secs] 53083K->49280K(68568K), > 0.0039430 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0232088 secs] 53248K->52251K(68568K), > 0.0232965 secs] > [GC [1 CMS-initial-mark: 52251K(64536K)] 52251K(68568K), 0.0012270 secs] > [CMS-concurrent-mark: 0.361/0.361 secs] > > to repeat the scenario- > deploy struts2-showcase-2.0.11 to TC (its a monster so this will take a > while..) > vi /tags/non-ui/actionTag/showActionTagDemo.jsp > add these lines to showActionTagDemo.jsp > > > > > ignoreContextParams="true"/> > > > > add these configuration lines to /WEB-INF/classes/struts-tags-non-ui.xml to > configure in a 'healthy' action class and a result > > /tags/non-ui/iteratorTag/done.jsp > > > insert the following jsp to /tags/non-ui/iteratorTag/date.jsp > <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> > > > This is done.jsp > > > This is done.jsp > > > > in a scratch folder create the necessary ActionTagDemo folder > use the following build.xml for building with > ant compile > > > > > > > > > > > > > > > > > > location="/struts/struts-2.0.11/lib/struts2-core-2.0.11.jar"/> > > > > > > > location=":/SPRING/spring-framework-2.0.6/target/mock-classes"/> > > > > > > > > > > location="/SPRING/SPRING~1.5/SPRING~1.5-W/SPRING~1.5/dist/spring.jar"/> > > > > > > > > > depends="dist" > description="default: build everything" > /> > > > > > > > depends="c
RE: How can I combine a result (tiles + xslt)?
Hi all, I checked out the current branch from the Tiles SVN repository: http://svn.apache.org/repos/asf/tiles/framework/trunk/ and built it. Version is 2.1.0-SNAPSHOT. This appears to be incompatible with the Struts2Tiles plugin? Has anyone run into this? The error is: Exception sending context initialized event to listener instance of class org.apache.struts2.tiles.StrutsTilesListener java.lang.IllegalStateException: RendererFactory not specified I tried adding additional Tiles configuration information as specified at: http://struts.apache.org/2.x/docs/tiles-plugin.html and http://tiles.apache.org/tutorial/configuration.html using the context-param and listener, but with the same error. This exception is not thrown with Tiles 2.0.5. I did not see a tag for tiles 2.0.6 in the SVN tree, where can I get the tiles-2.0.6-snapshot? Any help would be appreciated! MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 4:44 PM To: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Dave, I did. I will try both, easy path first. I'll let you know what I find so that you can close the JIRA incident I opened. I did look at the JIRA ticket Antonio posted, and it seems likely that is the problem. Thanks to all that replied, especially all the extra effort that Martin went to. Cheers! MG -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 12:45 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Did you see Antonio's post about how it's probably a bug in Tiles?! Seems like it would be quite a bit easier to try his idea than all this. --- Martin Gainty <[EMAIL PROTECTED]> wrote: > Good Afternoon Michael > > I just ran thru the scenario you described on a 'healthy' jsp page and see > this debug output: > 03-07 12:58:52,718 DEBUG > (org.apache.struts2.interceptor.validation.AnnotationValidationIntercept or:1 > 34) - Validating /tags/non-ui/actionTag/form with method execute. > 2000-03-07 12:58:52,734 DEBUG > (org.apache.struts2.dispatcher.ServletDispatcherResult:113) - Forwarding to > location /tags/non-ui/iteratorTag/done.jsp > [GC [DefNew: 3968K->0K(4032K), 0.0108816 secs] 49623K->47040K(68568K), > 0.0109704 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0168407 secs] 51008K->48964K(68568K), > 0.0169301 secs] > 2000-03-07 12:58:52,906 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a > 2000-03-07 12:58:52,921 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a.ftl > [GC [DefNew: 3968K->0K(4032K), 0.0051196 secs] 52932K->49117K(68568K), > 0.0052029 secs] > 2000-03-07 12:58:52,937 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a-close > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a-close.ftl > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup > counter=1 > [GC [DefNew: 3966K->0K(4032K), 0.0038605 secs] 53083K->49280K(68568K), > 0.0039430 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0232088 secs] 53248K->52251K(68568K), > 0.0232965 secs] > [GC [1 CMS-initial-mark: 52251K(64536K)] 52251K(68568K), 0.0012270 secs] > [CMS-concurrent-mark: 0.361/0.361 secs] > > to repeat the scenario- > deploy struts2-showcase-2.0.11 to TC (its a monster so this will take a > while..) > vi /tags/non-ui/actionTag/showActionTagDemo.jsp > add these lines to showActionTagDemo.jsp > > > > > ignoreContextParams="true"/> > > > > add these configuration lines to /WEB-INF/classes/struts-tags-non-ui.xml to > configure in a 'healthy' action class and a result > > /tags/non-ui/iteratorTag/done.jsp > > > insert the following jsp to /tags/non-ui/iteratorTag/date.jsp > <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> > > > This is done.jsp > > > This is done.jsp > > > > in a scratch folder create the necessary ActionTagDemo folder > use the following build.xml for building with > ant compile > > > > > > > > > > > > > > > > > > location="/struts/struts-2.0.11/lib/struts2-core-2.0.11.jar"/> > > > > > > > location=":/SPRING/spring-framework-2.0.6/target/mock-classes"/> > > > > > > >
RE: How can I combine a result (tiles + xslt)?
Dave, I did. I will try both, easy path first. I'll let you know what I find so that you can close the JIRA incident I opened. I did look at the JIRA ticket Antonio posted, and it seems likely that is the problem. Thanks to all that replied, especially all the extra effort that Martin went to. Cheers! MG -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 12:45 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Did you see Antonio's post about how it's probably a bug in Tiles?! Seems like it would be quite a bit easier to try his idea than all this. --- Martin Gainty <[EMAIL PROTECTED]> wrote: > Good Afternoon Michael > > I just ran thru the scenario you described on a 'healthy' jsp page and see > this debug output: > 03-07 12:58:52,718 DEBUG > (org.apache.struts2.interceptor.validation.AnnotationValidationIntercept or:1 > 34) - Validating /tags/non-ui/actionTag/form with method execute. > 2000-03-07 12:58:52,734 DEBUG > (org.apache.struts2.dispatcher.ServletDispatcherResult:113) - Forwarding to > location /tags/non-ui/iteratorTag/done.jsp > [GC [DefNew: 3968K->0K(4032K), 0.0108816 secs] 49623K->47040K(68568K), > 0.0109704 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0168407 secs] 51008K->48964K(68568K), > 0.0169301 secs] > 2000-03-07 12:58:52,906 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a > 2000-03-07 12:58:52,921 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a.ftl > [GC [DefNew: 3968K->0K(4032K), 0.0051196 secs] 52932K->49117K(68568K), > 0.0052029 secs] > 2000-03-07 12:58:52,937 DEBUG (org.apache.struts2.components.UIBean:526) - > Rendering template /template/xhtml/a-close > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.components.template.FreemarkerTemplateEngine:135) - > Rendering template /template/simple/a-close.ftl > 2000-03-07 12:58:52,953 DEBUG > (org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup > counter=1 > [GC [DefNew: 3966K->0K(4032K), 0.0038605 secs] 53083K->49280K(68568K), > 0.0039430 secs] > [GC [DefNew: 3968K->0K(4032K), 0.0232088 secs] 53248K->52251K(68568K), > 0.0232965 secs] > [GC [1 CMS-initial-mark: 52251K(64536K)] 52251K(68568K), 0.0012270 secs] > [CMS-concurrent-mark: 0.361/0.361 secs] > > to repeat the scenario- > deploy struts2-showcase-2.0.11 to TC (its a monster so this will take a > while..) > vi /tags/non-ui/actionTag/showActionTagDemo.jsp > add these lines to showActionTagDemo.jsp > > > > > ignoreContextParams="true"/> > > > > add these configuration lines to /WEB-INF/classes/struts-tags-non-ui.xml to > configure in a 'healthy' action class and a result > > /tags/non-ui/iteratorTag/done.jsp > > > insert the following jsp to /tags/non-ui/iteratorTag/date.jsp > <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> > > > This is done.jsp > > > This is done.jsp > > > > in a scratch folder create the necessary ActionTagDemo folder > use the following build.xml for building with > ant compile > > > > > > > > > > > > > > > > > > location="/struts/struts-2.0.11/lib/struts2-core-2.0.11.jar"/> > > > > > > > location=":/SPRING/spring-framework-2.0.6/target/mock-classes"/> > > > > > > > > > > location="/SPRING/SPRING~1.5/SPRING~1.5-W/SPRING~1.5/dist/spring.jar"/> > > > > > > > > > depends="dist" > description="default: build everything" > /> > > > > > > > depends="compile" > description="create distributables (jars etc)"> > > > > > > > > destdir="classes" >classpathref="compile.classpath" >debug="on" >deprecation="on"/> > > > > then edit in the following Action java file > /tmjee/testing/ActionTagAction.java > > package tmjee.testing; > import com.opensymphony.xwork2.ActionSupport; > import org.apache.struts2.ServletActionContext; > import java.lang.*; > public class ActionTagAction extends ActionSupport > { > public String execute() throws Exception { > return "done"; > } > public String doDefault() throws Exception { > ServletActionContext.getRequest().setAttribute("stringByAction", "This > is a String put in by the action's doDefault()"); > return "done"; > } > } > > ant compile > copy the compiled classes to Tomcat struts2-showcase-2.0.11 > copy /tmjee/testing*.class > $TOMCAT_HOME/webapps/struts2-showcase-2.0.11/WEB-INF/classes/tmjee/testi ng > > go to TC Manager > reload the web application so TC container will re-read the configuration > for struts2-showcase-2.0.11 > http://localhost:8080/manager/html/reload?path=/struts2-showcase-2.0.11 > > now reference the affe
RE: How can I combine a result (tiles + xslt)?
I'd be happy to do more than that; I'll fix the bug if someone can give me some design direction. MG -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 7:36 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Good Morning Michael This is a bug.. do you want to update JIRA? Thanks Martin- - Original Message - From: "Griffith, Michael *" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, March 06, 2008 4:07 PM Subject: RE: How can I combine a result (tiles + xslt)? Hi all, I've specified on both the struts tag, and the tiles include flush="false" .. template ... . tile ... Same result. Does anyone have any other ideas on what I can do to prevent this? Any tile that is supposed to be rendered after the body (ie the footer) is not rendered because the stream is closed. Any help would be much appreciated... MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 1:52 PM To: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Could this be a defect? https://issues.apache.org/struts/browse/WW-1385 -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 1:25 PM To: Martin Gainty Cc: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Hmmm... while this approach displays the page OK, I get the error below in my JBoss console when executing the action. Is this something I need to prevent with some sort of page directive? 2008-03-06 13:14:11,470 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DataCa ll].[jsp]] Servlet.service() for servlet jsp threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:20 4) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1 15) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1 86) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF actoryImpl.java:117) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm pl.java:76) at org.apache.jsp.fragments.root_jsp._jspService(root_jsp.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:373) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:654) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio nDispatcher.java:445) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:379) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:292) at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(Serv letTilesRequestContext.java:198) at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Ser vletTilesRequestContext.java:185) at org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesReques tContextWrapper.java:72) at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesR equestContext.java:86) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:419) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:370) at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:10 4) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu pport.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:348) -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 9:51 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Michael- remembering our academic coursework teaches Not(Not condition) evaluates positive be sure to set ignoreContextParams="false" as in I would encourage you to read Dave's article on using ResultTypes at http://struts.apache.org/2.x/docs/result-types.html MG - Or
RE: How can I combine a result (tiles + xslt)?
Struts 2.0.11.1 Tiles 2.0.5 -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2008 2:20 AM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? 2008/3/6, Griffith, Michael * <[EMAIL PROTECTED]>: > > Same result. Does anyone have any other ideas on what I can do to > prevent this? Any tile that is supposed to be rendered after the body > (ie the footer) is not rendered because the stream is closed. Version of Struts 2 and Tiles? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DispatchAction nonexisting method
Hi Edward, Create a method for handling "all the rest" or unspecified actions, and delegate to your view: protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return getView(mapping, form, request, response); } MG From: Edward Song [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 3:04 PM To: 'Struts Users Mailing List' Subject: DispatchAction nonexisting method Hi all, First, this is not a Struts 2 question And thanks to anyone who reads below... I was wondering how other's handled this problem with the org.apache.struts.actions.DispatchAction in Struts 1.3.9. I have an action that calls a data service that is to be presented to the user in numerous formats by using DispatchAction. * View * XLS * PDF As they all utilizes a common data service, I thought that this would be an excellent candidate for DispatchAction to centralize the call into one action. Say the parameter used was named "export", so my action mapping looks like, UserOrders extends DispatchAction and all this is working fine. I implement the following methods. public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception public ActionForward excel(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception public ActionForward pdf(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception All is well, until... http://localhost:8080/myapp/UserOrders.do?export=unnamedmethod When DispatchAction attempts to find the unnamedmethod, it throws a NoSuchMethodException prior to calling any method. Our app is configured to show a 500 page, and I know that I could use the and create an exception handler but the NoSuchMethodException is such a generic exception. Wrapping the exception is not really an option as it is thrown by DispatchAction. Has anyone thought of a good way for DispatchAction to handle an unnamed method?? Ed
RE: How can I combine a result (tiles + xslt)?
Hi all, I've specified on both the struts tag, and the tiles include flush="false" ... template ... .. tile ... Same result. Does anyone have any other ideas on what I can do to prevent this? Any tile that is supposed to be rendered after the body (ie the footer) is not rendered because the stream is closed. Any help would be much appreciated... MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 1:52 PM To: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Could this be a defect? https://issues.apache.org/struts/browse/WW-1385 -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 1:25 PM To: Martin Gainty Cc: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Hmmm... while this approach displays the page OK, I get the error below in my JBoss console when executing the action. Is this something I need to prevent with some sort of page directive? 2008-03-06 13:14:11,470 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DataCa ll].[jsp]] Servlet.service() for servlet jsp threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:20 4) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1 15) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1 86) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF actoryImpl.java:117) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm pl.java:76) at org.apache.jsp.fragments.root_jsp._jspService(root_jsp.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:373) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:654) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio nDispatcher.java:445) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:379) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:292) at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(Serv letTilesRequestContext.java:198) at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Ser vletTilesRequestContext.java:185) at org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesReques tContextWrapper.java:72) at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesR equestContext.java:86) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:419) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:370) at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:10 4) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu pport.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:348) -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 9:51 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Michael- remembering our academic coursework teaches Not(Not condition) evaluates positive be sure to set ignoreContextParams="false" as in I would encourage you to read Dave's article on using ResultTypes at http://struts.apache.org/2.x/docs/result-types.html MG - Original Message - From: "Griffith, Michael *" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, March 06, 2008 10:16 AM Subject: RE: How can I combine a result (tiles + xslt)? Hi Wes, Thanks for the reply. The s:action tag seems to work. I have a tiles action that is the actual URL that the user would navigate to, and in the JSP fragment that is the body tile, I am using the s:action to invoke the XSLT action and return the HTML fragment for the body. Thanks so much for pointing this out, I was not aware of this tag. Cheers! MG -Original Message- From: Wes Wannemacher [mailto:[EMA
RE: How can I combine a result (tiles + xslt)?
Could this be a defect? https://issues.apache.org/struts/browse/WW-1385 -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 1:25 PM To: Martin Gainty Cc: Struts Users Mailing List Subject: RE: How can I combine a result (tiles + xslt)? Hmmm... while this approach displays the page OK, I get the error below in my JBoss console when executing the action. Is this something I need to prevent with some sort of page directive? 2008-03-06 13:14:11,470 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DataCa ll].[jsp]] Servlet.service() for servlet jsp threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:20 4) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1 15) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1 86) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF actoryImpl.java:117) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm pl.java:76) at org.apache.jsp.fragments.root_jsp._jspService(root_jsp.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:373) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:654) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio nDispatcher.java:445) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:379) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:292) at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(Serv letTilesRequestContext.java:198) at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Ser vletTilesRequestContext.java:185) at org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesReques tContextWrapper.java:72) at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesR equestContext.java:86) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:419) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:370) at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:10 4) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu pport.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:348) -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 9:51 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Michael- remembering our academic coursework teaches Not(Not condition) evaluates positive be sure to set ignoreContextParams="false" as in I would encourage you to read Dave's article on using ResultTypes at http://struts.apache.org/2.x/docs/result-types.html MG - Original Message - From: "Griffith, Michael *" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, March 06, 2008 10:16 AM Subject: RE: How can I combine a result (tiles + xslt)? Hi Wes, Thanks for the reply. The s:action tag seems to work. I have a tiles action that is the actual URL that the user would navigate to, and in the JSP fragment that is the body tile, I am using the s:action to invoke the XSLT action and return the HTML fragment for the body. Thanks so much for pointing this out, I was not aware of this tag. Cheers! MG -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 4:49 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? On Wed, 2008-03-05 at 17:18 -0500, Griffith, Michael * wrote: [snip] > > > Is this a good application for writing my own interceptor for? You would want to write your own "Result Type" for this. Writing your own results is not as well documented as writing your own interceptors, but since you are combining the functionality of two built-in result types, it may be "pretty simple." Another possible choice w
RE: How can I combine a result (tiles + xslt)?
Hmmm... while this approach displays the page OK, I get the error below in my JBoss console when executing the action. Is this something I need to prevent with some sort of page directive? 2008-03-06 13:14:11,470 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/DataCa ll].[jsp]] Servlet.service() for servlet jsp threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:20 4) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:1 15) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:1 86) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspF actoryImpl.java:117) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryIm pl.java:76) at org.apache.jsp.fragments.root_jsp._jspService(root_jsp.java:106) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:373) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:654) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio nDispatcher.java:445) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:379) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:292) at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(Serv letTilesRequestContext.java:198) at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(Ser vletTilesRequestContext.java:185) at org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesReques tContextWrapper.java:72) at org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesR equestContext.java:86) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:419) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.jav a:370) at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:10 4) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSu pport.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:348) -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2008 9:51 AM To: Griffith, Michael * Cc: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? Michael- remembering our academic coursework teaches Not(Not condition) evaluates positive be sure to set ignoreContextParams="false" as in I would encourage you to read Dave's article on using ResultTypes at http://struts.apache.org/2.x/docs/result-types.html MG - Original Message - From: "Griffith, Michael *" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, March 06, 2008 10:16 AM Subject: RE: How can I combine a result (tiles + xslt)? Hi Wes, Thanks for the reply. The s:action tag seems to work. I have a tiles action that is the actual URL that the user would navigate to, and in the JSP fragment that is the body tile, I am using the s:action to invoke the XSLT action and return the HTML fragment for the body. Thanks so much for pointing this out, I was not aware of this tag. Cheers! MG -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 4:49 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? On Wed, 2008-03-05 at 17:18 -0500, Griffith, Michael * wrote: [snip] > > > Is this a good application for writing my own interceptor for? You would want to write your own "Result Type" for this. Writing your own results is not as well documented as writing your own interceptors, but since you are combining the functionality of two built-in result types, it may be "pretty simple." Another possible choice would be to use the s:action tag with executeResult set to true... http://struts.apache.org/2.x/docs/action.html Then, have one action that uses a tiles result, but in that result, have the s:action call the action which will render the xslt result. -Wes
RE: How can I combine a result (tiles + xslt)?
Hi Wes, Thanks for the reply. The s:action tag seems to work. I have a tiles action that is the actual URL that the user would navigate to, and in the JSP fragment that is the body tile, I am using the s:action to invoke the XSLT action and return the HTML fragment for the body. Thanks so much for pointing this out, I was not aware of this tag. Cheers! MG -Original Message- From: Wes Wannemacher [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 4:49 PM To: Struts Users Mailing List Subject: Re: How can I combine a result (tiles + xslt)? On Wed, 2008-03-05 at 17:18 -0500, Griffith, Michael * wrote: [snip] > > > Is this a good application for writing my own interceptor for? You would want to write your own "Result Type" for this. Writing your own results is not as well documented as writing your own interceptors, but since you are combining the functionality of two built-in result types, it may be "pretty simple." Another possible choice would be to use the s:action tag with executeResult set to true... http://struts.apache.org/2.x/docs/action.html Then, have one action that uses a tiles result, but in that result, have the s:action call the action which will render the xslt result. -Wes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I combine a result (tiles + xslt)?
Hi, Can anyone advise me on the best way to approach this problem? I have a Struts2 application using Tiles 2 for UI. I have a page where the body of my tiles composition needs to be generated dynamically from XSLT. I want to transform XML into HTML tags including a form and inputs, which would be dynamically generated from my action class. I checked out the XSLT result type, but if I go that route, it appears I can't use a tiles definition. What I am looking for is something like -- tile --- | x | x | tile | x | x | x -- tile --- Is this a good application for writing my own interceptor for? Any help would be much appreciated. MG
RE: AjaxTag 1.3 support?
Musachy, This is the actual response from the action when I invoke it from the browser: "{\"questions\":{\"420\":\"Is your Java Application a ME, SE or EE application?\",\"440\":\"If your Java Application is an SE application does it use Java Web Start?\",\"450\":\"If your Java Application is a Java Web Application, list the application server used for production\",\"490\":\"List any Java Web Services Technologies Used\",\"500\":\"List any Java Web Application Technologies Used for presentation\",\"510\":\"List any Java EE Technologies used in your application\"}}" I am building the JSON string and returning it from the action... private static final Character QUOTE= '"'; private static final String DELIM= ":"; private static final String COMMA=","; private static final String OPEN_BRACE="{"; private static final String CLOSE_BRACE="}"; StrinBuffer sb= new StringBuffer(); StringBuffer sb= new StringBuffer(); sb.append(OPEN_BRACE).append(QUOTE).append("questions").append(QUOTE); sb.append(DELIM).append(OPEN_BRACE); for (Question question : list) { sb.append(QUOTE).append(question.getId().toString()).append(QUOTE).appen d(DELIM).append(QUOTE).append(question.getText()).append(QUOTE).append(C OMMA); } ... The String actually looks like this before its serialized by the json result: {"questions":{"420":"Is your Java Application a ME, SE or EE application?","440":"If your Java Application is an SE application does it use Java Web Start?","450":"If your Java Application is a Java Web Application, list the application server used for production","490":"List any Java Web Services Technologies Used","500":"List any Java Web Application Technologies Used for presentation","510":"List any Java EE Technologies used in your application"}} -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 1:20 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Oh I am sorry about that! (doh) Do you see the quoutes escaped in firebug or something? As far as I remember the plugin doesnt escape the quoutes. If you put the url in your browser you should see the generated json as it actually is. musachy On Feb 5, 2008 2:12 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Musachy, > > Huh? That can't be right... > > First of all, the document says it wraps the JSON result in /* ... */ > comments, it doesn't say anything about escaping quotes. > > Second, the default value is false ;-) Adding this to the result > configuration did nothing to my result. This seems like a bug. > > MG > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, February 05, 2008 12:14 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > add: > > false > > to the result. See the section "Wrap with Comments" here: > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html > > musachy > > On Feb 5, 2008 12:58 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Musachy, > > > > I've looked over the documentation, and looked in the JSONWriter class > > -- and it is not obvious to me how to configure this plugin setting. > > How is it done? > > > > MG > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, February 05, 2008 11:23 AM > > To: Struts Users Mailing List > > > > Subject: Re: AjaxTag 1.3 support? > > > > Don't give up so easily :). That is just a setting on the json plugin > > to prevent cross site scripting, and can be disabled. > > > > musachy > > > > On Feb 5, 2008 11:27 AM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Well, to answer my own question -- the answer is no. The JSON result > > > serialization process escapes quotation marks, so my response that > > > looked like this before serialization: > > > > > > {"questions":{"420":"Is your Java Application a ME, SE or EE > > > application?","440":"If your Java Application is an SE application > > does > > > it use Java Web Start?","450":"If your Java Application is a Java > Web > > > Application, list the application server us
RE: AjaxTag 1.3 support?
Musachy, Huh? That can't be right... First of all, the document says it wraps the JSON result in /* ... */ comments, it doesn't say anything about escaping quotes. Second, the default value is false ;-) Adding this to the result configuration did nothing to my result. This seems like a bug. MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 12:14 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? add: false to the result. See the section "Wrap with Comments" here: http://cwiki.apache.org/S2PLUGINS/json-plugin.html musachy On Feb 5, 2008 12:58 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Musachy, > > I've looked over the documentation, and looked in the JSONWriter class > -- and it is not obvious to me how to configure this plugin setting. > How is it done? > > MG > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 05, 2008 11:23 AM > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > Don't give up so easily :). That is just a setting on the json plugin > to prevent cross site scripting, and can be disabled. > > musachy > > On Feb 5, 2008 11:27 AM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Well, to answer my own question -- the answer is no. The JSON result > > serialization process escapes quotation marks, so my response that > > looked like this before serialization: > > > > {"questions":{"420":"Is your Java Application a ME, SE or EE > > application?","440":"If your Java Application is an SE application > does > > it use Java Web Start?","450":"If your Java Application is a Java Web > > Application, list the application server used for > > production","490":"List any Java Web Services Technologies > > Used","500":"List any Java Web Application Technologies Used for > > presentation","510":"List any Java EE Technologies used in your > > application"}} > > > > Looks like this after serialization: > > > > "{\"questions\":{\"420\":\"Is your Java Application a ME, SE or EE > > application?\",\"440\":\"If your Java Application is an SE application > > does it use Java Web Start?\",\"450\":\"If your Java Application is a > > Java Web Application, list the application server used for > > production\",\"490\":\"List any Java Web Services Technologies > > Used\",\"500\":\"List any Java Web Application Technologies Used for > > presentation\",\"510\":\"List any Java EE Technologies used in your > > application\"}}" > > > > Making it unrecognizable to the autocompleter. This is pretty > > frustrating to me. Maybe I am expecting this to do something that it > was > > never designed to do. My end goal was to be able to evaluate the ID of > > the question that the user selected from the autocompleter. > > > > I'm giving up this path and looking elsewhere. Thanks to everyone > that > > replied to my question and tried to help me. > > > > MG > > > > > > -Original Message- > > From: Griffith, Michael * [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, February 05, 2008 8:32 AM > > To: Struts Users Mailing List > > Subject: RE: AjaxTag 1.3 support? > > > > Musachy, > > > > I can't seem to create the right blend of Entity objects/list/maps to > > allow the JSON plug in to serialize this response for me. If I create > > the string below using a loop, can I return it from the JSON plug in > > without the plug in doing anything further to it? > > > > In other words, does the plug in look at what it is trying to > serialize > > and say, "Hey this is already valid JSON, I don't need to do anything > to > > it..." or will it try to add additional info to the string returned? > > > > I'm guessing the shortest path for me is to just create the string in > my > > own serialization loop, but I don't want to confuse the plug in -- if > > that makes any sense. > > > > MG > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 6:30 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > Right on. > > > > On Feb 4, 2008 6:45 PM, Grif
RE: AjaxTag 1.3 support?
Musachy, I've looked over the documentation, and looked in the JSONWriter class -- and it is not obvious to me how to configure this plugin setting. How is it done? MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 11:23 AM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Don't give up so easily :). That is just a setting on the json plugin to prevent cross site scripting, and can be disabled. musachy On Feb 5, 2008 11:27 AM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Well, to answer my own question -- the answer is no. The JSON result > serialization process escapes quotation marks, so my response that > looked like this before serialization: > > {"questions":{"420":"Is your Java Application a ME, SE or EE > application?","440":"If your Java Application is an SE application does > it use Java Web Start?","450":"If your Java Application is a Java Web > Application, list the application server used for > production","490":"List any Java Web Services Technologies > Used","500":"List any Java Web Application Technologies Used for > presentation","510":"List any Java EE Technologies used in your > application"}} > > Looks like this after serialization: > > "{\"questions\":{\"420\":\"Is your Java Application a ME, SE or EE > application?\",\"440\":\"If your Java Application is an SE application > does it use Java Web Start?\",\"450\":\"If your Java Application is a > Java Web Application, list the application server used for > production\",\"490\":\"List any Java Web Services Technologies > Used\",\"500\":\"List any Java Web Application Technologies Used for > presentation\",\"510\":\"List any Java EE Technologies used in your > application\"}}" > > Making it unrecognizable to the autocompleter. This is pretty > frustrating to me. Maybe I am expecting this to do something that it was > never designed to do. My end goal was to be able to evaluate the ID of > the question that the user selected from the autocompleter. > > I'm giving up this path and looking elsewhere. Thanks to everyone that > replied to my question and tried to help me. > > MG > > > -Original Message- > From: Griffith, Michael * [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 05, 2008 8:32 AM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > Musachy, > > I can't seem to create the right blend of Entity objects/list/maps to > allow the JSON plug in to serialize this response for me. If I create > the string below using a loop, can I return it from the JSON plug in > without the plug in doing anything further to it? > > In other words, does the plug in look at what it is trying to serialize > and say, "Hey this is already valid JSON, I don't need to do anything to > it..." or will it try to add additional info to the string returned? > > I'm guessing the shortest path for me is to just create the string in my > own serialization loop, but I don't want to confuse the plug in -- if > that makes any sense. > > MG > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 6:30 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > Right on. > > On Feb 4, 2008 6:45 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Dave, > > > > I think the bigger problem is the JSON that is returned, while it may > be > > valid, it not in the right structure expected. I should be generating > > JSON like this: > > > > {"questions":{"420":"Is your Java Application a ME, SE or EE > > application?","440":"If your Java Application is an SE application > does > > it use Java Web Start?"}} > > > > The [] brackets seem to be ignored by the parser. > > > > -Original Message- > > From: Dave Newton [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 5:34 PM > > To: Struts Users Mailing List > > Subject: RE: AjaxTag 1.3 support? > > > > ... > > > > > > That's probably an issue. > > > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > Yea, I think so -- I copied and pasted this from the log > > file/console... > > > > > > From: Dave Newton [mailto:[EMAIL PROTECTED] >
RE: AjaxTag 1.3 support?
Well, to answer my own question -- the answer is no. The JSON result serialization process escapes quotation marks, so my response that looked like this before serialization: {"questions":{"420":"Is your Java Application a ME, SE or EE application?","440":"If your Java Application is an SE application does it use Java Web Start?","450":"If your Java Application is a Java Web Application, list the application server used for production","490":"List any Java Web Services Technologies Used","500":"List any Java Web Application Technologies Used for presentation","510":"List any Java EE Technologies used in your application"}} Looks like this after serialization: "{\"questions\":{\"420\":\"Is your Java Application a ME, SE or EE application?\",\"440\":\"If your Java Application is an SE application does it use Java Web Start?\",\"450\":\"If your Java Application is a Java Web Application, list the application server used for production\",\"490\":\"List any Java Web Services Technologies Used\",\"500\":\"List any Java Web Application Technologies Used for presentation\",\"510\":\"List any Java EE Technologies used in your application\"}}" Making it unrecognizable to the autocompleter. This is pretty frustrating to me. Maybe I am expecting this to do something that it was never designed to do. My end goal was to be able to evaluate the ID of the question that the user selected from the autocompleter. I'm giving up this path and looking elsewhere. Thanks to everyone that replied to my question and tried to help me. MG -Original Message- From: Griffith, Michael * [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 05, 2008 8:32 AM To: Struts Users Mailing List Subject: RE: AjaxTag 1.3 support? Musachy, I can't seem to create the right blend of Entity objects/list/maps to allow the JSON plug in to serialize this response for me. If I create the string below using a loop, can I return it from the JSON plug in without the plug in doing anything further to it? In other words, does the plug in look at what it is trying to serialize and say, "Hey this is already valid JSON, I don't need to do anything to it..." or will it try to add additional info to the string returned? I'm guessing the shortest path for me is to just create the string in my own serialization loop, but I don't want to confuse the plug in -- if that makes any sense. MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 6:30 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Right on. On Feb 4, 2008 6:45 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Dave, > > I think the bigger problem is the JSON that is returned, while it may be > valid, it not in the right structure expected. I should be generating > JSON like this: > > {"questions":{"420":"Is your Java Application a ME, SE or EE > application?","440":"If your Java Application is an SE application does > it use Java Web Start?"}} > > The [] brackets seem to be ignored by the parser. > > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 5:34 PM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > ... > > > That's probably an issue. > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > Yea, I think so -- I copied and pasted this from the log > file/console... > > > > From: Dave Newton [mailto:[EMAIL PROTECTED] > > > > Is it generating those brackets around your JSON? > > > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > > > Musachy, > > > > > > Thanks for your many replies... Does this JSON look like the right > > > format? As far as I can tell, it matches your snippet below -- but I > > get > > > the same dojo parting error. > > > > > > [{"questions":{"420":"Is your Java Application a ME, SE or EE > > > application?"}},{"questions":{"440":"If your Java Application is an > SE > > > application does it use Java Web Start?"}},{"questions":{"450":"If > > your > > > Java Application is a Java Web Application, list the application > > server > > > used for production"}}] > > > > > > -Original Message- > > > From: Musachy Barroso [mailto:[EMAIL PRO
RE: AjaxTag 1.3 support?
Musachy, I can't seem to create the right blend of Entity objects/list/maps to allow the JSON plug in to serialize this response for me. If I create the string below using a loop, can I return it from the JSON plug in without the plug in doing anything further to it? In other words, does the plug in look at what it is trying to serialize and say, "Hey this is already valid JSON, I don't need to do anything to it..." or will it try to add additional info to the string returned? I'm guessing the shortest path for me is to just create the string in my own serialization loop, but I don't want to confuse the plug in -- if that makes any sense. MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 6:30 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Right on. On Feb 4, 2008 6:45 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Dave, > > I think the bigger problem is the JSON that is returned, while it may be > valid, it not in the right structure expected. I should be generating > JSON like this: > > {"questions":{"420":"Is your Java Application a ME, SE or EE > application?","440":"If your Java Application is an SE application does > it use Java Web Start?"}} > > The [] brackets seem to be ignored by the parser. > > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 5:34 PM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > ... > > > That's probably an issue. > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > Yea, I think so -- I copied and pasted this from the log > file/console... > > > > From: Dave Newton [mailto:[EMAIL PROTECTED] > > > > Is it generating those brackets around your JSON? > > > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > > > Musachy, > > > > > > Thanks for your many replies... Does this JSON look like the right > > > format? As far as I can tell, it matches your snippet below -- but I > > get > > > the same dojo parting error. > > > > > > [{"questions":{"420":"Is your Java Application a ME, SE or EE > > > application?"}},{"questions":{"440":"If your Java Application is an > SE > > > application does it use Java Web Start?"}},{"questions":{"450":"If > > your > > > Java Application is a Java Web Application, list the application > > server > > > used for production"}}] > > > > > > -Original Message- > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > > Sent: Monday, February 04, 2008 3:52 PM > > > To: Struts Users Mailing List > > > Subject: Re: AjaxTag 1.3 support? > > > > > > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the > > > easiest way to generate the json is to have an object with a map > field > > > that matches the name of "dataFieldName" in the autocompleter tag: > > > > > > class QuestionJson { > > > private Map questions; > > > > > > } > > > > > > public QuestionJson getQuestionJson() { > > > Question q= ... [from my list] > > >Map m = new HaswhMap(); > > >m.put("Key1", q.getQuestion1()); > > >m.put("Key2", q.getQuestion2()); > > >return new QuestionJson(m); > > > } > > > > > > > > > > > > that will generate something like: > > > > > > { > > > "questions": { > > > "Key1" : "Question 1", > > > "Key2" : "Question 2", > > > } > > > } > > > > > > //that's the idea, but I typed out of what I remember which is often > > not > > > good :) > > > > > > musachy > > > > > > On Feb 4, 2008 4:34 PM, Griffith, Michael * > > > <[EMAIL PROTECTED]> wrote: > > > > Musachy, > > > > > > > > I'm still not getting it... > > > > I am now serializing a list of maps with the entity id and text I > > > > want... > > > > > > > > Map m= new HashMap(); > > > > Question q= ... [from my list] > > > > m.put("id", q.getId().toString()); > > > > m.put("text", q.getText()); > > > &g
RE: AjaxTag 1.3 support?
Dave, I think the bigger problem is the JSON that is returned, while it may be valid, it not in the right structure expected. I should be generating JSON like this: {"questions":{"420":"Is your Java Application a ME, SE or EE application?","440":"If your Java Application is an SE application does it use Java Web Start?"}} The [] brackets seem to be ignored by the parser. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 5:34 PM To: Struts Users Mailing List Subject: RE: AjaxTag 1.3 support? ... That's probably an issue. --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > Yea, I think so -- I copied and pasted this from the log file/console... > > From: Dave Newton [mailto:[EMAIL PROTECTED] > > Is it generating those brackets around your JSON? > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > Musachy, > > > > Thanks for your many replies... Does this JSON look like the right > > format? As far as I can tell, it matches your snippet below -- but I > get > > the same dojo parting error. > > > > [{"questions":{"420":"Is your Java Application a ME, SE or EE > > application?"}},{"questions":{"440":"If your Java Application is an SE > > application does it use Java Web Start?"}},{"questions":{"450":"If > your > > Java Application is a Java Web Application, list the application > server > > used for production"}}] > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 3:52 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the > > easiest way to generate the json is to have an object with a map field > > that matches the name of "dataFieldName" in the autocompleter tag: > > > > class QuestionJson { > > private Map questions; > > > > } > > > > public QuestionJson getQuestionJson() { > > Question q= ... [from my list] > >Map m = new HaswhMap(); > >m.put("Key1", q.getQuestion1()); > >m.put("Key2", q.getQuestion2()); > >return new QuestionJson(m); > > } > > > > > > > > that will generate something like: > > > > { > > "questions": { > > "Key1" : "Question 1", > > "Key2" : "Question 2", > > } > > } > > > > //that's the idea, but I typed out of what I remember which is often > not > > good :) > > > > musachy > > > > On Feb 4, 2008 4:34 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Musachy, > > > > > > I'm still not getting it... > > > I am now serializing a list of maps with the entity id and text I > > > want... > > > > > > Map m= new HashMap(); > > > Question q= ... [from my list] > > > m.put("id", q.getId().toString()); > > > m.put("text", q.getText()); > > > newList.add(m); > > > > > > And my JSON result looks: > > > > > > [JSON][{"text":"Is your Java Application a ME, SE or EE > > > application?","id":"420"},{"text":"If your Java Application is an SE > > > application does it use Java Web Start?","id":"440"},{"text":"If > your > > > Java Application is a Java Web Application, list the application > > server > > > used for production","id":"450"},{"text":"List any Java Web Services > > > Technologies Used","id":"490"},{"text":"List any Java Web > Application > > > Technologies Used for presentation","id":"500"},{"text":"List any > Java > > > EE Technologies used in your application","id":"510"}] > > > > > > I added the @JSON annotation as such: > > > > > > @JSON(name="question") > > > public List> getNewList(){ > > > return newList; > > > } > > > > > > But it appears to be ignored. > > > > > > MG > > > > > > -Original Message- > > > From: Mus
RE: AjaxTag 1.3 support?
Dave, Check out this JSON parser: http://braincast.nl/samples/jsoneditor/ Paste in the snippet below and it parses fine. BTW, the brackets are returned from the response. Without the brackets, the snippet doesn't seem to be correct. [{"questions":{"420":"Is your Java Application a ME, SE or EE application?"}},{"questions":{"440":"If your Java Application is an SE application does it use Java Web Start?"}},{"questions":{"450":"If your Java Application is a Java Web Application, list the application server used for production"}},{"questions":{"490":"List any Java Web Services Technologies Used"}},{"questions":{"500":"List any Java Web Application Technologies Used for presentation"}},{"questions":{"510":"List any Java EE Technologies used in your application"}}] -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 5:34 PM To: Struts Users Mailing List Subject: RE: AjaxTag 1.3 support? ... That's probably an issue. --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > Yea, I think so -- I copied and pasted this from the log file/console... > > From: Dave Newton [mailto:[EMAIL PROTECTED] > > Is it generating those brackets around your JSON? > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > Musachy, > > > > Thanks for your many replies... Does this JSON look like the right > > format? As far as I can tell, it matches your snippet below -- but I > get > > the same dojo parting error. > > > > [{"questions":{"420":"Is your Java Application a ME, SE or EE > > application?"}},{"questions":{"440":"If your Java Application is an SE > > application does it use Java Web Start?"}},{"questions":{"450":"If > your > > Java Application is a Java Web Application, list the application > server > > used for production"}}] > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 3:52 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the > > easiest way to generate the json is to have an object with a map field > > that matches the name of "dataFieldName" in the autocompleter tag: > > > > class QuestionJson { > > private Map questions; > > > > } > > > > public QuestionJson getQuestionJson() { > > Question q= ... [from my list] > >Map m = new HaswhMap(); > >m.put("Key1", q.getQuestion1()); > >m.put("Key2", q.getQuestion2()); > >return new QuestionJson(m); > > } > > > > > > > > that will generate something like: > > > > { > > "questions": { > > "Key1" : "Question 1", > > "Key2" : "Question 2", > > } > > } > > > > //that's the idea, but I typed out of what I remember which is often > not > > good :) > > > > musachy > > > > On Feb 4, 2008 4:34 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Musachy, > > > > > > I'm still not getting it... > > > I am now serializing a list of maps with the entity id and text I > > > want... > > > > > > Map m= new HashMap(); > > > Question q= ... [from my list] > > > m.put("id", q.getId().toString()); > > > m.put("text", q.getText()); > > > newList.add(m); > > > > > > And my JSON result looks: > > > > > > [JSON][{"text":"Is your Java Application a ME, SE or EE > > > application?","id":"420"},{"text":"If your Java Application is an SE > > > application does it use Java Web Start?","id":"440"},{"text":"If > your > > > Java Application is a Java Web Application, list the application > > server > > > used for production","id":"450"},{"text":"List any Java Web Services > > > Technologies Used","id":"490"},{"text":"List any Java Web > Application > > > Technologies Used for presentation","id":"500"},{"text":"List any > Java &g
RE: AjaxTag 1.3 support?
Yea, I think so -- I copied and pasted this from the log file/console... -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 5:02 PM To: Struts Users Mailing List Subject: RE: AjaxTag 1.3 support? Is it generating those brackets around your JSON? Dave --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > Musachy, > > Thanks for your many replies... Does this JSON look like the right > format? As far as I can tell, it matches your snippet below -- but I get > the same dojo parting error. > > [{"questions":{"420":"Is your Java Application a ME, SE or EE > application?"}},{"questions":{"440":"If your Java Application is an SE > application does it use Java Web Start?"}},{"questions":{"450":"If your > Java Application is a Java Web Application, list the application server > used for production"}}] > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 3:52 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the > easiest way to generate the json is to have an object with a map field > that matches the name of "dataFieldName" in the autocompleter tag: > > class QuestionJson { > private Map questions; > > } > > public QuestionJson getQuestionJson() { > Question q= ... [from my list] >Map m = new HaswhMap(); >m.put("Key1", q.getQuestion1()); >m.put("Key2", q.getQuestion2()); >return new QuestionJson(m); > } > > > > that will generate something like: > > { > "questions": { > "Key1" : "Question 1", > "Key2" : "Question 2", > } > } > > //that's the idea, but I typed out of what I remember which is often not > good :) > > musachy > > On Feb 4, 2008 4:34 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Musachy, > > > > I'm still not getting it... > > I am now serializing a list of maps with the entity id and text I > > want... > > > > Map m= new HashMap(); > > Question q= ... [from my list] > > m.put("id", q.getId().toString()); > > m.put("text", q.getText()); > > newList.add(m); > > > > And my JSON result looks: > > > > [JSON][{"text":"Is your Java Application a ME, SE or EE > > application?","id":"420"},{"text":"If your Java Application is an SE > > application does it use Java Web Start?","id":"440"},{"text":"If your > > Java Application is a Java Web Application, list the application > server > > used for production","id":"450"},{"text":"List any Java Web Services > > Technologies Used","id":"490"},{"text":"List any Java Web Application > > Technologies Used for presentation","id":"500"},{"text":"List any Java > > EE Technologies used in your application","id":"510"}] > > > > I added the @JSON annotation as such: > > > > @JSON(name="question") > > public List> getNewList(){ > > return newList; > > } > > > > But it appears to be ignored. > > > > MG > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > > > Sent: Monday, February 04, 2008 2:53 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > Take a look here: > > > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html > > > > musachy > > > > On Feb 4, 2008 3:43 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > So, if you have an array of Entity objects, in my case question: > > > > > > How can I produce? > > > { > > > "question" : [ > > > ["1","question 1 text..."], > > > ["2","question 2 text..."] > > > > > > ] > > > } > > > > > > -Original Message- > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > > Sent: Monday, February 04, 2008 2:37 PM > > > To: Struts Users Mailing List > > > Subject: Re: AjaxTag 1.3 support? > >
RE: AjaxTag 1.3 support?
Musachy, Thanks for your many replies... Does this JSON look like the right format? As far as I can tell, it matches your snippet below -- but I get the same dojo parting error. [{"questions":{"420":"Is your Java Application a ME, SE or EE application?"}},{"questions":{"440":"If your Java Application is an SE application does it use Java Web Start?"}},{"questions":{"450":"If your Java Application is a Java Web Application, list the application server used for production"}}] -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 3:52 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? The rule to use a map (simplest one) was added on 2.1, on 2.0.x the easiest way to generate the json is to have an object with a map field that matches the name of "dataFieldName" in the autocompleter tag: class QuestionJson { private Map questions; } public QuestionJson getQuestionJson() { Question q= ... [from my list] Map m = new HaswhMap(); m.put("Key1", q.getQuestion1()); m.put("Key2", q.getQuestion2()); return new QuestionJson(m); } that will generate something like: { "questions": { "Key1" : "Question 1", "Key2" : "Question 2", } } //that's the idea, but I typed out of what I remember which is often not good :) musachy On Feb 4, 2008 4:34 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Musachy, > > I'm still not getting it... > I am now serializing a list of maps with the entity id and text I > want... > > Map m= new HashMap(); > Question q= ... [from my list] > m.put("id", q.getId().toString()); > m.put("text", q.getText()); > newList.add(m); > > And my JSON result looks: > > [JSON][{"text":"Is your Java Application a ME, SE or EE > application?","id":"420"},{"text":"If your Java Application is an SE > application does it use Java Web Start?","id":"440"},{"text":"If your > Java Application is a Java Web Application, list the application server > used for production","id":"450"},{"text":"List any Java Web Services > Technologies Used","id":"490"},{"text":"List any Java Web Application > Technologies Used for presentation","id":"500"},{"text":"List any Java > EE Technologies used in your application","id":"510"}] > > I added the @JSON annotation as such: > > @JSON(name="question") > public List> getNewList(){ > return newList; > } > > But it appears to be ignored. > > MG > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 2:53 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > Take a look here: > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html > > musachy > > On Feb 4, 2008 3:43 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > So, if you have an array of Entity objects, in my case question: > > > > How can I produce? > > { > > "question" : [ > > ["1","question 1 text..."], > > ["2","question 2 text..."] > > > > ] > > } > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 2:37 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > yes, but the output will depend on what you feed the JSON result. > > > > musachy > > > > On Feb 4, 2008 3:20 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Musachy, > > > > > > I must have missed your point. Isn't the idea of using the JSON > > plug-in > > > so you don't have to iterate and create the list? If I have an array > > or > > > Entity objects or maps, isn't there a way that the plug-in will > create > > > the JSON specified below? > > > > > > MG > > > > > > -Original Message- > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > > Sent: Monday, February 04, 2008 1:56 PM > > > To: Struts Users Mailing List > > > Subject: Re: AjaxTag 1.3 support? > > > > > > > > > to use the dataFIeldName, you have to
RE: AjaxTag 1.3 support?
Musachy, Ok, I had a parameter set in the JSON plugin, that I think was effecting the serialization (root) ... I removed it and now my JSON looks like this: [JSON]{"question":[{"text":"Is your Java Application a ME, SE or EE application?","id":"420"},{"text":"If your Java Application is an SE application does it use Java Web Start?","id":"440"},{"text":"If your Java Application is a Java Web Application, list the application server used for production","id":"450"},{"text":"List any Java Web Services Technologies Used","id":"490"},{"text":"List any Java Web Application Technologies Used for presentation","id":"500"},{"text":"List any Java EE Technologies used in your application","id":"510"}]} My autocompleter looks like this: And I am still getting the JSON Parsing error: FATAL exception raised: TypeError: Value undefined (result of expression this.data[x][0].toLowerCase) is not object. What am I doing wrong? MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 2:53 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Take a look here: http://cwiki.apache.org/S2PLUGINS/json-plugin.html musachy On Feb 4, 2008 3:43 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > So, if you have an array of Entity objects, in my case question: > > How can I produce? > { > "question" : [ > ["1","question 1 text..."], > ["2","question 2 text..."] > > ] > } > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 2:37 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > yes, but the output will depend on what you feed the JSON result. > > musachy > > On Feb 4, 2008 3:20 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Musachy, > > > > I must have missed your point. Isn't the idea of using the JSON > plug-in > > so you don't have to iterate and create the list? If I have an array > or > > Entity objects or maps, isn't there a way that the plug-in will create > > the JSON specified below? > > > > MG > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 1:56 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > > > to use the dataFIeldName, you have to return something like: > > > > { > > "state" : [ > > ["Alabama","AL"], > > ["Alaska","AK"] > > ] > > } > > > > if you are using 2.1 check this link: > > > > > http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS > > criptRecipes-Autocompleter > > > > otherwise just an array of arrays should do: > > > > [ > > ["Alabama", "AL"], > > ["Alaska", "AK"] > > ] > > > > musachy > > > > On Feb 4, 2008 2:46 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Musachy > > > > > > Here is the autocompleter tag and the JSON returned... > > > > > > > > > > > value="/search/searchByText.action"/> > > > > > name="text" > > > dataFieldName="text" > > > loadOnTextChange="true" > > > indicator="indicator" > > > dropdownHeight="300" > > > cssStyle="width: 200px;" > > > searchType="substring" > > > autoComplete="false" > > > showDownArrow="false" > > > loadMinimumCount="3"/> > > > > > src="${pageContext.request.contextPath}/images/indicator.gif" > > > alt="Loading..." style="display:none"/> > > > > > > > > > [JSON][{"id":420,"questionType":{"declaringClass":"class > > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java > > > Application a ME, SE or EE > > > application?"},{"id":440,"qu
RE: AjaxTag 1.3 support?
Musachy, I'm still not getting it... I am now serializing a list of maps with the entity id and text I want... Map m= new HashMap(); Question q= ... [from my list] m.put("id", q.getId().toString()); m.put("text", q.getText()); newList.add(m); And my JSON result looks: [JSON][{"text":"Is your Java Application a ME, SE or EE application?","id":"420"},{"text":"If your Java Application is an SE application does it use Java Web Start?","id":"440"},{"text":"If your Java Application is a Java Web Application, list the application server used for production","id":"450"},{"text":"List any Java Web Services Technologies Used","id":"490"},{"text":"List any Java Web Application Technologies Used for presentation","id":"500"},{"text":"List any Java EE Technologies used in your application","id":"510"}] I added the @JSON annotation as such: @JSON(name="question") public List> getNewList(){ return newList; } But it appears to be ignored. MG -Original Message----- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 2:53 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? Take a look here: http://cwiki.apache.org/S2PLUGINS/json-plugin.html musachy On Feb 4, 2008 3:43 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > So, if you have an array of Entity objects, in my case question: > > How can I produce? > { > "question" : [ > ["1","question 1 text..."], > ["2","question 2 text..."] > > ] > } > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 2:37 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > yes, but the output will depend on what you feed the JSON result. > > musachy > > On Feb 4, 2008 3:20 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Musachy, > > > > I must have missed your point. Isn't the idea of using the JSON > plug-in > > so you don't have to iterate and create the list? If I have an array > or > > Entity objects or maps, isn't there a way that the plug-in will create > > the JSON specified below? > > > > MG > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 1:56 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > > > to use the dataFIeldName, you have to return something like: > > > > { > > "state" : [ > > ["Alabama","AL"], > > ["Alaska","AK"] > > ] > > } > > > > if you are using 2.1 check this link: > > > > > http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS > > criptRecipes-Autocompleter > > > > otherwise just an array of arrays should do: > > > > [ > > ["Alabama", "AL"], > > ["Alaska", "AK"] > > ] > > > > musachy > > > > On Feb 4, 2008 2:46 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Musachy > > > > > > Here is the autocompleter tag and the JSON returned... > > > > > > > > > > > value="/search/searchByText.action"/> > > > > > name="text" > > > dataFieldName="text" > > > loadOnTextChange="true" > > > indicator="indicator" > > > dropdownHeight="300" > > > cssStyle="width: 200px;" > > > searchType="substring" > > > autoComplete="false" > > > showDownArrow="false" > > > loadMinimumCount="3"/> > > > > > src="${pageContext.request.contextPath}/images/indicator.gif" > > > alt="Loading..." style="display:none"/> > > > > > > > > > [JSON][{"id":420,"questionType":{"declaringClass":"class > > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java > > > A
RE: AjaxTag 1.3 support?
So, if you have an array of Entity objects, in my case question: How can I produce? { "question" : [ ["1","question 1 text..."], ["2","question 2 text..."] ] } -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 2:37 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? yes, but the output will depend on what you feed the JSON result. musachy On Feb 4, 2008 3:20 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Musachy, > > I must have missed your point. Isn't the idea of using the JSON plug-in > so you don't have to iterate and create the list? If I have an array or > Entity objects or maps, isn't there a way that the plug-in will create > the JSON specified below? > > MG > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 1:56 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > > to use the dataFIeldName, you have to return something like: > > { > "state" : [ > ["Alabama","AL"], > ["Alaska","AK"] > ] > } > > if you are using 2.1 check this link: > > http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS > criptRecipes-Autocompleter > > otherwise just an array of arrays should do: > > [ > ["Alabama", "AL"], > ["Alaska", "AK"] > ] > > musachy > > On Feb 4, 2008 2:46 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Musachy > > > > Here is the autocompleter tag and the JSON returned... > > > > > > > value="/search/searchByText.action"/> > > > name="text" > > dataFieldName="text" > > loadOnTextChange="true" > > indicator="indicator" > > dropdownHeight="300" > > cssStyle="width: 200px;" > > searchType="substring" > > autoComplete="false" > > showDownArrow="false" > > loadMinimumCount="3"/> > > > src="${pageContext.request.contextPath}/images/indicator.gif" > > alt="Loading..." style="display:none"/> > > > > > > [JSON][{"id":420,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java > > Application a ME, SE or EE > > application?"},{"id":440,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java > > Application is an SE application does it use Java Web > > Start?"},{"id":450,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java > > Application is a Java Web Application, list the application server > used > > for production"},{"id":490,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web > > Services Technologies > > Used"},{"id":500,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web > > Application Technologies Used for > > presentation"},{"id":510,"questionType":{"declaringClass":"class > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE > > Technologies used in your application"}] > > > > > > -Original Message- > > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 1:22 PM > > To: Struts Users Mailing List > > Subject: Re: AjaxTag 1.3 support? > > > > funny thing is that now I remember the code(duh!), it is in the struts > > widget. It seems like the json is empty. Paste the section of your jsp > > with the autocompleter and the json that your action is returning. > > > > regards > > musachy > > > > On Feb 4, 2008 2:16 PM, Griffith, Michael * > > <[EMAIL PROTECTED]> wrote: > > > Jeromy, > > > > > > Thanks for
RE: AjaxTag 1.3 support?
Musachy, I must have missed your point. Isn't the idea of using the JSON plug-in so you don't have to iterate and create the list? If I have an array or Entity objects or maps, isn't there a way that the plug-in will create the JSON specified below? MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 1:56 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? to use the dataFIeldName, you have to return something like: { "state" : [ ["Alabama","AL"], ["Alaska","AK"] ] } if you are using 2.1 check this link: http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS criptRecipes-Autocompleter otherwise just an array of arrays should do: [ ["Alabama", "AL"], ["Alaska", "AK"] ] musachy On Feb 4, 2008 2:46 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Musachy > > Here is the autocompleter tag and the JSON returned... > > > value="/search/searchByText.action"/> > name="text" > dataFieldName="text" > loadOnTextChange="true" > indicator="indicator" > dropdownHeight="300" > cssStyle="width: 200px;" > searchType="substring" > autoComplete="false" > showDownArrow="false" > loadMinimumCount="3"/> > src="${pageContext.request.contextPath}/images/indicator.gif" > alt="Loading..." style="display:none"/> > > > [JSON][{"id":420,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java > Application a ME, SE or EE > application?"},{"id":440,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java > Application is an SE application does it use Java Web > Start?"},{"id":450,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java > Application is a Java Web Application, list the application server used > for production"},{"id":490,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web > Services Technologies > Used"},{"id":500,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web > Application Technologies Used for > presentation"},{"id":510,"questionType":{"declaringClass":"class > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE > Technologies used in your application"}] > > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 1:22 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > funny thing is that now I remember the code(duh!), it is in the struts > widget. It seems like the json is empty. Paste the section of your jsp > with the autocompleter and the json that your action is returning. > > regards > musachy > > On Feb 4, 2008 2:16 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: > > Jeromy, > > > > Thanks for your help. I was able to finally get the autocompleter to > > work with the example you provided. > > > > Strange behavior -- I can only get the autocompleter to work if the > list > > (array) is of the type String. If I try to return an array of my > Entity > > objects, or a Map I get the dojo error: > > > > FATAL exception raised: TypeError: Value undefined (result of > expression > > this.data[x][0].toLowerCase) is not object. > > > > I tried specifying the attribute dataField on the autocompleter, and > it > > didn't work either. > > > > I should be able to serialize the entity objects right? The JSON that > > was passed back to the browser looked like it serialized my objects > just > > fine. > > > > Again, thanks to all the people who replied to my question. > > > > MG > > > > > > -Original Message- > > From: Hodgins, Grant [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 04, 2008 12:31 PM >
RE: AjaxTag 1.3 support?
Musachy Here is the autocompleter tag and the JSON returned... [JSON][{"id":420,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java Application a ME, SE or EE application?"},{"id":440,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java Application is an SE application does it use Java Web Start?"},{"id":450,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java Application is a Java Web Application, list the application server used for production"},{"id":490,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web Services Technologies Used"},{"id":500,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web Application Technologies Used for presentation"},{"id":510,"questionType":{"declaringClass":"class gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE Technologies used in your application"}] -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 1:22 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? funny thing is that now I remember the code(duh!), it is in the struts widget. It seems like the json is empty. Paste the section of your jsp with the autocompleter and the json that your action is returning. regards musachy On Feb 4, 2008 2:16 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Jeromy, > > Thanks for your help. I was able to finally get the autocompleter to > work with the example you provided. > > Strange behavior -- I can only get the autocompleter to work if the list > (array) is of the type String. If I try to return an array of my Entity > objects, or a Map I get the dojo error: > > FATAL exception raised: TypeError: Value undefined (result of expression > this.data[x][0].toLowerCase) is not object. > > I tried specifying the attribute dataField on the autocompleter, and it > didn't work either. > > I should be able to serialize the entity objects right? The JSON that > was passed back to the browser looked like it serialized my objects just > fine. > > Again, thanks to all the people who replied to my question. > > MG > > > -Original Message- > From: Hodgins, Grant [mailto:[EMAIL PROTECTED] > Sent: Monday, February 04, 2008 12:31 PM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > Thanks for the insight Jeremy. > > I totally agree that writing to the response is not an elegant solution. > But sometimes we choose quick solutions that work when a project > deadline looms. > > The reason I initially chose AjaxTags was that the example for the > autocompleter combo in Struts Showcase didn't work in IE6(the last one): > http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/ > > Grant > > > > From: Jeromy Evans [mailto:[EMAIL PROTECTED] > Sent: Fri 2/1/2008 4:35 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > > > My 2c: > I think this is a bad solution and shouldn't be encouraged. It's > marginally better than writing a custom servlet. > > Struts2 ResultTypes [1] are designed specifically for controlling the > type and content of results from actions to separate the view from the > model, even if the "view" is XML data. Accessing the response and > writing to it directly isn't necessary except in the rarest of cases. > > For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType) > [2] will serialize your action into JSON automatically > The XSL ResultType will serialize your action into XML if you provide a > stylesheet [3] > The REST plugin includes code to serialize your action into XML using > Xstream. [4] > > My point is, your action can setup a model (eg. a javabean matching the > model expected by AjaxTag), and the ResultType can serialize it to the > output stream. In this case I'd create a custom result type using > XStream, but you could also use a XML template in a Tile, or have a > ResultType that accesses the instance created by AjaxXMLBuilder. > > [1] http://struts.apache.org/2.0.11/docs/result-types.html > [2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html > [3] http://struts.apache.org/2.0
RE: AjaxTag 1.3 support?
Jeromy, Thanks for your help. I was able to finally get the autocompleter to work with the example you provided. Strange behavior -- I can only get the autocompleter to work if the list (array) is of the type String. If I try to return an array of my Entity objects, or a Map I get the dojo error: FATAL exception raised: TypeError: Value undefined (result of expression this.data[x][0].toLowerCase) is not object. I tried specifying the attribute dataField on the autocompleter, and it didn't work either. I should be able to serialize the entity objects right? The JSON that was passed back to the browser looked like it serialized my objects just fine. Again, thanks to all the people who replied to my question. MG -Original Message- From: Hodgins, Grant [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 12:31 PM To: Struts Users Mailing List Subject: RE: AjaxTag 1.3 support? Thanks for the insight Jeremy. I totally agree that writing to the response is not an elegant solution. But sometimes we choose quick solutions that work when a project deadline looms. The reason I initially chose AjaxTags was that the example for the autocompleter combo in Struts Showcase didn't work in IE6(the last one): http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/ Grant From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Fri 2/1/2008 4:35 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? My 2c: I think this is a bad solution and shouldn't be encouraged. It's marginally better than writing a custom servlet. Struts2 ResultTypes [1] are designed specifically for controlling the type and content of results from actions to separate the view from the model, even if the "view" is XML data. Accessing the response and writing to it directly isn't necessary except in the rarest of cases. For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType) [2] will serialize your action into JSON automatically The XSL ResultType will serialize your action into XML if you provide a stylesheet [3] The REST plugin includes code to serialize your action into XML using Xstream. [4] My point is, your action can setup a model (eg. a javabean matching the model expected by AjaxTag), and the ResultType can serialize it to the output stream. In this case I'd create a custom result type using XStream, but you could also use a XML template in a Tile, or have a ResultType that accesses the instance created by AjaxXMLBuilder. [1] http://struts.apache.org/2.0.11/docs/result-types.html [2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html [3] http://struts.apache.org/2.0.11/docs/xsl-result.html [4] http://xstream.codehaus.org/ [5] http://struts.apache.org/2.0.11/docs/result-configuration.html regards Jeromy Evans Hodgins, Grant wrote: > I was able to get the AjaxTags stuff working (with Tiles2 although I don't think that matters at all). > > As Dave said, your action should return null since you want the action to return XML in the response. > > Instead, in addition to returning a null result, I simply wrote the xml to the response: > > AjaxXmlBuilder xml = new AjaxXmlBuilder(); > > ... build your xml response ... > > response.setContentType("text/xml; charset=iso-8859-1"); > response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate"); > response.addHeader("Cache-Control", "post-check=0, pre-check=0"); > response.setHeader("Pragma", "no-cache"); > > PrintWriter pw = response.getWriter(); > pw.write(xml.toString()); > pw.close(); > > Hope this helps. > > Grant > > > > From: Griffith, Michael * [mailto:[EMAIL PROTECTED] > Sent: Fri 2/1/2008 3:48 PM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > > > Dave, > > Thanks for the reply. I guess I should have said freemarker instead of > sitemesh...? At any rate, when the docs don't match the release, it's a > bad thing. > > I shouldn't need to do any of this should I? Can you point me at a > simple, minimalist example of the tag? > > mg > > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Friday, February 01, 2008 5:42 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > >> public class QuestionAction extends BaseAction implements >> ModelDriven, Preparable, ServletRequestAware, >> ServletResponseAware { >> public String getSearchTerm() throws Exception { >> System.out.println(" Question Search Term:" + qt); >
RE: AjaxTag 1.3 support?
Actually, I thought I would post the entire debug message here, in case that is helpful: DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not locate widget implementation for "html" in "html.widget" registered to namespace "html". Developers must specify correct namespaces for all non-Dojo widgets -- will be removed in version: 0.5 DEBUG: dojo.widget.Parse: error:TypeError: Value [object Object] (result of expression impl) is not a constructor. Cannot be used with new. FATAL exception raised: TypeError: Value undefined (result of expression this.data[x][0].toLowerCase) is not object. MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 11:06 AM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? I think that error is coming from your jsp, not the JSON generation. Do you have "this.data[x][0].toLowerCase" somewhere? musachy On Feb 4, 2008 11:57 AM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Jeromy, > > Again, thanks for the reply. I appreciate your help! > > Following your example below, I can see the JSON result in the app > server console when the action called, but I get the following error in > the browser: > > FATAL exception raised: TypeError: Value undefined (result of expression > this.data[x][0].toLowerCase) is not object. > > What is this telling me? > > -- my Struts mapping: > namespace="/search"> > class="...QuestionSearchAction"> > > list > > > > > -- My Form: > > loadOnTextChange="true" loadMinimumCount="3"/> > > > -- My Action: > public class QuestionSearchAction extends BaseAction { > > /** > * > */ > private static final long serialVersionUID = > 1127012585409657094L; > > Question[] list; > private QuestionService questionService; > > public void setQuestionService(QuestionService questionService) > { > this.questionService = questionService; > } > > public String execute() { > List all= questionService.getQuestions(); > list= all.toArray( new Question[all.size()]); > return SUCCESS; > } > > public Question[] getList(){ > return list; > } > > } > > > Cheers! > mg > > -Original Message- > From: Jeromy Evans [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 02, 2008 6:15 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > > I completely agree with Dave so I'll take a different tact. > > Based on this example: > http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet > erTag, > I would also take the approach of returning a JSON Result via the JSON > Plugin. Only the configuration changes for an XML result. > > So, my form looks like this: > > > > > So, my struts.xml contains the corresponding action definition with a > JSON result: > > > > > list > > > > > And my action method looks like this: > > private ACEntry[] list; > > public String execute() { > list = populateList() > return "success"; > } > > public ACEntry[] getList() { >return list; > } > > --- > In summary, the autocompleter does a get to /JSONList.action > Struts2 executes the execute method of ListAction > The execute method creates a structure that will populate the > autocompleter > The action returns a JSON result type > The JSON plugin converts the root object (the list property only rather > than the whole action) to a JSON structure > The JSON plugin returns the application/json content to the > autocompleter > > I'll leave it to you to determine what the list structure should like > like. As it'll probably be re-use I'd create a bean for the purpose. > Use the FireBug plugin for firefox to inspect the format of the JSON > result to ensure it matches the format required by the javascript > library (or even better, write a unit test). > This will work with any javascript library that accepts JSON - you just > have to provide an appropriate structure. It will also work with any > library that requires an XML response, except you'd use an XML result > type like I previously described in this thread. > > I hope that helps. Struts2 is really well suited at providing non-html > responses if you take the tim
RE: AjaxTag 1.3 support?
Musachy, The error displays in the browser, true, but I believe this is because I have: set to show debug. So this is an ajax/dojo message...? I don't have any code such as: "this.data[x][0].toLowerCase" anywhere in the JSP or javascript sources. Oh, and I have given up on AjaxTags -- it seems silly to include another library to do what is already built into struts. Now if I can just get it to work... Cheers! MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 04, 2008 11:06 AM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? I think that error is coming from your jsp, not the JSON generation. Do you have "this.data[x][0].toLowerCase" somewhere? musachy On Feb 4, 2008 11:57 AM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Jeromy, > > Again, thanks for the reply. I appreciate your help! > > Following your example below, I can see the JSON result in the app > server console when the action called, but I get the following error in > the browser: > > FATAL exception raised: TypeError: Value undefined (result of expression > this.data[x][0].toLowerCase) is not object. > > What is this telling me? > > -- my Struts mapping: > namespace="/search"> > class="...QuestionSearchAction"> > > list > > > > > -- My Form: > > loadOnTextChange="true" loadMinimumCount="3"/> > > > -- My Action: > public class QuestionSearchAction extends BaseAction { > > /** > * > */ > private static final long serialVersionUID = > 1127012585409657094L; > > Question[] list; > private QuestionService questionService; > > public void setQuestionService(QuestionService questionService) > { > this.questionService = questionService; > } > > public String execute() { > List all= questionService.getQuestions(); > list= all.toArray( new Question[all.size()]); > return SUCCESS; > } > > public Question[] getList(){ > return list; > } > > } > > > Cheers! > mg > > -Original Message- > From: Jeromy Evans [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 02, 2008 6:15 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > > I completely agree with Dave so I'll take a different tact. > > Based on this example: > http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet > erTag, > I would also take the approach of returning a JSON Result via the JSON > Plugin. Only the configuration changes for an XML result. > > So, my form looks like this: > > > > > So, my struts.xml contains the corresponding action definition with a > JSON result: > > > > > list > > > > > And my action method looks like this: > > private ACEntry[] list; > > public String execute() { > list = populateList() > return "success"; > } > > public ACEntry[] getList() { >return list; > } > > --- > In summary, the autocompleter does a get to /JSONList.action > Struts2 executes the execute method of ListAction > The execute method creates a structure that will populate the > autocompleter > The action returns a JSON result type > The JSON plugin converts the root object (the list property only rather > than the whole action) to a JSON structure > The JSON plugin returns the application/json content to the > autocompleter > > I'll leave it to you to determine what the list structure should like > like. As it'll probably be re-use I'd create a bean for the purpose. > Use the FireBug plugin for firefox to inspect the format of the JSON > result to ensure it matches the format required by the javascript > library (or even better, write a unit test). > This will work with any javascript library that accepts JSON - you just > have to provide an appropriate structure. It will also work with any > library that requires an XML response, except you'd use an XML result > type like I previously described in this thread. > > I hope that helps. Struts2 is really well suited at providing non-html > responses if you take the time to understand the ResultType > architecture. > > cheers, > Jeromy Evans > > Dave Newton wrote: > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > > > >>
RE: AjaxTag 1.3 support?
Jeromy, Again, thanks for the reply. I appreciate your help! Following your example below, I can see the JSON result in the app server console when the action called, but I get the following error in the browser: FATAL exception raised: TypeError: Value undefined (result of expression this.data[x][0].toLowerCase) is not object. What is this telling me? -- my Struts mapping: list -- My Form: -- My Action: public class QuestionSearchAction extends BaseAction { /** * */ private static final long serialVersionUID = 1127012585409657094L; Question[] list; private QuestionService questionService; public void setQuestionService(QuestionService questionService) { this.questionService = questionService; } public String execute() { List all= questionService.getQuestions(); list= all.toArray( new Question[all.size()]); return SUCCESS; } public Question[] getList(){ return list; } } Cheers! mg -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Saturday, February 02, 2008 6:15 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? I completely agree with Dave so I'll take a different tact. Based on this example: http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet erTag, I would also take the approach of returning a JSON Result via the JSON Plugin. Only the configuration changes for an XML result. So, my form looks like this: So, my struts.xml contains the corresponding action definition with a JSON result: list And my action method looks like this: private ACEntry[] list; public String execute() { list = populateList() return "success"; } public ACEntry[] getList() { return list; } --- In summary, the autocompleter does a get to /JSONList.action Struts2 executes the execute method of ListAction The execute method creates a structure that will populate the autocompleter The action returns a JSON result type The JSON plugin converts the root object (the list property only rather than the whole action) to a JSON structure The JSON plugin returns the application/json content to the autocompleter I'll leave it to you to determine what the list structure should like like. As it'll probably be re-use I'd create a bean for the purpose. Use the FireBug plugin for firefox to inspect the format of the JSON result to ensure it matches the format required by the javascript library (or even better, write a unit test). This will work with any javascript library that accepts JSON - you just have to provide an appropriate structure. It will also work with any library that requires an XML response, except you'd use an XML result type like I previously described in this thread. I hope that helps. Struts2 is really well suited at providing non-html responses if you take the time to understand the ResultType architecture. cheers, Jeromy Evans Dave Newton wrote: > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > >> Thanks for the comprehensive reply. Looking at the documentation and the >> example app, I am still not sure how to configure my action/response. I >> am using tiles 2. >> > > As previously stated if you are writing directly to the response you need to > return null from the action. I am still not sure why you're using a tile > definition here. > > > >> It seems I need to return my result in JSON format correct? By returning >> a JSON String from the action, how to I configure my response? >> > > As Jeremy said this is, however, probably a bad idea, considering that the > same outcome can be achieved in several different ways. > > Using a JSON result will serialize your action to JSON automagically. You'd > use a "json" result (via the JSON plugin), not a tile. Or you could build the > JSON manually and configure a FreeMarker result. > > >> If I use the tiles response type, I get a dojo parsing error because the >> whole page is returned from the reply. >> > > Sure. > > >> The example in the example app isn't very clear to me, as the action >> returns a .JS file with the result hard coded, and not using any >> template like tiles I might add. >> > > What example are you referring to? > > http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet erTag? > > When making an Ajax request for a component like it's > unlikely you'd wa
RE: AjaxTag 1.3 support?
Jeromy, Thanks for the comprehensive reply. Looking at the documentation and the example app, I am still not sure how to configure my action/response. I am using tiles 2. If I configure the autocompleter as such: It seems I need to return my result in JSON format correct? By returning a JSON String from the action, how to I configure my response? question.panel If I use the tiles response type, I get a dojo parsing error because the whole page is returned from the reply. The example in the example app isn't very clear to me, as the action returns a .JS file with the result hard coded, and not using any template like tiles I might add. Also, I think I found a bug? -- the namespace attribute seems to be ignored when I pass href=%{search} to the autocompleter. I had to put qualify the namespace in the value to get the correct action to be invoked. Any further assistance you might provide would be much appreciated... MG -Original Message- From: Jeromy Evans [mailto:[EMAIL PROTECTED] Sent: Friday, February 01, 2008 6:36 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? My 2c: I think this is a bad solution and shouldn't be encouraged. It's marginally better than writing a custom servlet. Struts2 ResultTypes [1] are designed specifically for controlling the type and content of results from actions to separate the view from the model, even if the "view" is XML data. Accessing the response and writing to it directly isn't necessary except in the rarest of cases. For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType) [2] will serialize your action into JSON automatically The XSL ResultType will serialize your action into XML if you provide a stylesheet [3] The REST plugin includes code to serialize your action into XML using Xstream. [4] My point is, your action can setup a model (eg. a javabean matching the model expected by AjaxTag), and the ResultType can serialize it to the output stream. In this case I'd create a custom result type using XStream, but you could also use a XML template in a Tile, or have a ResultType that accesses the instance created by AjaxXMLBuilder. [1] http://struts.apache.org/2.0.11/docs/result-types.html [2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html [3] http://struts.apache.org/2.0.11/docs/xsl-result.html [4] http://xstream.codehaus.org/ [5] http://struts.apache.org/2.0.11/docs/result-configuration.html regards Jeromy Evans Hodgins, Grant wrote: > I was able to get the AjaxTags stuff working (with Tiles2 although I don't think that matters at all). > > As Dave said, your action should return null since you want the action to return XML in the response. > > Instead, in addition to returning a null result, I simply wrote the xml to the response: > > AjaxXmlBuilder xml = new AjaxXmlBuilder(); > > ... build your xml response ... > > response.setContentType("text/xml; charset=iso-8859-1"); > response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate"); > response.addHeader("Cache-Control", "post-check=0, pre-check=0"); > response.setHeader("Pragma", "no-cache"); > > PrintWriter pw = response.getWriter(); > pw.write(xml.toString()); > pw.close(); > > Hope this helps. > > Grant > > > > From: Griffith, Michael * [mailto:[EMAIL PROTECTED] > Sent: Fri 2/1/2008 3:48 PM > To: Struts Users Mailing List > Subject: RE: AjaxTag 1.3 support? > > > > Dave, > > Thanks for the reply. I guess I should have said freemarker instead of > sitemesh...? At any rate, when the docs don't match the release, it's a > bad thing. > > I shouldn't need to do any of this should I? Can you point me at a > simple, minimalist example of the tag? > > mg > > -Original Message- > From: Dave Newton [mailto:[EMAIL PROTECTED] > Sent: Friday, February 01, 2008 5:42 PM > To: Struts Users Mailing List > Subject: Re: AjaxTag 1.3 support? > > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > >> public class QuestionAction extends BaseAction implements >> ModelDriven, Preparable, ServletRequestAware, >> ServletResponseAware { >> public String getSearchTerm() throws Exception { >> System.out.println(" Question Search Term:" + qt); >> List results= >> > questionService.getQuestions(qt); > >> AjaxXmlBuilder builder= new AjaxXmlBuilder(); >> builder.addItems(results, "questionType", "text"); >> >>response.setContentType("text/xml"); >>
RE: AjaxTag 1.3 support?
Dave, Thanks for the reply. I guess I should have said freemarker instead of sitemesh...? At any rate, when the docs don't match the release, it's a bad thing. I shouldn't need to do any of this should I? Can you point me at a simple, minimalist example of the tag? mg -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, February 01, 2008 5:42 PM To: Struts Users Mailing List Subject: Re: AjaxTag 1.3 support? --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote: > public class QuestionAction extends BaseAction implements > ModelDriven, Preparable, ServletRequestAware, > ServletResponseAware { > public String getSearchTerm() throws Exception { > System.out.println(" Question Search Term:" + qt); > List results= questionService.getQuestions(qt); > AjaxXmlBuilder builder= new AjaxXmlBuilder(); > builder.addItems(results, "questionType", "text"); > >response.setContentType("text/xml"); >response.setHeader("Cache-Control", "no-cache"); >ServletOutputStream out = response.getOutputStream(); >out.print(builder.toString()); >out.close(); > > return SUCCESS; > } > > My struts mapping: > >namespace="/question"> >class="...QuestionAction"> >type="tiles">question.panel > > If you're writing directly to the stream I doubt you'd even want to return anything other than a null from the action, no? What is the "question.panel" tile? > The struts 2 Ajax documentation seems manic and dated. It seems the S2 > Ajax implementation is tied closely to sitemesh, which I am not using. SiteMesh? The Ajax implementation isn't tied to SiteMesh at all. Dated? Much of the S2 Ajax documentation is for S2.1, which isn't even released yet. If anything, it's pre-dated. Dave - 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]
AjaxTag 1.3 support?
Hi all, I can't seem to get a simple Ajax based look ahead search to work. I am trying to use AjaxTags 1.3 (http://ajaxtags.sourceforge.net/) in my Struts2 application. What is the correct response to return? I am also using Tiles2. If I write the response directly to the output stream, that's what displays in my browser (obviously it's the response from the server) -- if I return the result, Struts complains that the mapping is not correct. Here's what I have: My form looks like this: Search Question Text: My Action looks like this: public class QuestionAction extends BaseAction implements ModelDriven, Preparable, ServletRequestAware, ServletResponseAware { ... public String getSearchTerm() throws Exception{ System.out.println(" Question Search Term:" + qt); List results= questionService.getQuestions(qt); AjaxXmlBuilder builder= new AjaxXmlBuilder(); builder.addItems(results, "questionType", "text"); System.out.println(" Question Search Result:" + builder.toString()); response.setContentType("text/xml"); response.setHeader("Cache-Control", "no-cache"); ServletOutputStream out = response.getOutputStream(); out.print(builder.toString()); out.close(); return SUCCESS; } My struts mapping: question.panel The struts 2 Ajax documentation seems manic and dated. It seems the S2 Ajax implementation is tied closely to sitemesh, which I am not using. If anyone can help me get this going I would definitely be interested in participating in the project updating the documentation. Michael Griffith Application Architect (Consultant) Office of the Chief Information Officer Office of the Commissioner U.S. Food and Drug Administration 5600 Fishers Lane Rockville, MD 20857 301.827.2381 507.581.6606 (cell) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with (1...N) Editing using Ajax?
Laurie, Thanks for your reply. You have nailed the problem! It seems like the 2nd solution is the more elegant one. Are there any reference implementations or examples you could point me to that might show me how to populate the form using JSON data? MG -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Friday, February 01, 2008 10:45 AM To: user@struts.apache.org Subject: Re: Help with (1...N) Editing using Ajax? The problem is that you're rendering the form before you've stored anything under #session['guide']. I assume when you say you want to 'bind the form to the object' your Ajax request places in the session, you mean you want to populate the form fields with data from that object? That can't work automagically, since the form is just part of the page in the browser and has no knowledge of what might be happening to the session over on the server. There are a couple of approaches you can consider to get this working: 1) instead of rendering the form as part of the initial page load, render it as the result of the Ajax request that loads the data. On the client-side, take that response and render it directly. 2) return the data itself as the result of the Ajax request (in XML or JSON format probably). On the client-side, take that response and use it to populate the form you already have. The key is that the form will not get populated with data just because you made data available after the fact. You either must render the form after the data is available, or perform additional processing to 'push' the data into the form. L. Griffith, Michael * wrote: > In fact, looking at the page source, it appears the expression is never > cooked... > > Here's the input from the rendered page: > value="#session['guide'].shortDescription" > id="updateGuide_#session_'guide'__shortDescription"/> > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 31, 2008 4:25 PM > To: Struts Users Mailing List > Subject: Re: Help with (1...N) Editing using Ajax? > > so #session['guide'] is not returning anything? > > musachy > > On Jan 31, 2008 5:16 PM, Griffith, Michael * > <[EMAIL PROTECTED]> wrote: >> Hello all, >> >> >> >> I am trying to understand how to present an interface where I allow a >> user to edit a master/detail relationship using an Ajax technique. I > am >> quite new to Struts2, so please forgive the dalliance. >> >> >> >> I have a form that presents the user the ability to edit the master of >> the master/detail, and below the form a list of each of the child >> records. Each child record presents an Ajax enabled link to trigger a >> method on the struts action, where I pick out the child record from > the >> list and put it in the session... >> >> >> >> The link looks like this: >> >> >> >> >> >> > namespace="/datacall" > >> >> > value="#guide.id" /> >> >> >> >> > notifyTopics="updateResult">> value="#guide.shortDescription"/> >> >> >> >> >> >> The method is triggered in the action, and I set the child into my >> request session... >> >> request.getSession().setAttribute("guide", g); >> >> >> >> And I have a form that I'm trying to bind to the object in the > session. >> The form is actually hidden in a div/panel I'm using the YUI to > present >> the form to the user after the round trip to the server. The form > isn't >> bound to the correct variable, because its set via a user interaction >> after the entire page is presented to the user. >> >> The form looks like this: >> >> >> >> >> >> >> >> > name="#session['guide'].shortDescription" /> >> >> > name="#session['guide'].instructions" cols="25" rows="8"/> >> >> >> >> >> >> In Struts 1 I would have gotten a terrible error saying that the bean >> wasn't found. Now the error fails silently. How can I make the form >> somehow bind to the object in the session after the user clicks the >> link? >> >> >> >> Any help would be much appreciated. >> >> >> >> MG >> >> >> >> > > > - 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: Help with (1...N) Editing using Ajax?
In fact, looking at the page source, it appears the expression is never cooked... Here's the input from the rendered page: -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 4:25 PM To: Struts Users Mailing List Subject: Re: Help with (1...N) Editing using Ajax? so #session['guide'] is not returning anything? musachy On Jan 31, 2008 5:16 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Hello all, > > > > I am trying to understand how to present an interface where I allow a > user to edit a master/detail relationship using an Ajax technique. I am > quite new to Struts2, so please forgive the dalliance. > > > > I have a form that presents the user the ability to edit the master of > the master/detail, and below the form a list of each of the child > records. Each child record presents an Ajax enabled link to trigger a > method on the struts action, where I pick out the child record from the > list and put it in the session... > > > > The link looks like this: > > > > > > namespace="/datacall" > > > value="#guide.id" /> > > > > notifyTopics="updateResult"> value="#guide.shortDescription"/> > > > > > > The method is triggered in the action, and I set the child into my > request session... > > request.getSession().setAttribute("guide", g); > > > > And I have a form that I'm trying to bind to the object in the session. > The form is actually hidden in a div/panel I'm using the YUI to present > the form to the user after the round trip to the server. The form isn't > bound to the correct variable, because its set via a user interaction > after the entire page is presented to the user. > > The form looks like this: > > > > > > > > name="#session['guide'].shortDescription" /> > > name="#session['guide'].instructions" cols="25" rows="8"/> > > > > > > In Struts 1 I would have gotten a terrible error saying that the bean > wasn't found. Now the error fails silently. How can I make the form > somehow bind to the object in the session after the user clicks the > link? > > > > Any help would be much appreciated. > > > > MG > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with (1...N) Editing using Ajax?
Nope, nothing. If I bind my form to #guide. I find the first or last item in the Collection that belongs to the parent when the list was iterated over. Maybe there is a better way to specify how to bind the property to the struts control? Maybe something like: But how would I specify the item index in the collection? Cheers! MG -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, January 31, 2008 4:25 PM To: Struts Users Mailing List Subject: Re: Help with (1...N) Editing using Ajax? so #session['guide'] is not returning anything? musachy On Jan 31, 2008 5:16 PM, Griffith, Michael * <[EMAIL PROTECTED]> wrote: > Hello all, > > > > I am trying to understand how to present an interface where I allow a > user to edit a master/detail relationship using an Ajax technique. I am > quite new to Struts2, so please forgive the dalliance. > > > > I have a form that presents the user the ability to edit the master of > the master/detail, and below the form a list of each of the child > records. Each child record presents an Ajax enabled link to trigger a > method on the struts action, where I pick out the child record from the > list and put it in the session... > > > > The link looks like this: > > > > > > namespace="/datacall" > > > value="#guide.id" /> > > > > notifyTopics="updateResult"> value="#guide.shortDescription"/> > > > > > > The method is triggered in the action, and I set the child into my > request session... > > request.getSession().setAttribute("guide", g); > > > > And I have a form that I'm trying to bind to the object in the session. > The form is actually hidden in a div/panel I'm using the YUI to present > the form to the user after the round trip to the server. The form isn't > bound to the correct variable, because its set via a user interaction > after the entire page is presented to the user. > > The form looks like this: > > > > > > > > name="#session['guide'].shortDescription" /> > > name="#session['guide'].instructions" cols="25" rows="8"/> > > > > > > In Struts 1 I would have gotten a terrible error saying that the bean > wasn't found. Now the error fails silently. How can I make the form > somehow bind to the object in the session after the user clicks the > link? > > > > Any help would be much appreciated. > > > > MG > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with (1...N) Editing using Ajax?
Hello all, I am trying to understand how to present an interface where I allow a user to edit a master/detail relationship using an Ajax technique. I am quite new to Struts2, so please forgive the dalliance. I have a form that presents the user the ability to edit the master of the master/detail, and below the form a list of each of the child records. Each child record presents an Ajax enabled link to trigger a method on the struts action, where I pick out the child record from the list and put it in the session... The link looks like this: The method is triggered in the action, and I set the child into my request session... request.getSession().setAttribute("guide", g); And I have a form that I'm trying to bind to the object in the session. The form is actually hidden in a div/panel I'm using the YUI to present the form to the user after the round trip to the server. The form isn't bound to the correct variable, because its set via a user interaction after the entire page is presented to the user. The form looks like this: In Struts 1 I would have gotten a terrible error saying that the bean wasn't found. Now the error fails silently. How can I make the form somehow bind to the object in the session after the user clicks the link? Any help would be much appreciated. MG