ClassName

atg.droplet.ProtocolChange

Component

/atg/dynamo/droplet/ProtocolChange

The ProtocolChange servlet bean takes a full or relative URL and renders a full URL that uses either the secure protocol (https) or the standard protocol (http), depending on which output parameter you specify. You can use this servlet bean to switch between protocols. For example, on a commerce site, you might want to switch from http to https before the customer enters personal information such as a credit card number.

To enable this servlet bean to change the protocol, you must set its enable property to true. By default, this property is set to false. When this property is false, the servlet bean sets the secureUrl and nonSecureUrl output parameters to the exact value of inUrl; it does not change the protocol or change a relative URL to a full URL. This property enables you to develop your application for a secure server even if your development environment’s server is not secure. To do this, leave the enable property set to false in your development environment, and set it to true in the production environment.

Input Parameter

inUrl
A full or relative URL that uses either the http or https protocol.

Output Parameters

secureUrl
If the enable property is set to true, this parameter is set to a full URL that uses the https protocol. If the enable property is false, this parameter is set to the value of inUrl.

nonSecureUrl
If the enable property is set to true, this parameter is set to a full URL that uses the http protocol. If the enable property is false, this parameter is set to the value of inUrl.

Open Parameter

output
This parameter is rendered once.

Example
<dsp:droplet name="/atg/dynamo/droplet/ProtocolChange">
  <dsp:param name="inUrl" value="../checkout/creditcard.jsp"/>
  <dsp:oparam name="output">
    <dsp:getvalueof var="a6" param="secureUrl" vartype="java.lang.String">
      <dsp:a href="${secureUrl}">Enter credit card information</dsp:a>
    </dsp:getvalueof>
  </dsp:oparam>
</dsp:droplet>
 
loading table of contents...