Author Login
Post Reply
user Digest 1 Feb 2008 23:48:51 -0000 Issue 7838
Topics (messages 182098 through 182127):
Newbie to Struts 2 - Question about Interceptors
182098 by: daveck
182107 by: Laurie Harper
182119 by: daveck
Re: actions defined in a package are visible in other packages??
182099 by: Dave Newton
182102 by: paulbrickell
182106 by: paulbrickell
182108 by: Dave Newton
182109 by: Dave Newton
182110 by: Laurie Harper
182113 by: paulbrickell
182114 by: paulbrickell
Re: Doubleselect tag
182100 by: stanlick.gmail.com
182111 by: Stanley, Eric
182122 by: stanlick.gmail.com
182123 by: Dave Newton
182124 by: stanlick.gmail.com
Re: Help with (1...N) Editing using Ajax?
182101 by: Laurie Harper
182103 by: Griffith, Michael *
Re: [struts] Struts2 tags loops
182104 by: Dale Newfield
Re: ActionContext.getContext().getSession return null when I test Struts2 action by JUnit.
182105 by: Laurie Harper
Can I use these two together?
182112 by: javaskull
182116 by: Antonio Petrelli
Mail list XML/HTML/tag eatery?
182115 by: Dave Newton
182117 by: Antonio Petrelli
182118 by: Dave Newton
Integrating Struts2 and JSF
182120 by: Manasa Inaganti
Re: Populate Form from DAO
182121 by: Wes Wannemacher
AjaxTag 1.3 support?
182125 by: Griffith, Michael *
182126 by: Dave Newton
182127 by: Griffith, Michael *
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_182098.ezm (zipped)
Hello,
I need to put up a "Confirmation Screen" in between my input jsp and my
success jsp.
byproduct.action -> byproduct-input.jsp
byproduct-input.jsp -> confirm.jsp
(If yes...)
confirm.jsp -> byproduct.action
byproduct.action -> byproduct-success.action
Is there a Struts 2 way to carry the input parameters across the confirm.jsp
so the second call to byproduct.action has access to them?
I've looked at the ChainInterceptor and ActionChaining and have a feeling
the solution resides there, but could use a little help. I hope I was clear
enough... :)
Thanks!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182107.ezm (zipped)daveck wrote:
> Hello,
> I need to put up a "Confirmation Screen" in between my input jsp and my
> success jsp.
>
> byproduct.action -> byproduct-input.jsp
> byproduct-input.jsp -> confirm.jsp
> (If yes...)
> confirm.jsp -> byproduct.action
> byproduct.action -> byproduct-success.action
>
> Is there a Struts 2 way to carry the input parameters across the confirm.jsp
> so the second call to byproduct.action has access to them?
>
> I've looked at the ChainInterceptor and ActionChaining and have a feeling
> the solution resides there, but could use a little help. I hope I was clear
> enough... :)
>
> Thanks!
The short answer is no, not without intervention from you. You will need
to arrange yourself for the data submitted from byproduct-input.jsp to
be carried over so that it's available to byproduct.action.
Two ways to do that are:
1) place an action between byproduct-input.jsp and confirm.jsp which
saves the submitted data into an object stored in the session, then
retrieve that object in byproduct-success.action
2) place hidden fields in confirm.jsp that correspond to the inputs in
byproduct-input.jsp, populating them from the request parameters. Make
sure that confirm.jsp calls byproduct.action using a form submit (not
just a link) so that the data in the hidden inputs gets sent.
You should probably be submitting byproduct-input.jsp to an action
anyway, so that you can perform validation and/or expose any additional
data that confirm.jsp might need but, other than that, the main thing
affecting which approach you choose is whether you want to use or avoid
the session.
HTH,
L.

Attachment:
user_182119.ezm (zipped)
I ended up solving the problem using an Interceptor and saving the parameter
Map to the session.
session.setAttribute("input_params", request.getParameterMap();
Then in my action I implemented SessionAware and utililized BeanUtils from
Jakarta Commons to re-populate the properties in my action class.
this.setRequestMap((Map)this.getSession().get("input_parms"));
BeanUtils.populate(this, this.getRequestMap();
Thank you for your help.
David
Laurie Harper wrote:
>
> daveck wrote:
>> Hello,
>> I need to put up a "Confirmation Screen" in between my input jsp and my
>> success jsp.
>>
>> byproduct.action -> byproduct-input.jsp
>> byproduct-input.jsp -> confirm.jsp
>> (If yes...)
>> confirm.jsp -> byproduct.action
>> byproduct.action -> byproduct-success.action
>>
>> Is there a Struts 2 way to carry the input parameters across the
>> confirm.jsp
>> so the second call to byproduct.action has access to them?
>>
>> I've looked at the ChainInterceptor and ActionChaining and have a feeling
>> the solution resides there, but could use a little help. I hope I was
>> clear
>> enough... :)
>>
>> Thanks!
>
> The short answer is no, not without intervention from you. You will need
> to arrange yourself for the data submitted from byproduct-input.jsp to
> be carried over so that it's available to byproduct.action.
>
> Two ways to do that are:
>
> 1) place an action between byproduct-input.jsp and confirm.jsp which
> saves the submitted data into an object stored in the session, then
> retrieve that object in byproduct-success.action
>
> 2) place hidden fields in confirm.jsp that correspond to the inputs in
> byproduct-input.jsp, populating them from the request parameters. Make
> sure that confirm.jsp calls byproduct.action using a form submit (not
> just a link) so that the data in the hidden inputs gets sent.
>
> You should probably be submitting byproduct-input.jsp to an action
> anyway, so that you can perform validation and/or expose any additional
> data that confirm.jsp might need but, other than that, the main thing
> affecting which approach you choose is whether you want to use or avoid
> the session.
>
> HTH,
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182099.ezm (zipped)--- paulbrickell <paul.brickell@(protected):
> I had seen those, but the problem I was having was that at no point in the
> docs (afaik) is there an example of a URL to actually target an action in a
> namespace.
Noted, although the <s:action...> [1] and <s:url...>[2] tag documentation
does list the "namespace" attribute. I've added a task to add explicit
examples.
> Do not seem to work. However like this...
>
> <s:action name="do" namespace="space"/>
>
> does.
>
> Annoyingly this...
>
> <s:action name="do.action" namespace="space"/>
>
> doesn't seem to work either.
Correct, appending the prefix to <s:action...>, which already assumes you're
referring to an action, wouldn't work.
> And don't even get me started about using namespaced actions with the a
> tag. href="/space/do" doesn't work either.
Well, no, "href" is for a URL, not an action, and the docs explicitly build
the URL with <s:url...>
> And the final insult when the actions don't resolve properly it fails
> silently and all I get is an empty browser.:-/
I haven't seen that; do you have "devMode" turned on? Under what
circumstances do you get an empty browser?
Dave
[1] http://struts.apache.org/2.x/docs/action.html
[2] http://struts.apache.org/2.x/docs/url.html

Attachment:
user_182102.ezm (zipped)
Cool the docs would make life easier for us poor saps.
I don't think I was clear about what I am seeing. If I have an action tag in
my page like this...
<div>
<s:action name="/some-namespace/myAction" executeResult="true"/>
</div>
And a struts.xml file that defines a package with the namespace
'some-namespace' that contains an action called myAction I see no call to
the target action (I am debugging and have a breakpoint in my action). I
simply get a blank space in my output. However if I past a full url in my
browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
well.
Weird.
newton.dave wrote:
>
> --- paulbrickell <paul.brickell@(protected):
>> I had seen those, but the problem I was having was that at no point in
>> the
>> docs (afaik) is there an example of a URL to actually target an action in
>> a
>> namespace.
>
> Noted, although the <s:action...> [1] and <s:url...>[2] tag documentation
> does list the "namespace" attribute. I've added a task to add explicit
> examples.
>
>> Do not seem to work. However like this...
>>
>> <s:action name="do" namespace="space"/>
>>
>> does.
>>
>> Annoyingly this...
>>
>> <s:action name="do.action" namespace="space"/>
>>
>> doesn't seem to work either.
>
> Correct, appending the prefix to <s:action...>, which already assumes
> you're
> referring to an action, wouldn't work.
>
>> And don't even get me started about using namespaced actions with the a
>> tag. href="/space/do" doesn't work either.
>
> Well, no, "href" is for a URL, not an action, and the docs explicitly
> build
> the URL with <s:url...>
>
>> And the final insult when the actions don't resolve properly it fails
>> silently and all I get is an empty browser.:-/
>
> I haven't seen that; do you have "devMode" turned on? Under what
> circumstances do you get an empty browser?
>
> Dave
>
> [1] http://struts.apache.org/2.x/docs/action.html
> [2] http://struts.apache.org/2.x/docs/url.html
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182106.ezm (zipped)
Actuallt it not clear to how I might build a link to an action in a namespace
if...
/namespace/myAction doesn't work.
What AM I doing wrong?
Cheers,
Paul B.
newton.dave wrote:
>
> --- paulbrickell <paul.brickell@(protected):
>> I had seen those, but the problem I was having was that at no point in
>> the
>> docs (afaik) is there an example of a URL to actually target an action in
>> a
>> namespace.
>
> Noted, although the <s:action...> [1] and <s:url...>[2] tag documentation
> does list the "namespace" attribute. I've added a task to add explicit
> examples.
>
>> Do not seem to work. However like this...
>>
>> <s:action name="do" namespace="space"/>
>>
>> does.
>>
>> Annoyingly this...
>>
>> <s:action name="do.action" namespace="space"/>
>>
>> doesn't seem to work either.
>
> Correct, appending the prefix to <s:action...>, which already assumes
> you're
> referring to an action, wouldn't work.
>
>> And don't even get me started about using namespaced actions with the a
>> tag. href="/space/do" doesn't work either.
>
> Well, no, "href" is for a URL, not an action, and the docs explicitly
> build
> the URL with <s:url...>
>
>> And the final insult when the actions don't resolve properly it fails
>> silently and all I get is an empty browser.:-/
>
> I haven't seen that; do you have "devMode" turned on? Under what
> circumstances do you get an empty browser?
>
> Dave
>
> [1] http://struts.apache.org/2.x/docs/action.html
> [2] http://struts.apache.org/2.x/docs/url.html
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182108.ezm (zipped)--- paulbrickell <paul.brickell@(protected):
> I don't think I was clear about what I am seeing. If I have an action tag
> in my page like this...
>
> <div>
> <s:action name="/some-namespace/myAction" executeResult="true"/>
> </div>
>
> And a struts.xml file that defines a package with the namespace
> 'some-namespace' that contains an action called myAction I see no call to
> the target action (I am debugging and have a breakpoint in my action). I
> simply get a blank space in my output. However if I past a full url in my
> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
> well.
Yeah, that's a little weird. If you turn up the logging is there anything on
the console? I mean, clearly it'll work w/ the proper use of the "namespace"
attribute etc. but something on the console might be handy if it isn't
already there.
Dave

Attachment:
user_182109.ezm (zipped)--- paulbrickell <paul.brickell@(protected):
> Actuallt it not clear to how I might build a link to an action in a
> namespace if...
>
> /namespace/myAction doesn't work.
>
> What AM I doing wrong?
Not using the "namespace" attribute.
Dave

Attachment:
user_182110.ezm (zipped)http://struts.apache.org/2.0.11/docs/action.html
Did you try <s:action namespace="/some-namespace" action="myAction"
executeResult="true"/>? If the namespace of the action that renders this
page is also some-namespace you should be able to leave out the
namespace attribute, too, and just use action="myAction".
L.
paulbrickell wrote:
> Cool the docs would make life easier for us poor saps.
>
> I don't think I was clear about what I am seeing. If I have an action tag in
> my page like this...
>
> <div>
> <s:action name="/some-namespace/myAction" executeResult="true"/>
> </div>
>
> And a struts.xml file that defines a package with the namespace
> 'some-namespace' that contains an action called myAction I see no call to
> the target action (I am debugging and have a breakpoint in my action). I
> simply get a blank space in my output. However if I past a full url in my
> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
> well.
>
> Weird.
>
>
>
> newton.dave wrote:
>> --- paulbrickell <paul.brickell@(protected):
>>> I had seen those, but the problem I was having was that at no point in
>>> the
>>> docs (afaik) is there an example of a URL to actually target an action in
>>> a
>>> namespace.
>> Noted, although the <s:action...> [1] and <s:url...>[2] tag documentation
>> does list the "namespace" attribute. I've added a task to add explicit
>> examples.
>>
>>> Do not seem to work. However like this...
>>>
>>> <s:action name="do" namespace="space"/>
>>>
>>> does.
>>>
>>> Annoyingly this...
>>>
>>> <s:action name="do.action" namespace="space"/>
>>>
>>> doesn't seem to work either.
>> Correct, appending the prefix to <s:action...>, which already assumes
>> you're
>> referring to an action, wouldn't work.
>>
>>> And don't even get me started about using namespaced actions with the a
>>> tag. href="/space/do" doesn't work either.
>> Well, no, "href" is for a URL, not an action, and the docs explicitly
>> build
>> the URL with <s:url...>
>>
>>> And the final insult when the actions don't resolve properly it fails
>>> silently and all I get is an empty browser.:-/
>> I haven't seen that; do you have "devMode" turned on? Under what
>> circumstances do you get an empty browser?
>>
>> Dave
>>
>> [1] http://struts.apache.org/2.x/docs/action.html
>> [2] http://struts.apache.org/2.x/docs/url.html
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>

Attachment:
user_182113.ezm (zipped)
laurie,
I have examples of one page in a namespace invoking action in the same
namespace and now I know how to call across to it from my root it all looks
good.
My problem is that I want to use actions in the target namespace from my
root namespace as simple links.
so I think (being a bit of a struts 2 novice) that something like...
<div>
<a: href="some-namespace/do.action"/>other-domain
</div>
might not be reasonable.
I might also want to pass the url to some Javascript to invoke a call for
some JSON or god forfend some XML. e.g.
<s:url namespace="some-namespace" name="do" var="theURL"/>
onClick="call('<s:property name="theURL">')"
In fact I have tried this and I get the same behaviour as the div example. A
console.debug the value of the param shows a partial url in the form
"/some-namespace/do.action". But I get nothing.
However when I click such a link I get no activity at all. I have breakpoint
in first the interceptor (acegi security as it happens) but there is no call
and looking at the browser source it shows no content in the div (firefox on
linux btw).
Its just plain odd. I am gonna have to do some more looking. I just know I
am doing something wrong here and when I fing myself sniffing networks I'm
certain.
Still if I had a life I probably wouldn't care. The earch goes on:-P
Cheers,
Paul B
Laurie Harper wrote:
>
> http://struts.apache.org/2.0.11/docs/action.html
>
> Did you try <s:action namespace="/some-namespace" action="myAction"
> executeResult="true"/>? If the namespace of the action that renders this
> page is also some-namespace you should be able to leave out the
> namespace attribute, too, and just use action="myAction".
>
> L.
>
> paulbrickell wrote:
>> Cool the docs would make life easier for us poor saps.
>>
>> I don't think I was clear about what I am seeing. If I have an action tag
>> in
>> my page like this...
>>
>> <div>
>> <s:action name="/some-namespace/myAction" executeResult="true"/>
>> </div>
>>
>> And a struts.xml file that defines a package with the namespace
>> 'some-namespace' that contains an action called myAction I see no call to
>> the target action (I am debugging and have a breakpoint in my action). I
>> simply get a blank space in my output. However if I past a full url in my
>> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
>> well.
>>
>> Weird.
>>
>>
>>
>> newton.dave wrote:
>>> --- paulbrickell <paul.brickell@(protected):
>>>> I had seen those, but the problem I was having was that at no point in
>>>> the
>>>> docs (afaik) is there an example of a URL to actually target an action
>>>> in
>>>> a
>>>> namespace.
>>> Noted, although the <s:action...> [1] and <s:url...>[2] tag
>>> documentation
>>> does list the "namespace" attribute. I've added a task to add explicit
>>> examples.
>>>
>>>> Do not seem to work. However like this...
>>>>
>>>> <s:action name="do" namespace="space"/>
>>>>
>>>> does.
>>>>
>>>> Annoyingly this...
>>>>
>>>> <s:action name="do.action" namespace="space"/>
>>>>
>>>> doesn't seem to work either.
>>> Correct, appending the prefix to <s:action...>, which already assumes
>>> you're
>>> referring to an action, wouldn't work.
>>>
>>>> And don't even get me started about using namespaced actions with the a
>>>> tag. href="/space/do" doesn't work either.
>>> Well, no, "href" is for a URL, not an action, and the docs explicitly
>>> build
>>> the URL with <s:url...>
>>>
>>>> And the final insult when the actions don't resolve properly it fails
>>>> silently and all I get is an empty browser.:-/
>>> I haven't seen that; do you have "devMode" turned on? Under what
>>> circumstances do you get an empty browser?
>>>
>>> Dave
>>>
>>> [1] http://struts.apache.org/2.x/docs/action.html
>>> [2] http://struts.apache.org/2.x/docs/url.html
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182114.ezm (zipped)
laurie,
I have examples of one page in a namespace invoking actions in the same
namespace and now I know how to call across to it from my root it all looks
good.
My problem is that I want to use actions in the target namespace from my
root namespace as simple links.
so I think (being a bit of a struts 2 novice) that something like...
<div>
<a: href="/some-namespace/do.action"/>other-domain
</div>
might not be reasonable.
However when I click such a link I get no activity at all. I have breakpoint
in first the interceptor (acegi security as it happens) but there is no call
and looking at the browser source it shows no content in the div (firefox on
linux btw).
I might also want to pass the url to some Javascript to invoke a call for
some JSON or god forfend some XML. e.g.
<s:url namespace="some-namespace" name="do" var="theURL"/>
onClick="call('<s:property name="theURL">')"
In fact I have tried this and I get the same behaviour as the div example. A
console.debug of the value of the param shows a partial url in the form
"/some-namespace/do.action". But I get nothing on the server.
Its just plain odd. I am gonna have to do some more looking. I just know I
am doing something wrong here and when I find myself sniffing network
packets I'm certain.
Still if I had a life I probably wouldn't care. The search goes on:-P
Cheers,
Paul B
Laurie Harper wrote:
>
> http://struts.apache.org/2.0.11/docs/action.html
>
> Did you try <s:action namespace="/some-namespace" action="myAction"
> executeResult="true"/>? If the namespace of the action that renders this
> page is also some-namespace you should be able to leave out the
> namespace attribute, too, and just use action="myAction".
>
> L.
>
> paulbrickell wrote:
>> Cool the docs would make life easier for us poor saps.
>>
>> I don't think I was clear about what I am seeing. If I have an action tag
>> in
>> my page like this...
>>
>> <div>
>> <s:action name="/some-namespace/myAction" executeResult="true"/>
>> </div>
>>
>> And a struts.xml file that defines a package with the namespace
>> 'some-namespace' that contains an action called myAction I see no call to
>> the target action (I am debugging and have a breakpoint in my action). I
>> simply get a blank space in my output. However if I past a full url in my
>> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
>> well.
>>
>> Weird.
>>
>>
>>
>> newton.dave wrote:
>>> --- paulbrickell <paul.brickell@(protected):
>>>> I had seen those, but the problem I was having was that at no point in
>>>> the
>>>> docs (afaik) is there an example of a URL to actually target an action
>>>> in
>>>> a
>>>> namespace.
>>> Noted, although the <s:action...> [1] and <s:url...>[2] tag
>>> documentation
>>> does list the "namespace" attribute. I've added a task to add explicit
>>> examples.
>>>
>>>> Do not seem to work. However like this...
>>>>
>>>> <s:action name="do" namespace="space"/>
>>>>
>>>> does.
>>>>
>>>> Annoyingly this...
>>>>
>>>> <s:action name="do.action" namespace="space"/>
>>>>
>>>> doesn't seem to work either.
>>> Correct, appending the prefix to <s:action...>, which already assumes
>>> you're
>>> referring to an action, wouldn't work.
>>>
>>>> And don't even get me started about using namespaced actions with the a
>>>> tag. href="/space/do" doesn't work either.
>>> Well, no, "href" is for a URL, not an action, and the docs explicitly
>>> build
>>> the URL with <s:url...>
>>>
>>>> And the final insult when the actions don't resolve properly it fails
>>>> silently and all I get is an empty browser.:-/
>>> I haven't seen that; do you have "devMode" turned on? Under what
>>> circumstances do you get an empty browser?
>>>
>>> Dave
>>>
>>> [1] http://struts.apache.org/2.x/docs/action.html
>>> [2] http://struts.apache.org/2.x/docs/url.html
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182100.ezm (zipped)Greetings--
I have added an example of doing this at
S2iA<http://www.manning-sandbox.com/thread.jspa?threadID=22922&tstart=0>that
I think describes this usage a little better.
Scott
On Jan 31, 2008 5:07 PM, Stanley, Eric <Eric.R.Stanley@(protected):
> I'd like to have a pair of selects, the first one controlling the
> content of the next. I understand that the <s:doublselect /> tag makes
> this possible. I just can't make it work. I tried just copying the
> example:
>
> <s:doubleselect label="doubleselect test1" name="menu"
> list="{'fruit','other'}" doubleName="dishes" doubleList="top == 'fruit'
> ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
> <s:doubleselect label="doubleselect test2" name="menu"
> list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}"
> doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} :
> {'monkey', 'chicken'}" />
> And it does not work either. It populates both selects automatically,
> and the second select never changes content based on the first. They
> just seem static. I'm sure I'm looking at this the wrong way, so I could
> use some clarity. Thanks in advance.
> -Ryan
>
>
> This communication is the property of Qwest and may contain confidential
> or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful. If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
>
--
Scott
stanlick@(protected)

Attachment:
user_182111.ezm (zipped)Could you please show me the classes state and city? I think that would
help. And thanks for the reply :)
-Ryan
-----Original Message-----
From: stanlick@(protected)]
Sent: Friday, February 01, 2008 9:39 AM
To: Struts Users Mailing List
Subject: Re: Doubleselect tag
Greetings--
I have added an example of doing this at
S2iA<http://www.manning-sandbox.com/thread.jspa?threadID=22922&tstart=0>
that
I think describes this usage a little better.
Scott
On Jan 31, 2008 5:07 PM, Stanley, Eric <Eric.R.Stanley@(protected):
> I'd like to have a pair of selects, the first one controlling the
> content of the next. I understand that the <s:doublselect /> tag makes
> this possible. I just can't make it work. I tried just copying the
> example:
>
> <s:doubleselect label="doubleselect test1" name="menu"
> list="{'fruit','other'}" doubleName="dishes" doubleList="top ==
'fruit'
> ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
> <s:doubleselect label="doubleselect test2" name="menu"
> list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}"
> doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} :
> {'monkey', 'chicken'}" />
> And it does not work either. It populates both selects automatically,
> and the second select never changes content based on the first. They
> just seem static. I'm sure I'm looking at this the wrong way, so I
could
> use some clarity. Thanks in advance.
> -Ryan
>
>
> This communication is the property of Qwest and may contain
confidential
> or
> privileged information. Unauthorized use of this communication is
strictly
> prohibited and may be unlawful. If you have received this
communication
> in error, please immediately notify the sender by reply e-mail and
destroy
> all copies of the communication and any attachments.
>
--
Scott
stanlick@(protected)

Attachment:
user_182122.ezm (zipped)I'll drop the m on the Manning site in a couple minutes. Holler if you need
more help.
Scot
On Feb 1, 2008 11:45 AM, Stanley, Eric <Eric.R.Stanley@(protected):
> Could you please show me the classes state and city? I think that would
> help. And thanks for the reply :)
>
> -Ryan
>
> -----Original Message-----
> From: stanlick@(protected)]
> Sent: Friday, February 01, 2008 9:39 AM
> To: Struts Users Mailing List
> Subject: Re: Doubleselect tag
>
> Greetings--
>
> I have added an example of doing this at
> S2iA<http://www.manning-sandbox.com/thread.jspa?threadID=22922&tstart=0>
> that
> I think describes this usage a little better.
>
> Scott
>
> On Jan 31, 2008 5:07 PM, Stanley, Eric <Eric.R.Stanley@(protected):
>
> > I'd like to have a pair of selects, the first one controlling the
> > content of the next. I understand that the <s:doublselect /> tag makes
> > this possible. I just can't make it work. I tried just copying the
> > example:
> >
> > <s:doubleselect label="doubleselect test1" name="menu"
> > list="{'fruit','other'}" doubleName="dishes" doubleList="top ==
> 'fruit'
> > ? {'apple', 'orange'} : {'monkey', 'chicken'}" />
> > <s:doubleselect label="doubleselect test2" name="menu"
> > list="#{'fruit':'Nice Fruits', 'other':'Other Dishes'}"
> > doubleName="dishes" doubleList="top == 'fruit' ? {'apple', 'orange'} :
> > {'monkey', 'chicken'}" />
> > And it does not work either. It populates both selects automatically,
> > and the second select never changes content based on the first. They
> > just seem static. I'm sure I'm looking at this the wrong way, so I
> could
> > use some clarity. Thanks in advance.
> > -Ryan
> >
> >
> > This communication is the property of Qwest and may contain
> confidential
> > or
> > privileged information. Unauthorized use of this communication is
> strictly
> > prohibited and may be unlawful. If you have received this
> communication
> > in error, please immediately notify the sender by reply e-mail and
> destroy
> > all copies of the communication and any attachments.
> >
>
>
>
> --
> Scott
> stanlick@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Scott
stanlick@(protected)

Attachment:
user_182123.ezm (zipped)--- stanlick@(protected):
> I'll drop the m on the Manning site in a couple minutes.
"anning"?
Did you get the #request issue worked out? I probably missed your followup.
d.

Attachment:
user_182124.ezm (zipped)Hey brah --
I actually have not been back to it yet, but I think your remarks about the
dot notation is on the mark!
Scott
On Feb 1, 2008 4:04 PM, Dave Newton <newton.dave@(protected):
> --- stanlick@(protected):
> > I'll drop the m on the Manning site in a couple minutes.
>
> "anning"?
>
> Did you get the #request issue worked out? I probably missed your
> followup.
>
> d.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Scott
stanlick@(protected)

Attachment:
user_182101.ezm (zipped)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:
> <input type="text" name="#session['guide'].shortDescription"
> value="#session['guide'].shortDescription"
> id="updateGuide_#session_'guide'__shortDescription"/>
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@(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 *
> <Michael.Griffith@(protected):
>> 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:
>>
>>
>>
>> <s:iterator id="guide" value="guides">
>>
>> <s:url id="editGuide" action="getGuide"
>> namespace="/datacall" >
>>
>> <s:param name="gid"
>> value="#guide.id" />
>>
>> </s:url>
>>
>> <s:a theme="ajax" href="%{editGuide}"
>> notifyTopics="updateResult"><s:property
>> value="#guide.shortDescription"/></s:a> <br/>
>>
>> </s:iterator>
>>
>>
>>
>> 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:
>>
>>
>>
>> <s:form theme="ajax" action="updateGuide" method="post">
>>
>> <s:hidden name="#session['guide'].id" />
>>
>> <s:textfield key="guide.shortDescription"
>> name="#session['guide'].shortDescription" />
>>
>> <s:textarea key="guide.instructions"
>> name="#session['guide'].instructions" cols="25" rows="8"/>
>>
>> </s:form>
>>
>>
>>
>> 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
>>
>>
>>
>>
>
>
>

Attachment:
user_182103.ezm (zipped)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:news@(protected)
Sent: Friday, February 01, 2008 10:45 AM
To: user@(protected)
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:
> <input type="text" name="#session['guide'].shortDescription"
> value="#session['guide'].shortDescription"
> id="updateGuide_#session_'guide'__shortDescription"/>
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@(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 *
> <Michael.Griffith@(protected):
>> 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:
>>
>>
>>
>> <s:iterator id="guide" value="guides">
>>
>> <s:url id="editGuide" action="getGuide"
>> namespace="/datacall" >
>>
>> <s:param name="gid"
>> value="#guide.id" />
>>
>> </s:url>
>>
>> <s:a theme="ajax" href="%{editGuide}"
>> notifyTopics="updateResult"><s:property
>> value="#guide.shortDescription"/></s:a> <br/>
>>
>> </s:iterator>
>>
>>
>>
>> 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:
>>
>>
>>
>> <s:form theme="ajax" action="updateGuide" method="post">
>>
>> <s:hidden name="#session['guide'].id" />
>>
>> <s:textfield key="guide.shortDescription"
>> name="#session['guide'].shortDescription" />
>>
>> <s:textarea key="guide.instructions"
>> name="#session['guide'].instructions" cols="25" rows="8"/>
>>
>> </s:form>
>>
>>
>>
>> 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: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_182104.ezm (zipped)Filipe David Manana wrote:
> The <c:forEach> jstl tag, as well as all other jstl tags, is not
> allowed in struts 2.0.11, afaik.
This is in no way the case.
What is disallowed in 2.0.11 is el expressions as struts tag attributes.
-Dale

Attachment:
user_182105.ezm (zipped)For completeness: you could also re-work your action to implement
SessionAware instead of using ActionContext.getContext().getSession().
Unit testing would then simply involve calling setSession() on the
action under test. The SessionAware interface exists, in part, to make
testing easier by decoupling your actions from their execution context.
L.
Joey wrote:
> I found it . like this.
>
> Map param = new HashMap();
> ActionContext.getContext().setSession(param);
>
> Thanks for your help
>
> On Feb 1, 2008 4:53 PM, Joey <joey.information@(protected):
>> Thanks, I just checked testing class in Struts2 package, but I am a
>> newbie for Struts2. I cannot understant Struts2 very well, so if you
>> don't mind, pls tell me which testing class I can learn from.
>>
>> Thanks again
>>
>>
>> On Feb 1, 2008 4:31 PM, Nils-Helge Garli Hegvik <nilsga@(protected):
>>> You need to initialize the ActionContext in your unit tests. Take a
>>> look at the Struts 2 tests how it is solved there.
>>>
>>> Nils-H
>>>
>>>
>>> On Feb 1, 2008 9:28 AM, Joey Watson <joey.information@(protected):
>>>> Hi everybody.
>>>>
>>>> I want to test a action class (Struts2) by JUnit. and then method in
>>>> this action need a value in session, then when I run my JUnit test
>>>> class, ActionContext.getContext().getSession return null. (not
>>>> ActionContext.getContext().getSession().get("XXX") return null).
>>>> this action class is working fine in browser.
>>>>
>>>>
>>>> thanks for any help
>>>>
>>>> Joey
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>> For additional commands, e-mail: user-help@(protected)
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>

Attachment:
user_182112.ezm (zipped)I am using RAD 7.0 and targeting WebSphere 6.1 using JDK 5.0. I
recently moved from RAD 6.0 and WAS 5.1. I removed Struts 1.1 and
Tiles 1.1 from the project facets, and then added the JARS for Apache
Tiles 2.05 and Struts 1.38 (and DisplayTag 1.1.1).
Can I use Tiles 2.05 and Struts 1.38 together?
Also, if I can, should I change this:
<tiles:insert attribute="header">
<tiles:put name="title" beanName="title" beanScope="tile" />
<tiles:put name="formDescription" beanName="formDescription"
beanScope="tile" />
<tiles:put name="formInstructions" beanName="formInstructions"
beanScope="tile" />
</tiles:insert>
to this:
<tiles:insertAttribute name="header">
<tiles:putAttribute name="title" value="${tile.title}" />
<tiles:putAttribute name="formDescription"
value="${title.formDescription}" />
<tiles:putAttribute name="formInstructions"
value="${title.formInstructions}" />
</tiles:insertAttribute>
?
I'm confused because there's only 2 of the beanXXX thigns instead of
all 3.

Attachment:
user_182116.ezm (zipped)2008/2/1, javaskull <Greg.Bishop@(protected)>:
> Can I use Tiles 2.05 and Struts 1.38 together?
Yes, as long as you don't use integration code, such as forward to a
Tiles definition. There is a Struts 1/Tiles 2 plugin in the SVN trunk
for the future Struts 1.4 but we really don't know when it will be
released.
>
> Also, if I can, should I change this:
>
> <tiles:insert attribute="header">
> <tiles:put name="title" beanName="title" beanScope="tile" />
> <tiles:put name="formDescription" beanName="formDescription"
> beanScope="tile" />
> <tiles:put name="formInstructions" beanName="formInstructions"
> beanScope="tile" />
> </tiles:insert>
>
> to this:
>
> <tiles:insertAttribute name="header">
> <tiles:putAttribute name="title" value="${tile.title}" />
> <tiles:putAttribute name="formDescription"
> value="${title.formDescription}" />
> <tiles:putAttribute name="formInstructions"
> value="${title.formInstructions}" />
> </tiles:insertAttribute>
>
> ?
>
> I'm confused because there's only 2 of the beanXXX thigns instead of
> all 3.
Ask these Tiles-related questions to Tiles Users mailing list:
http://tiles.apache.org/mail.html
Ciao
Antonio

Attachment:
user_182115.ezm (zipped)Hey all,
I don't know if tags/etc. don't come through because of my Yahoo account,
something in the list handler, or what.
Do other people have huge issues with tags dropping out (even when viewing
source) and all that? It's really frustrating.
Thanks,
Dave

Attachment:
user_182117.ezm (zipped)2008/2/1, Dave Newton <newton.dave@(protected)>:
> Hey all,
>
> I don't know if tags/etc. don't come through because of my Yahoo account,
> something in the list handler, or what.
>
> Do other people have huge issues with tags dropping out (even when viewing
> source) and all that? It's really frustrating.
At my GMail account it works perfectly.
<try>
<text>Hello</text>
<question>How do you see it?</question>
</try>
Ciao
Antonio

Attachment:
user_182118.ezm (zipped)The weird thing is that *sometimes* it works fine. Like my tags always seem
to come through, yours did now (including my paste of your email), and so on.
I guess it's a client thing and/or people are sending HTML email, etc. Total
PITA.
Thanks,
Dave
--- Antonio Petrelli <antonio.petrelli@(protected):
> 2008/2/1, Dave Newton <newton.dave@(protected)>:
> > Hey all,
> >
> > I don't know if tags/etc. don't come through because of my Yahoo account,
> > something in the list handler, or what.
> >
> > Do other people have huge issues with tags dropping out (even when
> viewing
> > source) and all that? It's really frustrating.
>
> At my GMail account it works perfectly.
> <try>
> <text>Hello</text>
> <question>How do you see it?</question>
> </try>
>
> Ciao
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_182120.ezm (zipped)
Hi,
I am kind of Newbie to Struts2 and JSF. I am trying to call a JSF page
from Struts2. For this, I am using JSF plugin and followed the showcase
example given in the site, which is not quite clear to me. Can anyone
help me with this by letting me know about what exact changes should
I need to make?
Thank you,
Manasa.
---------------------------------
Never miss a thing. Make Yahoo your homepage.

Attachment:
user_182121.ezm (zipped)If the beans match, you could probably use commons-beanutils, but
IIRC, you'll incur a performance penalty.
http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/BeanUtils.html#copyProperties(
java.lang.Object,%20java.lang.Object)
By doing it explicitly though, you allow yourself the room to change
your business/TO/etc. objects without the need to update your UI.
-Wes
On 2/1/08, Richard Sayre <richardsayre@(protected):
> Yes,
>
> I know I can do it this way. I'm just being lazy.
>
> I want:
>
> <s:textfield name="member1"/>
>
> To automatically get/set MyObject.getMeember1() rather then it
> automatically setting it in the Action and then having me create the
> Object and populate it with values.
>
>
>
>
> On Feb 1, 2008 9:10 AM, LEONARD Julien (Consulting for ACCOR Hotels)
> <julien.leonard@(protected):
> > Did you try :
> >
> > MyObject theObject;
> > (geter and setter on theObject)
> >
> > execute () {
> >
> > theObject = myDAO.getRecord(id);
> > }
> >
> > And in the JSP : <s:property value="theObject.member1"/>
> >
> > -----Message d'origine-----
> > De : Richard Sayre [mailto:richardsayre@(protected)]
> > Envoyé : vendredi 1 février 2008 13:37
> > À : Struts Users Mailing List
> > Objet : Populate Form from DAO
> >
> >
> > Struts 2 allows us to automatically populate our forms if we name our fields correctly, which is wonderful.
> >
> > My actions usually go something like this
> >
> > execute () {
> >
> > MyObject o = myDAO.getRecord(id);
> >
> > member1 = o.getMember1();
> > member2 = o.getMember2();
> >
> > }
> >
> > MyObject is a JO for hold a row in the database. I like the fact that I can name my form field 'member1' and it the interceptor will set and get from my Action. I dont like having to set up each member variable in the action with the members my class. Is it possible to somehow have Struts automatically populate an Java Object rather then the Action? I thought I remember reading about this before but I'm not sure. It's not a big deal, and I know I can use OGNL to access the value, but I wanted the convience of mapping a fieldName to my custom object. Is this possible?
> >
> > Thank you,
> >
> > Rich
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
> > This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
> > **********************************************************************
> > Ce message électronique et tous les fichiers joints ainsi que les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
> > **********************************************************************
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

Attachment:
user_182125.ezm (zipped)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:
<form>
Search Question Text: <input id="questionText" name="questionText"
type="text" size="30" class="form-autocomplete" />
</form>
<ajax:autocomplete
baseUrl="${pageContext.request.contextPath}/question/get-term.action"
source="questionText"
target="questionText"
parameters="qt={questionText}"
className="autocomplete"
indicator="throbbing"
minimumCharacters="1" />
My Action looks like this:
public class QuestionAction extends BaseAction implements
ModelDriven<Question>, Preparable, ServletRequestAware,
ServletResponseAware {
...
public String getSearchTerm() throws Exception{
System.out.println("**** Question Search Term:" + qt);
List<Question> 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:
<package name="question" extends="base-pkg"
namespace="/question">
<action name="get-term" method="getSearchTerm"
class="...QuestionAction">
<result name="success"
type="tiles">question.panel</result>
</action>
</package>
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)

Attachment:
user_182126.ezm (zipped)--- "Griffith, Michael *" <Michael.Griffith@(protected):
> public class QuestionAction extends BaseAction implements
> ModelDriven<Question>, Preparable, ServletRequestAware,
> ServletResponseAware {
> public String getSearchTerm() throws Exception {
> System.out.println("**** Question Search Term:" + qt);
> List<Question> 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:
>
> <package name="question" extends="base-pkg"
> namespace="/question">
> <action name="get-term" method="getSearchTerm"
> class="...QuestionAction">
> <result name="success"
> type="tiles">question.panel</result>
> </action>
> </package>
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

Attachment:
user_182127.ezm (zipped)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 <s:autocompleter> tag?
mg
-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Friday, February 01, 2008 5:42 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?
--- "Griffith, Michael *" <Michael.Griffith@(protected):
> public class QuestionAction extends BaseAction implements
> ModelDriven<Question>, Preparable, ServletRequestAware,
> ServletResponseAware {
> public String getSearchTerm() throws Exception {
> System.out.println("**** Question Search Term:" + qt);
> List<Question> 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:
>
> <package name="question" extends="base-pkg"
> namespace="/question">
> <action name="get-term" method="getSearchTerm"
> class="...QuestionAction">
> <result name="success"
> type="tiles">question.panel</result>
> </action>
> </package>
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: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)