Author Login
Post Reply
user Digest 3 Feb 2010 20:24:18 -0000 Issue 8999
Topics (messages 204928 through 204940):
Re: How to handle input from iterated output
204928 by: Stephen Turner
204929 by: Craig Ricciuto
Re: struts 2, writing a custom tag that is able to access objects in ActionContext using OGNL
204930 by: Jake Vang
204931 by: Bill Bohnenberger
New Struts2/Hibernate/Spring tutorial
204932 by: Hulbert Chris
204935 by: Kawczynski, David
204936 by: Hulbert Chris
Inline editable grid view for use with struts 2?
204933 by: Jim Talbut
204934 by: Paul Zepernick
204937 by: Johannes Geppert
Re: decorating static content with sitemesh
204938 by: Philipp Leusmann
204939 by: Philipp Leusmann
struts 1: id attribute in <html:messages.../> tag
204940 by: James Richter
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_204928.ezm (zipped)On Mon, 01 Feb 2010 10:55:55 -0500, Craig Ricciuto
<cricciuto@(protected):
> Hi, just a quick question.
> I have a class that has 4 fields. 2 Strings, 1 int, 1 boolean. I shall
> refer to this class as MyClass
> In my Action class I have a List (call it MyList) that is a list of
> MyClass.
> It can be populated with as little as 1 item or as many as say 256 items
> (could be more but I'll keep this limit for simplicity).
> Iterating through MyList in a JSP with the struts tag
> <s:iterator........</s:iterator> is easy enough. My question is this....
>
> When I iterate through MyList in the JSP I'm setting form fields (of all
> 4
> fields from MyClass). What would be the best way to get all that input
> back
> when I submit the form?
> Is there an example of this somewhere I haven't found or just a pretty
> straightforward way of doing this I'm not thinking of?
>
> Thanks,
> Craig
You just need to tell struts what type of objects are in the list:
http://struts.apache.org/2.0.8/docs/type-conversion.html
Basically this would involve a "Myaction-conversion.properties" file
alongside the action class. It would contain:
Element_MyList=mypackage.MyClass
Also, there's a pretty good section on this in "Struts in Action".
Steve
--
Stephen Turner
Senior Programmer/Analyst - SAIS
MIT IS&T

Attachment:
user_204929.ezm (zipped)Thank you very much. This seems to be exactly what I need.
On Mon, Feb 1, 2010 at 11:38 AM, Stephen Turner <sturner@(protected):
> On Mon, 01 Feb 2010 10:55:55 -0500, Craig Ricciuto <
> cricciuto@(protected):
>
> Hi, just a quick question.
>> I have a class that has 4 fields. 2 Strings, 1 int, 1 boolean. I shall
>> refer to this class as MyClass
>> In my Action class I have a List (call it MyList) that is a list of
>> MyClass.
>> It can be populated with as little as 1 item or as many as say 256 items
>> (could be more but I'll keep this limit for simplicity).
>> Iterating through MyList in a JSP with the struts tag
>> <s:iterator........</s:iterator> is easy enough. My question is this....
>>
>> When I iterate through MyList in the JSP I'm setting form fields (of all 4
>> fields from MyClass). What would be the best way to get all that input
>> back
>> when I submit the form?
>> Is there an example of this somewhere I haven't found or just a pretty
>> straightforward way of doing this I'm not thinking of?
>>
>> Thanks,
>> Craig
>>
>
> You just need to tell struts what type of objects are in the list:
>
> http://struts.apache.org/2.0.8/docs/type-conversion.html
>
> Basically this would involve a "Myaction-conversion.properties" file
> alongside the action class. It would contain:
>
> Element_MyList=mypackage.MyClass
>
> Also, there's a pretty good section on this in "Struts in Action".
>
> Steve
>
> --
> Stephen Turner
> Senior Programmer/Analyst - SAIS
> MIT IS&T
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Craig Ricciuto, B.Cosc
Software Developer
Symboticware Incorporated
Main: (800) 519-5496 ext. 105
Fax: (888) 693-5355
www.symboticware.com
---------------
DISCLAIMER: The information contained in this e-mail is intended only for
the use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged and private information. It is intended solely
for the addressee. Access to this e-mail by anyone else is unauthorized. If
you are not the intended recipient, you are hereby notified that any
perusal, use, distribution, copying, disclosure, or any action taken or
omitted to be taking in reliance on it, is strictly prohibited and may be
unlawful. If you have received this e-mail in error, please immediately
advise me by e-mail at cricciuto@(protected)
document without making a copy.

Attachment:
user_204930.ezm (zipped)bill, thanks for including the code (especially the import statements
so i will know where these objects/classes are coming from).
On Mon, Feb 1, 2010 at 11:09 AM, Bill Bohnenberger <bill98122@(protected):
> Hi Jake,
>
> I have a custom table tag that needs Value Stack access, too.
> Here's how I do it:
>
> package...
>
> import
org.apache.struts2.views.jsp.TagUtils;
> import
org.apache.struts2.util.MakeIterator;
>
> public class TableTag extends SimpleTagSupport
> {
> private String list;
>
> public void doTag() throws JspException
> {
> ValueStack stack = TagUtils.getStack((PageContext)getJspContext());
> Iterator iterator = MakeIterator.convert(stack.findValue(list));
> while (iterator.hasNext())
> {
> ...
> }
> }
>
> public void setList(String list)
> {
> this.list = list;
> }
> }
>
> Of course "list" is one of my custom tag's attributes and appropriately
> defined in my TLD.
>
> Cheers,
> Bill
>
>
> On Mon, Feb 1, 2010 at 5:04 AM, Jake Vang <vangjake@(protected):
>
>> i found something helpful here. it works.
>>
>> http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html
>>
>>
>>
>> On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang <vangjake@(protected):
>> > i was wondering if it was possible to write a custom tag that is able
>> > to access objects in the ActionContext using OGNL? i'm not sure if
>> > this is a "correct" question.
>> >
>> > my problem is that i have a form. the form is posted to an action. the
>> > action has getters/setters for the form fields. i then forward to
>> > form-success.jsp. on this page, i can use the struts taglibs to access
>> > the information posted. for example, <s:property value="email"/>.
>> > however, if i have a custom tag, how do i access "email" from the
>> > ActionContext? for example, <customTabLib:showEmail value="email"/>,
>> > doesn't work. the tag displays the value, "email". i also tried a
>> > couple of things too that didn't work.
>> >
>> > <customTagLib:showEmail value="#email"/>
>> > <customTagLib:showEmail value="%{#email}"/>
>> >
>> > is there a class/interface that i can extend/implement in struts 2
>> > that would easily help me get the value of email from the
>> > ActionContext in my custom tag?
>> >
>> > thanks.
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment:
user_204931.ezm (zipped)Aye, but whoops, I forgot this one :)
import
com.opensymphony.xwork2.util.ValueStack;
Cheers,
Bill
On Mon, Feb 1, 2010 at 2:18 PM, Jake Vang <vangjake@(protected):
> bill, thanks for including the code (especially the import statements
> so i will know where these objects/classes are coming from).
>
> On Mon, Feb 1, 2010 at 11:09 AM, Bill Bohnenberger <bill98122@(protected)>
> wrote:
> > Hi Jake,
> >
> > I have a custom table tag that needs Value Stack access, too.
> > Here's how I do it:
> >
> > package...
> >
> > import
org.apache.struts2.views.jsp.TagUtils;
> > import
org.apache.struts2.util.MakeIterator;
> >
> > public class TableTag extends SimpleTagSupport
> > {
> > private String list;
> >
> > public void doTag() throws JspException
> > {
> > ValueStack stack =
> TagUtils.getStack((PageContext)getJspContext());
> > Iterator iterator = MakeIterator.convert(stack.findValue(list));
> > while (iterator.hasNext())
> > {
> > ...
> > }
> > }
> >
> > public void setList(String list)
> > {
> > this.list = list;
> > }
> > }
> >
> > Of course "list" is one of my custom tag's attributes and appropriately
> > defined in my TLD.
> >
> > Cheers,
> > Bill
> >
> >
> > On Mon, Feb 1, 2010 at 5:04 AM, Jake Vang <vangjake@(protected)>
> wrote:
> >
> >> i found something helpful here. it works.
> >>
> >>
> http://struts.apache.org/2.1.8.1/docs/access-to-valuestack-from-jsps.html
> >>
> >>
> >>
> >> On Mon, Feb 1, 2010 at 7:34 AM, Jake Vang <vangjake@(protected)>
> wrote:
> >> > i was wondering if it was possible to write a custom tag that is able
> >> > to access objects in the ActionContext using OGNL? i'm not sure if
> >> > this is a "correct" question.
> >> >
> >> > my problem is that i have a form. the form is posted to an action. the
> >> > action has getters/setters for the form fields. i then forward to
> >> > form-success.jsp. on this page, i can use the struts taglibs to access
> >> > the information posted. for example, <s:property value="email"/>.
> >> > however, if i have a custom tag, how do i access "email" from the
> >> > ActionContext? for example, <customTabLib:showEmail value="email"/>,
> >> > doesn't work. the tag displays the value, "email". i also tried a
> >> > couple of things too that didn't work.
> >> >
> >> > <customTagLib:showEmail value="#email"/>
> >> > <customTagLib:showEmail value="%{#email}"/>
> >> >
> >> > is there a class/interface that i can extend/implement in struts 2
> >> > that would easily help me get the value of email from the
> >> > ActionContext in my custom tag?
> >> >
> >> > thanks.
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> 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_204932.ezm (zipped)Hi all, I've recently been working on a Struts2/Hibernate/Spring
beginners tutorial for some internal training at work, and was thinking
that perhaps it could have some worth to the greater struts community,
can anyone let me know if theres a site where it would belong and if you
think it's accurate? Thanks.
The tutorial can be found here:
http://www.scribd.com/doc/25244173/Java-Struts-Hibernate-Tutorial
Oh and apologies in advance for my email signature, I can't do anything
about it...
***********************************************************
CAUTION: This email and files included in its transmission
are solely intended for the use of the addressee(s) and may
contain information that is confidential and privileged.
If you receive this email in error, please advise us
immediately and delete it without copying the contents
contained within. Woolworths Limited (including its group
of companies) do not accept liability for the views
expressed within or the consequences of any computer
viruses that may be transmitted with this email. The
contents are also subject to copyright. No part of it
should be reproduced, adapted or transmitted without the
written consent of the copyright owner.
***********************************************************

Attachment:
user_204935.ezm (zipped)I don't think it is wise to instruct newbies to use scriptles,
especially in SiteMesh decorators. The decorator.xml file should
instruct SiteMesh to use different decorators for different paths.
Newbies need to get started off on the right foot, and not with bad
practices.
Other then that it's pretty good.
Cheers!
-dave
> -----Original Message-----
> From: Hulbert Chris [mailto:CHulbert@(protected)]
> Sent: Tuesday, February 02, 2010 12:32 AM
> To: user@(protected)
> Subject: New Struts2/Hibernate/Spring tutorial
>
> Hi all, I've recently been working on a Struts2/Hibernate/Spring
> beginners tutorial for some internal training at work, and
> was thinking
> that perhaps it could have some worth to the greater struts community,
> can anyone let me know if theres a site where it would belong
> and if you
> think it's accurate? Thanks.
>
> The tutorial can be found here:
> http://www.scribd.com/doc/25244173/Java-Struts-Hibernate-Tutorial
>
> Oh and apologies in advance for my email signature, I can't
> do anything
> about it...
>
> ***********************************************************
> CAUTION: This email and files included in its transmission
> are solely intended for the use of the addressee(s) and may
> contain information that is confidential and privileged.
> If you receive this email in error, please advise us
> immediately and delete it without copying the contents
> contained within. Woolworths Limited (including its group
> of companies) do not accept liability for the views
> expressed within or the consequences of any computer
> viruses that may be transmitted with this email. The
> contents are also subject to copyright. No part of it
> should be reproduced, adapted or transmitted without the
> written consent of the copyright owner.
> ***********************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.

Attachment:
user_204936.ezm (zipped)Thanks for the kind words, I've updated the sitemesh decorator to use
JSTL instead of scriptlets now and it does indeed look neater.
Updated project files here:
http://splinter.com.au/blog/wp-content/uploads/javastrutshibernatetutori
al.zip
And updated tutorial here:
http://www.scribd.com/doc/25244173/Java-Struts-Hibernate-Tutorial
So in the absence of any other feedback, would it be safe to assume I
wouldn't be leading our team astray by using this as a learning
tutorial?
Cheers, Chris
-----Original Message-----
From: Kawczynski, David [mailto:david_kawczynski@(protected)]
Sent: Wednesday, 3 February 2010 8:06 AM
To: Struts Users Mailing List
Subject: RE: New Struts2/Hibernate/Spring tutorial
I don't think it is wise to instruct newbies to use scriptles,
especially in SiteMesh decorators. The decorator.xml file should
instruct SiteMesh to use different decorators for different paths.
Newbies need to get started off on the right foot, and not with bad
practices.
Other then that it's pretty good.
Cheers!
-dave
> -----Original Message-----
> From: Hulbert Chris [mailto:CHulbert@(protected)]
> Sent: Tuesday, February 02, 2010 12:32 AM
> To: user@(protected)
> Subject: New Struts2/Hibernate/Spring tutorial
>
> Hi all, I've recently been working on a Struts2/Hibernate/Spring
> beginners tutorial for some internal training at work, and
> was thinking
> that perhaps it could have some worth to the greater struts community,
> can anyone let me know if theres a site where it would belong
> and if you
> think it's accurate? Thanks.
>
> The tutorial can be found here:
> http://www.scribd.com/doc/25244173/Java-Struts-Hibernate-Tutorial
>
> Oh and apologies in advance for my email signature, I can't
> do anything
> about it...
***********************************************************
CAUTION: This email and files included in its transmission
are solely intended for the use of the addressee(s) and may
contain information that is confidential and privileged.
If you receive this email in error, please advise us
immediately and delete it without copying the contents
contained within. Woolworths Limited (including its group
of companies) do not accept liability for the views
expressed within or the consequences of any computer
viruses that may be transmitted with this email. The
contents are also subject to copyright. No part of it
should be reproduced, adapted or transmitted without the
written consent of the copyright owner.
***********************************************************

Attachment:
user_204933.ezm (zipped)Hi,
I need an inline editable grid view that will be used in a struts 2 application.
It'll be used to collect multiple rows of child data when adding a single parent row.
Does anyone have any recommendations?
Thanks
Jim

Attachment:
user_204934.ezm (zipped)
Hi Jim,
We have used the jqGrid plugin for Jquery. We have not used the inline editing, but I know it is supported. It has worked very well for us. Here is a link to the Demo.
http://www.trirand.net/demophp.aspx
Regards,
Paul
-----Original Message-----
From: Jim Talbut [mailto:Jim.Talbut@groupgti.com]
Sent: Tuesday, February 02, 2010 2:40 PM
To: user@struts.apache.org
Subject: Inline editable grid view for use with struts 2?
Hi,
I need an inline editable grid view that will be used in a struts 2 application.
It'll be used to collect multiple rows of child data when adding a single parent row.
Does anyone have any recommendations?
Thanks
Jim
The information contained in this transmission contains confidential information that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled.
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of these documents is strictly prohibited. If you have received this information in error, please notify the sender immediately by return email and arrange for the return or destruction of these documents.

Attachment:
user_204937.ezm (zipped)
Hello,
the struts2-jquery plugin provides a grid tag based on jqGrid
with inline editing and cell editing. Take a look at the showcases
there are severals samples.
http://code.google.com/p/struts2-jquery/
Best Regards
Johannes Geppert
Jim Talbut-2 wrote:
>
> Hi,
>
> I need an inline editable grid view that will be used in a struts 2
> application.
> It'll be used to collect multiple rows of child data when adding a single
> parent row.
> Does anyone have any recommendations?
>
> Thanks
>
> Jim
>
>
-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204938.ezm (zipped)Sorry for my late reply, but I was busy doing other things.
I just investigated a little further into this issue, but still cannot find a way to resolve it.
As you proposed, I checked my struts filter mapping, which is /* , so that would be sufficient.
I also checked the struts.action.extension-property in struts.properties, which I commented out, so this defaults to "action" and "" in org.apache.struts2.dispatcher.mapper.DefaultActionMapper.
But in this class there seems to be the error: In revision 615679 a change was made to
org.apache.struts2.dispatcher.mapper.DefaultActionMapper.dropExtension(String, ActionMapping) , which was supposed to add some special handling for urls like /foo/bar-1.0/description . Anyway, this handling seems to breaks URLs like "foo.htm".
So, to sum it up, am I missing anything which I need to do to make my stuff work? If not, I'll subclass the DefaultActionMapper and override the mentioned method, but I don't think thats the way it's supposed to be.
Regards,
Philipp
Am 21.01.2010 um 20:47 schrieb Brian Thompson:
> In web.xml, make a Struts filter mapping that includes *.html in addition to
> *.action.
>
> -Brian
>
>
> On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann <
> philipp.leusmann@(protected):
>
>> Hi Brian,
>>
>> that would work, but then I'll have to make a call to
>> "/staticHTML/page.html.action" to access "/staticHTML/page.html".
>> Would be a workaround, but I still would prefer the call to *.html
>>
>> Philipp
>>
>> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
>>
>>> Can you get the Struts filter to execute for static pages? It seems like
>>> that would fix the Dispatcher.getInstance() problem. Something like
>>>
>>> <action name="*" class="
com.opensymphony.xwork2.ActionSupport">
>>> <result name="success">/staticHTML/{1}</result>
>>> </action>
>>>
>>> in your struts.xml seems like it would do the trick (be careful of
>>> overriding your regular actions!).
>>>
>>> -Brian
>>>
>>>
>>>
>>> On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
>>> philipp.leusmann@(protected):
>>>
>>>> Sure it would be faster without that stuff, but since I use some
>>>> session-related stuff (user login status etc.) , replacing it with a
>> static
>>>> decorator would not be feasible.
>>>>
>>>> Thanks anyway for your suggestions.
>>>>
>>>> Regards,
>>>> Philipp
>>>> <snip>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>

Attachment:
user_204939.ezm (zipped)Just to add things up, I filed a jira-issue for all of this: <https://issues.apache.org/jira/browse/WW-3381> , but maybe you can still convince me I got things wrong and the stuff works without jumping hoops
Am 03.02.2010 um 12:54 schrieb Philipp Leusmann:
> Sorry for my late reply, but I was busy doing other things.
>
> I just investigated a little further into this issue, but still cannot find a way to resolve it.
> As you proposed, I checked my struts filter mapping, which is /* , so that would be sufficient.
>
> I also checked the struts.action.extension-property in struts.properties, which I commented out, so this defaults to "action" and "" in org.apache.struts2.dispatcher.mapper.DefaultActionMapper.
> But in this class there seems to be the error: In revision 615679 a change was made to
org.apache.struts2.dispatcher.mapper.DefaultActionMapper.dropExtension(String, ActionMapping) , which was supposed to add some special handling for urls like /foo/bar-1.0/description . Anyway, this handling seems to breaks URLs like "foo.htm".
>
> So, to sum it up, am I missing anything which I need to do to make my stuff work? If not, I'll subclass the DefaultActionMapper and override the mentioned method, but I don't think thats the way it's supposed to be.
>
> Regards,
> Philipp
>
>
> Am 21.01.2010 um 20:47 schrieb Brian Thompson:
>
>> In web.xml, make a Struts filter mapping that includes *.html in addition to
>> *.action.
>>
>> -Brian
>>
>>
>> On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann <
>> philipp.leusmann@(protected):
>>
>>> Hi Brian,
>>>
>>> that would work, but then I'll have to make a call to
>>> "/staticHTML/page.html.action" to access "/staticHTML/page.html".
>>> Would be a workaround, but I still would prefer the call to *.html
>>>
>>> Philipp
>>>
>>> Am 21.01.2010 um 19:18 schrieb Brian Thompson:
>>>
>>>> Can you get the Struts filter to execute for static pages? It seems like
>>>> that would fix the Dispatcher.getInstance() problem. Something like
>>>>
>>>> <action name="*" class="
com.opensymphony.xwork2.ActionSupport">
>>>> <result name="success">/staticHTML/{1}</result>
>>>> </action>
>>>>
>>>> in your struts.xml seems like it would do the trick (be careful of
>>>> overriding your regular actions!).
>>>>
>>>> -Brian
>>>>
>>>>
>>>>
>>>> On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann <
>>>> philipp.leusmann@(protected):
>>>>
>>>>> Sure it would be faster without that stuff, but since I use some
>>>>> session-related stuff (user login status etc.) , replacing it with a
>>> static
>>>>> decorator would not be feasible.
>>>>>
>>>>> Thanks anyway for your suggestions.
>>>>>
>>>>> Regards,
>>>>> Philipp
>>>>> <snip>
>>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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_204940.ezm (zipped)
Hi,
Can anyone explain what should be used as the id value in the <html:messages
id="..." .../> tag? Where to define it? I read the doc
(http://struts.apache.org/1.3.10/struts-taglib/tlddoc/html/messages.html)
but can't figure it out.
In Action class,
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage("error.success"));
// error.success is a property key,
already defined
addMessages(request, messages);
In the view, I used this code to try to render the message.
<html:messages id="..." message="true" >
<bean:write name="msg" />
</html:messages>
What should be used as the id value?
Thanks.
--
Sent from the Struts - User mailing list archive at Nabble.com.