(iSeries)
Backing up and recovering JavaServer Pages files
JavaServer Pages source and generated servlet classes, Hypertext Transfer Protocol (HTTP) configuration, and administrative configuration should be considered for backup when using JavaServer Pages files.
Tasks
- Save installed applications. Application code and configuration such as bindings, is located by default in the profile_root/installedApps directory. By saving this directory, you save your installed applications, including HTML, servlets, JavaServer Pages (JSP) files, and enterprise beans. Normally, each application is located in a separate subdirectory, so we can choose to save all applications or a subset.
- Save all installed applications. The following command is wrapped for display purposes. Enter the following command as a single line, with a space between the end of DEV parameter and OBJ.
SAV DEV('/QSYS.lib/wsalib.lib/wsasavf.file') OBJ(('/profile_root/installedApps'))- Save the sampleApp application only. The following command is wrapped for display purposes. Enter the following command as a single line with a space between the end of DEV parameter and OBJ.
SAV DEV('/QSYS.lib/wsalib.lib/wsasavf.file') OBJ(('/profile_root/installedApps/cellName/sampleApp.ear'))
- Save and restore your JSP files. When JSP files are run, a servlet class is generated, compiled, and then run. When saving and restoring your JSP files, we can elect to save only the JSP source or the generated files as well.
- If we save and restore only the JSP source, the servlet source and class files are regenerated when they are invoked. This is a simpler, smaller save and restore operation. Note that regeneration slows the first requests, and default optimization is done on the generated Java programs.
- If we save and restore the source and generated files, no regeneration is done. If we have optimized Java programs to levels other than the default, this optimization is preserved.
Example
WebSphere Application Server places the generated files (.class, .java, and optionally, .dat) in a temporary directory under the WAS instance. For example, the default instance stores the generated files in this directory:
/profile_root/temp/node/application_server/enterprise_app/web_moduleIn this example:
- profile is the name of our instance. The default instance name is default.
- node is the name of the iSeries server or partition on which our WAS instance is running
- application_server is the name of our WAS
- enterprise_app is the name of the enterprise application to which the JSP file belongs
- web_module is the web module containing your JSP file.
A .dat file is a helper file used by the generated servlet.
Related:
JavaServer Pages Assembling web applications