You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by auz <f....@gmail.com> on 2008/01/07 14:44:08 UTC

getting param from an url link

hi, im a struts newbie, im using stuts 1.2.9 and have a problem, i cannot get
params from url in struts action

in my a href i have /sservice/editSP.do?spid=<bean:write name="studyProgram"
property="studyProgramID"/>

action code :

String param=(String)request.getAttribute("spid");



but request has no param with name spid or any other

note: if i  just type editSP?spid=..... server says resource not found altho
i have mapped it correctly in stuts config 
-- 
View this message in context: http://www.nabble.com/getting-param-from-an-url-link-tp14665989p14665989.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: getting param from an url link

Posted by auz <f....@gmail.com>.
tnx, OMG how stupid of me totally forgot about those 2, 

Nils-Helge Garli wrote:
> 
> There's a big difference between a request attribute and a request
> parameter. You should try request.getParameter instead.
> 
> Maybe this can explain: http://www.jguru.com/faq/view.jsp?EID=1307699
> 
> Nils-H
> 
> On 1/7/08, auz <f....@gmail.com> wrote:
>>
>> hi, im a struts newbie, im using stuts 1.2.9 and have a problem, i cannot
>> get
>> params from url in struts action
>>
>> in my a href i have /sservice/editSP.do?spid=<bean:write
>> name="studyProgram"
>> property="studyProgramID"/>
>>
>> action code :
>>
>> String param=(String)request.getAttribute("spid");
>>
>>
>>
>> but request has no param with name spid or any other
>>
>> note: if i  just type editSP?spid=..... server says resource not found
>> altho
>> i have mapped it correctly in stuts config
>> --
>> View this message in context:
>> http://www.nabble.com/getting-param-from-an-url-link-tp14665989p14665989.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/getting-param-from-an-url-link-tp14665989p14666536.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: getting param from an url link

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
There's a big difference between a request attribute and a request
parameter. You should try request.getParameter instead.

Maybe this can explain: http://www.jguru.com/faq/view.jsp?EID=1307699

Nils-H

On 1/7/08, auz <f....@gmail.com> wrote:
>
> hi, im a struts newbie, im using stuts 1.2.9 and have a problem, i cannot get
> params from url in struts action
>
> in my a href i have /sservice/editSP.do?spid=<bean:write name="studyProgram"
> property="studyProgramID"/>
>
> action code :
>
> String param=(String)request.getAttribute("spid");
>
>
>
> but request has no param with name spid or any other
>
> note: if i  just type editSP?spid=..... server says resource not found altho
> i have mapped it correctly in stuts config
> --
> View this message in context: http://www.nabble.com/getting-param-from-an-url-link-tp14665989p14665989.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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