You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antonio Petrelli <ap...@apache.org> on 2006/10/02 12:14:18 UTC

Re: cannot get parameter value in action class passed using html:link

Vinod Kumar ha scritto:
> this is the way I try to get value in
> aciton class
> System.out.println("PRINT VALUE  =
> "+request.getParameter( "print" ));
>
> Sometime, the printable link looks like
> http://localhost:81/myapp/setup.do;jsessionid=xrlq86pj71?print=YES
>
> even if i trim it to
> http://localhost:81/orion/setup.do?print=YES , no
> value is received in action class.

It seems to be a bug, but I don't know where it is. Just to restrict the 
problem see what prints:
request.getQueryString()
i.e. see if it contains the parameters you want. If you see them, be 
sure that you have not a filter that creates a wrapped 
HttpServletRequest that overrides "getParameter". If you have no filter 
(or your filter does not what I wrote before), it could be a bug of the 
servlet container (though I don't think it is...).

Ciao
Antonio


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


How to set Posted by Th...@in.efunds.com.
Hi All,

      I need to set <html:link> as a post method, caz I need to avoid the parameter values to be
catched in the histories in case of the GET method request.

can anyone send me some suggestions.

Thanks,
Thanigai M.

This electronic mail message is intended solely for the named recipients and may contain
confidential and proprietary business information of eFunds Corporation and all its subsidiaries.If
you are not a named recipient, please notify the sender immediately.You may not disclose the
contents to any other person; use this electronic mail message or its contents for any other
purpose; or further store or copy its contents in any medium


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


Re: cannot get parameter value in action class passed using html:link

Posted by Antonio Petrelli <ap...@apache.org>.
Hi Vinod

Vinod Kumar ha scritto:
> Hi Antonio,
>    Thanks for your response.
> 1. I am not using any filter and if i am not wrong,
> then tomcat 3.3.2 does support filters since it
> implements servlet 2.2 specs.
>   

Uh, right! Well i cannot know everything :-)
> I am not sure
> if paramters from html:link are passed only if the
> corresponding action has a ActionForm.
>   

They are passed anyway, but if there is an ActionForm, the parameters 
are got and put into the corresponding property, not the opposite.

> I will check this with latest version of tomcat later
> on.
>   

Good luck!

Ciao
Antonio


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


Re: cannot get parameter value in action class passed using html:link

Posted by Vinod Kumar <vk...@yahoo.com>.
Hi Antonio,
   Thanks for your response.
1. I am not using any filter and if i am not wrong,
then tomcat 3.3.2 does support filters since it
implements servlet 2.2 specs.

Other thing is that I am not using any ActionForm for
this Action. My Action is below:
        <action
            path="/print"
           
type="com.abc.myap.Actions.PrintableAction"
            scope="request">
    	</action>

Since I am just passing couple of parameters on the
html:link to action and I am able to get those using
getQueryString(). Then I just split them from there
and use them. Atleast it keeps me going. I am not sure
if paramters from html:link are passed only if the
corresponding action has a ActionForm.

I will check this with latest version of tomcat later
on.

Thanks
Vinod


--- Antonio Petrelli <ap...@apache.org> wrote:

> Vinod Kumar ha scritto:
> > Hi Antonio,
> >   When I Printed getQueryString in the action
> class
> > using the below stmt
> > System.out.println("request.getQueryString() =
> > "+request.getQueryString());
> >
> > Result was 
> > request.getQueryString() = print=1
> >
> > So it means, Query string has print parameter but
> > request.getParameter("print") is returning null in
> the
> > action class.
> >   
> 
> Gosh that's *really* strange, Houston we have a
> problem!
> 
> > I am using tomcat 3.3.2 and struts 1.2.9
> >   
> 
> Mmm... Did you try to use the latest Tomcat? It
> really could be the 
> container.
> 
> > Is there any other way to retrive this parameter
> other
> > than using getParameter?
> >   
> 
> No, I mean, since Struts' ActionForm is populated
> using "getParameter", 
> as it returns null, the parameter is not passed to
> the corresponding 
> property too!
> Now you should check if you are using a filter and:
> 1) if yes, debug your application to see what's the
> name of the class of 
> the instance of HttpServletRequest: if it is not a
> Tomcat's one, I would 
> suspect there's a bug in the filter;
> 2) if no, it could be a container problem, check it
> using the latest 
> Tomcat version.
> 
> Please let me know.
> 
> Ciao
> Antonio
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: cannot get parameter value in action class passed using html:link

Posted by Antonio Petrelli <ap...@apache.org>.
Vinod Kumar ha scritto:
> Hi Antonio,
>   When I Printed getQueryString in the action class
> using the below stmt
> System.out.println("request.getQueryString() =
> "+request.getQueryString());
>
> Result was 
> request.getQueryString() = print=1
>
> So it means, Query string has print parameter but
> request.getParameter("print") is returning null in the
> action class.
>   

Gosh that's *really* strange, Houston we have a problem!

> I am using tomcat 3.3.2 and struts 1.2.9
>   

Mmm... Did you try to use the latest Tomcat? It really could be the 
container.

> Is there any other way to retrive this parameter other
> than using getParameter?
>   

No, I mean, since Struts' ActionForm is populated using "getParameter", 
as it returns null, the parameter is not passed to the corresponding 
property too!
Now you should check if you are using a filter and:
1) if yes, debug your application to see what's the name of the class of 
the instance of HttpServletRequest: if it is not a Tomcat's one, I would 
suspect there's a bug in the filter;
2) if no, it could be a container problem, check it using the latest 
Tomcat version.

Please let me know.

Ciao
Antonio


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


Re: cannot get parameter value in action class passed using html:link

Posted by Vinod Kumar <vk...@yahoo.com>.
Hi Antonio,
  When I Printed getQueryString in the action class
using the below stmt
System.out.println("request.getQueryString() =
"+request.getQueryString());

Result was 
request.getQueryString() = print=1

So it means, Query string has print parameter but
request.getParameter("print") is returning null in the
action class.

I am using tomcat 3.3.2 and struts 1.2.9

Is there any other way to retrive this parameter other
than using getParameter?


Thanks
Vinod


--- Antonio Petrelli <ap...@apache.org> wrote:

> Vinod Kumar ha scritto:
> > this is the way I try to get value in
> > aciton class
> > System.out.println("PRINT VALUE  =
> > "+request.getParameter( "print" ));
> >
> > Sometime, the printable link looks like
> >
>
http://localhost:81/myapp/setup.do;jsessionid=xrlq86pj71?print=YES
> >
> > even if i trim it to
> > http://localhost:81/orion/setup.do?print=YES , no
> > value is received in action class.
> 
> It seems to be a bug, but I don't know where it is.
> Just to restrict the 
> problem see what prints:
> request.getQueryString()
> i.e. see if it contains the parameters you want. If
> you see them, be 
> sure that you have not a filter that creates a
> wrapped 
> HttpServletRequest that overrides "getParameter". If
> you have no filter 
> (or your filter does not what I wrote before), it
> could be a bug of the 
> servlet container (though I don't think it is...).
> 
> Ciao
> Antonio
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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