mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Added better error message when a Struts tag is used w/o its filter
WW-1969 git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@572226 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -38,6 +38,7 @@ import org.apache.struts2.util.AttributeMap;
|
||||
|
||||
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 @@ public class TagUtils {
|
||||
|
||||
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),
|
||||
|
||||
Reference in New Issue
Block a user