BBjHttpRequest::removeAttribute


Description

In BBj 15.0 and higher, this method removes an attribute from this request. This method is not generally needed as attributes only persist as long as the request is being handled.

Syntax

Return Value

Method

void

removeAttribute(string name)

Parameters

Variable

Description

name

A String specifying the name of the attribute to remove.

Return Value

None.

Remarks

None.

Example

rem 'Obtain the instance of the BBjAPI object

let myAPI! = BBjAPI()
MyServlet! = new MyServlet()

data!.setCallback(data!.ON_WEB_CONNECTION, myServlet!, "myMethod")

process_events

class public MyServlet
    method public void myMethod(BBjServletEvent p_event!)
        let chan = UNT
        request! = p_event!.getHttpRequest()
        response! = p_event!.getHttpResponse()
        resp!.setContentType("text/html")
        open (chan)"JSERVLET"
        print (chan)"<html><body><h1>Hello BBj!</h1>"

        o! = request!.removeAttribute("myAttribute")
        print (chan)"removed <b>myAttribute</b> = " + str(o!)
        print (chan)"</body></html>"
        close (chan)
    methodend
classend