geirm 01/03/12 19:52:06
Modified: src/java/org/apache/velocity/servlet VelocityServlet.java
Log:
Promoted DEFAULT_CONTENT_TYPE to be a constant in VelocityServlet, not in Runtime, as
we are removing default.contentType as a property - it doesn't make sense as a
velocity
property as it's something that servlet specific.
With the setContentType() overridable method, as well as the ease in which props can
be
overridden an controlled in this class, this seems to be ok.
If this is incorrect, howl now...
Revision Changes Path
1.25 +7 -3
jakarta-velocity/src/java/org/apache/velocity/servlet/VelocityServlet.java
Index: VelocityServlet.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/servlet/VelocityServlet.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- VelocityServlet.java 2001/03/12 04:03:59 1.24
+++ VelocityServlet.java 2001/03/13 03:52:06 1.25
@@ -122,7 +122,7 @@
* @author Dave Bryson
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
- * $Id: VelocityServlet.java,v 1.24 2001/03/12 04:03:59 geirm Exp $
+ * $Id: VelocityServlet.java,v 1.25 2001/03/13 03:52:06 geirm Exp $
*/
public abstract class VelocityServlet extends HttpServlet
{
@@ -140,6 +140,11 @@
* The HTTP content type context key.
*/
public static final String CONTENT_TYPE = "contentType";
+
+ /**
+ * The default content type for the response
+ */
+ public static final String DEFAULT_CONTENT_TYPE = "text/html";
/**
* The encoding to use when generating outputing.
@@ -188,8 +193,7 @@
Runtime.init( props );
- defaultContentType =
- Runtime.getString(Runtime.DEFAULT_CONTENT_TYPE, "text/html");
+ defaultContentType = DEFAULT_CONTENT_TYPE;
encoding = Runtime.getString(Runtime.TEMPLATE_ENCODING, "8859_1");
}