You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bob <to...@excite.com> on 2007/02/19 20:26:49 UTC

[S2] access to URL information

What's the cleanest way to get to the request url information, such as the domain name, from within an interceptor?  I know that I could get a hold of the servlet API to do this, but is this a best practice?  I know that I've read that you should try to avoid accessing the servlet API from within your struts code.  

Any advice on the cleanest way to get this domain name from within struts?     

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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


Re: [S2] access to URL information

Posted by Matt Filion <mf...@csc.com>.
Right now I have an interceptor that is creating a context for a set of 
menus that is being generated around each page. In order for it to capture 
the current "section" it is getting sent as a querystring paramter in a 
link. When I sniff the request which I check from both the opensymphony 
ActionContext.getContext().getParamter("") and ServletActionContext.
getRequest().getParameter(""). I am getting the names of all paramters in 
the request from both and printing them out and get absolutely no 
querystring parameters. I get the parameters submitted via the form but 
not the querystring parameters.


Matt

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




Dave Newton <ne...@yahoo.com> 
02/19/2007 02:49 PM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
Struts Users Mailing List <us...@struts.apache.org>
cc

Subject
Re: [S2] access to URL information






--- Matt Filion <mf...@csc.com> wrote:
> I'm actually having a similar issue. I'm trying to
> get some paramters from the querystring (in either
an
> interceptor and tried earlier on an action) 
> and have been unable to get any querystring values.

I don't know how either of you are going to get host
or URL information w/o access the request context
(which is also how you'd get the querystring, although
it is quite unclear to my why you would prefer that
over being ParameterAware).

I suppose you could set the information in one of the
interfaces with a map via an interceptor, or create
your own interface, but so far it's not clear to me
why you'd want to.

d.



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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



Re: [S2] access to URL information

Posted by Dave Newton <ne...@yahoo.com>.
--- Matt Filion <mf...@csc.com> wrote:
> I'm actually having a similar issue. I'm trying to
> get some paramters from the querystring (in either
an
> interceptor and tried earlier on an action) 
> and have been unable to get any querystring values.

I don't know how either of you are going to get host
or URL information w/o access the request context
(which is also how you'd get the querystring, although
it is quite unclear to my why you would prefer that
over being ParameterAware).

I suppose you could set the information in one of the
interfaces with a map via an interceptor, or create
your own interface, but so far it's not clear to me
why you'd want to.

d.



 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

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


Re: [S2] access to URL information

Posted by Matt Filion <mf...@csc.com>.
I'm actually having a similar issue. I'm trying to get some paramters from 
the querystring (in either an interceptor and tried earlier on an action) 
and have been unable to get any querystring values.

I am using the 1.4.2 version of struts 2.

Matt


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please 
delete without copying and kindly advise us by e-mail of the mistake in 
delivery. NOTE: Regardless of content, this e-mail shall not operate to 
bind CSC to any order or other contract unless pursuant to explicit 
written agreement or government initiative expressly permitting the use of 
e-mail for such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




"bob" <to...@excite.com> 
02/19/2007 11:26 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
user@struts.apache.org
cc

Subject
[S2] access to URL information







What's the cleanest way to get to the request url information, such as the 
domain name, from within an interceptor?  I know that I could get a hold 
of the servlet API to do this, but is this a best practice?  I know that 
I've read that you should try to avoid accessing the servlet API from 
within your struts code. 

Any advice on the cleanest way to get this domain name from within struts? 
 

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



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