BBjspCommandResult::getForward (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher this method returns the previously set forward name for this BBjspCommandResult

Syntax

Return Value

Method

String

getForward()

Parameters

None.

Return Value

the name of the forward

Remarks

None.

Example

class public LogonCommand

    field public BBjspWebRequest request!
    field public BBjspWebResponse response!
    field public BBjspWebSession session!

    method public BBjspCommandResult execute(BBjspCommandContext context!)

        declare BBjspCommandResult result!
        #request! = context!.getRequest()
        #response! = context!.getResponse()
        #session! = request!.getSession()

        result! = context!.getResult()
        result!.setForward("fail")

        action$ = Request!.getParameter("action")

        if ("logon" = action$) then
            username$ = Request!.getParameter("userName")
            password$ = Request!.getParameter("password")

            if (password$ = "admin123") then
                #session!.setAttribute("USER_NAME",username$)
                result!.setForward( "logon_success" )
            else
                result!.addError("logonForm","Incorrect Username or Password")
            endif
        endif

        if ("logoff" = action$) then
            #session!.invalidate()
            result!.setForward( "logoff_success" )
            result!.addMessage("logonForm","User logged-off")
        endif

        context!.getJettyContext().getLogger().log("LogonCommand : " + result!.getForward())

        methodret result!
    methodend

classend

See Also

BBJSP

BBjspCommand