You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2003/02/28 17:05:46 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/util DynamicURI.java
henning 2003/02/28 08:05:46
Modified: src/java/org/apache/turbine TurbineConstants.java
src/java/org/apache/turbine/util DynamicURI.java
Log:
- Changed Constants for USE_SSL, added a default
- Remove TurbineResources from DynamicURL, use constants
from URIConstants and TurbineConstants
- sync local Constants to URIConstants and deprecated them.
Revision Changes Path
1.15 +6 -6 jakarta-turbine-2/src/java/org/apache/turbine/TurbineConstants.java
Index: TurbineConstants.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/TurbineConstants.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- TurbineConstants.java 28 Feb 2003 15:21:09 -0000 1.14
+++ TurbineConstants.java 28 Feb 2003 16:05:45 -0000 1.15
@@ -220,11 +220,11 @@
/** Session Timeout Default Value */
int SESSION_TIMEOUT_DEFAULT = -1;
- /**
- * Indicate whether this Turbine application is using SSL.
- * Used for creating dynamic URIs.
- */
- String USE_SSL = "use.ssl";
+ /** Indicate whether this Turbine application is using SSL. */
+ String USE_SSL_KEY = "use.ssl";
+
+ /** Default value for the SSL key */
+ boolean USE_SSL_DEFAULT = true;
/**
* Should the PP fold the case of everything. Possible values are
1.6 +20 -12 jakarta-turbine-2/src/java/org/apache/turbine/util/DynamicURI.java
Index: DynamicURI.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/DynamicURI.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DynamicURI.java 28 Feb 2003 12:39:48 -0000 1.5
+++ DynamicURI.java 28 Feb 2003 16:05:45 -0000 1.6
@@ -55,14 +55,20 @@
*/
import java.net.URLEncoder;
+
import java.util.Enumeration;
import java.util.Vector;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.ecs.html.A;
-import org.apache.turbine.services.resources.TurbineResources;
+
+import org.apache.turbine.Turbine;
+import org.apache.turbine.TurbineConstants;
+
import org.apache.turbine.util.parser.ParserUtils;
+import org.apache.turbine.util.uri.URIConstants;
/**
* This creates a Dynamic URI for use within the Turbine system
@@ -88,11 +94,11 @@
*/
public class DynamicURI
{
- /** HTTP protocol. */
- public static final String HTTP = "http";
+ /** @deprecated Use URIConstants.HTTP */
+ public static final String HTTP = URIConstants.HTTP;
- /** HTTPS protocol. */
- public static final String HTTPS = "https";
+ /** @deprecated Use URIConstants.HTTPS */
+ public static final String HTTPS = URIConstants.HTTPS;
/** The ServerData object. */
protected ServerData sd = null;
@@ -928,12 +934,14 @@
*/
public DynamicURI setSecure(int port)
{
- boolean isSSL = TurbineResources.getBoolean("use.ssl", true);
- if (isSSL)
- {
- setServerScheme(DynamicURI.HTTPS);
- setServerPort(port);
- }
+ boolean useSSL =
+ Turbine.getConfiguration()
+ .getBoolean(TurbineConstants.USE_SSL_KEY,
+ TurbineConstants.USE_SSL_DEFAULT);
+
+ setServerScheme(useSSL ? URIConstants.HTTPS : URIConstants.HTTP);
+ setServerPort(port);
+
return this;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org