Hi Martin,

Thank you for your time but I am not sure that it answers my question. Here is some code to illustrate:

This works:
<s:component template='HighlightPanel.jsp' id="newsletter-subscribe-box">
	<s:param name="title">Welcome to our site</s:param>
	....
</s:component>
This does not work:
<s:component template='HighlightPanel.jsp'>
	<s:param name="title">Welcome to our site</s:param>
	<s:param name="id">newsletter-subscribe-box</s:param>
...
</s:component>
The "id" parameter is not sent to the "HighlightPanel.jsp" component.

In the s:component documentation, there seems to be no distinction between the "title" parameter and the "id" parameter. Why this inconsistent behavior? Could this behavior change in future releases?

Best regard,
Thim Anneessens.


On 11/30/2012 01:56 PM, Martin Gainty wrote:
<s:url var="url" action="" class="code-quote">"Welcome">
  <s:param name="request_locale">en</s:param>
</s:url>
<s:a href="" class="code-quote">"%{url}">English</s:a>

This param tag will
1)add the parameter "?request_locale=en" to the Welcome Action URL, and
2)store it under the name "url".
The a tag then injects the "url" reference into the hyperlink. This request_locale parameter will be picked up by the I18n Interceptor, and change your Locale accordingly.

Any number of parameters can be added to the URI by adding more param tags.

the Struts doc explanation appears to be clear on the use of params to build out the parameter(s)  list
http://struts.apache.org/2.0.11.2/docs/using-tags.html
 
so in your case title would be request scoped
id would not be request scope since every component would require an id
 
does this conform to your understanding
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, 30 Nov 2012 10:56:47 +0100
From: t.anneess...@ictjob.be
To: user@struts.apache.org
Subject: Inconsistency in Struts2 s:component parameters handling

Hello,

We are using Struts 2.3.1.2 and have noticed a strange behavior in component parameter handling:

We have a component that uses both an "id" parameter and a "title" parameter.

What is strange is that when we use s:component, the "title" parameter value can either be specified using the "title" attribute of s:component or a s:param. The "id" parameter value can only be specified using the "id" attribute of s:component. Using the s:param for "id" has no effect.

There seems to be no pertinent explanation for this behavior in the documentation and I was wondering if this behavior would evolve in further versions. We are currently using s:param to specify our numerous "title" parameters and hope that it will always be possible in the future.

Could anyone shed some light on this inconsistent behavior?

Best regards,
--
Thim Anneessens
IT Department

ictjob group

ictjob.be
Tel: +32 2 725 73 00
Terhulpsesteenweg, 6B
B-1560 Hoeilaart
ictjob.lu
Tel: +352 621 364 792
12, rue Eugène Ruppert
L-2453 Luxembourg
jobtic.fr
Tel: +33 9 81 25 19 66
19 rue Martel
75010 Paris
ticjob.es
Tel: +34 911 25 43 11
Calle Santo Tomé 4, 5B
28004 Madrid
ictjob.de
Tel: +49 711 91 41 07 32
Humboldtstr. 32
70771 Leinfelden-Echterdingen


--
Thim Anneessens
IT Department

ictjob group

ictjob.be
Tel: +32 2 725 73 00
Terhulpsesteenweg, 6B
B-1560 Hoeilaart
ictjob.lu
Tel: +352 621 364 792
12, rue Eugène Ruppert
L-2453 Luxembourg
jobtic.fr
Tel: +33 9 81 25 19 66
19 rue Martel
75010 Paris
ticjob.es
Tel: +34 911 25 43 11
Calle Santo Tomé 4, 5B
28004 Madrid
ictjob.de
Tel: +49 711 91 41 07 32
Humboldtstr. 32
70771 Leinfelden-Echterdingen

Reply via email to