Chapter 4. Building the base scenario: Stage 1 115
try {
DTK.initialize("RedpaperDemo", "1.0.0", "6.5.0");
} catch (UWIException initE) {
System.out
.println("SubmissionServlet: init(): exception occurred initializing
Workplace Forms API: "
+ initE.toString());
} catch (Exception anE) {
System.out
.println("SubmissionServlet: init(): exception occurred: "
+ anE.toString());
}
//Read in the properties file for the submission folder names
try {
ServletContext ctx = config.getServletContext();
//ctx.getRealPath()
InputStream inputStream = ctx
.getResourceAsStream("/WEB-INF/folders.properties");
props = new java.util.Properties();
props.load(inputStream);
TEMPLATE_FOLDER = props.getProperty("TEMPLATE_FOLDER");
MANAGER_FOLDER = props.getProperty("MANAGER_FOLDER");
DIRECTOR_FOLDER = props.getProperty("DIRECTOR_FOLDER");
APPROVED_FOLDER = props.getProperty("APPROVED_FOLDER");
SALES_REP_FOLDER = props.getProperty("SALES_REP_FOLDER");
CANCELLED_FOLDER = props.getProperty("CANCELLED_FOLDER");
FORM_NAME_PREFIX = props.getProperty("FORM_NAME_PREFIX");
} catch (Exception anE) {
System.out
.println("SubmissionServlet: init(): exception occurred reading properties
file: "
+ anE.toString());
}
System.out.println("SubmissionServlet: init(): completed");
}
public void destroy() {
super.destroy();
}
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws
ServletException, IOException {
// TODO Auto-generated method stub
}
protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws
ServletException, IOException {
// TODO Auto-generated method stub
}
}
There is no forms specific code except the DTK.initialize statement. It connects us to
Workplace Forms API of version 6.5.0. This will allow us to access the XFDL form in the code.
Now we are prepared to implement the doGet methods (operating in this stage only for
navigation), and later on, the doPost methods handling the submitted form.

Get IBM Workplace Forms: Guide to Building and Integrating a Sample Workplace Forms Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.