I believe you might be able to use an alternation of a solution I used for getting https to work properly between my development and production servers.

public static void contributeAlias(Configuration<AliasContribution> configuration, @Inject @Value("${"+SymbolConstants.PRODUCTION_MODE+"}" ) final String production
 {
                if (0 != production.compareToIgnoreCase("true"))
                {
              BaseURLSource source = new BaseURLSource()
              {
                  public String getBaseURL(boolean secure)
                  {
                      String protocol = secure ? "https" : "http";
        
                      int port = secure ? 8443 : 8080;
        
return String.format("%s://localhost:%d", protocol, port);
                  }
              };
        
configuration.add(AliasContribution.create(BaseURLSource.class, source));
                }
 }

Somehow make this dependent on the user selection and return it accordingly.

Not a quick solution but possible a direction to try!

Keith

On Nov 14, 2008, at 7:18 AM, Inge Solvoll wrote:

Hi!

My web application is large and consists of Struts, T4 and T5 pages. In Struts and T4, I use the current http request to figure out whether to use https or not. Users can choose if they want to log in using https or not.
The chosen protocol is used on all pages after login.

In T5, this is either a global static setting, or a static setting per page. Is there a service or something I can override to implement my own "protocol
builder"? Something like this:

public class HttpProtocolBuilder {
 public HttpProtocolBuilder (final HttpServletRequest request) {
   this.request = request
 }

 public String getProtocol() {
   if (request.isSecure()) {
     return "https";
   }
   else {
    return "http";
    }
}

Regards

Inge


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to