Revision: 976
http://stripes.svn.sourceforge.net/stripes/?rev=976&view=rev
Author: bengunter
Date: 2008-10-17 03:32:34 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
Applied fix for STS-575 from trunk (revision 975)
Revision Links:
--------------
http://stripes.svn.sourceforge.net/stripes/?rev=975&view=rev
Modified Paths:
--------------
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/AnnotatedClassActionResolver.java
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DynamicMappingFilter.java
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/StripesFilter.java
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/AnnotatedClassActionResolver.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/AnnotatedClassActionResolver.java
2008-10-17 03:28:56 UTC (rev 975)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/AnnotatedClassActionResolver.java
2008-10-17 03:32:34 UTC (rev 976)
@@ -24,6 +24,7 @@
import net.sourceforge.stripes.exception.ActionBeanNotFoundException;
import net.sourceforge.stripes.exception.StripesRuntimeException;
import net.sourceforge.stripes.exception.StripesServletException;
+import net.sourceforge.stripes.util.HttpUtil;
import net.sourceforge.stripes.util.Log;
import net.sourceforge.stripes.util.ResolverUtil;
import net.sourceforge.stripes.util.StringUtil;
@@ -275,7 +276,7 @@
public ActionBean getActionBean(ActionBeanContext context) throws
StripesServletException {
HttpServletRequest request = context.getRequest();
UrlBinding binding =
UrlBindingFactory.getInstance().getBindingPrototype(request);
- String path = binding == null ? getRequestedPath(request) :
binding.getPath();
+ String path = binding == null ? HttpUtil.getRequestedPath(request) :
binding.getPath();
ActionBean bean = getActionBean(context, path);
request.setAttribute(RESOLVED_ACTION, getUrlBindingFromPath(path));
return bean;
@@ -287,7 +288,9 @@
*
* @param request the current HttpServletRequest
* @return the servlet-context relative path that is being requested
+ * @deprecated Use [EMAIL PROTECTED]
HttpUtil#getRequestedPath(HttpServletRequest)} instead.
*/
+ @Deprecated
protected String getRequestedPath(HttpServletRequest request) {
String servletPath = null, pathInfo = null;
@@ -520,7 +523,7 @@
protected String getEventNameFromPath(Class<? extends ActionBean> bean,
ActionBeanContext context) {
Map<String,Method> mappings = this.eventMappings.get(bean);
- String path = getRequestedPath(context.getRequest());
+ String path = HttpUtil.getRequestedPath(context.getRequest());
String binding = getUrlBindingFromPath(path);
if (binding != null && path.length() != binding.length()) {
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
2008-10-17 03:28:56 UTC (rev 975)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DispatcherServlet.java
2008-10-17 03:32:34 UTC (rev 976)
@@ -19,6 +19,7 @@
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.config.Configuration;
import net.sourceforge.stripes.exception.StripesServletException;
+import net.sourceforge.stripes.util.HttpUtil;
import net.sourceforge.stripes.util.Log;
import net.sourceforge.stripes.validation.BooleanTypeConverter;
import net.sourceforge.stripes.validation.expression.ExpressionValidator;
@@ -90,7 +91,7 @@
///////////////////////////////////////////////////////////////////////
// Here beings the real processing of the request!
///////////////////////////////////////////////////////////////////////
- log.trace("Dispatching request to URL: ", request.getRequestURI());
+ log.trace("Dispatching request to URL: ",
HttpUtil.getRequestedPath(request));
PageContext pageContext = null;
final ExecutionContext ctx = new ExecutionContext();
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DynamicMappingFilter.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DynamicMappingFilter.java
2008-10-17 03:28:56 UTC (rev 975)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/DynamicMappingFilter.java
2008-10-17 03:32:34 UTC (rev 976)
@@ -35,6 +35,7 @@
import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.config.Configuration;
import net.sourceforge.stripes.exception.StripesServletException;
+import net.sourceforge.stripes.util.HttpUtil;
import net.sourceforge.stripes.util.Log;
/**
@@ -341,7 +342,7 @@
// Wrap the response in a wrapper that catches errors (but not
exceptions)
final ErrorTrappingResponseWrapper wrapper = new
ErrorTrappingResponseWrapper(
(HttpServletResponse) response);
-
wrapper.setInclude(request.getAttribute("javax.servlet.include.request_uri") !=
null);
+
wrapper.setInclude(request.getAttribute(StripesConstants.REQ_ATTR_INCLUDE_PATH)
!= null);
chain.doFilter(request, wrapper);
// If a SC_NOT_FOUND error occurred, then try to match an ActionBean
to the URL
@@ -351,7 +352,7 @@
public void doFilter(ServletRequest request, ServletResponse
response)
throws IOException, ServletException {
// Look for an ActionBean that is mapped to the URI
- String uri = getRequestURI((HttpServletRequest) request);
+ String uri =
HttpUtil.getRequestedPath((HttpServletRequest) request);
Class<? extends ActionBean> beanType =
StripesFilter.getConfiguration()
.getActionResolver().getActionBeanType(uri);
@@ -384,7 +385,12 @@
initialized = true;
}
- /** Get the context-relative URI of the current include, forward or
request. */
+ /**
+ * Get the context-relative URI of the current include, forward or request.
+ *
+ * @deprecated Use [EMAIL PROTECTED]
HttpUtil#getRequestedPath(HttpServletRequest)} instead.
+ */
+ @Deprecated
protected String getRequestURI(HttpServletRequest request) {
// Check for an include
String uri = (String)
request.getAttribute("javax.servlet.include.request_uri");
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/StripesFilter.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/StripesFilter.java
2008-10-17 03:28:56 UTC (rev 975)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/StripesFilter.java
2008-10-17 03:32:34 UTC (rev 976)
@@ -19,6 +19,7 @@
import net.sourceforge.stripes.config.RuntimeConfiguration;
import net.sourceforge.stripes.exception.StripesRuntimeException;
import net.sourceforge.stripes.exception.StripesServletException;
+import net.sourceforge.stripes.util.HttpUtil;
import net.sourceforge.stripes.util.Log;
import javax.servlet.Filter;
@@ -203,7 +204,7 @@
// Wrap pretty much everything in a try/catch so that we can funnel
even the most
// bizarre or unexpected exceptions into the exception handler
try {
- log.trace("Intercepting request to URL: ",
httpRequest.getRequestURI());
+ log.trace("Intercepting request to URL: ",
HttpUtil.getRequestedPath(httpRequest));
if (initial) {
// Pop the configuration into thread local
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
===================================================================
---
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
2008-10-17 03:28:56 UTC (rev 975)
+++
branches/1.5.x/stripes/src/net/sourceforge/stripes/controller/UrlBindingFactory.java
2008-10-17 03:32:34 UTC (rev 976)
@@ -31,6 +31,7 @@
import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.exception.StripesRuntimeException;
+import net.sourceforge.stripes.util.HttpUtil;
import net.sourceforge.stripes.util.bean.ParseException;
/**
@@ -111,7 +112,7 @@
}
/**
- * Examines a URI (as might be returned by [EMAIL PROTECTED]
HttpServletRequest#getRequestURI()}) and
+ * Examines a URI (as returned by [EMAIL PROTECTED]
HttpUtil#getRequestedPath(HttpServletRequest)}) and
* returns the associated binding prototype, if any. No attempt is made to
extract parameter
* values from the URI. This is intended as a fast means to get static
information associated
* with a given request URI.
@@ -145,11 +146,11 @@
* @return a binding prototype, or null if the request URI does not match
*/
public UrlBinding getBindingPrototype(HttpServletRequest request) {
- return getBindingPrototype(trimContextPath(request));
+ return getBindingPrototype(HttpUtil.getRequestedPath(request));
}
/**
- * Examines a URI (as might be returned by [EMAIL PROTECTED]
HttpServletRequest#getRequestURI()}) and
+ * Examines a URI (as returned by [EMAIL PROTECTED]
HttpUtil#getRequestedPath(HttpServletRequest)}) and
* returns the associated binding, if any. Parameters will be extracted
from the URI, and the
* [EMAIL PROTECTED] UrlBindingParameter} objects returned by [EMAIL
PROTECTED] UrlBinding#getParameters()} will
* contain the values that are present in the URI.
@@ -241,7 +242,7 @@
* binding. Otherwise, this method should return null.
*/
public UrlBinding getBinding(HttpServletRequest request) {
- return getBinding(trimContextPath(request));
+ return getBinding(HttpUtil.getRequestedPath(request));
}
/**
@@ -424,7 +425,9 @@
*
* @param request a servlet request
* @return the context-relative request URI
+ * @deprecated Use [EMAIL PROTECTED]
HttpUtil#getRequestedPath(HttpServletRequest)} instead.
*/
+ @Deprecated
protected String trimContextPath(HttpServletRequest request) {
// Trim context path from beginning of URI
String uri = request.getRequestURI();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development