BBjspWebResponse::sendRedirect


Description

In BBj 16.0 and higher, this method sends a redirect to the client.

Syntax

Return Value

Method

void

sendRedirect(string location)

Parameters

Variable

Description

location

Specifies the new URL to be redirected to.

Return Value

None.

Remarks

The example below shows sending a redirect within a BBJSP Servlet.

Example

This example demonstrates how this works in a BBJSP web-page

<%
    #getResponse().sendRedirect("http://www.google.com")
%>

This example demonstrates how this works in a BBJSP servlet

class public MyServlet

  field private BBjspWebRequest request!
  field private BBjspWebResponse response!
  field private BBjspWebSession session!
  
  method public void service(BBjspServletContext context!)
       
    #request! = context!.getRequest()
    #response! = context!.getResponse()

    #response!.sendRedirect("http://www.google.com")
  methodend
classend

See Also

BBJSP

BBjspWebRequest

BBjspWebResponse