Dynamic Server Page

advertisement
1
webMethods KB
DSP
A dynamic server page (DSP) is a document embedded with special codes (tags) that instruct
the webMethods Integration Server to perform certain actions when an HTTP client requests
the document.

It is just like JSP java server pages which contain java scripplets with HTML tags.

DSPsare used to construct browser-based applications.

DSP should only contain HTML content.

The webMethods Integration Server Administrator is composed entirely of DSPs
DSP Sample
<HTML>
<HEAD>
<title>Order
Tracking
System</title>
</HEAD>
<BODY>
<h1>Current Orders</h1>
%invoke orders:showOrders%
%loop orders%
Date : %value orderDate%
PO Number: %value orderNum%
%endloop%
%endinvoke%
</BODY>
</HTML>
2
webMethods KB
Request a DSP
DSPs may be invoked from HTML forms
:
<HTML>
<HEAD>
<title> Page Title </title>
</HEAD>
<BODY>
<A HREF=/package Name/fileName.dsp>Show Page</A>
</BODY>
</HTML>
Dsp Tags
The Integration Server automatically processes DSP tags when a DSP is requested via HTTP.
.
Use the belong
%invoke%
%value%
%ifvar% / %switch%
.
%loop%
%comment%
action
Invoke a service within a DSP
Manipulate variables.
Conditionally process a block of code within DSP
Reiterate a block of code within a DSP.
Denote a comment within a DSP.
Scope

Scope refers to the set of variables upon which a DSP can operate directly.

Initial Scope means whose variables exist for the entire life ofa DSP

Example:
http://hostName:portNum/packageName/fileName.dsp?varName1=var1&var
Name2=var2

Only those variables that are within the current scope are passed to a service that is
invoked in a DSP.
3
webMethods KB

The %end% tag, cause the current scope to close and discard the variables within it and
scope reverts to the previous level.
Conditionally Executing Blocks of Code

The %ifvar% and %switch% tags selectively execute a block of code based on the
existence or value of a variable at run time.

Use %ifvar% tag to denote a block of code that is to be executedonly when a specified
variable exists or contains a value that you specify.

The %switch% tag allows to define a separate block of code (a case) for each value that
a variable can take at run time.

Use %switch% tag instead of %ifvar% when there are more than two possible paths of
execution.
%ifvar variableName%
Block of Code
%else%
Block of Code
%end%
Where variable Name specifies the name of the variable you want to evaluate at run time
%switch variableName%
%case 'switchValue'%
Block of Code
%case 'switchValue'%
Block of Code
%case%
Default Block of Code
%end%
where variable Name specifies the name of the variable you want to evaluate at run time and switch
Value is the value that will cause a case to execute .
Download