Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

JSP Web Target object model – PB Docs 90 – PowerBuilder Library

JSP Web Target object model – PB Docs 90

JSP Web Target object model

The Web Target object
model for JSP targets is based on the Web Target object model for
PowerDynamo and ASP targets. Its classes handle the complexities of
data transfer, HTML generation, and JavaScript generation for client
scripts.

The non-4GL part of the JSP object model provides a set of
utility Java classes that implement this functionality and encapsulate
most of the JSP page’s implicit objects. These object classes
can be used on non-4GL Web pages as well as on 4GL Web pages. The
JSP deployment controller imports the JSP object model for each
JSP page it deploys.

For more information about the server scripts added by the
JSP deployment controller, see “Transformations for JSP
targets”
.

Use of constructors

For Web site targets, you do not need to use a constructor
for objects of type PSCommandClass, PSConnectionClass, or PSCursorClass.
You can simply designate an untyped JavaScript variable to reference
an instance of the object that is returned by the CreateCommand, CreateConnection,
or CreateCursor methods. For JSP targets, you
must assign a variable of the correct class type before you can
create an instance of the object or call methods on it.

For more information about JSP constructors for Web Target
object model classes, see the Web and JSP Target Reference
.

Object model changes for JSP targets

A few Web Target object methods have either not been implemented
or have changed syntaxes for JSP targets. The psServer GetConnection and MapPath methods,
and the SetSQL method on the PSCommandClass object
are not implemented for JSP targets. The psServer CreateConnection method
has separate syntaxes for JSP targets that allow it to return objects
of the PSConnectionClass type for these targets.

The GetValue method on the PSCursor object
does not return a value of a set datatype and therefore cannot be
used with JSP pages. This method has been replaced by a series of
methods that return values of a specific datatype.

Table 8-9: JSP object
model methods not available for other Web targets
Method Return value datatype
GetColumn<DataType> (String
strColName) where <DataType> can
be Boolean, Byte, Double, Float, Int, Long, Short, or String
Corresponds to DataType used
in method name
GetColumn<DataType> (int
iColNo)
where <DataType> can
be Boolean, Byte, Double, Float, Int, Long, Short, or String
Corresponds to DataType used
in method name
GetColumnLength (String strColName) int
GetColumnLength (int iCol) int
GetColumnName(int iCol) String
GetColumnType(int iCol) int
GetColumnTypeName (int iCol) String
GetPrecision(int iCol) int
GetResultSet() ResultSet
GetResultSetMetaData() ResultSetMetaData
GetScale(int iCol) int

These methods are described in more detail in the Web
and JSP Target Reference

. If the syntax of a method is
target dependent, the Web and JSP Target Reference
indicates
the proper syntax to use for each target type.

Server side events

When you enable 4GL functionality on a JSP page, you can rely
on an event-driven infrastructure to handle many of the
details of coding server scripts. The JSP 4GL object model provides
foundation classes for the event-driven infrastructure,
such as the server control classes, the DataWindow class, server
variables, and parameter classes.

Unlike PowerDynamo or ASP Web targets, in JSP Web targets
you must script a return value for the server-side events of a
4GL Web page that have a return value as part of their event signature.
If there is no return statement, a servlet translation error occurs
at runtime. The following server-side events on the 4GL psPage object
have boolean return types: BeforeAction, BeforeGenerate, FirstTime,
RequestStart, ServerError, and Validate.

The IsTrace method for 4GL targets

The doTrace property for the psPage object is not available
for JSP Web targets. The errors property for the psPage object has
a Vector datatype (rather than a String datatype, as in a Dynamo
or ASP Web target). The Vector datatype for the errors property
is a collection of PageError objects. PageError is a value class
with three string attributes (location, cause, message).

The psPage object in the JSP Web Target object model has a
method to check if tracing is on before calling the Trace method
multiple times. The IsTrace method returns a
boolean and takes no arguments. You can use the IsTrace and SetTrace methods
in place of the doTrace property that is not available for JSP Web
targets.

Variables

When you create variables on the Variables page of the Page
Properties dialog box for 4GL JSP pages, you specify the same properties
that you do for a 4GL HTML page in a Web site target. You must also
associate a datatype with the variable. The following variable datatypes
are supported in 4GL JSP pages: boolean, byte, char, double, float, int, long, short,
and String.

For more information on sett 4GL page and session variables,
see “Setting up page and session
variables”
.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x