Author: pete.muir(a)jboss.org
Date: 2008-09-18 07:21:46 -0400 (Thu, 18 Sep 2008)
New Revision: 9014
Modified:
trunk/src/main/org/jboss/seam/mock/MockViewHandler.java
Log:
ws
Modified: trunk/src/main/org/jboss/seam/mock/MockViewHandler.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockViewHandler.java 2008-09-18 09:13:58 UTC (rev
9013)
+++ trunk/src/main/org/jboss/seam/mock/MockViewHandler.java 2008-09-18 11:21:46 UTC (rev
9014)
@@ -31,24 +31,29 @@
}
@Override
- public String getActionURL(FacesContext ctx, String viewId)
+ public String getActionURL(FacesContext ctx, String viewId)
{
- String contextPath = ctx.getExternalContext().getRequestContextPath();
- String pathInfo = ctx.getExternalContext().getRequestPathInfo();
- String servletPath = ctx.getExternalContext().getRequestServletPath();
-
- if (Strings.isEmpty(pathInfo)) {
- int loc = viewId.lastIndexOf('.');
- if (loc<0) throw new IllegalArgumentException("no file extension in view
id: " + viewId);
- int sploc = servletPath.lastIndexOf('.');
- if (sploc<0) throw new IllegalArgumentException("no file extension in
servlet path: " + servletPath);
- return contextPath + viewId.substring(0, loc) + servletPath.substring(sploc);
-
- } else {
- return contextPath + servletPath + viewId;
- }
- }
+ String contextPath = ctx.getExternalContext().getRequestContextPath();
+ String pathInfo = ctx.getExternalContext().getRequestPathInfo();
+ String servletPath = ctx.getExternalContext().getRequestServletPath();
+ if (Strings.isEmpty(pathInfo))
+ {
+ int loc = viewId.lastIndexOf('.');
+ if (loc < 0)
+ throw new IllegalArgumentException("no file extension in view id: "
+ viewId);
+ int sploc = servletPath.lastIndexOf('.');
+ if (sploc < 0)
+ throw new IllegalArgumentException("no file extension in servlet path:
" + servletPath);
+ return contextPath + viewId.substring(0, loc) + servletPath.substring(sploc);
+
+ }
+ else
+ {
+ return contextPath + servletPath + viewId;
+ }
+ }
+
@Override
public String getResourceURL(FacesContext ctx, String url)
{
Show replies by date