You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by nb...@apache.org on 2003/07/31 00:02:30 UTC
cvs commit: jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/context ViewContext.java
nbubna 2003/07/30 15:02:30
Modified: src/java/org/apache/velocity/tools/view/context
ViewContext.java
Log:
move req/res/sess/app keys to ViewContext and add getAttribute method
Revision Changes Path
1.3 +22 -1 jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/context/ViewContext.java
Index: ViewContext.java
===================================================================
RCS file: /home/cvs/jakarta-velocity-tools/src/java/org/apache/velocity/tools/view/context/ViewContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ViewContext.java 28 May 2003 00:17:16 -0000 1.2
+++ ViewContext.java 30 Jul 2003 22:02:30 -0000 1.3
@@ -77,6 +77,19 @@
*/
public interface ViewContext
{
+ /** Key used for the HTTP request object. */
+ public static final String REQUEST = "request";
+
+ /** Key used for the HTTP response object. */
+ public static final String RESPONSE = "response";
+
+ /** Key used for the HTTP session object. */
+ public static final String SESSION = "session";
+
+ /** Key used for the servlet context object. */
+ public static final String APPLICATION = "application";
+
+
/**
* <p>Returns the instance of {@link HttpServletRequest} for this request.</p>
*/
@@ -93,6 +106,14 @@
* <p>Returns the instance of {@link ServletContext} for this request.</p>
*/
public ServletContext getServletContext();
+
+
+ /**
+ * <p>Searches for the named attribute in request, session (if valid),
+ * and application scope(s) in order and returns the value associated
+ * or null.</p>
+ */
+ public Object getAttribute(String key);
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org