Boris,

Your technique sounds like the way to go but I'm a little confused about
your example.  Have the following questions:

1.) Where should i put the call to the doHttpRedirect method?  In the
button's onWeb_event?
2.) What does the string "Location:" represent?  Should this be "https:"?
3.) What does the string what represent?  Is this the URL that I want to
redirect to?
4.) What does the 302 HttpStatus represent?

Thanks again for all your help.

-----Original Message-----
From: Partensky, Boris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 04, 1999 12:33 PM
To: '[EMAIL PROTECTED]'
Subject: Re: [ND] Need Alternative for setExternalURL for https


You can write a redirect directive to browser:

HTH
Boris

private void doHttpRedirect(String what)
{
        String whereTo = "Location: "+what+"\n\n";
        try
        {
                CSpHttp.reset();
                CSpHttp.setHttpStatus(302);
                CSpider.getOutputStream().write(whereTo);
        }
        catch (Exception ex)
        {
                CSpLog.send(this, CSpLog.ERROR, "Writing HTTP redirect
command: "+
                                        ex.toString());
        }
}

> -----Original Message-----
> From: peter cheung 
> Sent: Thursday, November 04, 1999 10:59 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: [ND] Need Alternative for setExternalURL for https
> 
> 
> I know this works but I am not sure this is the best way to do it.
> 
> You can in onBeforeHtmlOutput event to get the text and modify it to what
> ever you need.
> 
> 
> 
> "Howarth, Dan" <[EMAIL PROTECTED]> wrote:
> >Am currently attempting to use the setExternalURL method to dynamically
> >change the URL  on a button but it fails with an exception since the
> >java.net.URL class does not support https.   Does anyone have a
> workaround
> >for this problem?   Any input is much appreciated.  My code is below:
> >
> >public int btSubmit_onWebEvent(CSpWebEvent event)
> >     {
> >             int command = PROCEED;
> >             
> >             CSpButton myButton = (CSpButton) event.getSource();
> >             String sessionStr = getPageSessionNvp().getNvp().toString();
> >     
> >myButton.setActionType(CSpCommand.GO_TO_EXTERNAL_URL_ACTION_TYPE);
> >             try {
> >                     myButton.setExternalURL(new 
> >     
> >URL("http://101.111.110.65/servlets/VolStatement?tbEmailAddr=" +
> >                           getDisplayFieldValue("tbEmailAddr").toString()
> >+
> >                           "&stCustomerID=" +
> >     
> >getDisplayFieldValue("hdCustomerID").toString() +
> >                           "&cbMonth=" +
> >                           getDisplayFieldValue("cbMonth").toString() +
> >                           "&sessionID=" + sessionStr));
> >                     command = doAction(event);      
> >             }
> >        catch (MalformedURLException ex) {
> >             ex.printStackTrace();
> >        }
> >
> >
> >Dan Howarth
> >Information Technology
> >PG&E Gas Transmission
> >210-528-4088
> >210-321-0911 (fax)
> >
> >
> >
> >
> >
> >PG&E Gas Transmission Texas and any other company referenced herein which
> uses the
>  PG&E name or logo are not the same company as Pacific Gas and Electric
> Company, the
>  California utility.  These companies are not regulated by the California
> Public Utilities
>  Commission, and customers do not have to buy products from these
> companies in order
>  to continue to receive quality regulated services from the utility.
> 
> _________________________________________________________________________
> 
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
> 
> For dire need help, email: [EMAIL PROTECTED]
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]


PG&E Gas Transmission Texas and any other company referenced herein which uses the 
PG&E name or logo are not the same company as Pacific Gas and Electric Company, the 
California utility.  These companies are not regulated by the California Public 
Utilities Commission, and customers do not have to buy products from these companies 
in order to continue to receive quality regulated services from the utility.
_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to