You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2006/02/10 19:09:25 UTC
svn commit: r376780 [2/3] -
/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTag.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTag.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTag.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTag.java Fri Feb 10 10:09:22 2006
@@ -1,209 +1,258 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import org.apache.struts.taglib.logic.NotMatchTag;
-import javax.servlet.jsp.JspException;
import org.apache.strutsel.taglib.utils.EvalHelper;
+import javax.servlet.jsp.JspException;
+
/**
- * Evalute the nested body content of this tag if the specified value
- * is a substring of the specified variable.
- *<p>
- * This class is a subclass of the class
- * <code>org.apache.struts.taglib.logic.NotMatchTag</code> which provides most
- * of the described functionality. This subclass allows all attribute values
- * to be specified as expressions utilizing the JavaServer Pages Standard
- * Library expression language.
+ * Evalute the nested body content of this tag if the specified value is a
+ * substring of the specified variable. <p> This class is a subclass of the
+ * class <code>org.apache.struts.taglib.logic.NotMatchTag</code> which
+ * provides most of the described functionality. This subclass allows all
+ * attribute values to be specified as expressions utilizing the JavaServer
+ * Pages Standard Library expression language.
*
* @version $Rev$
*/
public class ELNotMatchTag extends NotMatchTag {
-
/**
- * Instance variable mapped to "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "cookie" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String cookieExpr;
+
/**
- * Instance variable mapped to "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "header" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String headerExpr;
+
/**
- * Instance variable mapped to "location" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "location" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String locationExpr;
+
/**
- * Instance variable mapped to "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "name" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String nameExpr;
+
/**
- * Instance variable mapped to "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "parameter" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String parameterExpr;
+
/**
- * Instance variable mapped to "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "property" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String propertyExpr;
+
/**
- * Instance variable mapped to "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "scope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String scopeExpr;
+
/**
- * Instance variable mapped to "value" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "value" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String valueExpr;
/**
- * Getter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * String value of expression to be evaluated.
*/
- public String getCookieExpr() { return (cookieExpr); }
+ private String expr;
+
/**
- * Getter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Evaluated value of expression.
*/
- public String getHeaderExpr() { return (headerExpr); }
+ private String exprValue;
+
/**
- * Getter method for "location" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getLocationExpr() { return (locationExpr); }
+ public String getCookieExpr() {
+ return (cookieExpr);
+ }
+
/**
- * Getter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getNameExpr() { return (nameExpr); }
+ public String getHeaderExpr() {
+ return (headerExpr);
+ }
+
/**
- * Getter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "location" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getParameterExpr() { return (parameterExpr); }
+ public String getLocationExpr() {
+ return (locationExpr);
+ }
+
/**
- * Getter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getPropertyExpr() { return (propertyExpr); }
+ public String getNameExpr() {
+ return (nameExpr);
+ }
+
/**
- * Getter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getScopeExpr() { return (scopeExpr); }
+ public String getParameterExpr() {
+ return (parameterExpr);
+ }
+
/**
- * Getter method for "value" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getValueExpr() { return (valueExpr); }
+ public String getPropertyExpr() {
+ return (propertyExpr);
+ }
/**
- * Setter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setCookieExpr(String cookieExpr) { this.cookieExpr = cookieExpr; }
+ public String getScopeExpr() {
+ return (scopeExpr);
+ }
+
/**
- * Setter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "value" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setHeaderExpr(String headerExpr) { this.headerExpr = headerExpr; }
+ public String getValueExpr() {
+ return (valueExpr);
+ }
+
/**
- * Setter method for "location" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setLocationExpr(String locationExpr) { this.locationExpr = locationExpr; }
+ public void setCookieExpr(String cookieExpr) {
+ this.cookieExpr = cookieExpr;
+ }
+
/**
- * Setter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; }
+ public void setHeaderExpr(String headerExpr) {
+ this.headerExpr = headerExpr;
+ }
+
/**
- * Setter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "location" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setParameterExpr(String parameterExpr) { this.parameterExpr = parameterExpr; }
+ public void setLocationExpr(String locationExpr) {
+ this.locationExpr = locationExpr;
+ }
+
/**
- * Setter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; }
+ public void setNameExpr(String nameExpr) {
+ this.nameExpr = nameExpr;
+ }
+
+ /**
+ * Setter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
+ */
+ public void setParameterExpr(String parameterExpr) {
+ this.parameterExpr = parameterExpr;
+ }
+
/**
- * Setter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; }
+ public void setPropertyExpr(String propertyExpr) {
+ this.propertyExpr = propertyExpr;
+ }
+
/**
- * Setter method for "value" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setValueExpr(String valueExpr) { this.valueExpr = valueExpr; }
+ public void setScopeExpr(String scopeExpr) {
+ this.scopeExpr = scopeExpr;
+ }
/**
- * String value of expression to be evaluated.
+ * Setter method for "value" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- private String expr;
+ public void setValueExpr(String valueExpr) {
+ this.valueExpr = valueExpr;
+ }
/**
* Returns the string value of the expression. This value will be
* evaluated by the JSTL EL engine.
*/
- public String getExpr() {
+ public String getExpr() {
return (expr);
}
-
+
/**
* Sets the string value of the expression. This expression will be
* evaluated by the JSTL EL engine.
*/
- public void setExpr(String expr) {
+ public void setExpr(String expr) {
this.expr = expr;
}
/**
- * Evaluated value of expression.
- */
- private String exprValue;
-
- /**
* Returns the evaluated expression.
*/
- public String getExprValue() {
+ public String getExprValue() {
return (exprValue);
}
/**
* Sets the evaluated expression.
*/
- public void setExprValue(String exprValue) {
- this.exprValue = exprValue;
+ public void setExprValue(String exprValue) {
+ this.exprValue = exprValue;
}
/**
* Releases state of custom tag so this instance can be reused.
*/
- public void release()
- {
+ public void release() {
super.release();
setCookieExpr(null);
setHeaderExpr(null);
@@ -216,14 +265,15 @@
setExpr(null);
setExprValue(null);
}
-
+
/**
* Process the start tag.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
evaluateExpressions();
+
return (super.doStartTag());
}
@@ -233,18 +283,20 @@
* should be evaluated, or <code>false</code> if it should be skipped.
*
* @param desired Desired value for a true result
- * @exception JspException if a JSP exception occurs
+ * @throws JspException if a JSP exception occurs
*/
- protected boolean condition(boolean desired) throws JspException {
- boolean result = false;
+ protected boolean condition(boolean desired)
+ throws JspException {
+ boolean result = false;
+
if (getExprValue() != null) {
- result =
+ result =
ELMatchSupport.condition(desired, getExprValue(), value,
- location, messages, pageContext);
- }
- else {
- result = super.condition(desired);
+ location, messages, pageContext);
+ } else {
+ result = super.condition(desired);
}
+
return (result);
}
@@ -252,45 +304,60 @@
* Processes all attribute values which use the JSTL expression evaluation
* engine to determine their values.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- private void evaluateExpressions() throws JspException {
- String string = null;
-
- if ((string = EvalHelper.evalString("cookie", getCookieExpr(),
- this, pageContext)) != null)
+ private void evaluateExpressions()
+ throws JspException {
+ String string = null;
+
+ if ((string =
+ EvalHelper.evalString("cookie", getCookieExpr(), this,
+ pageContext)) != null) {
setCookie(string);
+ }
- if ((string = EvalHelper.evalString("expr", getExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("expr", getExpr(), this, pageContext)) != null) {
setExprValue(string);
+ }
- if ((string = EvalHelper.evalString("header", getHeaderExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("header", getHeaderExpr(), this,
+ pageContext)) != null) {
setHeader(string);
+ }
- if ((string = EvalHelper.evalString("location", getLocationExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("location", getLocationExpr(), this,
+ pageContext)) != null) {
setLocation(string);
+ }
- if ((string = EvalHelper.evalString("name", getNameExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
setName(string);
+ }
- if ((string = EvalHelper.evalString("parameter", getParameterExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("parameter", getParameterExpr(), this,
+ pageContext)) != null) {
setParameter(string);
+ }
- if ((string = EvalHelper.evalString("property", getPropertyExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("property", getPropertyExpr(), this,
+ pageContext)) != null) {
setProperty(string);
+ }
- if ((string = EvalHelper.evalString("scope", getScopeExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("scope", getScopeExpr(), this, pageContext)) != null) {
setScope(string);
+ }
- if ((string = EvalHelper.evalString("value", getValueExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("value", getValueExpr(), this, pageContext)) != null) {
setValue(string);
+ }
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTagBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTagBeanInfo.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTagBeanInfo.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotMatchTagBeanInfo.java Fri Feb 10 10:09:22 2006
@@ -1,86 +1,99 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
+
import java.util.ArrayList;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.logic.ELNotMatchTag</code> class. It is
* needed to override the default mapping of custom tag attribute names to
- * class attribute names.
- *<p>
- * This is because the value of the unevaluated EL expression has to be kept
- * separately from the evaluated value, which is stored in the base class. This
- * is related to the fact that the JSP compiler can choose to reuse different
- * tag instances if they received the same original attribute values, and the
- * JSP compiler can choose to not re-call the setter methods, because it can
- * assume the same values are already set.
+ * class attribute names. <p> This is because the value of the unevaluated EL
+ * expression has to be kept separately from the evaluated value, which is
+ * stored in the base class. This is related to the fact that the JSP compiler
+ * can choose to reuse different tag instances if they received the same
+ * original attribute values, and the JSP compiler can choose to not re-call
+ * the setter methods, because it can assume the same values are already set.
*/
-public class ELNotMatchTagBeanInfo extends SimpleBeanInfo
-{
- public PropertyDescriptor[] getPropertyDescriptors()
- {
+public class ELNotMatchTagBeanInfo extends SimpleBeanInfo {
+ public PropertyDescriptor[] getPropertyDescriptors() {
ArrayList proplist = new ArrayList();
try {
proplist.add(new PropertyDescriptor("cookie", ELNotMatchTag.class,
- null, "setCookieExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setCookieExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("header", ELNotMatchTag.class,
- null, "setHeaderExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setHeaderExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
- proplist.add(new PropertyDescriptor("location", ELNotMatchTag.class,
- null, "setLocationExpr"));
- } catch (IntrospectionException ex) {}
+ proplist.add(new PropertyDescriptor("location",
+ ELNotMatchTag.class, null, "setLocationExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("name", ELNotMatchTag.class,
- null, "setNameExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setNameExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ try {
+ proplist.add(new PropertyDescriptor("parameter",
+ ELNotMatchTag.class, null, "setParameterExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
- proplist.add(new PropertyDescriptor("parameter", ELNotMatchTag.class,
- null, "setParameterExpr"));
- } catch (IntrospectionException ex) {}
- try {
- proplist.add(new PropertyDescriptor("property", ELNotMatchTag.class,
- null, "setPropertyExpr"));
- } catch (IntrospectionException ex) {}
+ proplist.add(new PropertyDescriptor("property",
+ ELNotMatchTag.class, null, "setPropertyExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("scope", ELNotMatchTag.class,
- null, "setScopeExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setScopeExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("value", ELNotMatchTag.class,
- null, "setValueExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setValueExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("expr", ELNotMatchTag.class,
- null, "setExpr"));
- } catch (IntrospectionException ex) {}
-
- PropertyDescriptor[] result =
- new PropertyDescriptor[proplist.size()];
+ null, "setExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
+
return ((PropertyDescriptor[]) proplist.toArray(result));
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTag.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTag.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTag.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTag.java Fri Feb 10 10:09:22 2006
@@ -1,169 +1,218 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import org.apache.struts.taglib.logic.NotPresentTag;
-import javax.servlet.jsp.JspException;
import org.apache.strutsel.taglib.utils.EvalHelper;
+import javax.servlet.jsp.JspException;
+
/**
- * Evaluates the nested body content of this tag if the specified value is
- * not present for this request.
- *<p>
- * This class is a subclass of the class
- * <code>org.apache.struts.taglib.logic.NotPresentTag</code> which
- * provides most of the described functionality. This subclass allows all
- * attribute values to be specified as expressions utilizing the JavaServer
- * Pages Standard Library expression language.
+ * Evaluates the nested body content of this tag if the specified value is not
+ * present for this request. <p> This class is a subclass of the class
+ * <code>org.apache.struts.taglib.logic.NotPresentTag</code> which provides
+ * most of the described functionality. This subclass allows all attribute
+ * values to be specified as expressions utilizing the JavaServer Pages
+ * Standard Library expression language.
*
* @version $Rev$
*/
public class ELNotPresentTag extends NotPresentTag {
-
/**
- * Instance variable mapped to "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "cookie" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String cookieExpr;
+
/**
- * Instance variable mapped to "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "header" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String headerExpr;
+
/**
- * Instance variable mapped to "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "name" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String nameExpr;
+
/**
- * Instance variable mapped to "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "parameter" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String parameterExpr;
+
/**
- * Instance variable mapped to "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "property" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String propertyExpr;
+
/**
- * Instance variable mapped to "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "role" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String roleExpr;
+
/**
- * Instance variable mapped to "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "scope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String scopeExpr;
+
/**
- * Instance variable mapped to "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "user" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String userExpr;
/**
- * Getter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getCookieExpr() { return (cookieExpr); }
+ public String getCookieExpr() {
+ return (cookieExpr);
+ }
+
/**
- * Getter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getHeaderExpr() { return (headerExpr); }
+ public String getHeaderExpr() {
+ return (headerExpr);
+ }
+
/**
- * Getter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getNameExpr() { return (nameExpr); }
+ public String getNameExpr() {
+ return (nameExpr);
+ }
+
/**
- * Getter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getParameterExpr() { return (parameterExpr); }
+ public String getParameterExpr() {
+ return (parameterExpr);
+ }
+
/**
- * Getter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getPropertyExpr() { return (propertyExpr); }
+ public String getPropertyExpr() {
+ return (propertyExpr);
+ }
+
/**
- * Getter method for "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "role" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getRoleExpr() { return (roleExpr); }
+ public String getRoleExpr() {
+ return (roleExpr);
+ }
+
/**
- * Getter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getScopeExpr() { return (scopeExpr); }
+ public String getScopeExpr() {
+ return (scopeExpr);
+ }
+
/**
- * Getter method for "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "user" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getUserExpr() { return (userExpr); }
+ public String getUserExpr() {
+ return (userExpr);
+ }
/**
- * Setter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setCookieExpr(String cookieExpr) { this.cookieExpr = cookieExpr; }
+ public void setCookieExpr(String cookieExpr) {
+ this.cookieExpr = cookieExpr;
+ }
+
/**
- * Setter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setHeaderExpr(String headerExpr) { this.headerExpr = headerExpr; }
+ public void setHeaderExpr(String headerExpr) {
+ this.headerExpr = headerExpr;
+ }
+
/**
- * Setter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; }
+ public void setNameExpr(String nameExpr) {
+ this.nameExpr = nameExpr;
+ }
+
/**
- * Setter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setParameterExpr(String parameterExpr) { this.parameterExpr = parameterExpr; }
+ public void setParameterExpr(String parameterExpr) {
+ this.parameterExpr = parameterExpr;
+ }
+
/**
- * Setter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; }
+ public void setPropertyExpr(String propertyExpr) {
+ this.propertyExpr = propertyExpr;
+ }
+
/**
- * Setter method for "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "role" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; }
+ public void setRoleExpr(String roleExpr) {
+ this.roleExpr = roleExpr;
+ }
+
/**
- * Setter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; }
+ public void setScopeExpr(String scopeExpr) {
+ this.scopeExpr = scopeExpr;
+ }
+
/**
- * Setter method for "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "user" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setUserExpr(String userExpr) { this.userExpr = userExpr; }
+ public void setUserExpr(String userExpr) {
+ this.userExpr = userExpr;
+ }
/**
* Resets attribute values for tag reuse.
*/
- public void release()
- {
+ public void release() {
super.release();
setCookieExpr(null);
setHeaderExpr(null);
@@ -174,14 +223,15 @@
setScopeExpr(null);
setUserExpr(null);
}
-
+
/**
* Process the start tag.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
evaluateExpressions();
+
return (super.doStartTag());
}
@@ -189,41 +239,54 @@
* Processes all attribute values which use the JSTL expression evaluation
* engine to determine their values.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- private void evaluateExpressions() throws JspException {
- String string = null;
-
- if ((string = EvalHelper.evalString("cookie", getCookieExpr(),
- this, pageContext)) != null)
+ private void evaluateExpressions()
+ throws JspException {
+ String string = null;
+
+ if ((string =
+ EvalHelper.evalString("cookie", getCookieExpr(), this,
+ pageContext)) != null) {
setCookie(string);
+ }
- if ((string = EvalHelper.evalString("header", getHeaderExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("header", getHeaderExpr(), this,
+ pageContext)) != null) {
setHeader(string);
+ }
- if ((string = EvalHelper.evalString("name", getNameExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
setName(string);
+ }
- if ((string = EvalHelper.evalString("parameter", getParameterExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("parameter", getParameterExpr(), this,
+ pageContext)) != null) {
setParameter(string);
+ }
- if ((string = EvalHelper.evalString("property", getPropertyExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("property", getPropertyExpr(), this,
+ pageContext)) != null) {
setProperty(string);
+ }
- if ((string = EvalHelper.evalString("role", getRoleExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("role", getRoleExpr(), this, pageContext)) != null) {
setRole(string);
+ }
- if ((string = EvalHelper.evalString("scope", getScopeExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("scope", getScopeExpr(), this, pageContext)) != null) {
setScope(string);
+ }
- if ((string = EvalHelper.evalString("user", getUserExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("user", getUserExpr(), this, pageContext)) != null) {
setUser(string);
+ }
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTagBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTagBeanInfo.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTagBeanInfo.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELNotPresentTagBeanInfo.java Fri Feb 10 10:09:22 2006
@@ -1,82 +1,93 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
+
import java.util.ArrayList;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.logic.ELNotPresentTag</code> class. It is
* needed to override the default mapping of custom tag attribute names to
- * class attribute names.
- *<p>
- * This is because the value of the unevaluated EL expression has to be kept
- * separately from the evaluated value, which is stored in the base class. This
- * is related to the fact that the JSP compiler can choose to reuse different
- * tag instances if they received the same original attribute values, and the
- * JSP compiler can choose to not re-call the setter methods, because it can
- * assume the same values are already set.
+ * class attribute names. <p> This is because the value of the unevaluated EL
+ * expression has to be kept separately from the evaluated value, which is
+ * stored in the base class. This is related to the fact that the JSP compiler
+ * can choose to reuse different tag instances if they received the same
+ * original attribute values, and the JSP compiler can choose to not re-call
+ * the setter methods, because it can assume the same values are already set.
*/
-public class ELNotPresentTagBeanInfo extends SimpleBeanInfo
-{
- public PropertyDescriptor[] getPropertyDescriptors()
- {
+public class ELNotPresentTagBeanInfo extends SimpleBeanInfo {
+ public PropertyDescriptor[] getPropertyDescriptors() {
ArrayList proplist = new ArrayList();
try {
- proplist.add(new PropertyDescriptor("cookie", ELNotPresentTag.class,
- null, "setCookieExpr"));
- } catch (IntrospectionException ex) {}
- try {
- proplist.add(new PropertyDescriptor("header", ELNotPresentTag.class,
- null, "setHeaderExpr"));
- } catch (IntrospectionException ex) {}
+ proplist.add(new PropertyDescriptor("cookie",
+ ELNotPresentTag.class, null, "setCookieExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ try {
+ proplist.add(new PropertyDescriptor("header",
+ ELNotPresentTag.class, null, "setHeaderExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("name", ELNotPresentTag.class,
- null, "setNameExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setNameExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ try {
+ proplist.add(new PropertyDescriptor("parameter",
+ ELNotPresentTag.class, null, "setParameterExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
- proplist.add(new PropertyDescriptor("parameter", ELNotPresentTag.class,
- null, "setParameterExpr"));
- } catch (IntrospectionException ex) {}
- try {
- proplist.add(new PropertyDescriptor("property", ELNotPresentTag.class,
- null, "setPropertyExpr"));
- } catch (IntrospectionException ex) {}
+ proplist.add(new PropertyDescriptor("property",
+ ELNotPresentTag.class, null, "setPropertyExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("role", ELNotPresentTag.class,
- null, "setRoleExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setRoleExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("scope", ELNotPresentTag.class,
- null, "setScopeExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setScopeExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("user", ELNotPresentTag.class,
- null, "setUserExpr"));
- } catch (IntrospectionException ex) {}
-
- PropertyDescriptor[] result =
- new PropertyDescriptor[proplist.size()];
+ null, "setUserExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
+
return ((PropertyDescriptor[]) proplist.toArray(result));
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTag.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTag.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTag.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTag.java Fri Feb 10 10:09:22 2006
@@ -1,169 +1,218 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import org.apache.struts.taglib.logic.PresentTag;
-import javax.servlet.jsp.JspException;
import org.apache.strutsel.taglib.utils.EvalHelper;
+import javax.servlet.jsp.JspException;
+
/**
* Evaluates the nested body content of this tag if the specified value is
- * present for this request.
- *<p>
- * This class is a subclass of the class
- * <code>org.apache.struts.taglib.logic.PresentTag</code> which
- * provides most of the described functionality. This subclass allows all
- * attribute values to be specified as expressions utilizing the JavaServer
- * Pages Standard Library expression language.
+ * present for this request. <p> This class is a subclass of the class
+ * <code>org.apache.struts.taglib.logic.PresentTag</code> which provides most
+ * of the described functionality. This subclass allows all attribute values
+ * to be specified as expressions utilizing the JavaServer Pages Standard
+ * Library expression language.
*
* @version $Rev$
*/
public class ELPresentTag extends PresentTag {
-
/**
- * Instance variable mapped to "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "cookie" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String cookieExpr;
+
/**
- * Instance variable mapped to "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "header" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String headerExpr;
+
/**
- * Instance variable mapped to "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "name" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String nameExpr;
+
/**
- * Instance variable mapped to "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "parameter" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String parameterExpr;
+
/**
- * Instance variable mapped to "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "property" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String propertyExpr;
+
/**
- * Instance variable mapped to "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "role" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String roleExpr;
+
/**
- * Instance variable mapped to "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "scope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String scopeExpr;
+
/**
- * Instance variable mapped to "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "user" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String userExpr;
/**
- * Getter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getCookieExpr() { return (cookieExpr); }
+ public String getCookieExpr() {
+ return (cookieExpr);
+ }
+
/**
- * Getter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getHeaderExpr() { return (headerExpr); }
+ public String getHeaderExpr() {
+ return (headerExpr);
+ }
+
/**
- * Getter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getNameExpr() { return (nameExpr); }
+ public String getNameExpr() {
+ return (nameExpr);
+ }
+
/**
- * Getter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getParameterExpr() { return (parameterExpr); }
+ public String getParameterExpr() {
+ return (parameterExpr);
+ }
+
/**
- * Getter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getPropertyExpr() { return (propertyExpr); }
+ public String getPropertyExpr() {
+ return (propertyExpr);
+ }
+
/**
- * Getter method for "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "role" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getRoleExpr() { return (roleExpr); }
+ public String getRoleExpr() {
+ return (roleExpr);
+ }
+
/**
- * Getter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getScopeExpr() { return (scopeExpr); }
+ public String getScopeExpr() {
+ return (scopeExpr);
+ }
+
/**
- * Getter method for "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "user" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getUserExpr() { return (userExpr); }
+ public String getUserExpr() {
+ return (userExpr);
+ }
/**
- * Setter method for "cookie" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "cookie" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setCookieExpr(String cookieExpr) { this.cookieExpr = cookieExpr; }
+ public void setCookieExpr(String cookieExpr) {
+ this.cookieExpr = cookieExpr;
+ }
+
/**
- * Setter method for "header" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "header" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setHeaderExpr(String headerExpr) { this.headerExpr = headerExpr; }
+ public void setHeaderExpr(String headerExpr) {
+ this.headerExpr = headerExpr;
+ }
+
/**
- * Setter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; }
+ public void setNameExpr(String nameExpr) {
+ this.nameExpr = nameExpr;
+ }
+
/**
- * Setter method for "parameter" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "parameter" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setParameterExpr(String parameterExpr) { this.parameterExpr = parameterExpr; }
+ public void setParameterExpr(String parameterExpr) {
+ this.parameterExpr = parameterExpr;
+ }
+
/**
- * Setter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; }
+ public void setPropertyExpr(String propertyExpr) {
+ this.propertyExpr = propertyExpr;
+ }
+
/**
- * Setter method for "role" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "role" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setRoleExpr(String roleExpr) { this.roleExpr = roleExpr; }
+ public void setRoleExpr(String roleExpr) {
+ this.roleExpr = roleExpr;
+ }
+
/**
- * Setter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; }
+ public void setScopeExpr(String scopeExpr) {
+ this.scopeExpr = scopeExpr;
+ }
+
/**
- * Setter method for "user" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "user" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setUserExpr(String userExpr) { this.userExpr = userExpr; }
+ public void setUserExpr(String userExpr) {
+ this.userExpr = userExpr;
+ }
/**
* Resets attribute values for tag reuse.
*/
- public void release()
- {
+ public void release() {
super.release();
setCookieExpr(null);
setHeaderExpr(null);
@@ -174,14 +223,15 @@
setScopeExpr(null);
setUserExpr(null);
}
-
+
/**
* Process the start tag.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
evaluateExpressions();
+
return (super.doStartTag());
}
@@ -189,41 +239,54 @@
* Processes all attribute values which use the JSTL expression evaluation
* engine to determine their values.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- private void evaluateExpressions() throws JspException {
- String string = null;
-
- if ((string = EvalHelper.evalString("cookie", getCookieExpr(),
- this, pageContext)) != null)
+ private void evaluateExpressions()
+ throws JspException {
+ String string = null;
+
+ if ((string =
+ EvalHelper.evalString("cookie", getCookieExpr(), this,
+ pageContext)) != null) {
setCookie(string);
+ }
- if ((string = EvalHelper.evalString("header", getHeaderExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("header", getHeaderExpr(), this,
+ pageContext)) != null) {
setHeader(string);
+ }
- if ((string = EvalHelper.evalString("name", getNameExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
setName(string);
+ }
- if ((string = EvalHelper.evalString("parameter", getParameterExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("parameter", getParameterExpr(), this,
+ pageContext)) != null) {
setParameter(string);
+ }
- if ((string = EvalHelper.evalString("property", getPropertyExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("property", getPropertyExpr(), this,
+ pageContext)) != null) {
setProperty(string);
+ }
- if ((string = EvalHelper.evalString("role", getRoleExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("role", getRoleExpr(), this, pageContext)) != null) {
setRole(string);
+ }
- if ((string = EvalHelper.evalString("scope", getScopeExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("scope", getScopeExpr(), this, pageContext)) != null) {
setScope(string);
+ }
- if ((string = EvalHelper.evalString("user", getUserExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("user", getUserExpr(), this, pageContext)) != null) {
setUser(string);
+ }
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTagBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTagBeanInfo.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTagBeanInfo.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELPresentTagBeanInfo.java Fri Feb 10 10:09:22 2006
@@ -1,82 +1,93 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.beans.SimpleBeanInfo;
+
import java.util.ArrayList;
/**
* This is the <code>BeanInfo</code> descriptor for the
* <code>org.apache.strutsel.taglib.logic.ELPresentTag</code> class. It is
* needed to override the default mapping of custom tag attribute names to
- * class attribute names.
- *<p>
- * This is because the value of the unevaluated EL expression has to be kept
- * separately from the evaluated value, which is stored in the base class. This
- * is related to the fact that the JSP compiler can choose to reuse different
- * tag instances if they received the same original attribute values, and the
- * JSP compiler can choose to not re-call the setter methods, because it can
- * assume the same values are already set.
+ * class attribute names. <p> This is because the value of the unevaluated EL
+ * expression has to be kept separately from the evaluated value, which is
+ * stored in the base class. This is related to the fact that the JSP compiler
+ * can choose to reuse different tag instances if they received the same
+ * original attribute values, and the JSP compiler can choose to not re-call
+ * the setter methods, because it can assume the same values are already set.
*/
-public class ELPresentTagBeanInfo extends SimpleBeanInfo
-{
- public PropertyDescriptor[] getPropertyDescriptors()
- {
+public class ELPresentTagBeanInfo extends SimpleBeanInfo {
+ public PropertyDescriptor[] getPropertyDescriptors() {
ArrayList proplist = new ArrayList();
try {
proplist.add(new PropertyDescriptor("cookie", ELPresentTag.class,
- null, "setCookieExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setCookieExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("header", ELPresentTag.class,
- null, "setHeaderExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setHeaderExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("name", ELPresentTag.class,
- null, "setNameExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setNameExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
- proplist.add(new PropertyDescriptor("parameter", ELPresentTag.class,
- null, "setParameterExpr"));
- } catch (IntrospectionException ex) {}
+ proplist.add(new PropertyDescriptor("parameter",
+ ELPresentTag.class, null, "setParameterExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("property", ELPresentTag.class,
- null, "setPropertyExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setPropertyExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("role", ELPresentTag.class,
- null, "setRoleExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setRoleExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("scope", ELPresentTag.class,
- null, "setScopeExpr"));
- } catch (IntrospectionException ex) {}
+ null, "setScopeExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
try {
proplist.add(new PropertyDescriptor("user", ELPresentTag.class,
- null, "setUserExpr"));
- } catch (IntrospectionException ex) {}
-
- PropertyDescriptor[] result =
- new PropertyDescriptor[proplist.size()];
+ null, "setUserExpr"));
+ } catch (IntrospectionException ex) {
+ }
+
+ PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
+
return ((PropertyDescriptor[]) proplist.toArray(result));
}
}
Modified: struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELRedirectTag.java
URL: http://svn.apache.org/viewcvs/struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELRedirectTag.java?rev=376780&r1=376779&r2=376780&view=diff
==============================================================================
--- struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELRedirectTag.java (original)
+++ struts/el/trunk/src/java/org/apache/strutsel/taglib/logic/ELRedirectTag.java Fri Feb 10 10:09:22 2006
@@ -1,258 +1,349 @@
/*
- * $Id$
+ * $Id$
*
* Copyright 1999-2004 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.strutsel.taglib.logic;
import org.apache.struts.taglib.logic.RedirectTag;
-import javax.servlet.jsp.JspException;
import org.apache.strutsel.taglib.utils.EvalHelper;
+import javax.servlet.jsp.JspException;
+
/**
- * Generate a URL-encoded redirect to the specified URI.
- *<p>
- * This class is a subclass of the class
- * <code>org.apache.struts.taglib.logic.RedirectTag</code> which
- * provides most of the described functionality. This subclass allows all
- * attribute values to be specified as expressions utilizing the JavaServer
- * Pages Standard Library expression language.
+ * Generate a URL-encoded redirect to the specified URI. <p> This class is a
+ * subclass of the class <code>org.apache.struts.taglib.logic.RedirectTag</code>
+ * which provides most of the described functionality. This subclass allows
+ * all attribute values to be specified as expressions utilizing the
+ * JavaServer Pages Standard Library expression language.
*
* @version $Rev$
*/
public class ELRedirectTag extends RedirectTag {
-
/**
- * Instance variable mapped to "action" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "action" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String actionExpr;
+
/**
- * Instance variable mapped to "anchor" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "anchor" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String anchorExpr;
+
/**
- * Instance variable mapped to "forward" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "forward" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String forwardExpr;
+
/**
- * Instance variable mapped to "href" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "href" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String hrefExpr;
+
/**
- * Instance variable mapped to "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "name" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String nameExpr;
+
/**
- * Instance variable mapped to "page" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "page" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String pageExpr;
+
/**
- * Instance variable mapped to "paramId" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "paramId" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String paramIdExpr;
+
/**
- * Instance variable mapped to "paramName" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "paramName" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String paramNameExpr;
+
/**
- * Instance variable mapped to "paramProperty" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "paramProperty" tag attribute. (Mapping set
+ * in associated BeanInfo class.)
*/
private String paramPropertyExpr;
+
/**
- * Instance variable mapped to "paramScope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "paramScope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String paramScopeExpr;
+
/**
- * Instance variable mapped to "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "property" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String propertyExpr;
+
/**
- * Instance variable mapped to "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "scope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
private String scopeExpr;
+
/**
- * Instance variable mapped to "transaction" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "transaction" tag attribute. (Mapping set
+ * in associated BeanInfo class.)
*/
private String transactionExpr;
+
/**
- * Instance variable mapped to "useLocalEncoding" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Instance variable mapped to "useLocalEncoding" tag attribute. (Mapping
+ * set in associated BeanInfo class.)
*/
private String useLocalEncodingExpr;
/**
- * Getter method for "action" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "action" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getActionExpr() { return (actionExpr); }
+ public String getActionExpr() {
+ return (actionExpr);
+ }
+
/**
- * Getter method for "anchor" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "anchor" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getAnchorExpr() { return (anchorExpr); }
+ public String getAnchorExpr() {
+ return (anchorExpr);
+ }
+
/**
- * Getter method for "forward" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "forward" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getForwardExpr() { return (forwardExpr); }
+ public String getForwardExpr() {
+ return (forwardExpr);
+ }
+
/**
- * Getter method for "href" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "href" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getHrefExpr() { return (hrefExpr); }
+ public String getHrefExpr() {
+ return (hrefExpr);
+ }
+
/**
- * Getter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getNameExpr() { return (nameExpr); }
+ public String getNameExpr() {
+ return (nameExpr);
+ }
+
/**
- * Getter method for "page" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "page" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getPageExpr() { return (pageExpr); }
+ public String getPageExpr() {
+ return (pageExpr);
+ }
+
/**
- * Getter method for "paramId" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "paramId" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getParamIdExpr() { return (paramIdExpr); }
+ public String getParamIdExpr() {
+ return (paramIdExpr);
+ }
+
/**
- * Getter method for "paramName" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "paramName" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getParamNameExpr() { return (paramNameExpr); }
+ public String getParamNameExpr() {
+ return (paramNameExpr);
+ }
+
/**
- * Getter method for "paramProperty" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "paramProperty" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public String getParamPropertyExpr() { return (paramPropertyExpr); }
+ public String getParamPropertyExpr() {
+ return (paramPropertyExpr);
+ }
+
/**
- * Getter method for "paramScope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "paramScope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public String getParamScopeExpr() { return (paramScopeExpr); }
+ public String getParamScopeExpr() {
+ return (paramScopeExpr);
+ }
+
/**
- * Getter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getPropertyExpr() { return (propertyExpr); }
+ public String getPropertyExpr() {
+ return (propertyExpr);
+ }
+
/**
- * Getter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public String getScopeExpr() { return (scopeExpr); }
+ public String getScopeExpr() {
+ return (scopeExpr);
+ }
+
/**
- * Getter method for "transaction" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "transaction" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public String getTransactionExpr() { return (transactionExpr); }
+ public String getTransactionExpr() {
+ return (transactionExpr);
+ }
+
/**
- * Getter method for "useLocalEncoding" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Getter method for "useLocalEncoding" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public String getUseLocalEncodingExpr() { return (useLocalEncodingExpr); }
+ public String getUseLocalEncodingExpr() {
+ return (useLocalEncodingExpr);
+ }
/**
- * Setter method for "action" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "action" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setActionExpr(String actionExpr) { this.actionExpr = actionExpr; }
+ public void setActionExpr(String actionExpr) {
+ this.actionExpr = actionExpr;
+ }
+
/**
- * Setter method for "anchor" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "anchor" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setAnchorExpr(String anchorExpr) { this.anchorExpr = anchorExpr; }
+ public void setAnchorExpr(String anchorExpr) {
+ this.anchorExpr = anchorExpr;
+ }
+
/**
- * Setter method for "forward" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "forward" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setForwardExpr(String forwardExpr) { this.forwardExpr = forwardExpr; }
+ public void setForwardExpr(String forwardExpr) {
+ this.forwardExpr = forwardExpr;
+ }
+
/**
- * Setter method for "href" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "href" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setHrefExpr(String hrefExpr) { this.hrefExpr = hrefExpr; }
+ public void setHrefExpr(String hrefExpr) {
+ this.hrefExpr = hrefExpr;
+ }
+
/**
- * Setter method for "name" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "name" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; }
+ public void setNameExpr(String nameExpr) {
+ this.nameExpr = nameExpr;
+ }
+
/**
- * Setter method for "page" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "page" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setPageExpr(String pageExpr) { this.pageExpr = pageExpr; }
+ public void setPageExpr(String pageExpr) {
+ this.pageExpr = pageExpr;
+ }
+
/**
- * Setter method for "paramId" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "paramId" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setParamIdExpr(String paramIdExpr) { this.paramIdExpr = paramIdExpr; }
+ public void setParamIdExpr(String paramIdExpr) {
+ this.paramIdExpr = paramIdExpr;
+ }
+
/**
- * Setter method for "paramName" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "paramName" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setParamNameExpr(String paramNameExpr) { this.paramNameExpr = paramNameExpr; }
+ public void setParamNameExpr(String paramNameExpr) {
+ this.paramNameExpr = paramNameExpr;
+ }
+
/**
- * Setter method for "paramProperty" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "paramProperty" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public void setParamPropertyExpr(String paramPropertyExpr) { this.paramPropertyExpr = paramPropertyExpr; }
+ public void setParamPropertyExpr(String paramPropertyExpr) {
+ this.paramPropertyExpr = paramPropertyExpr;
+ }
+
/**
- * Setter method for "paramScope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "paramScope" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public void setParamScopeExpr(String paramScopeExpr) { this.paramScopeExpr = paramScopeExpr; }
+ public void setParamScopeExpr(String paramScopeExpr) {
+ this.paramScopeExpr = paramScopeExpr;
+ }
+
/**
- * Setter method for "property" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "property" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; }
+ public void setPropertyExpr(String propertyExpr) {
+ this.propertyExpr = propertyExpr;
+ }
+
/**
- * Setter method for "scope" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "scope" tag attribute. (Mapping set in associated
+ * BeanInfo class.)
*/
- public void setScopeExpr(String scopeExpr) { this.scopeExpr = scopeExpr; }
+ public void setScopeExpr(String scopeExpr) {
+ this.scopeExpr = scopeExpr;
+ }
+
/**
- * Setter method for "transaction" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "transaction" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public void setTransactionExpr(String transactionExpr) { this.transactionExpr = transactionExpr; }
+ public void setTransactionExpr(String transactionExpr) {
+ this.transactionExpr = transactionExpr;
+ }
+
/**
- * Setter method for "useLocalEncoding" tag attribute.
- * (Mapping set in associated BeanInfo class.)
+ * Setter method for "useLocalEncoding" tag attribute. (Mapping set in
+ * associated BeanInfo class.)
*/
- public void setUseLocalEncodingExpr(String useLocalEncodingExpr) { this.useLocalEncodingExpr = useLocalEncodingExpr; }
+ public void setUseLocalEncodingExpr(String useLocalEncodingExpr) {
+ this.useLocalEncodingExpr = useLocalEncodingExpr;
+ }
/**
* Resets attribute values for tag reuse.
*/
- public void release()
- {
+ public void release() {
super.release();
setActionExpr(null);
setAnchorExpr(null);
@@ -273,10 +364,11 @@
/**
* Process the start tag.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
evaluateExpressions();
+
return (super.doStartTag());
}
@@ -284,66 +376,91 @@
* Processes all attribute values which use the JSTL expression evaluation
* engine to determine their values.
*
- * @exception JspException if a JSP exception has occurred
+ * @throws JspException if a JSP exception has occurred
*/
- private void evaluateExpressions() throws JspException {
- String string = null;
- Boolean bool = null;
-
- if ((string = EvalHelper.evalString("action", getActionExpr(),
- this, pageContext)) != null)
+ private void evaluateExpressions()
+ throws JspException {
+ String string = null;
+ Boolean bool = null;
+
+ if ((string =
+ EvalHelper.evalString("action", getActionExpr(), this,
+ pageContext)) != null) {
setAction(string);
+ }
- if ((string = EvalHelper.evalString("anchor", getAnchorExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("anchor", getAnchorExpr(), this,
+ pageContext)) != null) {
setAnchor(string);
+ }
- if ((string = EvalHelper.evalString("forward", getForwardExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("forward", getForwardExpr(), this,
+ pageContext)) != null) {
setForward(string);
+ }
- if ((string = EvalHelper.evalString("href", getHrefExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("href", getHrefExpr(), this, pageContext)) != null) {
setHref(string);
+ }
- if ((string = EvalHelper.evalString("name", getNameExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("name", getNameExpr(), this, pageContext)) != null) {
setName(string);
+ }
- if ((string = EvalHelper.evalString("page", getPageExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("page", getPageExpr(), this, pageContext)) != null) {
setPage(string);
+ }
- if ((string = EvalHelper.evalString("paramId", getParamIdExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("paramId", getParamIdExpr(), this,
+ pageContext)) != null) {
setParamId(string);
+ }
- if ((string = EvalHelper.evalString("paramName", getParamNameExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("paramName", getParamNameExpr(), this,
+ pageContext)) != null) {
setParamName(string);
+ }
- if ((string = EvalHelper.evalString("paramProperty", getParamPropertyExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("paramProperty", getParamPropertyExpr(),
+ this, pageContext)) != null) {
setParamProperty(string);
+ }
- if ((string = EvalHelper.evalString("paramScope", getParamScopeExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("paramScope", getParamScopeExpr(), this,
+ pageContext)) != null) {
setParamScope(string);
+ }
- if ((string = EvalHelper.evalString("property", getPropertyExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("property", getPropertyExpr(), this,
+ pageContext)) != null) {
setProperty(string);
+ }
- if ((string = EvalHelper.evalString("scope", getScopeExpr(),
- this, pageContext)) != null)
+ if ((string =
+ EvalHelper.evalString("scope", getScopeExpr(), this, pageContext)) != null) {
setScope(string);
+ }
- if ((bool = EvalHelper.evalBoolean("transaction", getTransactionExpr(),
- this, pageContext)) != null)
+ if ((bool =
+ EvalHelper.evalBoolean("transaction", getTransactionExpr(),
+ this, pageContext)) != null) {
setTransaction(bool.booleanValue());
+ }
- if ((bool = EvalHelper.evalBoolean("useLocalEncoding", getUseLocalEncodingExpr(),
- this, pageContext)) != null)
+ if ((bool =
+ EvalHelper.evalBoolean("useLocalEncoding",
+ getUseLocalEncodingExpr(), this, pageContext)) != null) {
setUseLocalEncoding(bool.booleanValue());
+ }
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org