Author: manaRH
Date: 2011-11-04 04:36:46 -0400 (Fri, 04 Nov 2011)
New Revision: 14244
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockViewHandler.java
Log:
JBSEAM-4146 instead of throwing IllegalArgumentException trying to use viewId and printout
Warning about wrong usage
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockViewHandler.java
===================================================================
---
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockViewHandler.java 2011-10-30
13:06:28 UTC (rev 14243)
+++
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/mock/MockViewHandler.java 2011-11-04
08:36:46 UTC (rev 14244)
@@ -8,10 +8,14 @@
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.seam.util.Strings;
public class MockViewHandler extends ViewHandler {
+ private final Log logger = LogFactory.getLog(getClass());
+
@Override
public Locale calculateLocale(FacesContext ctx) {
return Locale.getDefault();
@@ -42,7 +46,9 @@
int sploc = servletPath.lastIndexOf('.');
if (sploc < 0)
{
- throw new IllegalArgumentException("no file extension in servlet path:
" + servletPath);
+ logger.warn("You should catch the exception before Seam", new
IllegalArgumentException("no file extension in servlet path: " + servletPath));
+ // in case of Servlet exception which is not mapped and handled by Seam
+ return contextPath + viewId;
}
return contextPath + getViewIdSansSuffix(viewId) +
servletPath.substring(sploc);