I suggest you revert TemplateLink and use your own implementation that
overrides it. If this is in fact even necessary. I run my apps using
ssl and TemplateLink always provides me with ssl links. Without having
looked at the detail, I think there is a lot of cloning of ServerData
going on which is probably initialized from the first request -
configure mod_rewrite to force ssl for the first request and ssl will be
used for all subsequent links.
Scott
Juergen Hoffmann wrote:
Hi Scott,
then again, TemplateLink does not expose the setSecure Method from TemplateURI.
What is in your eyes the correct Behaviour?
I think that if I set the property "use.ssl" to true, I would like the
Application, to use it. Withou me having to edit each and every Link in my templates.
Plus I can use https on the production platform, and use http in my dev environment, just
by setting use.ssl to false.
Kind regards
Juergen
-----Ursprüngliche Nachricht-----
Von: Scott Eade [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 31. Mai 2007 13:52
An: Turbine Developers List
Betreff: Re: AW: svn commit: r543081 -
/jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/tur
bine/services/pull/tools/TemplateLink.java
Well I am no http expert, but it looks to me like the code below from
BaseURI is somewhat odd - in that if use.ssl is false setSecure() will
result in a link that is http on port 443.
I think there may be a few semantic issues here. According to the
comments in TurbineResources.properties use.ssl is used to signify
whether or not ssl is *able* to be used, not that it *should* be used.
So I would argue that:
1. TemplateLink was correct in the first place. use.ssl says that
the server is able to use ssl, but it is up top the user of
TemplateLink to determine if a specific url is to be ssl or not
and to set the link properties accordingly.
2. BaseURI.setSecure() should exist as setSecure(boolean) rather than
setSecure(int port)
Scott
Juergen Hoffmann wrote:
Hi Scott,
this conditional Check is within templateURI itself
/**
* Method to specify that a URI should use SSL. The default port
* is used.
*/
public void setSecure()
{
setSecure(HTTPS_PORT);
}
/**
* Method to specify that a URI should use SSL.
* Whether or not it does is determined from Turbine.properties.
* If use.ssl in the Turbine.properties is set to false, then
* http is used in any case. (Default of use.ssl is true).
*
* @param port An int with the port number.
*/
public void setSecure(int port)
{
boolean useSSL =
Turbine.getConfiguration()
.getBoolean(TurbineConstants.USE_SSL_KEY,
TurbineConstants.USE_SSL_DEFAULT);
setServerScheme(useSSL ? HTTPS : HTTP);
setServerPort(port);
}
Kind regards
Juergen
-----Ursprüngliche Nachricht-----
Von: Scott Eade [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 31. Mai 2007 10:58
An: Turbine Developers List
Betreff: Re: svn commit: r543081 -
/jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/tur
bine/services/pull/tools/TemplateLink.java
This change doesn't set the server scheme based on the use.ssl
property
- it sets it unconditionally!
Scott.
[EMAIL PROTECTED] wrote:
Author: hoffmann
Date: Thu May 31 01:30:57 2007
New Revision: 543081
URL: http://svn.apache.org/viewvc?view=rev&rev=543081
Log:
see JIRA https://issues.apache.org/jira/browse/TRB-65
Modified:
jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turb
ine/services/pull/tools/TemplateLink.java
Modified:
jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turb
ine/services/pull/tools/TemplateLink.java
URL:
http://svn.apache.org/viewvc/jakarta/turbine/core/branches/TURBINE_2_3_BR
ANCH/src/java/org/apache/turbine/services/pull/tools/TemplateLink.java?vi
ew=diff&rev=543081&r1=543080&r2=543081
=========================================================================
=====
---
jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turb
ine/services/pull/tools/TemplateLink.java (original)
+++
jakarta/turbine/core/branches/TURBINE_2_3_BRANCH/src/java/org/apache/turb
ine/services/pull/tools/TemplateLink.java Thu May 31 01:30:57 2007
@@ -111,6 +111,10 @@
// exception.
templateURI = new TemplateURI((RunData) data);
+
+ // Set the Server Scheme Based on the use.ssl Property from
TR.props
+ // If false, http is used and if true https is used.
+ templateURI.setSecure();
Configuration conf =
Turbine.getConfiguration().subset(TEMPLATE_LINK_PREFIX);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]