You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jb...@apache.org on 2010/11/14 19:32:54 UTC

svn commit: r1035039 - in /tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core: ParamTag.java RedirectTag.java SetTag.java UrlTag.java WhenTag.java

Author: jboynes
Date: Sun Nov 14 18:32:53 2010
New Revision: 1035039

URL: http://svn.apache.org/viewvc?rev=1035039&view=rev
Log:
add remaining core tags for compat module

Added:
    tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java   (with props)
    tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java   (with props)
    tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java   (with props)
    tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java   (with props)
    tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java   (with props)

Added: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java?rev=1035039&view=auto
==============================================================================
--- tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java (added)
+++ tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java Sun Nov 14 18:32:53 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.taglibs.standard.tag.compat.core;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspException;
+
+import org.apache.taglibs.standard.tag.common.core.ParamSupport;
+import org.apache.taglibs.standard.util.ExpressionUtil;
+
+/**
+ */
+public class ParamTag extends ParamSupport {
+
+    private ValueExpression nameExpression;
+    private ValueExpression valueExpression;
+
+    public ParamTag() {
+    }
+
+    @Override
+    public int doStartTag() throws JspException {
+        name = (String) nameExpression.getValue(pageContext.getELContext());
+        value = (String) valueExpression.getValue(pageContext.getELContext());
+        return super.doStartTag();
+    }
+
+    @Override
+    public void release() {
+        nameExpression = null;
+        valueExpression = null;
+        super.release();
+    }
+
+    public void setName(String name) {
+        nameExpression = ExpressionUtil.createValueExpression(pageContext, name, String.class);
+    }
+
+    public void setValue(String value) {
+        valueExpression = ExpressionUtil.createValueExpression(pageContext, value, String.class);
+    }
+}

Propchange: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/ParamTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java?rev=1035039&view=auto
==============================================================================
--- tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java (added)
+++ tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java Sun Nov 14 18:32:53 2010
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.taglibs.standard.tag.compat.core;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspException;
+
+import org.apache.taglibs.standard.tag.common.core.RedirectSupport;
+import org.apache.taglibs.standard.util.ExpressionUtil;
+
+/**
+ */
+public class RedirectTag extends RedirectSupport {
+
+    private ValueExpression urlExpression;
+    private ValueExpression contextExpression;
+
+    public RedirectTag() {
+    }
+
+    @Override
+    public void release() {
+        urlExpression = null;
+        contextExpression = null;
+        super.release();
+    }
+
+    @Override
+    public int doStartTag() throws JspException {
+        url = (String) urlExpression.getValue(pageContext.getELContext());
+        if (contextExpression != null) {
+            context = (String) contextExpression.getValue(pageContext.getELContext());
+        }
+        return super.doStartTag();
+    }
+
+    public void setUrl(String url) {
+        urlExpression = ExpressionUtil.createValueExpression(pageContext, url, String.class);
+    }
+
+    public void setContextExpression(String context) {
+        contextExpression = ExpressionUtil.createValueExpression(pageContext, context, String.class);
+    }
+}

Propchange: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/RedirectTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java?rev=1035039&view=auto
==============================================================================
--- tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java (added)
+++ tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java Sun Nov 14 18:32:53 2010
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.taglibs.standard.tag.compat.core;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspException;
+
+import org.apache.taglibs.standard.tag.common.core.SetSupport;
+import org.apache.taglibs.standard.util.ExpressionUtil;
+
+/**
+ */
+public class SetTag extends SetSupport {
+
+    private ValueExpression valueExpression;
+    private ValueExpression targetExpression;
+    private ValueExpression propertyExpression;
+
+    public SetTag() {
+    }
+
+    public void setValue(String value) {
+        valueExpression = ExpressionUtil.createValueExpression(pageContext, value, Object.class);
+    }
+
+    public void setTarget(String target) {
+        targetExpression = ExpressionUtil.createValueExpression(pageContext, target, Object.class);
+    }
+
+    public void setProperty(String property) {
+        propertyExpression = ExpressionUtil.createValueExpression(pageContext, property, String.class);
+    }
+
+    @Override
+    public void release() {
+        valueExpression = null;
+        targetExpression = null;
+        propertyExpression = null;
+        super.release();
+    }
+
+    @Override
+    protected boolean isValueSpecified() {
+        return valueExpression != null;
+    }
+
+    @Override
+    protected Object evalValue() throws JspException {
+        return valueExpression.getValue(pageContext.getELContext());
+    }
+
+    @Override
+    protected Object evalTarget() throws JspException {
+        return targetExpression.getValue(pageContext.getELContext());
+    }
+
+    @Override
+    protected String evalProperty() throws JspException {
+        return (String) propertyExpression.getValue(pageContext.getELContext());
+    }
+}

Propchange: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/SetTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java?rev=1035039&view=auto
==============================================================================
--- tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java (added)
+++ tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java Sun Nov 14 18:32:53 2010
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.taglibs.standard.tag.compat.core;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspException;
+
+import org.apache.taglibs.standard.tag.common.core.UrlSupport;
+import org.apache.taglibs.standard.util.ExpressionUtil;
+
+/**
+ */
+public class UrlTag extends UrlSupport {
+
+    private ValueExpression valueExpression;
+    private ValueExpression contextExpression;
+
+    public UrlTag() {
+    }
+
+    @Override
+    public int doStartTag() throws JspException {
+        value = (String) valueExpression.getValue(pageContext.getELContext());
+        if (contextExpression != null) {
+            context = (String) contextExpression.getValue(pageContext.getELContext());
+        }
+        return super.doStartTag();
+    }
+
+    @Override
+    public void release() {
+        valueExpression = null;
+        contextExpression = null;
+        super.release();
+    }
+
+    public void setValue(String value) {
+        valueExpression = ExpressionUtil.createValueExpression(pageContext, value, String.class);
+    }
+
+    public void setContext(String context) {
+        contextExpression = ExpressionUtil.createValueExpression(pageContext, context, String.class);
+    }
+}

Propchange: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/UrlTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java?rev=1035039&view=auto
==============================================================================
--- tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java (added)
+++ tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java Sun Nov 14 18:32:53 2010
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.taglibs.standard.tag.compat.core;
+
+import javax.el.ValueExpression;
+import javax.servlet.jsp.JspTagException;
+
+import org.apache.taglibs.standard.tag.common.core.WhenTagSupport;
+import org.apache.taglibs.standard.util.ExpressionUtil;
+
+/**
+ */
+public class WhenTag extends WhenTagSupport {
+
+    private ValueExpression testExpression;
+
+    public WhenTag() {
+    }
+
+    @Override
+    public void release() {
+        testExpression = null;
+        super.release();
+    }
+
+    @Override
+    protected boolean condition() throws JspTagException {
+        return (Boolean) testExpression.getValue(pageContext.getELContext());
+    }
+
+    public void setTest(String test) {
+        testExpression = ExpressionUtil.createValueExpression(pageContext, test, Boolean.class);
+    }
+}

Propchange: tomcat/taglibs/standard/trunk/compat/src/main/java/org/apache/taglibs/standard/tag/compat/core/WhenTag.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org