Author: apetrelli
Date: Fri Dec 19 04:51:00 2008
New Revision: 728014
URL: http://svn.apache.org/viewvc?rev=728014&view=rev
Log:
TILES-341
Re-added RenderTagSupport for binary compatibility.
Added @since tags.
Added:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
(with props)
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java?rev=728014&r1=728013&r2=728014&view=diff
==============================================================================
---
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
(original)
+++
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
Fri Dec 19 04:51:00 2008
@@ -22,7 +22,6 @@
import java.io.IOException;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;
import org.apache.commons.logging.Log;
@@ -47,7 +46,7 @@
* that all all included attributes in subsequent tiles are scoped properly and
* do not bleed outside their intended scope.
*
- * @since Tiles 2.0
+ * @since 2.1.1
* @version $Rev$ $Date$
*/
public abstract class RenderTag extends TilesBodyTag implements
@@ -61,32 +60,44 @@
/**
* The role to check. If the user is in the specified role, the tag is
taken
* into account; otherwise, the tag is ignored (skipped).
+ *
+ * @since 2.1.1
*/
protected String role;
/**
* The view preparer to use before the rendering.
+ *
+ * @since 2.1.1
*/
protected String preparer;
/**
* This flag, if <code>true</code>, flushes the content before rendering.
+ *
+ * @since 2.1.1
*/
protected boolean flush;
/**
* This flag, if <code>true</code>, ignores exception thrown by preparers
* and those caused by problems with definitions.
+ *
+ * @since 2.1.1
*/
protected boolean ignore;
/**
* The Tiles container that can be used inside the tag.
+ *
+ * @since 2.1.1
*/
protected TilesContainer container;
/**
* The attribute context to use to store and read attribute values.
+ *
+ * @since 2.1.1
*/
protected AttributeContext attributeContext;
@@ -95,6 +106,7 @@
* taken into account; otherwise, the tag is ignored (skipped).
*
* @return The role to check.
+ * @since 2.1.1
*/
public String getRole() {
return role;
@@ -105,6 +117,7 @@
* taken into account; otherwise, the tag is ignored (skipped).
*
* @param role The role to check.
+ * @since 2.1.1
*/
public void setRole(String role) {
this.role = role;
@@ -114,6 +127,7 @@
* Returns the preparer name.
*
* @return The preparer name.
+ * @since 2.1.1
*/
public String getPreparer() {
return preparer;
@@ -123,6 +137,7 @@
* Sets the preparer name.
*
* @param preparer The preparer name.
+ * @since 2.1.1
*/
public void setPreparer(String preparer) {
this.preparer = preparer;
@@ -133,6 +148,7 @@
* is flushed before insertion.
*
* @return The flush flag.
+ * @since 2.1.1
*/
public boolean isFlush() {
return flush;
@@ -143,6 +159,7 @@
* is flushed before insertion.
*
* @param flush The flush flag.
+ * @since 2.1.1
*/
public void setFlush(boolean flush) {
this.flush = flush;
@@ -155,6 +172,7 @@
* exception to be thrown.
*
* @return The ignore flag.
+ * @since 2.1.1
*/
public boolean isIgnore() {
return ignore;
@@ -167,6 +185,7 @@
* exception to be thrown.
*
* @param ignore The ignore flag.
+ * @since 2.1.1
*/
public void setIgnore(boolean ignore) {
this.ignore = ignore;
@@ -214,24 +233,6 @@
}
/**
- * Execute the tag by invoking the preparer, if defined, and then
- * rendering.
- *
- * @throws TilesJspException if a jsp exception occurs.
- * @throws IOException if an io exception occurs.
- * @deprecated Use {...@link #render()}.
- */
- protected void execute() throws TilesJspException, IOException {
- if (preparer != null) {
- container.prepare(preparer, pageContext);
- }
- render();
- if (flush) {
- pageContext.getOut().flush();
- }
- }
-
- /**
* Render the specified content.
*
* @throws TilesJspException if a jsp exception occurs.
@@ -292,16 +293,4 @@
attributeContext.putAttribute(nestedTag.getName(), attribute, nestedTag
.isCascade());
}
-
- /**
- * Checks if the user is inside the specified role.
- *
- * @return <code>true</code> if the user is allowed to have the tag
- * rendered.
- * @deprecated Implement access allowance in your own tag.
- */
- protected boolean isAccessAllowed() {
- HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
- return (role == null || req.isUserInRole(role));
- }
}
Added:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java?rev=728014&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
(added)
+++
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
Fri Dec 19 04:51:00 2008
@@ -0,0 +1,75 @@
+/*
+ * $Id$
+ *
+ * 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.tiles.jsp.taglib;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * <p>
+ * Support for all tags which render (an attribute, a template, or definition).
+ * </p>
+ * <p>
+ * Properly invokes the defined preparer and invokes the abstract render method
+ * upon completion.
+ * </p>
+ * This tag takes special care to ensure that the attribute context is reset to
+ * it's original state after the execution of the tag is complete. This ensures
+ * that all all included attributes in subsequent tiles are scoped properly and
+ * do not bleed outside their intended scope.
+ *
+ * @version $Rev$ $Date$
+ * @deprecated Use {...@link RenderTag}.
+ */
+...@deprecated
+public abstract class RenderTagSupport extends RenderTag {
+
+ /**
+ * Execute the tag by invoking the preparer, if defined, and then
+ * rendering.
+ *
+ * @throws TilesJspException if a jsp exception occurs.
+ * @throws IOException if an io exception occurs.
+ * @deprecated Use {...@link #render()}.
+ */
+ protected void execute() throws TilesJspException, IOException {
+ if (preparer != null) {
+ container.prepare(preparer, pageContext);
+ }
+ render();
+ if (flush) {
+ pageContext.getOut().flush();
+ }
+ }
+
+ /**
+ * Checks if the user is inside the specified role.
+ *
+ * @return <code>true</code> if the user is allowed to have the tag
+ * rendered.
+ * @deprecated Implement access allowance in your own tag.
+ */
+ protected boolean isAccessAllowed() {
+ HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
+ return (role == null || req.isUserInRole(role));
+ }
+}
Propchange:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL