JSPs in EAServer must be created in a Web application. If necessary, create the Web application to contain the JSPs as described in Chapter 21, “Creating Web Applications.” You can create new JSPs in EAServer Manager or import them from existing JSP source files.
Creating or importing JSPs
In EAServer Manager, select the Web Application folder.
Select an existing Web application to which you are adding a JSP, then import the JSP or create a new one as follows:
Creating new JSP files Select File | New Web Component. Enter the name of the Web component (JSP) and click OK.
EAServer creates the JSP under the Web applications folder. For example, if you name your JSP testjsp and it belongs to the MyWebApp application, then the location is EAServer_home/Repository/WebApplication/MyWebApp/testjsp.
Importing JSP files If you have existing JSPs that you want to add to your Web application or if you create JSPs with another editing tool, you can copy them to this location, making sure the JSP you copy and the name you enter for the JSP match.
Configuring the JSP properties
To configure your JSP, double-click the JSP or highlight the JSP and select File | Web Application Component Properties. Complete the information described below:
General properties – select this tab to enter general parameters for your JSP:
Description – a brief description of the JSP file.
Web Component Type – select JSP.
JSP File Name – the name and path of the JSP file. The path is relative to the Web application context. For example, if you enter /work/test.jsp, the JSP will be placed in EAServer/Repository/WebApplication/appname/work/test.jsp, where EAServer is the EAServer installation directory and appname is the Web application name. The JSP file must include the .jsp extension.
Startup Load Sequence Position – enter a number that indicates when the JSP loads in relation to other JSP files when the Web application starts. This option applies only if Load During Startup is true. The lower the number the earlier it loads; 1 indicates that this JSP loads first. If a JSP is dependent on another JSP that requires time to initialize, specify the JSP that requires additional initialization time to load first. JSPs with a startup load sequence position of 0 loads last.
Load During Startup – this option compiles and translates the JSP into a servlet at start-up. If you do not select this option, the JSP is compiled when it is first called.
Init-Args – select this tab to enter the initialization parameters associated with the JSP. If your JSP uses externally configured parameters, add or modify the values with the controls on this tab:
Add – enter the Initialization Property Name. Add a default value for your parameter in the Property Value window.
Modify – highlight the argument you want to modify and click Modify. Make your modifications and click OK.
Delete – highlight the argument you want to delete and click Delete.
Advanced – to improve JSP performance, set the value of the com.sybase.jaguar.webapplicaton.jspc-interval property, which determines if and when the JSP runtime checks whether a JSP is current. Set the property value to an integer.
If set to a negative number, the JSP runtime never checks.
If set to 0, the JSP runtime always checks.
To specify the number of seconds before the next check, set the value to a number greater than 0. If a request comes in before the time expires, the JSP is not checked.
Complete the rest of the properties as you would for a servlet.
To configure security for your JSP, see Chapter 3, “Using Web Application Security,” the EAServer Security Administration and Programming Guide.
Editing the JSP source
EAServer supplies an editor for creating and modifying your JSP files; however, you can use any text editor to perform the same tasks. To edit the JSP in EAServer Manager:
Open the Web Application folder and select the Web application to which the JSP belongs.
Highlight the JSP.
Select File | Edit JSP. An editor displays where you can view and modify your JSP. Locate other files for editing by selecting File | Open. When you are finished, select File | Save.
Deleting a JSP
Open the Web Application folder and select the Web application to which the JSP file belongs.
Highlight the JSP.
Select File | Delete Web Application Component.
Copyright © 2005. Sybase Inc. All rights reserved. |