You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by dd...@apache.org on 2006/11/02 03:03:04 UTC
svn commit: r470185 [4/5] - in /struts/sandbox/trunk/tiles:
tiles-api/src/main/java/org/apache/tiles/
tiles-core/src/main/java/org/apache/tiles/
tiles-core/src/main/java/org/apache/tiles/access/
tiles-core/src/main/java/org/apache/tiles/beans/ tiles-co...
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/BaseInsertTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/BaseInsertTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/BaseInsertTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/BaseInsertTag.java Wed Nov 1 18:03:00 2006
@@ -18,93 +18,92 @@
package org.apache.tiles.taglib;
-import java.io.IOException;
-import java.util.Map;
-import java.util.StringTokenizer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tiles.definition.ComponentAttribute;
+import org.apache.tiles.ComponentContext;
+import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.preparer.ViewPreparer;
+import org.apache.tiles.taglib.util.TagUtils;
+import org.apache.tiles.util.TilesUtil;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.ComponentAttribute;
-import org.apache.tiles.taglib.util.TagUtils;
-import org.apache.tiles.ComponentContext;
-import org.apache.tiles.ComponentDefinition;
-import org.apache.tiles.TilesRequestContext;
-import org.apache.tiles.ViewPreparer;
-import org.apache.tiles.TilesUtil;
+import java.io.IOException;
+import java.util.Map;
+import java.util.StringTokenizer;
/**
* This is the base abstract class for all Tiles composition JSP tags. The tag's
* body content can consist of <tiles:put> and <tiles:putList> tags,
* which are accessed by <tiles:attribute>, <tiles:getAsString> and
* <tiles:importAttribute> in the template.
- *
+ *
* @version $Rev$ $Date$
*/
public abstract class BaseInsertTag extends DefinitionTagSupport implements
- PutTagParent, ComponentConstants, PutListTagParent {
-
+ PutTagParent, ComponentConstants, PutListTagParent {
+
/**
* Commons Logging instance.
*/
protected static Log log = LogFactory.getLog(BaseInsertTag.class);
-
+
/* JSP Tag attributes */
/**
* Flush attribute value.
*/
protected boolean flush = true;
-
+
/**
* Are errors ignored. This is the property for attribute 'ignore'. Default
* value is false, which throw an exception. Only 'attribute not found'
* errors are ignored.
*/
protected boolean isErrorIgnored = false;
-
+
/* Internal properties */
/**
* Does the end tag need to be processed. Default value is true. Boolean set
* in case of ignored errors.
*/
protected boolean processEndTag = true;
-
+
/**
* Current component context.
*/
protected ComponentContext cachedCurrentContext;
-
+
/**
* Final handler of tag methods.
*/
protected TagHandler tagHandler = null;
-
+
/**
* Trick to allows inner classes to access pageContext.
*/
protected PageContext pageContext = null;
-
+
/**
* Reset member values for reuse. This method calls super.release(), which
* invokes TagSupport.release(), which typically does nothing.
*/
public void release() {
-
+
super.release();
-
+
flush = true;
template = null;
role = null;
isErrorIgnored = false;
-
+
releaseInternal();
}
-
+
/**
* Reset internal member values for reuse.
*/
@@ -114,69 +113,69 @@
// pageContext = null; // orion doesn't set it between two tags
tagHandler = null;
}
-
+
/**
* Set the current page context. Called by the page implementation prior to
* doStartTag().
- * <p>
+ * <p/>
* Needed to allow inner classes to access pageContext.
*/
public void setPageContext(PageContext pc) {
this.pageContext = pc;
super.setPageContext(pc);
}
-
+
/**
* Get the pageContext property.
*/
public PageContext getPageContext() {
return pageContext;
}
-
+
/**
* Set flush.
*/
public void setFlush(boolean flush) {
this.flush = flush;
}
-
+
/**
* Get flush.
*/
public boolean getFlush() {
return flush;
}
-
+
/**
* Set flush. Method added for compatibility with JSP1.1
*/
public void setFlush(String flush) {
this.flush = (Boolean.valueOf(flush).booleanValue());
}
-
+
/**
* Set ignore.
*/
public void setIgnore(boolean ignore) {
this.isErrorIgnored = ignore;
}
-
+
/**
* Get ignore.
*/
public boolean getIgnore() {
return isErrorIgnored;
}
-
+
// ///////////////////////////////////////////////////////////////////////
-
+
/**
* Add a body attribute. Erase any attribute with same name previously set.
*/
public void putAttribute(String name, Object value) {
tagHandler.putAttribute(name, value);
}
-
+
/**
* Process nested ≶put> tag. Method calls by nested ≶put> tags.
* Nested list is added to current list. If role is defined, it is checked
@@ -185,17 +184,17 @@
public void processNestedTag(PutTag nestedTag) throws JspException {
// Check role
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
+ .getRequest();
String role = nestedTag.getRole();
if (role != null && !request.isUserInRole(role)) {
// not allowed : skip attribute
return;
}
-
+
putAttribute(nestedTag.getName(), new ComponentAttribute(nestedTag
- .getRealValue(), nestedTag.getRole(), nestedTag.getType()));
+ .getRealValue(), nestedTag.getRole(), nestedTag.getType()));
}
-
+
/**
* Process nested ≶putList> tag. Method calls by nested
* ≶putList> tags. Nested list is added to sub-component attributes If
@@ -204,23 +203,23 @@
public void processNestedTag(PutListTag nestedTag) throws JspException {
// Check role
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
+ .getRequest();
String role = nestedTag.getRole();
if (role != null && !request.isUserInRole(role)) {
// not allowed : skip attribute
return;
}
-
+
// Check if a name is defined
if (nestedTag.getName() == null) {
throw new JspException(
- "Error - PutList : attribute name is not defined. It is mandatory as the list is added as attribute of 'insert'.");
+ "Error - PutList : attribute name is not defined. It is mandatory as the list is added as attribute of 'insert'.");
}
-
+
// now add attribute to enclosing parent (i.e. : this object).
putAttribute(nestedTag.getName(), nestedTag.getList());
}
-
+
/**
* Method calls by nested ≶putList> tags. A new list is added to
* current insert object.
@@ -228,49 +227,49 @@
public void putAttribute(PutListTag nestedTag) throws JspException {
// Check role
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
+ .getRequest();
String role = nestedTag.getRole();
if (role != null && !request.isUserInRole(role)) {
// not allowed : skip attribute
return;
}
-
+
putAttribute(nestedTag.getName(), nestedTag.getList());
}
-
+
/**
* Get current component context.
*/
protected ComponentContext getCurrentContext() {
if (cachedCurrentContext == null) {
cachedCurrentContext = (ComponentContext) pageContext.getAttribute(
- ComponentConstants.COMPONENT_CONTEXT,
- PageContext.REQUEST_SCOPE);
+ ComponentConstants.COMPONENT_CONTEXT,
+ PageContext.REQUEST_SCOPE);
}
-
+
return cachedCurrentContext;
}
-
+
/**
* Get instantiated ViewPreparer. Return preparer denoted by preparerType,
* or <code>null</code> if preparerType is null.
- *
+ *
* @throws JspException If preparer can't be created.
*/
protected ViewPreparer getPreparer() throws JspException {
if (preparerType == null) {
return null;
}
-
+
try {
return ComponentDefinition.createPreparer(preparerName,
- preparerType);
-
+ preparerType);
+
} catch (InstantiationException ex) {
throw new JspException(ex);
}
}
-
+
/**
* Process the start tag by checking tag's attributes and creating
* appropriate handler. Possible handlers :
@@ -282,24 +281,24 @@
* Handlers also contain sub-component context.
*/
public int doStartTag() throws JspException {
-
+
// Additional fix for Bug 20034 (2005-04-28)
cachedCurrentContext = null;
-
+
// Check role immediatly to avoid useless stuff.
// In case of insertion of a "definition", definition's role still
// checked later.
// This lead to a double check of "role" ;-(
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
+ .getRequest();
if (role != null && !request.isUserInRole(role)) {
processEndTag = false;
return SKIP_BODY;
}
-
+
try {
tagHandler = createTagHandler();
-
+
} catch (JspException e) {
if (isErrorIgnored) {
processEndTag = false;
@@ -308,10 +307,10 @@
throw e;
}
}
-
+
return tagHandler.doStartTag();
}
-
+
/**
* Process the end tag by including the template. Simply call the handler
* doEndTag
@@ -321,85 +320,84 @@
releaseInternal();
return EVAL_PAGE;
}
-
+
int res = tagHandler.doEndTag();
// Reset properties used by object, in order to be able to reuse object.
releaseInternal();
return res;
}
-
+
/**
* Processes tag attributes and create corresponding tag handler.<br>
* Each implementation will create the correct instance of
* {@link TagHandler} depending on their needs.
- *
*/
public abstract TagHandler createTagHandler() throws JspException;
-
+
/**
* End of Process tag attribute "definition". Overload definition with tag
* attributes "template" and "role". Then, create appropriate tag handler.
- *
+ *
* @param definition Definition to process.
* @return Appropriate TagHandler.
* @throws JspException InstantiationException Can't create requested
- * preparer
+ * preparer
*/
protected TagHandler processDefinition(ComponentDefinition definition)
- throws JspException {
+ throws JspException {
// Declare local variable in order to not change Tag attribute values.
String role = this.role;
String page = this.template;
ViewPreparer preparer = null;
-
+
try {
preparer = definition.getOrCreatePreparer();
-
+
// Overload definition with tag's template and role.
if (role == null) {
role = definition.getRole();
}
-
+
if (page == null) {
page = definition.getTemplate();
}
-
+
if (preparerName != null) {
preparer = ComponentDefinition.createPreparer(preparerName,
- preparerType);
+ preparerType);
}
-
+
// Can check if page is set
return new InsertHandler(definition.getAttributes(), page, role,
- preparer);
-
+ preparer);
+
} catch (InstantiationException ex) {
throw new JspException(ex);
}
}
-
+
/**
* Do an include of specified page. This method is used internally to do all
* includes from this class. It delegates the include call to the
* TilesUtil.doInclude().
- *
- * @param page The page that will be included
+ *
+ * @param page The page that will be included
* @param flush If the writer should be flushed before the include
* @throws ServletException - Thrown by call to pageContext.include()
- * @throws IOException - Thrown by call to pageContext.include()
+ * @throws IOException - Thrown by call to pageContext.include()
*/
protected void doInclude(String page, boolean flush) throws Exception,
- IOException {
+ IOException {
TilesUtil.doInclude(page, pageContext, flush);
}
-
+
// ///////////////////////////////////////////////////////////////////////////
-
+
/**
* Parse the list of roles and return <code>true</code> or
* <code>false</code> based on whether the user has that role or not.
- *
- * @param role Comma-delimited list of roles.
+ *
+ * @param role Comma-delimited list of roles.
* @param request The request.
*/
static public boolean userHasRole(HttpServletRequest request, String role) {
@@ -409,12 +407,12 @@
return true;
}
}
-
+
return false;
}
-
+
// ///////////////////////////////////////////////////////////////////////////
-
+
/**
* Inner Interface. Sub handler for tag.
*/
@@ -423,46 +421,46 @@
* Create ComponentContext for type depicted by implementation class.
*/
public int doStartTag() throws JspException;
-
+
/**
* Do include for type depicted by implementation class.
*/
public int doEndTag() throws JspException;
-
+
/**
* Add a component parameter (attribute) to subContext.
*/
public void putAttribute(String name, Object value);
} // end inner interface
-
+
// ///////////////////////////////////////////////////////////////////////////
-
+
/**
* Real handler, after attribute resolution. Handle include sub-component.
*/
protected class InsertHandler implements TagHandler {
protected String page;
-
+
protected ComponentContext currentContext;
-
+
protected ComponentContext subCompContext;
-
+
protected String role;
-
+
protected ViewPreparer preparer;
-
+
/**
* Constructor. Create insert handler using Component definition.
*/
public InsertHandler(Map attributes, String page, String role,
- ViewPreparer preparer) {
-
+ ViewPreparer preparer) {
+
this.page = page;
this.role = role;
this.preparer = preparer;
subCompContext = new ComponentContext(attributes);
}
-
+
/**
* Constructor. Create insert handler to insert page at specified
* location.
@@ -473,142 +471,144 @@
this.preparer = preparer;
subCompContext = new ComponentContext();
}
-
+
/**
* Create a new empty context.
*/
public int doStartTag() throws JspException {
// Check role
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
-
+ .getRequest();
+
if (role != null && !request.isUserInRole(role)) {
return SKIP_BODY;
}
-
+
// save current context
this.currentContext = getCurrentContext();
return EVAL_BODY_INCLUDE;
}
-
+
/**
* Add attribute to sub context. Do nothing.
*/
public void putAttribute(String name, Object value) {
subCompContext.putAttribute(name, value);
}
-
+
/**
* Include requested page.
*/
public int doEndTag() throws JspException {
// Check role
HttpServletRequest request = (HttpServletRequest) pageContext
- .getRequest();
-
+ .getRequest();
+
if (role != null && !request.isUserInRole(role)) {
return EVAL_PAGE;
}
-
+
try {
if (log.isDebugEnabled()) {
log.debug("insert page='" + page + "'.");
}
-
+
// set new context for included component.
pageContext.setAttribute(ComponentConstants.COMPONENT_CONTEXT,
- subCompContext, PageContext.REQUEST_SCOPE);
-
+ subCompContext, PageContext.REQUEST_SCOPE);
+
// Call preparer if any
if (preparer != null) {
try {
TilesRequestContext tilesContext = TagUtils
- .getTilesRequestContext(pageContext);
+ .getTilesRequestContext(pageContext);
preparer.execute(tilesContext, subCompContext);
} catch (Exception e) {
throw new ServletException(e);
}
-
+
}
-
+
// include requested component.
if (flush) {
pageContext.getOut().flush();
}
-
+
doInclude(page, flush);
-
+
} catch (IOException e) {
String msg = "Can't insert page '" + page + "' : "
- + e.getMessage();
+ + e.getMessage();
log.error(msg, e);
throw new JspException(msg);
-
+
} catch (IllegalArgumentException e) {
// Can't resolve page uri, should we ignore it?
if (!(page == null && isErrorIgnored)) {
String msg = "Can't insert page '" + page
- + "'. Check if it exists.\n" + e.getMessage();
-
+ + "'. Check if it exists.\n" + e.getMessage();
+
log.error(msg, e);
throw new JspException(msg, e);
}
-
+
} catch (Exception e) {
Throwable cause = e;
if (e.getCause() != null) {
cause = e.getCause();
}
-
+
String msg = "Exception in '" + page + "': "
- + cause.getMessage();
-
+ + cause.getMessage();
+
log.error(msg, e);
throw new JspException(msg, e);
-
+
} finally {
// restore old context only if currentContext not null
// (bug with Silverstream ?; related by Arvindra Sehmi 20010712)
if (currentContext != null) {
pageContext.setAttribute(
- ComponentConstants.COMPONENT_CONTEXT,
- currentContext, PageContext.REQUEST_SCOPE);
+ ComponentConstants.COMPONENT_CONTEXT,
+ currentContext, PageContext.REQUEST_SCOPE);
}
}
-
+
return EVAL_PAGE;
}
}
-
+
// ///////////////////////////////////////////////////////////////////////////
-
+
/**
* Handle insert direct string.
*/
protected class DirectStringHandler implements TagHandler {
- /** Object to print as a direct string */
+ /**
+ * Object to print as a direct string
+ */
private Object value;
-
+
/**
* Constructor.
*/
public DirectStringHandler(Object value) {
this.value = value;
}
-
+
/**
* Do nothing, there is no context for a direct string.
*/
public int doStartTag() throws JspException {
return SKIP_BODY;
}
-
+
/**
* Add attribute to sub context. Do nothing.
*/
public void putAttribute(String name, Object value) {
}
-
+
/**
* Print String in page output stream.
*/
@@ -617,21 +617,21 @@
if (flush) {
pageContext.getOut().flush();
}
-
+
pageContext.getOut().print(value);
-
+
} catch (IOException ex) {
if (log.isDebugEnabled()) {
log.debug("Can't write string '" + value + "' : ", ex);
}
-
+
pageContext.setAttribute(ComponentConstants.EXCEPTION_KEY, ex,
- PageContext.REQUEST_SCOPE);
-
+ PageContext.REQUEST_SCOPE);
+
throw new JspException("Can't write string '" + value + "' : "
- + ex.getMessage(), ex);
+ + ex.getMessage(), ex);
}
-
+
return EVAL_PAGE;
}
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ComponentConstants.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ComponentConstants.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ComponentConstants.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ComponentConstants.java Wed Nov 1 18:03:00 2006
@@ -23,7 +23,9 @@
*/
public interface ComponentConstants {
- /** Name used to store Tile/Component context. */
+ /**
+ * Name used to store Tile/Component context.
+ */
public static final String COMPONENT_CONTEXT = "org.apache.tiles.CompContext";
public static final int COMPONENT_SCOPE = 8;
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTag.java Wed Nov 1 18:03:00 2006
@@ -18,11 +18,11 @@
package org.apache.tiles.taglib;
-import javax.servlet.jsp.JspException;
-
+import org.apache.tiles.definition.ComponentAttribute;
+import org.apache.tiles.definition.ComponentDefinition;
import org.apache.tiles.taglib.util.TagUtils;
-import org.apache.tiles.ComponentDefinition;
-import org.apache.tiles.ComponentAttribute;
+
+import javax.servlet.jsp.JspException;
/**
* This is the tag handler for <tiles:definition>, which defines
@@ -105,14 +105,14 @@
ComponentAttribute def = null;
if (attributeValue != null
- && attributeValue instanceof ComponentAttribute) {
+ && attributeValue instanceof ComponentAttribute) {
def = ((ComponentAttribute) attributeValue);
if (nestedTag.getRole() != null) {
def.setRole(nestedTag.getRole());
}
} else {
def = new ComponentAttribute(attributeValue, nestedTag.getRole(),
- nestedTag.getType());
+ nestedTag.getType());
}
// now add attribute to enclosing parent (i.e. : this object)
@@ -149,6 +149,7 @@
/**
* Get the ID.
+ *
* @return ID
*/
public String getName() {
@@ -157,15 +158,16 @@
/**
* Set the ID.
- *
- * @param name New ID.
+ *
+ * @param name New name.
*/
- public void setName(String id) {
- this.name = id;
+ public void setName(String name) {
+ this.name = name;
}
/**
* Get the scope.
+ *
* @return Scope.
*/
public String getScope() {
@@ -174,6 +176,7 @@
/**
* Set the scope.
+ *
* @param aScope Scope.
*/
public void setScope(String aScope) {
@@ -182,6 +185,7 @@
/**
* Set <code>extends</code> (parent) definition name.
+ *
* @param definitionName Name of parent definition.
*/
public void setExtends(String definitionName) {
@@ -190,6 +194,7 @@
/**
* Get <code>extends</code> (parent) definition name.
+ *
* @return Name of parent definition.
*/
public String getExtends() {
@@ -198,6 +203,7 @@
/**
* Process the start tag by creating a new definition.
+ *
* @throws JspException On errors processing tag.
*/
public int doStartTag() throws JspException {
@@ -226,6 +232,7 @@
/**
* Process the end tag by putting the definition in appropriate context.
+ *
* @throws JspException On errors processing tag.
*/
public int doEndTag() throws JspException {
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java Wed Nov 1 18:03:00 2006
@@ -17,8 +17,8 @@
*/
package org.apache.tiles.taglib;
-import java.io.Serializable;
import javax.servlet.jsp.tagext.TagSupport;
+import java.io.Serializable;
/**
* Common base class for tags dealing with Tiles definitions.
@@ -38,7 +38,7 @@
* Role associated to definition.
*/
protected String role;
-
+
/**
* JSP page that implements the definition.
*/
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/GetAsStringTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/GetAsStringTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/GetAsStringTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/GetAsStringTag.java Wed Nov 1 18:03:00 2006
@@ -19,37 +19,38 @@
package org.apache.tiles.taglib;
-import java.io.IOException;
+import org.apache.tiles.ComponentContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
+import java.io.IOException;
-import org.apache.tiles.ComponentContext;
-
- /**
- * Retrieve the value of the specified component/template attribute property,
- * and render it to the current JspWriter as a String.
- * The usual toString() conversion is applied on the found value.
- */
+/**
+ * Retrieve the value of the specified component/template attribute property,
+ * and render it to the current JspWriter as a String.
+ * The usual toString() conversion is applied on the found value.
+ */
public class GetAsStringTag extends TagSupport implements ComponentConstants {
- private String attribute = null;
- /** Role attribute */
- private String role = null;
+ private String attribute = null;
+ /**
+ * Role attribute
+ */
+ private String role = null;
/**
* Do we ignore error if attribute is not found.
* Default value is <code>false</code>, which will throw an exception.
*/
- private boolean isErrorIgnored = false;
+ private boolean isErrorIgnored = false;
- /**
- * Default constructor.
- */
- public GetAsStringTag() {
- super();
- }
+ /**
+ * Default constructor.
+ */
+ public GetAsStringTag() {
+ super();
+ }
/**
* Release all allocated resources.
@@ -64,114 +65,113 @@
/**
* Set attribute.
+ *
* @param attribute Attribute.
*/
- public void setAttribute(String attribute){
- this.attribute = attribute;
- }
+ public void setAttribute(String attribute) {
+ this.attribute = attribute;
+ }
/**
* Get attribute.
+ *
* @return Attribute.
*/
- public String getAttribute()
- {
- return attribute;
- }
+ public String getAttribute() {
+ return attribute;
+ }
/**
* Set Name.
* Same as setAttribute().
+ *
* @param value Attribute.
*/
- public void setName(String value)
- {
- this.attribute = value;
+ public void setName(String value) {
+ this.attribute = value;
}
/**
* Get Name.
* Set as getAttribute().
+ *
* @return Attribute.
*/
- public String getName()
- {
- return attribute;
- }
+ public String getName() {
+ return attribute;
+ }
/**
* Set ignoring flag when attribute is not found.
+ *
* @param ignore default: <code>false</code>: Exception is thrown when attribute is not found, set to <code>
- * true</code> to ignore missing attributes silently
+ * true</code> to ignore missing attributes silently
*/
- public void setIgnore(boolean ignore)
- {
- this.isErrorIgnored = ignore;
+ public void setIgnore(boolean ignore) {
+ this.isErrorIgnored = ignore;
}
/**
* Get ignore flag.
+ *
* @return <code>false</code>: Exception is thrown when attribute is not found, set to <code>
- * true</code> to ignore missing attributes silently
+ * true</code> to ignore missing attributes silently
*/
- public boolean getIgnore()
- {
- return isErrorIgnored;
- }
+ public boolean getIgnore() {
+ return isErrorIgnored;
+ }
/**
* Set role.
+ *
* @param role The role the user must be in to store content.
*/
- public void setRole(String role) {
- this.role = role;
- }
+ public void setRole(String role) {
+ this.role = role;
+ }
/**
* Get role.
+ *
* @return Role.
*/
- public String getRole()
- {
- return role;
- }
+ public String getRole() {
+ return role;
+ }
/**
* Close tag.
+ *
* @throws JspException On error processing tag.
*/
- public int doEndTag() throws JspException {
+ public int doEndTag() throws JspException {
- // Check role
- if(role != null && !((HttpServletRequest)pageContext.getRequest()).isUserInRole(role) )
- {
- return EVAL_PAGE;
- } // end if
-
- // Get context
- ComponentContext compContext = (ComponentContext)pageContext.getAttribute( ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
-
- if( compContext == null )
- throw new JspException ( "Error - tag.getAsString : component context is not defined. Check tag syntax" );
-
- Object value = compContext.getAttribute(attribute);
- if( value == null)
- { // no value : throw error or fail silently according to ignore
- if(isErrorIgnored == false )
- throw new JspException ( "Error - tag.getAsString : attribute '"+ attribute + "' not found in context. Check tag syntax" );
- else
- return EVAL_PAGE;
- } // end if
-
-
- try
- {
- pageContext.getOut().print( value );
- }
- catch( IOException ex )
- {
- ex.printStackTrace();
- throw new JspException ( "Error - tag.getProperty : IOException ", ex);
+ // Check role
+ if (role != null && !((HttpServletRequest) pageContext.getRequest()).isUserInRole(role)) {
+ return EVAL_PAGE;
+ } // end if
+
+ // Get context
+ ComponentContext compContext = (ComponentContext) pageContext.getAttribute(ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
+
+ if (compContext == null)
+ throw new JspException("Error - tag.getAsString : component context is not defined. Check tag syntax");
+
+ Object value = compContext.getAttribute(attribute);
+ if (value == null) { // no value : throw error or fail silently according to ignore
+ if (isErrorIgnored == false)
+ throw new JspException("Error - tag.getAsString : attribute '" + attribute + "' not found in context. Check tag syntax");
+ else
+ return EVAL_PAGE;
+ } // end if
+
+
+ try {
+ pageContext.getOut().print(value);
+ }
+ catch (IOException ex) {
+ ex.printStackTrace();
+ throw new JspException ( "Error - tag.getProperty : IOException ", ex);
}
return EVAL_PAGE;
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/ImportAttributeTag.java Wed Nov 1 18:03:00 2006
@@ -19,21 +19,20 @@
package org.apache.tiles.taglib;
-import java.util.Iterator;
+import org.apache.tiles.definition.ComponentAttribute;
+import org.apache.tiles.ComponentContext;
+import org.apache.tiles.taglib.util.TagUtils;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
-
-import org.apache.tiles.taglib.util.TagUtils;
-import org.apache.tiles.ComponentAttribute;
-import org.apache.tiles.ComponentContext;
+import java.util.Iterator;
/**
- * Import attribute from component to requested scope.
- * Attribute name and scope are optional. If not specified, all component
- * attributes are imported in page scope.
+ * Import attribute from component to requested scope.
+ * Attribute name and scope are optional. If not specified, all component
+ * attributes are imported in page scope.
*/
public class ImportAttributeTag extends TagSupport {
@@ -41,7 +40,7 @@
/**
* Class name of object.
*/
- private String name = null;
+ private String name = null;
/**
@@ -58,7 +57,7 @@
* Default value is <code>false</code>, which throws an exception.
* Only "attribute not found" - errors are ignored.
*/
- protected boolean isErrorIgnored = false;
+ protected boolean isErrorIgnored = false;
/**
@@ -75,60 +74,60 @@
/**
* Get the name.
+ *
* @return Name.
*/
- public String getName()
- {
- return (this.name);
- }
+ public String getName() {
+ return (this.name);
+ }
/**
* Set the name.
+ *
* @param name The new name
*/
- public void setName(String name)
- {
- this.name = name;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
/**
* Set the scope.
+ *
* @param scope Scope.
*/
- public void setScope(String scope)
- {
- this.scopeName = scope;
- }
+ public void setScope(String scope) {
+ this.scopeName = scope;
+ }
/**
* Get scope.
+ *
* @return Scope.
*/
- public String getScope()
- {
- return scopeName;
- }
+ public String getScope() {
+ return scopeName;
+ }
/**
* Set ignore flag.
+ *
* @param ignore default: <code>false</code>: Exception is thrown when attribute is not found, set to <code>
- * true</code> to ignore missing attributes silently
+ * true</code> to ignore missing attributes silently
*/
- public void setIgnore(boolean ignore)
- {
- this.isErrorIgnored = ignore;
+ public void setIgnore(boolean ignore) {
+ this.isErrorIgnored = ignore;
}
/**
* Get ignore flag.
+ *
* @return default: <code>false</code>: Exception is thrown when attribute is not found, set to <code>
- * true</code> to ignore missing attributes silently
+ * true</code> to ignore missing attributes silently
*/
- public boolean getIgnore()
- {
- return isErrorIgnored;
- }
+ public boolean getIgnore() {
+ return isErrorIgnored;
+ }
// --------------------------------------------------------- Public Methods
@@ -136,71 +135,66 @@
/**
* Expose the requested property from component context.
*
- * @exception JspException On errors processing tag.
+ * @throws JspException On errors processing tag.
*/
-public int doStartTag() throws JspException
- {
- // retrieve component context
- ComponentContext compContext = (ComponentContext)pageContext.getAttribute(ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
- if( compContext == null )
- throw new JspException ( "Error - tag importAttribute : no tiles context found." );
-
- // set scope
- scope = TagUtils.getScope( scopeName, PageContext.PAGE_SCOPE );
-
- // push attribute in requested context.
- if( name != null )
- {
- Object value = compContext.getAttribute(name);
- // Check if value exist and if we must send a runtime exception
- if( value == null ) {
- if(!isErrorIgnored)
- throw new JspException ( "Error - tag importAttribute : property '"+ name + "' not found in context. Check tag syntax" );
- else
- return SKIP_BODY;
- } else if (value instanceof ComponentAttribute) {
- value = ((ComponentAttribute) value).getValue();
- }
-
- pageContext.setAttribute(name, value, scope);
- }
- else
- { // set all attributes
- Iterator names = compContext.getAttributeNames();
- while(names.hasNext())
- {
- String name = (String)names.next();
- if(name == null ) {
- if(!isErrorIgnored)
- throw new JspException ( "Error - tag importAttribute : encountered an attribute with key 'null'" );
- else
- return SKIP_BODY;
- }
-
- Object value = compContext.getAttribute(name);
- // Check if value exist and if we must send a runtime exception
- if( value == null ) {
- if(!isErrorIgnored)
- throw new JspException ( "Error - tag importAttribute : property '"+ name + "' has a value of 'null'" );
- else
- return SKIP_BODY;
- } else if (value instanceof ComponentAttribute) {
- value = ((ComponentAttribute) value).getValue();
- }
- pageContext.setAttribute(name, value, scope);
- } // end loop
- } // end else
+ public int doStartTag() throws JspException {
+ // retrieve component context
+ ComponentContext compContext = (ComponentContext) pageContext.getAttribute(ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
+ if (compContext == null)
+ throw new JspException("Error - tag importAttribute : no tiles context found.");
+
+ // set scope
+ scope = TagUtils.getScope(scopeName, PageContext.PAGE_SCOPE);
+
+ // push attribute in requested context.
+ if (name != null) {
+ Object value = compContext.getAttribute(name);
+ // Check if value exist and if we must send a runtime exception
+ if (value == null) {
+ if (!isErrorIgnored)
+ throw new JspException("Error - tag importAttribute : property '" + name + "' not found in context. Check tag syntax");
+ else
+ return SKIP_BODY;
+ } else if (value instanceof ComponentAttribute) {
+ value = ((ComponentAttribute) value).getValue();
+ }
+
+ pageContext.setAttribute(name, value, scope);
+ } else { // set all attributes
+ Iterator names = compContext.getAttributeNames();
+ while (names.hasNext()) {
+ String name = (String) names.next();
+ if (name == null) {
+ if (!isErrorIgnored)
+ throw new JspException("Error - tag importAttribute : encountered an attribute with key 'null'");
+ else
+ return SKIP_BODY;
+ }
+
+ Object value = compContext.getAttribute(name);
+ // Check if value exist and if we must send a runtime exception
+ if (value == null) {
+ if (!isErrorIgnored)
+ throw new JspException("Error - tag importAttribute : property '" + name + "' has a value of 'null'");
+ else
+ return SKIP_BODY;
+ } else if (value instanceof ComponentAttribute) {
+ value = ((ComponentAttribute) value).getValue();
+ }
+ pageContext.setAttribute(name, value, scope);
+ } // end loop
+ } // end else
- // Continue processing this page
- return SKIP_BODY;
+ // Continue processing this page
+ return SKIP_BODY;
}
/**
* Clean up after processing this enumeration.
*
- * @exception JspException On errors processing tag.
+ * @throws JspException On errors processing tag.
*/
- public int doEndTag() throws JspException
+ public int doEndTag() throws JspException
{
return (EVAL_PAGE);
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InitDefinitionsTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InitDefinitionsTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InitDefinitionsTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InitDefinitionsTag.java Wed Nov 1 18:03:00 2006
@@ -19,81 +19,85 @@
package org.apache.tiles.taglib;
+import org.apache.tiles.TilesApplicationContext;
+import org.apache.tiles.access.TilesAccess;
+import org.apache.tiles.definition.DefinitionsFactory;
+import org.apache.tiles.definition.DefinitionsFactoryConfig;
+import org.apache.tiles.definition.DefinitionsFactoryException;
+import org.apache.tiles.util.TilesUtil;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
-import org.apache.tiles.*;
-import org.apache.tiles.access.TilesAccess;
-
/**
* Init definitions impl.
*/
public class InitDefinitionsTag extends TagSupport implements ComponentConstants {
-private String filename = null;
-private String classname = null;
+ private String filename = null;
+ private String classname = null;
-/**
- * Default constructor.
- */
-public InitDefinitionsTag() {
- super();
-}
-
- /**
- * Release all allocated resources.
- */
- public void release() {
-
- super.release();
- filename = null;
- }
-
- /**
- * Set file.
- */
-public void setFile(String name){
- this.filename = name;
-}
-
- /**
- * Set classname.
- */
-public void setClassname(String classname){
- this.classname = classname;
-}
-
- /**
- * Do start tag.
- */
-public int doStartTag() throws JspException {
- TilesApplicationContext tilesContext =
- TilesAccess.getApplicationContext(pageContext.getServletContext());
- DefinitionsFactory factory = TilesUtil.getDefinitionsFactory();
- if(factory != null ) {
- return SKIP_BODY;
+ /**
+ * Default constructor.
+ */
+ public InitDefinitionsTag() {
+ super();
}
- DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
- factoryConfig.setFactoryClassname( classname );
- factoryConfig.setDefinitionConfigFiles( filename );
-
- try {
- factory = TilesUtil.createDefinitionsFactory(factoryConfig);
- } catch( DefinitionsFactoryException ex ) {
- ex.printStackTrace();
- throw new JspException( ex );
+ /**
+ * Release all allocated resources.
+ */
+ public void release() {
+
+ super.release();
+ filename = null;
}
- return SKIP_BODY;
-}
+ /**
+ * Set file.
+ */
+ public void setFile(String name) {
+ this.filename = name;
+ }
+
+ /**
+ * Set classname.
+ */
+ public void setClassname(String classname) {
+ this.classname = classname;
+ }
+
+ /**
+ * Do start tag.
+ */
+ public int doStartTag() throws JspException {
+ TilesApplicationContext tilesContext =
+ TilesAccess.getApplicationContext(pageContext.getServletContext());
+ DefinitionsFactory factory = TilesUtil.getDefinitionsFactory();
+ if (factory != null) {
+ return SKIP_BODY;
+ }
+
+ DefinitionsFactoryConfig factoryConfig = new DefinitionsFactoryConfig();
+ factoryConfig.setFactoryClassname(classname);
+ factoryConfig.setDefinitionConfigFiles(filename);
+
+ try {
+ factory = TilesUtil.createDefinitionsFactory(factoryConfig);
+ } catch (DefinitionsFactoryException ex) {
+ ex.printStackTrace();
+ throw new JspException(ex);
+ }
+
+ return SKIP_BODY;
+ }
- /**
- * Do end tag.
- */
-public int doEndTag() throws JspException {
- return EVAL_PAGE;
+ /**
+ * Do end tag.
+ */
+ public int doEndTag() throws JspException {
+ return EVAL_PAGE;
}
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java Wed Nov 1 18:03:00 2006
@@ -18,41 +18,41 @@
package org.apache.tiles.taglib;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
-
-import org.apache.tiles.ComponentDefinition;
-import org.apache.tiles.NoSuchDefinitionException;
import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.NoSuchDefinitionException;
import org.apache.tiles.taglib.util.TagUtils;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+
/**
* This is the tag handler for <tiles:insertDefinition>, which includes a
* definition, eventually overriding or filling attributes of its template.
- *
+ *
* @version $Rev$ $Date$
*/
public class InsertDefinitionTag extends BaseInsertTag {
-
+
/**
* Name to insert.
*/
protected String name = null;
-
+
/**
* Set name.
*/
public void setName(String value) {
this.name = value;
}
-
+
/**
* Get name.
*/
public String getName() {
return name;
}
-
+
/**
* Processes tag attributes and create corresponding tag handler.<br>
* This implementation processes the definition name to create an
@@ -61,60 +61,60 @@
public TagHandler createTagHandler() throws JspException {
return processDefinitionName(name);
}
-
+
/**
* Reset member values for reuse. This method calls super.release(), which
* invokes TagSupport.release(), which typically does nothing.
*/
public void release() {
-
+
super.release();
-
+
flush = true;
name = null;
template = null;
role = null;
isErrorIgnored = false;
-
+
releaseInternal();
}
-
+
/**
* Process tag attribute "definition". First, search definition in the
* factory, then create handler from this definition.
- *
+ *
* @param name Name of the definition.
* @return Appropriate TagHandler.
* @throws JspException- NoSuchDefinitionException No Definition found for
- * name.
+ * name.
* @throws JspException- FactoryNotFoundException Can't find Definitions
- * factory.
+ * factory.
* @throws JspException- DefinedComponentFactoryException General error in
- * factory.
- * @throws JspException InstantiationException Can't create requested
- * preparer
+ * factory.
+ * @throws JspException InstantiationException Can't create requested
+ * preparer
*/
protected TagHandler processDefinitionName(String name) throws JspException {
-
+
try {
TilesRequestContext tilesContext = TagUtils.getTilesRequestContext(pageContext);
ComponentDefinition definition = null;
definition = TagUtils.getComponentDefinition(name, pageContext,
- tilesContext);
-
+ tilesContext);
+
if (definition == null) { // is it possible ?
throw new NoSuchDefinitionException(
- "Error - Tag Insert : Can't get definition '"
- + name
- + "'. Check if this name exists in definitions factory.");
+ "Error - Tag Insert : Can't get definition '"
+ + name
+ + "'. Check if this name exists in definitions factory.");
}
-
+
return processDefinition(definition);
-
+
} catch (NoSuchDefinitionException ex) {
// Save exception to be able to show it later
pageContext.setAttribute(ComponentConstants.EXCEPTION_KEY, ex,
- PageContext.REQUEST_SCOPE);
+ PageContext.REQUEST_SCOPE);
throw new JspException(ex);
}
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTemplateTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTemplateTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTemplateTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTemplateTag.java Wed Nov 1 18:03:00 2006
@@ -23,11 +23,11 @@
/**
* This is the tag handler for <tiles:insertTemplate>, which includes a
* template ready to be filled.
- *
+ *
* @version $Rev$ $Date$
*/
public class InsertTemplateTag extends BaseInsertTag {
-
+
/**
* Processes tag attributes and create corresponding tag handler.<br>
* This implementation processes the definition name to create an
@@ -36,10 +36,10 @@
public TagHandler createTagHandler() throws JspException {
return processUrl(template);
}
-
+
/**
* Process the url.
- *
+ *
* @throws JspException If failed to create preparer
*/
protected TagHandler processUrl(String url) throws JspException {
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTag.java Wed Nov 1 18:03:00 2006
@@ -18,12 +18,12 @@
package org.apache.tiles.taglib;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.tiles.definition.ComponentAttribute;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
-import org.apache.tiles.ComponentAttribute;
+import java.util.ArrayList;
+import java.util.List;
/**
* PutList tag implementation.
@@ -32,18 +32,18 @@
extends TagSupport
implements ComponentConstants, AddTagParent, PutListTagParent {
- /**
- * Name of this attribute.
+ /**
+ * Name of this attribute.
*/
private String attributeName = null;
-
- /**
- * The list itself.
+
+ /**
+ * The list itself.
*/
private List list = null;
-
- /**
- * Role attribute.
+
+ /**
+ * Role attribute.
*/
private String role = null;
@@ -86,6 +86,7 @@
/**
* Set role attribute.
+ *
* @param role The role the user must be in to store content.
*/
public void setRole(String role) {
@@ -113,7 +114,7 @@
if (list == null) {
list = new ArrayList();
}
-
+
list.add(value);
}
@@ -135,7 +136,7 @@
def.setRole(nestedTag.getRole());
attributeValue = def;
}
-
+
// now add attribute to enclosing parent (i.e. : this object)
addElement(attributeValue);
}
@@ -160,16 +161,16 @@
} catch (ClassCastException ex) {
def = new ComponentAttribute(attributeValue);
}
-
+
if (def != null) {
def.setRole(nestedTag.getRole());
} else {
// what now? Is this an exception?
}
-
+
attributeValue = def;
}
-
+
// now add attribute to enclosing parent (i.e. : this object)
addElement(attributeValue);
}
@@ -194,6 +195,7 @@
/**
* Find enclosing parent tag accepting this tag.
+ *
* @throws JspException If we can't find an appropriate enclosing tag.
*/
protected PutListTagParent findEnclosingParent() throws JspException {
@@ -201,13 +203,13 @@
PutListTagParent parent =
(PutListTagParent) findAncestorWithClass(this,
PutListTagParent.class);
-
+
if (parent == null) {
throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag.");
}
-
+
return parent;
-
+
} catch (ClassCastException ex) {
throw new JspException("Error - tag putList : enclosing tag doesn't accept 'putList' tag.", ex);
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTagParent.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTagParent.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTagParent.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutListTagParent.java Wed Nov 1 18:03:00 2006
@@ -26,10 +26,11 @@
* This interface defines a method called by nested tags.
*/
public interface PutListTagParent {
- /**
- * Add an attribute to container.
- * @param nestedTag Nested PutTag defining the attribute.
- */
- void processNestedTag(PutListTag nestedTag) throws JspException;
+ /**
+ * Add an attribute to container.
+ *
+ * @param nestedTag Nested PutTag defining the attribute.
+ */
+ void processNestedTag(PutListTag nestedTag) throws JspException;
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTag.java Wed Nov 1 18:03:00 2006
@@ -18,14 +18,9 @@
package org.apache.tiles.taglib;
-import java.lang.reflect.InvocationTargetException;
-
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.tiles.taglib.util.TagUtils;
-
/**
* Put an attribute in enclosing attribute container tag.
* Enclosing attribute container tag can be : <insert> or <definition>.
@@ -60,30 +55,30 @@
/* JSP Tag attributes */
- /**
- * Name of attribute to put in component context.
+ /**
+ * Name of attribute to put in component context.
*/
protected String attributeName = null;
- /**
- * Associated attribute value.
+ /**
+ * Associated attribute value.
*/
private Object value = null;
- /**
- * Requested type for the value.
+ /**
+ * Requested type for the value.
*/
private String valueType = null;
- /**
- * Role attribute.
+ /**
+ * Role attribute.
*/
private String role = null;
/* Internal properties */
- /**
- * Cached real value computed from tag attributes.
+ /**
+ * Cached real value computed from tag attributes.
*/
protected Object realValue = null;
@@ -188,6 +183,7 @@
/**
* Set role attribute.
+ *
* @param role The role the user must be in to store content.
*/
public void setRole(String role) {
@@ -196,6 +192,7 @@
/**
* Get role attribute
+ *
* @return The role defined in the tag or <code>null</code>.
*/
public String getRole() {
@@ -205,6 +202,7 @@
/**
* Get real value according to tag attribute.
* Real value is the value computed after attribute processing.
+ *
* @return Real value.
* @throws JspException If something goes wrong while getting value from bean.
*/
@@ -218,6 +216,7 @@
/**
* Compute real value according to tag attributes.
+ *
* @throws JspException If something goes wrong while getting value from bean.
*/
protected void computeRealValue() throws JspException {
@@ -305,7 +304,7 @@
/**
* Save the body content of this tag (if any)
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
public int doAfterBody() throws JspException {
@@ -331,6 +330,7 @@
/**
* Find parent tag which must implement AttributeContainer.
+ *
* @throws JspException If we can't find an appropriate enclosing tag.
*/
protected void callParent() throws JspException {
@@ -341,6 +341,7 @@
/**
* Find parent tag which must implement AttributeContainer.
+ *
* @throws JspException If we can't find an appropriate enclosing tag.
*/
protected PutTagParent findEnclosingPutTagParent() throws JspException {
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTagParent.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTagParent.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTagParent.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/PutTagParent.java Wed Nov 1 18:03:00 2006
@@ -26,10 +26,11 @@
* This interface defines a method called by nested tags.
*/
public interface PutTagParent {
- /**
- * Process the nested tag.
- * @param nestedTag Nested tag to process.
- */
- void processNestedTag(PutTag nestedTag ) throws JspException;
+ /**
+ * Process the nested tag.
+ *
+ * @param nestedTag Nested tag to process.
+ */
+ void processNestedTag(PutTag nestedTag) throws JspException;
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTag.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTag.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTag.java Wed Nov 1 18:03:00 2006
@@ -19,28 +19,26 @@
package org.apache.tiles.taglib;
+import org.apache.tiles.ComponentContext;
+import org.apache.tiles.taglib.util.TagUtils;
+
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
-import org.apache.tiles.taglib.util.TagUtils;
-import org.apache.tiles.ComponentContext;
-
/**
* Custom tag exposing a component attribute to page.
- *
*/
public class UseAttributeTag extends TagSupport {
-
// ----------------------------------------------------- Instance Variables
/**
* Class name of object.
*/
- private String classname = null;
+ private String classname = null;
/**
@@ -54,7 +52,6 @@
private int scope = PageContext.PAGE_SCOPE;
-
/**
* The attribute name to be exposed.
*/
@@ -65,8 +62,7 @@
* Default value is <code>false</code>, which throws an exception.
* Only "attribute not found" - errors are ignored.
*/
- protected boolean isErrorIgnored = false;
-
+ protected boolean isErrorIgnored = false;
// ------------------------------------------------------------- Properties
@@ -82,8 +78,8 @@
scope = PageContext.PAGE_SCOPE;
scopeName = null;
isErrorIgnored = false;
- // Parent doesn't clear id, so we do it
- // bug reported by Heath Chiavettone on 18 Mar 2002
+ // Parent doesn't clear id, so we do it
+ // bug reported by Heath Chiavettone on 18 Mar 2002
id = null;
}
@@ -92,7 +88,7 @@
*/
public String getClassname() {
- return (this.classname);
+ return (this.classname);
}
@@ -104,24 +100,23 @@
*/
public void setClassname(String name) {
- this.classname = name;
+ this.classname = name;
}
/**
* Set name.
*/
- public void setName(String value){
- this.attributeName = value;
- }
+ public void setName(String value) {
+ this.attributeName = value;
+ }
/**
* Get name.
*/
- public String getName()
- {
- return attributeName;
- }
+ public String getName() {
+ return attributeName;
+ }
/**
* Set the scope.
@@ -129,32 +124,29 @@
* @param scope The new scope.
*/
public void setScope(String scope) {
- this.scopeName = scope;
+ this.scopeName = scope;
}
/**
* Get scope.
*/
- public String getScope()
- {
- return scopeName;
- }
+ public String getScope() {
+ return scopeName;
+ }
/**
* Set ignore.
*/
- public void setIgnore(boolean ignore)
- {
- this.isErrorIgnored = ignore;
+ public void setIgnore(boolean ignore) {
+ this.isErrorIgnored = ignore;
}
/**
* Get ignore.
*/
- public boolean getIgnore()
- {
- return isErrorIgnored;
- }
+ public boolean getIgnore() {
+ return isErrorIgnored;
+ }
// --------------------------------------------------------- Public Methods
@@ -162,49 +154,44 @@
/**
* Expose the requested attribute from component context.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- public int doStartTag() throws JspException
- {
- // Do a local copy of id
- String localId=this.id;
- if( localId==null )
- localId=attributeName;
-
- ComponentContext compContext = (ComponentContext)pageContext.getAttribute( ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
- if( compContext == null )
- throw new JspException ( "Error - tag useAttribute : no tiles context found." );
+ public int doStartTag() throws JspException {
+ // Do a local copy of id
+ String localId = this.id;
+ if (localId == null)
+ localId = attributeName;
+
+ ComponentContext compContext = (ComponentContext) pageContext.getAttribute(ComponentConstants.COMPONENT_CONTEXT, PageContext.REQUEST_SCOPE);
+ if (compContext == null)
+ throw new JspException("Error - tag useAttribute : no tiles context found.");
- Object value = compContext.getAttribute(attributeName);
+ Object value = compContext.getAttribute(attributeName);
// Check if value exists and if we must send a runtime exception
- if( value == null )
- if(!isErrorIgnored)
- throw new JspException ( "Error - tag useAttribute : attribute '"+ attributeName + "' not found in context. Check tag syntax" );
- else
- return SKIP_BODY;
+ if (value == null)
+ if (!isErrorIgnored)
+ throw new JspException("Error - tag useAttribute : attribute '" + attributeName + "' not found in context. Check tag syntax");
+ else
+ return SKIP_BODY;
+
+ if (scopeName != null) {
+ scope = TagUtils.getScope(scopeName, PageContext.PAGE_SCOPE);
+ if (scope != ComponentConstants.COMPONENT_SCOPE)
+ pageContext.setAttribute(localId, value, scope);
+ } else
+ pageContext.setAttribute(localId, value);
- if( scopeName != null )
- {
- scope = TagUtils.getScope( scopeName, PageContext.PAGE_SCOPE );
- if(scope!=ComponentConstants.COMPONENT_SCOPE)
- pageContext.setAttribute(localId, value, scope);
- }
- else
- pageContext.setAttribute(localId, value);
-
- // Continue processing this page
- return SKIP_BODY;
+ // Continue processing this page
+ return SKIP_BODY;
}
-
-
/**
* Clean up after processing this enumeration.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- public int doEndTag() throws JspException
+ public int doEndTag() throws JspException
{
return (EVAL_PAGE);
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTei.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTei.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTei.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/UseAttributeTei.java Wed Nov 1 18:03:00 2006
@@ -28,7 +28,6 @@
/**
* Implementation of <code>TagExtraInfo</code> for the <b>UseAttribute</b>
* tag, identifying the scripting object(s) to be made visible.
- *
*/
public final class UseAttributeTei extends TagExtraInfo {
@@ -39,19 +38,19 @@
*/
public VariableInfo[] getVariableInfo(TagData data) {
- String classname = data.getAttributeString("classname");
- if( classname == null )
- classname = "java.lang.Object";
- String id = data.getAttributeString("id");
- if( id == null )
- id = data.getAttributeString("name");
+ String classname = data.getAttributeString("classname");
+ if (classname == null)
+ classname = "java.lang.Object";
+ String id = data.getAttributeString("id");
+ if (id == null)
+ id = data.getAttributeString("name");
- return new VariableInfo[] {
- new VariableInfo(id,
- classname,
- true,
- VariableInfo.AT_END)
- };
+ return new VariableInfo[]{
+ new VariableInfo(id,
+ classname,
+ true,
+ VariableInfo.AT_END)
+ };
}
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/package.html
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/package.html?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/package.html (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/package.html Wed Nov 1 18:03:00 2006
@@ -1,13 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <title>Package Documentation for org.apache.taglib.tiles Package</title>
+ <title>Package Documentation for org.apache.taglib.tiles Package</title>
</head>
- <body bgcolor="white">
-
+<body bgcolor="white">
-<p> The "tiles-core" tag library contains tags that are useful in
-creating dynamic reusable components. </p>
- </body>
+<p> The "tiles-core" tag library contains tags that are useful in
+ creating dynamic reusable components. </p>
+
+</body>
</html>
Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/util/TagUtils.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/util/TagUtils.java?view=diff&rev=470185&r1=470184&r2=470185
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/util/TagUtils.java (original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/util/TagUtils.java Wed Nov 1 18:03:00 2006
@@ -18,31 +18,38 @@
package org.apache.tiles.taglib.util;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-import java.util.HashMap;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.tiles.ComponentContext;
+import org.apache.tiles.TilesApplicationContext;
+import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.access.TilesAccess;
+import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.DefinitionsFactoryException;
+import org.apache.tiles.definition.FactoryNotFoundException;
+import org.apache.tiles.definition.NoSuchDefinitionException;
+import org.apache.tiles.taglib.ComponentConstants;
+import org.apache.tiles.util.TilesUtil;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.tiles.taglib.ComponentConstants;
-import org.apache.tiles.*;
-import org.apache.tiles.access.TilesAccess;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
/**
* Collection of utilities.
* This class also serves as an interface between Components and Struts. If
* you want to rip away Struts, simply reimplement some methods in this class.
* You can copy them from Struts.
- *
*/
public class TagUtils {
- /** Debug flag */
+ /**
+ * Debug flag
+ */
public static final boolean debug = true;
/**
@@ -76,12 +83,13 @@
/**
- * Get scope value from string value
- * @param scopeName Scope as a String.
- * @param defaultValue Returned default value, if not found.
- * @return Scope as an <code>int</code>, or <code>defaultValue</code> if scope is <code>null</code>.
- * @throws JspException Scope name is not recognized as a valid scope.
- */
+ * Get scope value from string value
+ *
+ * @param scopeName Scope as a String.
+ * @param defaultValue Returned default value, if not found.
+ * @return Scope as an <code>int</code>, or <code>defaultValue</code> if scope is <code>null</code>.
+ * @throws JspException Scope name is not recognized as a valid scope.
+ */
public static int getScope(String scopeName, int defaultValue) throws JspException {
if (scopeName == null) {
return defaultValue;
@@ -103,8 +111,9 @@
/**
* Converts the scope name into its corresponding PageContext constant value.
+ *
* @param scopeName Can be "page", "request", "session", or "application" in any
- * case.
+ * case.
* @return The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
* @throws JspException if the scopeName is not a valid name.
*/
@@ -113,14 +122,13 @@
if (scope == null) {
//throw new JspException(messages.getMessage("lookup.scope", scope));
- throw new JspException("Unable to retrieve the scope "+scopeName);
+ throw new JspException("Unable to retrieve the scope " + scopeName);
}
return scope.intValue();
}
-
/**
* Return the value of the specified property of the specified bean,
* no matter which property reference format is used, with no
@@ -128,22 +136,21 @@
*
* @param bean Bean whose property is to be extracted.
* @param name Possibly indexed and/or nested name of the property
- * to be extracted.
- *
- * @exception IllegalAccessException if the caller does not have
- * access to the property accessor method
- * @exception InvocationTargetException if the property accessor method
- * throws an exception
- * @exception NoSuchMethodException if an accessor method for this
- * propety cannot be found.
+ * to be extracted.
+ * @throws IllegalAccessException if the caller does not have
+ * access to the property accessor method
+ * @throws InvocationTargetException if the property accessor method
+ * throws an exception
+ * @throws NoSuchMethodException if an accessor method for this
+ * propety cannot be found.
* @deprecated Use PropertyUtils.getProperty() directly. This will be removed
- * after Struts 1.2.
+ * after Struts 1.2.
*/
public static Object getProperty(Object bean, String name)
throws
- IllegalAccessException,
- InvocationTargetException,
- NoSuchMethodException {
+ IllegalAccessException,
+ InvocationTargetException,
+ NoSuchMethodException {
return PropertyUtils.getProperty(bean, name);
}
@@ -152,9 +159,9 @@
* Retrieve bean from page context, using specified scope.
* If scope is not set, use <code>findAttribute()</code>.
*
- * @param beanName Name of bean to retrieve.
- * @param scopeName Scope or <code>null</code>. If <code>null</code>, bean is searched using
- * findAttribute().
+ * @param beanName Name of bean to retrieve.
+ * @param scopeName Scope or <code>null</code>. If <code>null</code>, bean is searched using
+ * findAttribute().
* @param pageContext Current pageContext.
* @return Requested bean or <code>null</code> if not found.
* @throws JspException Scope name is not recognized as a valid scope.
@@ -176,7 +183,8 @@
/**
* Search attribute in different contexts.
* First, check in component context, then use pageContext.findAttribute().
- * @param beanName Name of bean to retrieve.
+ *
+ * @param beanName Name of bean to retrieve.
* @param pageContext Current pageContext.
* @return Requested bean or <code>null</code> if not found.
*/
@@ -198,8 +206,9 @@
/**
* Get object from requested context. Return <code>null</code> if not found.
* Context can be "component" or normal JSP contexts.
- * @param beanName Name of bean to retrieve.
- * @param scope Scope from which bean must be retrieved.
+ *
+ * @param beanName Name of bean to retrieve.
+ * @param scope Scope from which bean must be retrieved.
* @param pageContext Current pageContext.
* @return Requested bean or <code>null</code> if not found.
*/
@@ -216,18 +225,17 @@
* Locate and return the specified property of the specified bean, from
* an optionally specified scope, in the specified page context.
*
- * @param pageContext Page context to be searched.
- * @param beanName Name of the bean to be retrieved.
+ * @param pageContext Page context to be searched.
+ * @param beanName Name of the bean to be retrieved.
* @param beanProperty Name of the property to be retrieved, or
- * <code>null</code> to retrieve the bean itself.
- * @param beanScope Scope to be searched (page, request, session, application)
- * or <code>null</code> to use <code>findAttribute()</code> instead.
- *
- * @exception JspException Scope name is not recognized as a valid scope
- * @exception JspException if the specified bean is not found
- * @exception JspException if accessing this property causes an
- * IllegalAccessException, IllegalArgumentException,
- * InvocationTargetException, or NoSuchMethodException
+ * <code>null</code> to retrieve the bean itself.
+ * @param beanScope Scope to be searched (page, request, session, application)
+ * or <code>null</code> to use <code>findAttribute()</code> instead.
+ * @throws JspException Scope name is not recognized as a valid scope
+ * @throws JspException if the specified bean is not found
+ * @throws JspException if accessing this property causes an
+ * IllegalAccessException, IllegalArgumentException,
+ * InvocationTargetException, or NoSuchMethodException
*/
public static Object getRealValueFromBean(
String beanName,
@@ -286,12 +294,11 @@
* If scope is <code>null</code>, save it in REQUEST_SCOPE context.
*
* @param pageContext Current pageContext.
- * @param name Name of the bean.
- * @param scope Scope under which bean is saved (page, request, session, application)
- * or <code>null</code> to store in <code>request()</code> instead.
- * @param value Bean value to store.
- *
- * @exception JspException Scope name is not recognized as a valid scope
+ * @param name Name of the bean.
+ * @param scope Scope under which bean is saved (page, request, session, application)
+ * or <code>null</code> to store in <code>request()</code> instead.
+ * @param value Bean value to store.
+ * @throws JspException Scope name is not recognized as a valid scope
*/
public static void setAttribute(
PageContext pageContext,
@@ -319,10 +326,9 @@
* Store bean in REQUEST_SCOPE context.
*
* @param pageContext Current pageContext.
- * @param name Name of the bean.
- * @param beanValue Bean value to store.
- *
- * @exception JspException Scope name is not recognized as a valid scope
+ * @param name Name of the bean.
+ * @param beanValue Bean value to store.
+ * @throws JspException Scope name is not recognized as a valid scope
*/
public static void setAttribute(PageContext pageContext, String name, Object beanValue)
throws JspException {
@@ -333,7 +339,7 @@
* Save the specified exception as a request attribute for later use.
*
* @param pageContext The PageContext for the current page.
- * @param exception The exception to be saved.
+ * @param exception The exception to be saved.
*/
public static void saveException(PageContext pageContext, Throwable exception) {
pageContext.setAttribute(ComponentConstants.EXCEPTION_KEY, exception, PageContext.REQUEST_SCOPE);
@@ -341,7 +347,8 @@
/**
* Get component definition by its name.
- * @param name Definition name.
+ *
+ * @param name Definition name.
* @param pageContext The PageContext for the current page.
* @throws JspException -
*/
@@ -353,10 +360,11 @@
/**
* Get component definition by its name.
- * @param name Definition name.
- * @param pageContext The PageContext for the current page.
+ *
+ * @param name Definition name.
+ * @param pageContext The PageContext for the current page.
* @param tilesContext The TilesApplicationContext for the current request. If it is
- * null, it will be created.
+ * null, it will be created.
* @throws JspException -
*/
public static ComponentDefinition getComponentDefinition(String name,
@@ -368,7 +376,7 @@
ComponentDefinition definition;
Object definitionCandidate = findAttribute(name, pageContext);
if (definitionCandidate != null
- && definitionCandidate instanceof ComponentDefinition) {
+ && definitionCandidate instanceof ComponentDefinition) {
definition = (ComponentDefinition) definitionCandidate;
} else {
if (tilesContext == null) {
@@ -382,7 +390,7 @@
throw new JspException(
"Error : Can't get component definition for '"
+ name
- + "'. Check if this name exist in component definitions.",ex);
+ + "'. Check if this name exist in component definitions.", ex);
} catch (FactoryNotFoundException ex) { // impl not found.
throw new JspException(ex);