Working with web applications

This section describes how to work with web applications when building JRun installers or embedding JRun as your application server.

Hiding JSP source code

When deploying JSP pages as part of a web application, you might not want to provide your customers with the clear text version of those pages (the .jsp files). Instead, you can distribute only the binary (.class) versions of those pages.

JRun compiles a JSP page to create the page's class file when the page is initially requested by a client or when a requested JSP page was modified since its last request. However, in a deployed application, you can bypass compilation to force JRun to always load the page's class file.

You bypass the compilation of a JSP page for the following reasons:

Turning off JSP compilation

In an OEM environment, you might want to disable JSP compilation so that users cannot change and then recompile JSPs. This is possible if they have the source code, but it is also possible for them to reverse engineer the JSP pages or add their own implementations in your application.

To disable dynamic JSP compilation:

In the jrun_root/servers/jrun_server/SERVER-INF/default-web.xml file, set the JSPServlet translationDisabled initialization parameter to true, as the following example shows:

...
<servlet>
��<servlet-name>JSPServlet</servlet-name>
��<servlet-class>jrun.jsp.JSPServlet</servlet-class>
��<init-param>
����<param-name>translationDisabled</param-name>
����<param-value>true</param-value>
��</init-param>
</servlet>
...

Parameters set in the default-web.xml file apply to all applications running on that JRun server. These changes take effect the next time you start the JRun server.

If you disable JSP compilation but your application includes JSPs, you must precompile them using the instructions in the section, "Precompiling JSPs".

Precompiling JSPs

When you turn off compilation, you must include the corresponding class files for all JSP pages in your installation. Therefore, you must precompile all JSP pages to create the class files before you deploy the application. You perform precompilation in one of two ways:

Adding web applications

As an OEM, you usually include your web application with the JRun installation.

In Windows, create a merge module (.msm file). Then create a Windows Installer project file, include your application and the JRun merge modules.

On UNIX, add your application to the fileset definitions in the JRun installer script.

When adding applications to your installation, you must add the application to an autodeploy directory or configure the directory to automatically deploy.

Removing web applications

You usually deploy only your application on the embedded JRun server, so you might want to remove the default applications that JRun deploys. Some JRun servers have the same default applications on them. For example, the Macromedia Flash Remoting service is deployed on both the default JRun server and the samples JRun server.

Most commonly, you will remove the JMC application from the installer. To do this in a Windows Installer environment, remove the JRun4JMC.msm merge module from your project. On other platforms, remove the JRun4JMC.bin file from your project.

Note:   Removing the JMC also removes the admin JRun server.

To remove other applications, extract their EAR files from the filesets, merge module, or BIN files, and update your install project to catch file dependencies.

A complete JRun installation deploys the following default applications:
Application name
JRun server
File name
JRun Management Console
admin
jrun_root/servers/admin/jmc-app.ear
Flash Remoting
default
samples
jrun_root/lib/flashgateway.ear
Default
default
jrun_root/servers/default/default-ear/
Compass
samples
jrun_root/servers/samples/compass-ear/
Default
samples
jrun_root/servers/samples/default-ear/
Flash Remoting Samples
samples
jrun_root/servers/samples/flashsamples-ear/
SmarTicket
samples
jrun_root/servers/samples/smarticket.ear
Techniques
samples
jrun_root/servers/samples/techniques-ear/
TravelNet
samples
jrun_root/servers/samples/travelnet-ear/
Web Services
samples
jrun_root/servers/samples/ws-ear/
WorldMusic
samples
jrun_root/servers/samples/worldmusic.war

Note:   The samples server is not included as a module in the JRun SDK.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/jrun/4/JRun_SDK_Guide/embedding3.htm