Author Login
Post Reply
user Digest 19 Jul 2009 02:08:00 -0000 Issue 8759
Topics (messages 200869 through 200880):
Tags as template parameters?
200869 by: Pascal
200875 by: Wes Wannemacher
null and zero issue
200870 by: Russo, Joe
200874 by: Dave Newton
Ghostly exception
200871 by: Peter Bliznak
Re: Struts2 + JPA - Lazy Initialization During View Generation
200872 by: Nathan Schulte
Re: Help with a redirect
200873 by: Dave Newton
Struts w/Ajax with Struts again
200876 by: cpanon
200879 by: Martin Gainty
200880 by: cpanon
XML data in request parameter gotchas?
200877 by: Michael Finney
Exception though the result looks as expected
200878 by: mathias-ewald
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_200869.ezm (zipped)Hello list,
in Struts2 it is possible to do something like
<html>
<body>
<s:myMainNavigationMenu />
<h1>A page</h1>
<p>Some content</p>
</body>
</html>
This works ok, but my problem is that I have to change every single
page, if i would like to have a custom footer for every page, for example.
Now my question is: Is it possible to do something like this?
<s:useTemplate name="myCommonTemplate">
<s:setTemplateTag name="body">
<h1>A page</h1>
<p>Some content</p>
</s:setTemplateTag>
</s:useTemplate>
And as template definition say
<!-- Main menu -->
<table>...</table>
<s:insertTemplateTag name="body" />
<!-- Footer -->
<p>This is the footer</p>
I know it is possible to use parameters for templates, but they
obviously have huge limitations as I can't just put the tags there as I
did in my example.
Also, I could do something like
<s:myMainTemplate>
<s:param name="bodyPage" value="page1.jsp" />
</s:myMainTemplate>
which I also don't want because I would have an extra (unnecessary) page.
So, is it possible to pass whole XML-Structures to templates? Maybe you
have some reasons why I shouldn't want what I'm suggesting here, I would
be eager to hear them! :-)
Pascal

Attachment:
user_200875.ezm (zipped)I'm on my phone so I only skimmed your message. If I read correctly,
you should take a look at sitemesh.
-W
On 7/17/09, Pascal <pascal@(protected):
> Hello list,
>
> in Struts2 it is possible to do something like
>
> <html>
> <body>
> <s:myMainNavigationMenu />
>
> <h1>A page</h1>
> <p>Some content</p>
> </body>
> </html>
>
> This works ok, but my problem is that I have to change every single
> page, if i would like to have a custom footer for every page, for example.
>
> Now my question is: Is it possible to do something like this?
>
> <s:useTemplate name="myCommonTemplate">
> <s:setTemplateTag name="body">
> <h1>A page</h1>
> <p>Some content</p>
> </s:setTemplateTag>
> </s:useTemplate>
>
> And as template definition say
>
> <!-- Main menu -->
> <table>...</table>
>
> <s:insertTemplateTag name="body" />
>
> <!-- Footer -->
> <p>This is the footer</p>
>
> I know it is possible to use parameters for templates, but they
> obviously have huge limitations as I can't just put the tags there as I
> did in my example.
>
> Also, I could do something like
>
> <s:myMainTemplate>
> <s:param name="bodyPage" value="page1.jsp" />
> </s:myMainTemplate>
>
> which I also don't want because I would have an extra (unnecessary) page.
>
> So, is it possible to pass whole XML-Structures to templates? Maybe you
> have some reasons why I shouldn't want what I'm suggesting here, I would
> be eager to hear them! :-)
>
> Pascal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

Attachment:
user_200870.ezm (zipped)I know this may not be the appropriate group to send this, but I think
this is a general issue that I am not aware of and this group is active
and thought I'd give it a shot.
I wrote a web service component using JAX-WS API and deployed on JBoss
5.0.1 application server. And also, wrote a Soap client which sends a
valid soap request to server and server executes corresponding method
and returns soap response back to client but what ever parameters I
included in soap, it considers it as null for string datatype and zero
for int data type.
Appreciate if you could help me to resolve this problem.
Joe
****

Attachment:
user_200874.ezm (zipped)Russo, Joe wrote:
> I know this may not be the appropriate group to send this, but I think
> this is a general issue that I am not aware of and this group is active
> and thought I'd give it a shot.
Wouldn't a web service list/forum be a better bet?
Dave

Attachment:
user_200871.ezm (zipped)
Attachment:
user_200872.ezm (zipped)Nathan Schulte <nathan.schulte <at> ngc.com> writes:
> I'll let you know what I come up with.
Well, I was able to get this to work. The interceptor is placed on the end of
the stack, although it's location oughtn't matter. Also, it is placed on the
stack for _all_ actions. I'm not sure if this is a problem, it may actually be
a good thing (at least in my case, I was not wrapping all of the actions' calls
to the EJBs in a UserTransaction, this takes care of that, everywhere). Also
note, this doesn't support transaction rollback in it's current form. As a
simple test, it worked though.
This would look ten times prettier if only the container supported resource
injection, :).
http://pastebin.com/f3c76ae6f
-Nate

Attachment:
user_200873.ezm (zipped)Is it actually not being set on the action, or is this just the normal
log message for parameters that don't exist in the result?
Dave
Security Management wrote:
> OK, tried adding the "parse" param, and still no luck...
>
> <action name="unlock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlUnlockDoor">
> <result name="success" type="redirectAction">
> <param name="actionName">statusAjax</param>
> <param name="door.id">${door.id}</param>
> <param name="parse">true</param>
> </result>
> </action>
>
> -----Original Message-----
> From: Security Management [mailto:list-subscriptions@(protected)]
> Sent: Friday, July 17, 2009 9:56 AM
> To: 'Struts Users Mailing List'
> Subject: Help with a redirect
>
> When my index page loads, ajax requests are posted to the statusAjax page
> with a parameter of door.id equal to x for the doors.
>
> That works fine, and is a POST.
>
> When I click on an icon, it posts to the identical action, to either lock or
> unlock. When the action is done, I redirect to the status action (just like
> when the index loads, except with a GET this time). I get an exception
> setting the door.id, but the url shows that the get value and property name
> are right for the redirect action. Can someone explain what I am doing
> wrong? The action works on the index ajax calls, but future clicks give me:
>
> Caused by: ognl.NoSuchPropertyException:
>
org.apache.struts2.dispatcher.ServletActionRedirectResult.door>
> Here is the struts.xml
>
> <action name="index"
> class="com.secmgmt.struts2.actions.door_control.DoorControlIndexAction">
> <result
> name="success">/pages/door-control/jsps/index-ajax.jsp</result>
> </action>
> <action name="lock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlLockDoor">
> <result name="success" type="redirectAction">
> <param name="actionName">statusAjax</param>
> <param name="door.id">${door.id}</param>
> </result>
> </action>
>
> <action name="unlock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlUnlockDoor">
> <result name="success" type="redirectAction">
> <param name="actionName">statusAjax</param>
> <param name="door.id">${door.id}</param>
> </result>
> </action>
>
> <action name="statusAjax"
> class="com.secmgmt.struts2.actions.door_control.AjaxDoorStatus">
> <result
> name="success">/pages/door-control/jsps/single-door-ajax.jsp</result>
> </action>
>
>
> ---------------------------------------------------------------------
> 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_200876.ezm (zipped)Hello
I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back. (With prototpye and json, very, very elegant). I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc. I understand how with getInputForward it doesnt happen. If I setAttribute(), the original value that was processed when the form first generated is all that ever shows. A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members. Is there a way to force a complete reprocessing the jsp from within an action? tia.

Attachment:
user_200879.ezm (zipped)
ajax's responsibility is to return either json or html formatted text to innerHtml attribute of div tag identified in ajax call
other activity such as refreshing session attributes would need to take place
in the action class..upon return from action all tags of the jsp would re-display the content based on the refreshed state for those session attributes
another strategy is to create and/or modify a jsp in the action and on return forwards to a result *which will forward to the just created or modified jsp*
you're welcome
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Fri, 17 Jul 2009 18:45:18 -0700
> From: cpanon@(protected)
> Subject: Struts w/Ajax with Struts again
> To: user@(protected)
>
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back. (With prototpye and json, very, very elegant). I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc. I understand how with getInputForward it doesnt happen. If I setAttribute(), the original value that was processed when the form first generated is all that ever shows. A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members. Is there a way to force a complete reprocessing the jsp from within an action? tia.
_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports

Attachment:
user_200880.ezm (zipped)Hi Martin
Thank you. So I may be misunderstanding something. If I return to the Ajax call with mapping.getInputForward() for the defined input attribute of that action processing the Ajax call, should I see changes in the session objects displayed? Because before I return I set an element in the actionForm.setSeeMe("hi"), set the session.setAttribute("actionForm", modified) and I do not see it in the display. I am accessing that element with the ${seeMe} syntax. I am seeing the json results, but not what I put in the actionForm. That is what I would "organically" expect to see. Can you clarify this? tia.
--- On Sat, 7/18/09, Martin Gainty <mgainty@(protected):
From: Martin Gainty <mgainty@(protected)>
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" <user@(protected)>
Date: Saturday, July 18, 2009, 9:32 PM
ajax's responsibility is to return either json or html formatted text to innerHtml attribute of div tag identified in ajax call
other activity such as refreshing session attributes would need to take place
in the action class..upon return from action all tags of the jsp would re-display the content based on the refreshed state for those session attributes
another strategy is to create and/or modify a jsp in the action and on return forwards to a result *which will forward to the just created or modified jsp*
you're welcome
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Fri, 17 Jul 2009 18:45:18 -0700
> From: cpanon@(protected)
> Subject: Struts w/Ajax with Struts again
> To: user@(protected)
>
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back. (With prototpye and json, very, very elegant). I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc. I understand how with getInputForward it doesnt happen. If I setAttribute(), the original value that was processed when the form first generated is all that ever shows. A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members. Is there a way to force a complete reprocessing the jsp from within an action? tia.
_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports

Attachment:
user_200877.ezm (zipped)Hi,
If a client is sending us XML via HTTP POST, are there any gotcha's with
struts2?
Also, what is a great way to send test XML data using an HTTP POST; just
populate a form field and submit it?
Thanks.

Attachment:
user_200878.ezm (zipped)