You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jo...@noaa.gov on 2009/04/14 23:04:47 UTC

does not include parameter

Hello All,

I'm trying to understand why the following does not produce a URL w/ the
requested parameter appended. Can someone please help me?

var url = "<s:url action="ListFeatures" 
namespace="/secure/json"><s:param name="status" value="ALL" /></s:url>";

//produces '/scufn/secure/json/ListFeatures.action'


Thanks!

--john


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: does not include parameter

Posted by Martin Gainty <mg...@hotmail.com>.
Good Evening John

i found this link helpful for explaining namespace and action resolution
http://struts.apache.org/2.0.14/docs/namespace-configuration.html

HTH
Martin Gainty 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
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: Tue, 14 Apr 2009 16:12:59 -0600
> From: John.C.Cartwright@noaa.gov
> Subject: Re: <s:url> does not include parameter
> To: user@struts.apache.org
> 
> OK, makes perfect sense now.  Thanks to both Dave and Jeroen for your 
> prompt replies!
> 
> --john
> 
> 
> Dave Newton wrote:
> > John.C.Cartwright@noaa.gov wrote:
> >> I'm trying to understand why the following does not produce a URL w/ the
> >> requested parameter appended. Can someone please help me?
> >>
> >> var url = "<s:url action="ListFeatures" 
> >> namespace="/secure/json"><s:param name="status" value="ALL" /></s:url>";
> >>
> >> //produces '/scufn/secure/json/ListFeatures.action'
> >
> > You probably don't have an action property named "ALL".
> >
> > The "value" attribute is an OGNL expression, not an immediate string. 
> > If you want to use an immediate string, quote it:
> >
> > <s:url action="ListFeatures" namespace="/secure/json">
> >   <s:param name="status" value="'ALL'" />
> > </s:url>
> >
> > Using OGNL's %{} escape sequence can make it absolutely clear what's 
> > going on (and add visual separation):
> >
> > <s:param name="status" value="%{'ALL'}" />
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live™ SkyDrive: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_skydrive_032009

Re: does not include parameter

Posted by John Cartwright <Jo...@noaa.gov>.
OK, makes perfect sense now.  Thanks to both Dave and Jeroen for your 
prompt replies!

--john


Dave Newton wrote:
> John.C.Cartwright@noaa.gov wrote:
>> I'm trying to understand why the following does not produce a URL w/ the
>> requested parameter appended. Can someone please help me?
>>
>> var url = "<s:url action="ListFeatures" 
>> namespace="/secure/json"><s:param name="status" value="ALL" /></s:url>";
>>
>> //produces '/scufn/secure/json/ListFeatures.action'
>
> You probably don't have an action property named "ALL".
>
> The "value" attribute is an OGNL expression, not an immediate string. 
> If you want to use an immediate string, quote it:
>
> <s:url action="ListFeatures" namespace="/secure/json">
>   <s:param name="status" value="'ALL'" />
> </s:url>
>
> Using OGNL's %{} escape sequence can make it absolutely clear what's 
> going on (and add visual separation):
>
> <s:param name="status" value="%{'ALL'}" />
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: does not include parameter

Posted by Dave Newton <ne...@yahoo.com>.
John.C.Cartwright@noaa.gov wrote:
> I'm trying to understand why the following does not produce a URL w/ the
> requested parameter appended. Can someone please help me?
> 
> var url = "<s:url action="ListFeatures" 
> namespace="/secure/json"><s:param name="status" value="ALL" /></s:url>";
> 
> //produces '/scufn/secure/json/ListFeatures.action'

You probably don't have an action property named "ALL".

The "value" attribute is an OGNL expression, not an immediate string. If 
you want to use an immediate string, quote it:

<s:url action="ListFeatures" namespace="/secure/json">
   <s:param name="status" value="'ALL'" />
</s:url>

Using OGNL's %{} escape sequence can make it absolutely clear what's 
going on (and add visual separation):

<s:param name="status" value="%{'ALL'}" />

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: does not include parameter

Posted by Jeroen De Ridder <vo...@gmail.com>.
It's evaluating "ALL" as an OGNL expression, not a string literal. Use 
either

<s:url action="ListFeatures" namespace="/secure/json"><s:param 
name="status">ALL</s:param></s:url>

or

<s:url action="ListFeatures" namespace="/secure/json"><s:param 
name="status" value="'ALL'" /></s:url>

(notice the extra single quotes in the second one).

> Hello All,
>
> I'm trying to understand why the following does not produce a URL w/ the
> requested parameter appended. Can someone please help me?
>
> var url = "<s:url action="ListFeatures" 
> namespace="/secure/json"><s:param name="status" value="ALL" /></s:url>";
>
> //produces '/scufn/secure/json/ListFeatures.action'
>
>
> Thanks!
>
> --john
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org