struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Struts Wiki] Update of "StrutsTaglibHtmlBase" by MichaelJouravlev
Date Tue, 10 Jan 2006 00:48:42 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Struts Wiki" for change notification.

The following page has been changed by MichaelJouravlev:
http://wiki.apache.org/struts/StrutsTaglibHtmlBase

------------------------------------------------------------------------------
  While HTML <base> tag does additional processing of request elements, its basic functionality
boils down to the following expression:
  {{{
   <base href="
-    <%= request.getScheme()+
+    <%= request.getScheme()+ "://"+
-        "://"+request.getServerName()+":"+
+        request.getServerName()+":"+
         request.getServerPort()+
         request.getRequestURI()
     %>">
  }}}
  
- Note: if you access an action from the browser and then forward to a JSP page, then you
can use request.getRequestURL() to obtain address of the action, and request.getRequestURI()
to obtain address of the JSP page. For example, consider that the action is defined in struts-config.xml
as "/Home", JSP page is stored in directory "pages" as "home.jsp" and context is defined as
"myapp". The results obtained from JSP page will be similar to the following:
+ Note: if you access an action from the browser and then forward to a JSP page, then you
can use request.getRequestURL() to obtain address of the action, and request.getRequestURI()
to obtain address of the JSP page.
+ 
+ For example, consider that the action is defined in struts-config.xml as "/Home", JSP page
is stored in directory "pages" as "home.jsp" and context is defined as "myapp". The results
obtained from JSP page will be similar to the following:
  {{{
  request.getRequestURL() ==> http://myserver:8080/myapp/Home.do
  request.getRequestURI() ==> /myapp/pages/home.jsp
  }}}
+ The above behavior is specified in Servlet documentation. It states that request.getRequestURI()
points to location that was forwarded to. See [http://www.javaworld.com/javaworld/jw-03-2003/jw-0328-servlet_p.html
this article] for insight.
  
  ==== Attributes ====
  

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


Mime
View raw message