Author: mrdon
Date: Sun Sep 2 20:24:53 2007
New Revision: 572225
URL: http://svn.apache.org/viewvc?rev=572225&view=rev
Log:
Adding better error message when a Struts tag is used w/o the servlet filter
WW-1969
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java?rev=572225&r1=572224&r2=572225&view=diff
==============================================================================
---
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
(original)
+++
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/jsp/TagUtils.java
Sun Sep 2 20:24:53 2007
@@ -38,6 +38,7 @@
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
@@ -55,6 +56,11 @@
HttpServletResponse res = (HttpServletResponse)
pageContext.getResponse();
Dispatcher du = Dispatcher.getInstance();
+ if (du == null) {
+ throw new ConfigurationException("The Struts dispatcher cannot
be found. This is usually caused by "+
+ "using Struts tags without the associated filter.
Struts tags are only usable when the request "+
+ "has passed through its servlet filter, which
initializes the Struts dispatcher needed for this tag.");
+ }
Map extraContext = du.createContextMap(new RequestMap(req),
req.getParameterMap(),
new SessionMap(req),