10-0 Web Applications Developers Guide
10-0 Web Applications Developers Guide
Innovation Release
Version 10.0
April 2017
This document applies to webMethods Integration Server and Software AG Designer Version 10.0 and to all subsequent releases.
Specifications contained herein are subject to change and these changes will be reported in subsequent release notes or new editions.
Copyright © 2007-2017 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or
its affiliates and/or their licensors.
The name Software AG and all Software AG product names are either trademarks or registered trademarks of Software AG and/or
Software AG USA Inc. and/or its subsidiaries and/or its affiliates and/or their licensors. Other company and product names mentioned
herein may be trademarks of their respective owners.
Detailed information on trademarks and patents owned by Software AG and/or its subsidiaries is located at
hp://softwareag.com/licenses.
Use of this software is subject to adherence to Software AG's licensing conditions and terms. These terms are part of the product
documentation, located at hp://softwareag.com/licenses and/or in the root installation directory of the licensed product(s).
This software may include portions of third-party products. For third-party copyright notices, license terms, additional rights or
restrictions, please refer to "License Texts, Copyright Notices and Disclaimers of Third Party Products". For certain specific third-party
license restrictions, please refer to section E of the Legal Notices available under "License Terms and Conditions for Use of Software AG
Products / Copyright and Trademark Notices of Software AG Products". These documents are part of the product documentation, located
at hp://softwareag.com/licenses and/or in the root installation directory of the licensed product(s).
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with
Software AG.
Table of Contents
Concepts........................................................................................................................................... 7
How webMethods Integration Server Processes Web Applications...........................................8
Key Differences with the webMethods Tomcat Implementation............................................... 10
Servlet Context.................................................................................................................. 10
About Servlet Mapping...................................................................................................... 10
File Locations for WmTomcat............................................................................................10
Where You Store Web Application Files....................................................................11
Where You Store Shared Class and Jar Files........................................................... 12
Where Tomcat Configuration Files Are Stored...........................................................13
Where Tomcat’s Working Directory Is Located.......................................................... 14
URL for the WmTomcat ROOT Context Package.............................................................15
URL You Use to Invoke a Web Application...................................................................... 15
How WmTomcat Executes the Tomcat Buffering Methods............................................... 16
Administering Your Web Applications............................................................................... 16
Index................................................................................................................................................ 71
This guide is for developers who want to incorporate web applications into the
webMethods Integration Server environment, secure and access these applications, and
use the webMethods tag library for JSP to invoke Integration Server services and obtain
pipeline data.This guide assumes you already know how to develop and deploy web
applications.
Document Conventions
Convention Description
Italic Identifies variables for which you must supply values specific to
your own situation or environment. Identifies new terms the first
time they occur in the text.
{} Indicates a set of choices from which you must choose one. Type
only the information inside the curly braces. Do not type the { }
symbols.
... Indicates that you can type multiple options of the same type.
Type only the information. Do not type the ellipsis (...).
Online Information
Software AG Documentation Website
You can find documentation on the Software AG Documentation website at “hp://
documentation.softwareag.com”. The site requires Empower credentials. If you do not
have Empower credentials, you must use the TECHcommunity website.
Software AG TECHcommunity
You can find documentation and other technical information on the Software AG
TECHcommunity website at “hp://techcommunity.softwareag.com”. You can:
Access product documentation, if you have TECHcommunity credentials. If you do
not, you will need to register and specify "Documentation" as an area of interest.
Access articles, code samples, demos, and tutorials.
Use the online discussion forums, moderated by Software AG professionals, to
ask questions, discuss best practices, and learn how other customers are using
Software AG technology.
Link to external websites that discuss open standards and web technology.
1 Concepts
You can use Integration Server as a general purpose servlet container and run web
applications based on servlets and JSPs. The following diagram shows how Integration
Server processes Tomcat requests.
Step Description
1 In a browser, a user enters a URL for a web page. The HTTP request is sent
to Integration Server.
2 Integration Server receives control. Because the URL contains the "/web"
directive, Integration Server’s dispatcher forwards the request to the logic in
the WmTomcat package.
6 After the final web page is built and displayed in the browser, control is
returned to Tomcat, which in turn returns the web page to the WmTomcat
Connector.
Step Description
Servlet Context
For WmTomcat, a servlet context always corresponds to exactly one Integration Server
package. Because each context is associated with a single package, each web application
is associated with a single package. The corresponding WmTomcat ROOT context
package and corresponding files are in the \web directory of the WmTomcat package
itself.
Note: The location of shared class and jar files that are used by multiple web
applications is different from where you place shared jar files that are used by
services in multiple Integration Server packages.
Shared class and jar files that are used by multiple web applications must be
placed in the WmTomcat package as shown above.
Shared jar files that are used by services in multiple IS packages are
stored within the same package as a service, but are placed in the
Integration Server_directory\instances\instance_name \lib\jars directory.
Tip: Entering the URL to display the root page is a good test to ensure that
WmTomcat is running and that the Tomcat engine is functioning correctly.
The “/web” element is required as a signal to Integration Server that this URL is for a
web application and must be sent to the WmTomcat package for processing.
In a typical Tomcat implementation, the “/web” element is not part of the URL to invoke
a web application.
Task Guideline
Using a text editor to create files Create the files using your preferred text editor
or IDE.
Specifying literal text In the JSP files, type text exactly as you want
it to appear in the document that you want
Integration Server to return to the client.
Using the webMethods tag In the JSP files, use tags from the webMethods
library for JSP tag library for JSP to invoke Integration Server
services and obtain pipeline data. To use the
webMethods tag library for JSP, do the following:
Add this directive above all tags in a JSP file:
<%@ taglib uri="http://webm-taglib.tld"
prefix="webm" %>
Task Guideline
a Package so a Web Application Can Use the
webMethods Tags for JSP” on page 19.
Important:
Keep the number of tags in a single JSP to a
minimum. A good practice is to only include
the tags needed to perform a single task
in each JSP. A side benefit of keeping JSPs
small is that small JSPs are easier to debug
and use.
Storing supporting web resource Create supporting web resource files for the
files JSP (for example, HTML pages or image and
sound files) as necessary. Store these files in
appropriate subdirectories, as described in “The
Integration Server Package Directory Structure”
on page 26.
Selecting a file extension Save the JSP in a text file with a “.jsp” extension
(for example, showorders.jsp).
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.wm.data.*;
import com.wm.app.b2b.server.Service;
try{
}
}
Identify package dependencies. For the web applications to load correctly, the
packages containing web applications must reference the classes in the WmTomcat
package by identifying the WmTomcat package as a package dependency. For
more information about creating a package dependency, see webMethods Service
Development Help.
Verify that your environment is set up correctly to run embedded Tomcat in
Integration Server.
To ensure that your environment is properly set up to run embedded Tomcat in Integration Server
Enter the following URL in your web browser: hp://hostName :portNumber /web/
For example, you might enter: hp://localhost:5555/web/
This is the URL for the ROOT page of WmTomcat and will appear only if the
environment is set up correctly.
A web application, consisting of JSPs, servlets, and supporting files or a web archive
(war) file packing those files into an appropriate directory structure
The webMethods tag library (webm-taglib.tld), if you want to use webMethods tags
to invoke Integration Server services and obtain pipeline data
Note: Packages created in Integration Server before version 6.0 do not have a \web
subdirectory. You can deploy web applications in these packages by creating
this subdirectory beneath the package’s root directory. For more information,
see “About Deploying Web Applications” on page 27.
The following diagram illustrates a typical web application directory structure within an
Integration Server package.
Integration Server stores the files associated with a web application in the Integration
Server package directory structure as follows:
Hot deploy the war file that contains the web application files. For more information
and instructions, see “About Hot Deployment of the War File” on page 28.
Place the war file that contains the web application files in the \web directory of the
Integration Server package for the web application. For instructions, see “Placing the
War File in the Package \web Directory” on page 30.
Place the web application files (JSP, supporting files, and subdirectories of
supporting files) in the \web directory of the Integration Server package for the
web application. For instructions, see “Placing Web Application Files in the Package
\web Directory” on page 31.
Note: You can publish and subscribe to packages that contain web applications.
When you create a package release, Integration Server includes the contents
of the package’s \web subdirectory. When you install a package on another
server, the installation process also installs its associated web application files.
The new server will execute the web application as long as the server meets
the requirements described in “Before You Begin” on page 24.
When you place a new war file in the directory, if an Integration Server package named
the same as the war file does not exist, the hotDeploy service creates a new package.
Be sure the name of your war file contains only characters that are valid for a
package name; for more information, see webMethods Service Development Help. The
hotDeploy service then unpacks the web application files to the \web directory of the
Integration Server package for the web application.
When you place an updated war file in the directory, the hotDeploy service unpacks the web
application files from the updated war file into the \web directory of the Integration
Server package, replacing all files in the \web directory that have the same name as
files in the war file.
When you delete a war file from the directory, the hotDeploy service takes no action. It does
not delete the web application from the \web directory of the Integration Server
package for the web application. The web application will still be available. If you
want to delete the web application, see “Deleting Web Applications” on page 32.
3. Place the war file for the web application in the Integration Server_directory \instances
\instance_name \web\webapps directory.
Be sure to retain the appropriate directory structure for the JSPs and their supporting
files, as described in “The Integration Server Package Directory Structure” on
page 26. In the war file, do not include the \web directory itself. Include only the
files and subdirectories that reside beneath the \web directory.
4. Execute the wm.tomcat.admin:hotDeploy service.
The wm.tomcat.admin:hotDeploy service is automatically executed if you created a user
task to have Integration Server regularly execute thewm.tomcat.admin:hotDeploy
service. No further action is needed. After placing the war file in the
Integration Server_directory\instances\instance_name \web\webapps directory,
the next time the wm.tomcat.admin:hotDeploy service executes, the hotDeploy service
deploys the web application.
Manually execute the wm.tomcat.admin:hotDeploy service if you did not create a user
task to execute the service. To manually execute the service do the following:
i. From the Integration Server Administrator, in the Packages menu of the
navigation panel, click Management.
ii. In the list of packages, click WmTomcat.
iii. Click Browse services in WmTomcat.
iv. Click wm.tomcat.admin:hotDeploy.
v. Click Test hotDeploy.
vi. Click Test (without inputs).
data, see “Seing Up a Package so a Web Application Can Use the webMethods
Tags for JSP” on page 19.
2. Copy the war file into the package’s \web directory.
Be sure to retain the appropriate directory structure for the JSPs and their supporting
files, as described in “The Integration Server Package Directory Structure” on
page 26. In the war file, do not include the \web directory itself. Include only the
files and subdirectories that reside beneath the \web directory.
3. Reload the package. When you reload the package, WmTomcat unpacks the web
application files the package’s \web directory and deletes the war file.
To deploy by placing web application files into the \web directory of a package
1. Prepare the Integration Server package for the web application:
a. If the Integration Server package does not exist, start Designer and create a new
package. The package name does not have to match the name of the JSP you will
be using. For more information about creating packages, see webMethods Service
Development Help.
b. If the Integration Server package already exists and the package was created
before Integration Server 6.0, create a \web directory beneath the package’s root
directory, as follows:
Integration Server_directory\instances\instance_name \packages
\packageName \web
c. If you are using tags from the webMethods tag library for JSP within your web
application’s JSP files to invoke Integration Server services and obtain pipeline
data, see “Seing Up a Package so a Web Application Can Use the webMethods
Tags for JSP” on page 19.
2. Copy the web application files to the appropriate subdirectories beneath the
package’s \web directory. For example, to publish a web application in the Orders
package, you would copy the files to the Integration Server_directory \instances
\instance_name \packages\Orders\web directory.
Be sure to retain the appropriate directory structure for the JSPs and their supporting
files, as described in “The Integration Server Package Directory Structure” on
page 26.
3. Reload the package.
Note: If you receive a message about your browser’s language seing, right-click
anywhere in the browser window, click Encoding, and then click Unicode
(UTF‑8).
Parameter Description
Parameter Description
\instance_name \packages on the server. If you do not specify
a package name, the server looks for the JSP in the Default
package.
This parameter is case sensitive.
fileName .jsp Name of the file containing the JSP. This file name must have a
“.jsp” extension and it must reside within the \web directory
under the package directory named in packageName . If the JSP
resides in a subdirectory of \web, include the name of that
subdirectory in the file name (see example below).
This parameter is case sensitive.
Note: If you are using a war file, supply the name of the JSP file
here, not the name of the war file.
Examples
The following URL retrieves showorders.jsp from a package named ORDER_TRAK
on a server named rubicon:
hp://rubicon:5555/web/ORDER_TRAK/showorders.jsp
The following URL retrieves showorders.jsp from the STATUS subdirectory in a
package named ORDER_TRAK on a server named rubicon:
hp://rubicon:5555/web/ORDER_TRAK/STATUS/showorders.jsp
The following URL retrieves showorders.jsp from the Default package on a server
named rubicon:
hp://rubicon:5555/web/showorders.jsp
Note: If you provide a URL to a directory that does not contain a welcome file (for
example, index.html), Integration Server displays a listing of the files in that
directory. You can click a file to run the application associated with the file.
In this example, the JSP called sampleFormAction.jsp executes when the user clicks Go!.
For more information about accessing the form input variables, see the description of the
<webm:value> tag in “ webMethods Tag Library for JSP” on page 45.
Invoking a Servlet
To invoke a servlet, use the following URL format:
hp://hostName :portNum /web/packageName /servletName
Parameter Description
Troubleshooting Errors
Errors might arise at four different points in the development and execution of a web
application:
Compilation errors might occur as you develop the application.
Errors might occur when you invoke the application.
Run-time exceptions might occur when you invoke the application.
Errors might occur when you reload the package containing the application.
Integration Server logs these errors to its server log. The WmTomcat package directs
Tomcat internal messages and any servlet and JSP error messages to the Integration
Server server log.
For complete information about Integration Server logs, see webMethods Audit Logging
Guide and webMethods Integration Server Administrator’s Guide.
Fatal Fatal
Error Error
Warning Warn
Information Info
Debug Debug
Trace Trace
The default logging level for the server log is Info. When you are testing JSPs, you
might want to set the logging level higher.
Note: If you set your logging level to Debug or higher, you might receive large
numbers of Tomcat messages in your server log.
3. In the Facilities list, choose to include information for these two facilities:
Facility Description
0072 Reporter Details about the tags that Integration Server executes.
The webMethods tag library for JSP is a thin wrapper of
the Integration Server Reporter module. If errors result
from the tags, you should first aempt to troubleshoot
the Reporter module. To do so, you will need to raise the
log level of the 0072 Reporter facility.
0100 Web Container Information about Tomcat, WmTomcat, and your web
application.
Create a file in a package’s Reload the package and then provide the
\web subdirectory appropriate URL in a browser to invoke the file.
Note: For more information about specifying JSP security constraints, see the Java
Servlet standards.
Note: Modifying the global deployment descriptor file requires that you reload the
WmTomcat package. Special conditions apply to UNIX platforms; for more
information, see “Reloading the WmTomcat Package on UNIX Platforms” on
page 22.
Note: If you do not set up global security, skip step 1. However, be sure the
web.xml files in each package contain their own <security-constraint>
sections. Doing so prevents unauthorized access to the web applications
contained within them.
If you plan to override or augment your global security seings for some web
applications, be careful how you set up your URL paerns. If the global web.xml
file specifies a “superset” URL paern (for example, /*), a package’s web.xml file
will not override this security constraint.
Examples:
To protect all files in a web application by the same ACL, specify a URL
paern of /* and a role name that matches the ACL you want to use. In this
example, all files in the web application are protected by the Administrators
ACL:
<security-constraint>
<web-resource-collection>
<web-resource-name>All
Restricted</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Administrators</role-name>
</auth-constraint>
</security-constraint>
Note: If the web application invokes services, Integration Server uses the
credentials the user supplies to access the application to determine access
to the invoked services.
■ Overview ....................................................................................................................................... 46
■ webMethods Tag Library Summary ............................................................................................. 48
■ <jsp:include> ................................................................................................................................ 50
■ <webm:comment> ........................................................................................................................ 51
■ <webm:ifvar> ................................................................................................................................ 51
■ <webm:invoke> ............................................................................................................................ 53
■ <webm:loop> ................................................................................................................................ 55
■ <webm:nl> .................................................................................................................................... 58
■ <webm:rename> ........................................................................................................................... 59
■ <webm:scope> ............................................................................................................................. 60
■ <webm:switch> ............................................................................................................................. 62
■ <webm:sysvar> ............................................................................................................................ 64
■ <webm:usePipeline> .................................................................................................................... 65
■ <webm:value> .............................................................................................................................. 65
■ DSP Equivalents .......................................................................................................................... 68
Overview
The webMethods tag library for JSP is a set of customized implementation classes.
You use tags in this library in JSPs to import actions that let you call Integration Server
services and retrieve data from the Integration Server pipeline.
The examples shown in this appendix assume a pipeline that looks as follows:
Key Value
shipNum 991015-00104
shipDate 10/15/99
carrier UPS
serviceLevel Ground
arrivalDate 10/18/99
qty 10
stockNum BK-XS160
orderNum GSG-99401088
qty 15
stockNum WT-XS160
orderNum GSG-99401088
Key Value
status Complete
streeAddr2
city Missoula
state MT
postalCode 59801
supplierID BRB-950817-001
phoneNum 406-721-5000
faxNum 406-721-5001
email Shipping@BierrootBoards.com
accountNum
streetAddr2
city Cleveland
state OH
Key Value
postalCode 22130
email [email protected]
Note: Tags are case sensitive. In your JSP, you must type them exactly as shown
in this appendix (for example, <webm:comment>, not <WEBM:COMMENT> or
<Webm:Comment>).
For information about how Integration Server identifies the tag prefix (webm),
see “About Creating Web Applications” on page 18.
<jsp:include>
You use the <jsp:include> tag to insert a text file in the JSP. At run time, Integration
Server inserts the contents of the specified file in the JSP and processes any tags the file
contains.
Tip: If you use JSPs extensively, you might want to build a library of standard
“code fragments” that you reference using <jsp:include> tags.
Syntax
Arguments
Argument Description
file.extension Text file to insert. If the text file is not in the same directory as the
JSP that references it, specify the path to the file relative to the JSP.
Examples
These examples insert the TMPL_ShipToBlock.html file into the JSP.
The TMPL_ShipToBlock.html file resides in the same directory as the JSP.
<webm:scope recordName="buyerInfo">
<p>Shipped To:<br>
<jsp:include page="TMPL_ShipToBlock.html" flush="true"/>
</p>
</webm:scope>
<webm:comment>
You use the <webm:comment> tag to add a comment to the JSP.
Syntax
<webm:comment>comment</webm:comment>
Example
<webm:comment>
Use this JSP to generate an order list from any document that contains
a purchase item number, quantity, description, and PO number.
</webm:comment>
Note: You can also use the HTML comment syntax <!-- comment --> to include
comments in JSP code.
<webm:ifvar>
You use the <webm:ifvar> tag to execute a block of code in the JSP if a specified
condition is met. The condition can be either that a certain Integration Server pipeline
variable exists or has a particular value.
You can also define a different block of code to execute if the specified condition is not
met
Use <webm:then> to define the block of code to execute if the condition is met. Use
<webm:else> to define the block of code to execute if the condition is not met.
Syntax
<webm:ifvar variable="variable" [isNull="true"] [notEmpty="true"]
[equals="any_string"] [vequals="ref_variable"] [matches="regular_exp"]>
<webm:then>block_of_code</webm:then>
[<webm:else>block_of_code</webm:else>]</webm:ifvar>
Arguments
Argument Description
Example
If a variable named AuthCode exists in the pipeline, this code inserts a success message
into the HTML page produced from the JSP. The success message includes the current
date and the value of the pipeline variable AuthCode . If the variable does not exist, the
code inserts an error message.
<webm:ifvar variable="AuthCode">
<webm:then>
<p>Authorization code received <webm:sysvar variable="date">
<webm:value variable="AuthCode"></p>
</webm:then>
<webm:else>
<p>Error: Authorization code does not exist.</p>
</webm:else>
</webm:ifvar>
<webm:invoke>
You use the <webm:invoke> tag to call an Integration Server service. You can also define
a block of code to execute if the service completes without errors and a block of code to
execute if the service fails. Integration Server runs the specified service at run time and
returns the results of the service to the JSP.
Use the <webm:onSuccess> tag to define the block of code to execute if the service
completes without errors. Use the <webm:onError> tag to define the block of code to
execute if the service fails. Within the <webm:onError> tag block of code, you can use
these pipeline variables:
Key Description
localizedMessage Localized error message text that uses the client’s locale.
Syntax
<webm:invoke serviceName="service">
<webm:onSuccess>block_of_code</webm:onSuccess>
<webm:onError>block_of_code</webm:onError>
</webm:invoke>
Arguments
Argument Description
Example
This code calls the Integration Server service orders:getShipInfo, which gets shipping
information from a back-end system and builds an HTML form that allows the user to
edit or cancel an order. If the service fails, error information is displayed.
<webm:invoke serviceName="orders:getShipInfo">
<h2>Shipping Details for Order <webm:value variable="/oNum"/></h2>
<p>Date Shipped: <webm:value variable="shipDate"/><br>
Carrier: <webm:value variable="carrier"/>
<webm:value variable="serviceLevel"/></p>
<hr>
<webm:ifvar variable="shipDate" notempty="true">
<form action="http://rubicon:5555/orders/editShipInfo.dsp"
method="get">
<p><b>Change this Shipment:</b></p>
<p><input type="RADIO" name="action" value="edit">
Edit Shipment Details</p>
<p><input type="RADIO" name="action" value="cancel">
Cancel this shipment</p>
<input type="SUBMIT" value="Submit">
<input type="HIDDEN" name="oNum"
value="<webm:value variable=’/oNum’/>"
</form>
<hr>
</webm:ifvar>
<p><a href="http://rubicon:5555/orders/getorder.dsp
?action=showorder&oNum=<webm:value variable=’/oNum’/>View Entire Order</a></p>
<webm:onError>
<hr>
<p><font color="FF0000">Integration Server could not process
your request because the following error occurred. Contact
your server administrator.</font></p>
<table width="50%" border="1">
<tr>
<td><b>Service</b></td>
<td><webm:value variable="errorService"/></td>
</tr>
<tr>
<td><b>Error</b></td>
<td><webm:value variable="errorMessage"/></td>
</tr>
</table>
<hr>
</webm:onError>
</webm:invoke>
<webm:loop>
You use the <webm:loop> tag to execute a block of code once for each element in a
specified Document, Document List, or String List in the Integration Server pipeline.
If you do not specify a Document, Document List, or String List to loop over, Integration
Server will loop over the entire pipeline.
You can use the <webm:loopsep> tag to insert a specified character sequence
between results from a <webm:loop> tag in the HTML page produced from the JSP.
(<webm:loopsep> does not insert the character sequence after the result produced by the
last iteration of the loop.)
At run time, Integration Server loops over the pipeline data as follows:
Syntax
For the pipeline:
<webm:loop loopStruct="true" [excludePrivate="true"]>
block_of_code
[<webm:loopsep sepString="separator_string "/>]
</webm:loop>
For a Document:
<webm:loop variable="loop_variable " loopStruct="true" [excludePrivate="true"]>
block_of_code
[<webm:loopsep sepString="separator_string "/>]
</webm:loop>
Arguments
Argument Description
[variable="loop_variable "]
Document, Document List, or String List to loop
over. If you do not specify this option, Integration
Server loops over the entire pipeline.
Example
<webm:loop variable="items">
Examples
This code puts shipping information for each Document in the Document List items
in the HTML page produced from the JSP.
<p>This shipment contains the following items:</p>
<webm:loop variable="items">
<p>
<webm:value variable="qty"/>
<webm:value variable="stockNum"/>
<webm:value variable="description"/>
<webm:value variable="status"/>
</p>
</webm:loop>
This code lists each element in the String List backItems on separate lines in the
HTML page and indicates that the elements are on backorder.
<p>The following items are backordered</p>
<p>
<webm:loop variable="backitems">
<webm:value/><BR>
</webm:loop>
</p>
This code lists the elements in the String List backItems with commas between the
elements and indicates that the elements are on backorder.
<p>The following items are backordered</p>
<p>
<webm:loop variable="backitems">
<webm:value/>
<webm:loopsep sepString=","/>
</webm:loop>
</p>
This code displays the names and values of the keys in the Integration Server
pipeline in the HTML page.
<webm:loop loopStruct="true">
<webm:value variable="$key"/><br>
<webm:value/><br>
</webm:loop>
This code loops over the keys in the Document named Addresses , whose contents are
not known until run time, and inserts each name and its associated address into the
HTML page produced from the JSP. The basic structure of the Document looks like
this:
Key Value
streetAddr2
city Cleveland
state OH
postalCode 22130
Key Value
streetAddr2
state MD
postalCode 20905
.
.
.
Key Value
state NY
postalCode 11302
<p>Customer Addresses:</p>
<p>
<webm:loop variable="Addresses" loopStruct="true">
<webm:value variable="$key"/>
<webm:loop variable="$key" loopStruct="true">
<webm:value variable="streetAddr1"/>
<webm:value variable="streetAddr2"/>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</webm:loop>
</webm:loop>
</p>
<webm:nl>
You use the <webm:nl> tag to generate a new line character in the HTML page produced
from the JSP.
Use this tag when you want to preserve the ending of a line that ends in a tag. The tag
does not insert the HTML line break <br> code. It merely inserts a line break character,
which Integration Server treats as white space. If you do not explicitly insert this tag on
such lines, Integration Server drops the new line character following that tag.
Syntax
<webm:nl/>
Example
This code inserts the values of the variables carrier , serviceLevel , and arrivalDate on
separate lines in the HTML page.
<hr>
<p>Shipping Info:
<webm:value variable="carrier"/><webm:nl/>
<webm:value variable="serviceLevel"/><webm:nl/>
<webm:value variable="arrivalDate"/><webm:nl/></p>
<hr>
<webm:rename>
You use the <webm:rename> tag to rename or copy a variable in the Integration Server
pipeline.
Syntax
<webm:rename sourceVar="source_variable " targetVar="target_variable "
[copy="true"]/>
Arguments
Argument Description
Example
This code renames the pipeline variable state in the Document buyerinfo to ST .
<webm:scope recordName="buyerInfo">
<webm:rename sourceVar="state" targetVar="ST"/>
<jsp:include page="TMPL_ShipToBlock.html" flush="true"/>
</webm:scope>
<webm:scope>
You use the <webm:scope> tag to limit the variables in the Integration Server pipeline
that are available to a specified block of code in the JSP.
The specified scope remains in effect until Integration Server encounters the next </
webm:scope> tag.
Syntax
<webm:scope [recordName="document "]
[options="param(name =’value ’)
param(stringList []=’value1 ’, ’value2 ’,...’valuen ’)
rparam(document ={name1 =’value1 ’;name2 =’value2 ’;...namen =’valuen ’})
rparam(documentList []={name1 =’value1 ’;name2 =’value2 ’;...namen =’valuen ’}|
{name1 =’value1 ’;name2 =’value2 ’;...namen =’valuen ’})"]> block_of_code
</webm:scope>
Arguments
You can use any of the following options with this tag. If you specify multiple options,
use a space to separate the options.
Important: If you set the value of a variable with these options, the value you specify
will replace the current value of that variable.
If the value of a variable contains spaces, enclose the value within single
quotes.
When you use the <webm:scope> tag in a JSP, the entire tag must appear on
one line.
Argument Description
Specifies the document to use as the current scope.
[recordName="document "]
Adds to the current scope a String named name whose value is value .
[options="param(name =’value ’)"]
Example
<webm:scope options="param(csClass=Gold) param(csName='Joe Smith')"/>
Adds to the current scope a String List named stringList whose values are
value1 value2 ...valuen .
[options="param(stringList []=’value1 ’, ’value2 ’,...
’valuen ’)"]
Example
<webm:scope options="param(shipPoints[]=BOS,LAX,NYC,PHL)
param(warehouseLoc[]=’Los Angeles’,Philadelphia)"/>
Adds to the current scope a Document named document whose variables are name
and whose values are value .
[options="rparam(document ={name1 =’value1 ’;name2 =’value2 ’;...
namen =’valuen ’})"]
Example
<webm:scope options="rparam(custServiceInfo={csClass=Gold;
csPhone=’800-444-2300’;csRep=’Ann Johnson’})
rparam(buyerInfo={buyerName=’Joe Smith’;buyerPhone=’800-333-1234’})"/>
Adds to the current scope a Document List named documentList whose variables are
name and whose values are value .
[options="rparam(documentList []={name1 =’value1’; name2 =’value2 ’;...
namen =’valuen ’}|{name1 =’value1 ’;name2 =’value2 ’;...namen =’valuen ’})"]
Example
<webm:scope options="rparam(custServiceCtrs[]=
{csName=Memphis;csPhone=’800-444-2300’}|
{csName=Troy;csPhone=’800-444-3300’}|
{csName=Austin;csPhone=’800-444-4300’})
rparam(custServiceReps[]={csRep=’Ann Johnson’;csExt=27}|
{csRep=’John Jones’;csExt=28}|
{csRep=’Chris Smith’;csExt=29})"/>
Examples
This code sets the scope to the Document buyerInfo and inserts the information in the
scope into the HTML page produced by the JSP.
<webm:scope recordName="buyerInfo">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
</webm:scope>
This code sets the scope to the Document buyerInfo , adds variables named buyerClass
and shipPoint to the scope, and inserts the information in the scope into the HTML
page produced by the JSP.
<webm:scope recordName="buyerInfo"
options="param(buyerClass=Gold) param(shipPoint='BWI Hub')">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
<hr>
<p>Point of Departure: <webm:value variable="shipPoint"/><br>
Customer Class: <webm:value variable="buyerClass"/></p>
</webm:scope>
This code sets the scope to the Document buyerInfo , adds variables named buyerClass
and shipPoint from a Document named shipInfo to the scope, and inserts the
information in the scope into the HTML page produced by the JSP.
<webm:scope recordName="buyerInfo"
options="rparam(shipInfo={buyerClass=Gold;shipPoint='BWI Hub'})">
<p>Shipped To:<br>
<webm:value variable="companyName"/><br>
<webm:value variable="streetAddr1"/><br>
<webm:value variable="streetAddr2"/><br>
<webm:value variable="city"/>
<webm:value variable="state"/>
<webm:value variable="postalCode"/>
</p>
<hr>
<p>Point of Departure: <webm:value
variable="shipInfo/shipPoint"/><br>
Customer Class: <webm:value variable="shipInfo/buyerClass"/></p>
</webm:scope>
This code sets the scope to the Document buyerInfo , adds a variable named
shipPoints to the scope, adds variables named name and ssid from a Document
List called custInfo , and inserts the information in the scope into the HTML page
produced by the JSP.
<webm:scope recordName="buyerInfo"
options="param(shipPoints[]=DC,VA,LA,MD)
rparam(custInfo[]={name=Joe;ssid=ssid1}|{name=John;ssid=ssid2})">
<h3>Ship Points: </h3>
<webm:loop variable="shipPoints">
<webm:value /><br>
</webm:loop>
<h3>Customers: </h3>
<webm:loop variable="custInfo">
<webm:value variable="name" />, <webm:value variable="ssid" /> <br>
</webm:loop>
</webm:scope>
<webm:switch>
You use the <webm:switch> tag to execute one of multiple blocks of code, based on the
value of a variable in the Integration Server pipeline.
Use <webm:case> to define each value and the associated block of code to execute.
Integration Server evaluates <webm:case> tags in the order they appear in the JSP. When
a case is true, Integration Server executes the associated block of code, then exits the
<webm:switch> structure.
If you want to define a default case (that is, the case to execute if the specified variable
does not exist or if none of the other cases is true), specify a <webm:case> tag with no
switch_value . The default case must be the last <webm:case> tag in the <webm:switch>
tag.
Syntax
<webm:switch variable="variable ">
<webm:case value="switch_value1 ">block_of_code </webm:case>
[<webm:case value="switch_value2 ">block_of_code </webm:case>...
<webm:case value="switch_valuen ">block_of_code </webm:case>]
[<webm:case>block_of_code </webm:case>]
</webm:switch>
Arguments
Argument Description
Examples
This code inserts different paragraphs into the HTML page produced from the JSP,
based on the value in the pipeline variable carrier .
<webm:switch variable="carrier">
<webm:case value="FedEx">
<p>Shipped via Federal Express <webm:value="serviceLevel"/>
<webm:value="trackNum"/></p>
</webm:case>
<webm:case value="UPS">
<p>Shipped via UPS <webm:value="serviceLevel"/></p>
</webm:case>
<webm:case value="Freight">
<p>Shipped via <webm:value="transCompany"/><br>
FOB: <webm:value="buyerInfo/streetAddr1"/><br>
<webm:value="buyerInfo/streetAddr2"/><br>
<webm:value="city"/>, <webm:value="state"/>
<webm:value="postalCode"/></p>
</webm:case>
</webm:switch>
This code calls different Integration Server services based on the value of the pipeline
variable action .
<html>
<head>
<title>Order Tracking System</title>
</head>
<body bgcolor="FFFFCC">
<h1>Order Tracking System</h1>
<hr>
<webm:switch variable="action">
<webm:case value="shipinfo"/>
<webm:invoke serviceName="orders:getShipInfo"/>
.
.
.
<webm:case value="showorder"/>
<webm:invoke serviceName="orders:orders:getOrderInfo"/>
.
.
.
.
<webm:case value="showinvoice"/>
<webm:invoke serviceName="orders:orders:getInvoices"/>
.
.
.
</webm:switch>
<hr>
<jsp:include page="stdFooter.txt" flush="true"/>
</body>
</html>
<webm:sysvar>
You use the <webm:sysvar> tag to insert a special variable or server property into the
HTML page produced from the JSP.
Syntax
<webm:sysvar variable="system_variable "/>
Arguments
Argument Description
Value Description
Argument Description
wa.server.port) or any Java system
property (for example, java.home).
See webMethods Integration Server
Administrator’s Guide for a list of
Integration Server properties.
Examples
This code inserts the name of the Integration Server that processed the JSP into the
HTML page.
Response generated by host <webm:sysvar variable="host"/>
This code inserts the value of the Integration Server property wa.server.port, which
identifies Integration Server’s main HTTP listening port, into the HTML page:
<p>
<webm:sysvar variable="host"/> was listening on
<webm:sysvar variable="property(watt.server.port)"/>
</p>
<webm:usePipeline>
You use the <webm:usePipeline> tag to make the current Integration Server pipeline
available to the JSP in Java code as an IData variable named webm_pipe .
Syntax
<webm:usePipeline>block_of_code </webm:usePipeline>
Example
This code prints the contents of the current pipeline in one long string to the HTML page
produced from the JSP.
<webm:usePipeline>
<% System.out.println ("pipeline is :" + webm_pipe.toString ()); %>
</webm:usePipeline>
<webm:value>
You use the <webm:value> tag to insert the values of one or more variables from the
Integration Server pipeline into the HTML page produced from the JSP. You can also use
the tag within a loop to insert the value of the loop’s current key. To do so, specify the
tag without any arguments (that is, <webm:value/>).
Syntax
Separate nested fields with a forward slash (/).
Arguments
Argument Description
Argument Description
Example
<webm:value variable="backItems" index="1"/>
[encode="code "]
Encodes the contents of variable before inserting it,
where code specifies the encoding system to apply, as
follows:
Examples
This code calls the orders:getOrderInfo service and inserts the results of the service into
the HTML page produced from the JSP.
<webm:invoke serviceName="orders:getOrderInfo"><br>
<p><webm:value variable="buyerInfo/companyName"/><br>
<webm:value variable="buyerInfo/acctNum"/>
<p>This shipment contains the following items</p>
<table width="90%" border="1">
<tr>
<td>Number</td><td>Qty</td>
<td>Description</td><td>Status</td>
</tr>
<tr>
<webm:loop variable="items">
<td><webm:value variable="stockNum"/></td>
<td><webm:value variable="qty"/></td>
<td><webm:value variable="description"/></td>
<td><webm:value variable="status"/></td>
</tr>
</webm:loop>
</table>
</webm:invoke>
This code loops over the pipeline and inserts the names and values of the keys in the
pipeline into the HTML page.
<webm:loop loopStruct="true">
<webm:value variable="$key"/><br>
<webm:value/><br>
</webm:loop>
This code inserts the contents of the variable carrier into the HTML page. If carrier is
null or empty, the code inserts the string “UPS”.
<webm:value variable="carrier" null="UPS" empty="UPS"/>
DSP Equivalents
The webMethods tags for JSP that Integration Server supports are similar to
webMethods DSP tags. The following table lists the tags in the webMethods tag library
and their DSP equivalents. For more information about these tags and their arguments
and options, see Dynamic Server Pages and Output Templates Developer’s Guide.
include include
webm:case case
webm:comment comment
webm:else else
webm:ifvar ifvar
webm:invoke invoke
webm:loop loop
webm:loopsep loopsep
webm:nl nl
webm:onError onerror
webm:onSuccess None
webm:rename rename
webm:scope scope
webm:switch switch
webm:sysvar sysvar
webm:value value
Index documentation
using effectively 5
A
E
Access Control Lists 39
else tag 51
ACLs 39
engine, Tomcat 9
administering Web applications 16
error log 38
executing services manually 30
B
buffering, Tomcat methods 16
F
form, HTML 34
C
case tag 62
G
class files
guidelines for creating Web applications 18
where to store shared files 12
comment tag 51
configuration files H
where Tomcat configuration files are stored 13 host,Tomcat when using WmTomcat 9
context, Tomcat ROOT 10 hot deployment
creating Web applications creation of IS package 29
file extension to use 19 description 28
guidelines 18 how it works 28
specifying literal text 18 setting up in development environment 28
text editor to use 18 steps to deploy 29
using webMethods tag library 18 using webMethods tags in Web application 29
where to place war file to deploy 29
HTML form 34
D
HTTP, buffering responses 16
deleting Web applications 32
hyperlinks to JSPs 34
deploying
war files 28, 30
Web applications I
hot deployment 28 ifvar tag 51
hot deployment when using webMethods tags include tag 50
29 invoke tag 53
individual files in package web directory 31 invoking
methods of deploying 27 JSP 33
performing hot deployment 29 services
preparation 24, 30, 31 from JSPs 20
requirements 25 from servlets 20
setting up hot deployment 28 from Web applications 20
war file in package web directory 30 Web applications 33
where to place war file to deploy 29, 31 IS package
deployment descriptor file created by wm.tomcat.admin:hotDeploy service
contents 39 29
defined 26 created during hot deployment 29
security section 40
UNIX platform considerations 22 J
Web application configuration 39 jar files, where to store s hared files 12
Symbols
\web directory 11
<$nopage>Web archive (war) file. See war files 25
<$nopage>web.xml file. See deployment descriptor
file 26
<$nopage>webMethods tags. See tags
(webMethods) 46