Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes pageContext.request. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "pageContext.request." Watch "pageContext.request." New topic
Author

pageContext.request.

Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
Hi,

I am getting a different value in case of request.getRequestURL() and request.getRequestURL() when used with pageContext.request.requestURI and
pageContext.request.requestURL

I have done the following maping in my struts-config.xml
<action path="/GDCityDetail"
type="struts.actions.GDCityDispatchAction"
parameter="methodToCall" name="brandNeutralCityContentForm"
scope="session">
<forward name="showCityIntroduction" path="GDCityIntroductionView"/>
<forward name="showCityHotels" path="GDCityHotelsView"/>
<forward name="showCityMap" path="GDCityMapView"/>
<forward name="showCityResturants" path="GDCityResturantsView"/>
<forward name="showCityAttractions" path="GDCityAttractionsView"/>
<forward name="showCityEvents" path="GDCityEventsView"/>
<forward name="showCityEventDetails" path="GDCityEventDetailsView"/>
<forward name="showCityTransport" path="GDCityTransportView"/>
<forward name="showCityWeather" path="GDCityWeatherView"/>


<forward name="failure" path="ErrorView"/>
</action>

<action path="/city/introduction"
forward="/GDCityDetail.do?methodToCall=displayCityIntroduction">
</action>

request.getRequestURI returns me /GDCityDetail.do while pageContext.request.requestURI returns me the path of the jsp mapped i tiles-def.

Thanks
Neeraj.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Are you sure that you are not confusing the URL and URI methods?

What container? Under Tomcat 5.5, I get identical results.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
Hi,

I am not getting confused iwth URI and URL methods.


I am using atg 7 as server. I am not sure whether it is because of struts definations.

Thanks,
Neeraj.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: pageContext.request.
 
Similar Threads
Getting Bad Request
Not able to Call The Action class
forward to another action
mapping.getInputForward()
Problem with having identical field names across form beans