Getting Set and Going with JSP and Enterprise IBM FormsAdded by John Boyer on April 19, 2013 | Version 1
|Quickstart guide for getting set to use JavaServer Pages (JSP) technology within enterprise IBM Forms (XFDL).
The article JSP meets IBM Forms enterprise web application development has now appeared in the IBM Websphere Developer Technical Journal. JavaServer™ Pages (JSP) makes it easy for web application developers to use simple Java™ expressions and scriptlets to populate web content before serving it. Now, you can leverage the power and simplicity of JSP right in your IBM Forms (XFDL) documents. This allows you to manage more of XFDL-based solutions as pieces of content. In other words, you can not only have the XFDL forms express the client-side data collection and interactive behaviors, but also now they can contain the pieces of Java code that prepopulate XFDL forms before they are served and process the results of the XFDL forms when they're completed. These combined XFDL/JSP documents work with IBM Forms Webform Server as well as IBM Forms Viewer, and best of all, you can even maintain the combined XFDL and JSP in the IBM Forms Designer.
Besides drawing your attention to the above article, this page also starts right at the beginning and gives you indepth instructions on how to get started with the code samples attached to the article.
Whether developing a Java Servlet or a JSP-based solution (or both), there are a few common setup configurations:
If you use just a basic Eclipse environment like Eclipse 4.2 Juno EE, then be sure to use Help | Eclipse Marketplace... to add IBM Websphere Application Server V8 Developer Tools.
The IBM Forms Webform Server and IBM Websphere Application Server V8 may be installed remotely, so you will have to adapt some places below where I've said localhost or given a local machine path.
Define a new Server to which web applications are deployed
- In Enterprise Explorer, Right-click | New | Other... | Server
- Define server host name, for example. localhost
- Select IBM Websphere Application Server v8.0, Next >
- Enter location of server, for example C:\IBM\WebSphere\AppServer, Next >
- Provide admin password, Finish
Create an EAR Application Project (needed step for IBM WAS V8)
- In Enterprise Explorer, Right-click | New | Enterprise Application Project...
- Give a Project Name, e.g. customerDemoEAR
Create a dynamic web project within the EAR
- In Enterprise Explorer, Right-click | New | Dynamic Web Project
- Give a Project Name, e.g. customerDemoWAR
- Ensure the EAR project name is set, e.g. customerDemoEAR
Copy the WFS and API development jars to the WAR's WebContent/WEB-INF/lib folder:
- To faciliate the listing, the following names are used (and their defaults on a local windows WebForm Server deployment are given)
WFS_HOME = C:\Program Files\IBM\Forms Server\8.0
WFS_SERVLET = %WFS_HOME%\WebformServer\redist
WFS_API = %WFS_HOME%\API\redist\WinX64\PureEdge\80\java\classes
- Copy the following:
For a JSP, it's also helpful if you add these WFS and API jars in WebContent/WEB-INF/lib to the WAR project's Properties | Java Build Path | Libraries via Add External Jars... This step helps because Eclipse does not (as of Juno 4.2) relate the definitions in the WAR's JARs to the directives, expressions and scriptlets in the JSP, so this step eliminates false positive syntax errors in the Java that invokes the functionality of these JARs.
For JSP, you're now equipped to create New | JSP File... or to add JSP files to the WebContent of the WAR, such as customerName.jsp and customerDependents.jsp from the JSP article.
Once you have the JARs and JSPs in place, you can Deploy the web application
- Right-click the Server and choose "Add and Remove..."
- Choose the EAR (e.g. customerDemoEAR), Add >
Finally, you can call the JSP based on its name and the containing WAR, like this http://localhost:10039/customerDemoWAR/customerName.jsp