VisualAge(R) for Java(TM)

Version 3.5

JavaServer Pages (JSP)/Servlet Development Environment

RELEASE NOTES



Table of contents

1.0 Loading the required features
2.0 Using the JSP/Servlet Development Environment
      2.1 New functions added to the JSP Execution Monitor
      2.2 Recommendations for using the JSP Execution Monitor
      2.3 Resolving JSP case-sensitivity issues
      2.4 Importing JSPs/servlets generated by the IBM(R) Websphere(TM) Studio wizards
3.0 Limitations and known problems
      3.1 "Class Not Found" error occurs when loading JSP files
      3.2 Getting "Cannot Load Page Compiled Class" error message in a browser
      3.3 Getting exceptions reported in a browser after JSP files are changed
      3.4 Reverting to an older version of a JSP file
      3.5 Getting an "Java.io:ClassNotFoundDef error" exception when starting up Servlet Engine
      3.6 Icons in the JSP Execution Monitor are not getting repainted
      3.7 You cannot save JSP files in a directory whose name contains a "."
      3.8 On Windows 2000, you may encounter problems loading the "Find the Leap Years" sample using the Internet Explorer browser
      3.9 JSP 1.0 engine with the Load generated servlet externally option enabled may cause "Source not available"
      3.10 Imported package not found during compilation

1.0 Loading the required features

To work with JavaServer Pages in VisualAge for Java, you must first load the necessary features from the repository into the workspace.

To perform a feature install, select File > Quick Start > Features > Add Features. Select IBM WebSphere Test Environment. Click OK. The following projects will automatically be loaded into your IDE workspace:

The IBM WebSphere Test Environment feature contains the WebSphere integration components, the Servlet API classes, and the JSP Execution Monitor.

Refer to the online help for more information on working with JSPs and servlets in VisualAge for Java.

VisualAge for Java, Version 3.5 supports both the JSP 0.91 and JSP 1.0 specifications. JSP 1.0 is the default. Refer to the online help for detailed instructions about switching between JSP 0.91 and 1.0.

2.0 Using The JSP/Servlet Development Environment

The follow sections contain information about using the JSP/Servlet Development Environment and working around problems.

2.1 New function added to the JSP Execution Monitor

You can use the WebSphere Test Environment Control Center to configure the JSP Execution Monitor; refer to the WebSphere Test Environment online help for details. 

A new function has been added to the JSP Execution Monitor, the Enable JSP source debugging function. It enables you to debug JSP source using the IDE debugger. When you select to enable JSP source debugging, and then load a JSP file in your browser, the JSP source is displayed in the IDE debugger window. You can then debug the JSP source by setting breakpoints in the source.

2.2 Recommendations for using the JSP Execution Monitor

After serving a JSP file, we recommend that you do not exit the JSP Execution Monitor if you intend to load more JSP files into the JSP Execution Monitor. By doing this, the next time you serve a JSP file, the file will load faster in the JSP Execution Monitor.

2.3 Resolving JSP case-sensitivity issues

When you are loading a JSP file into your browser, the URL you qualify must match the file structure of your document root. Since the WebSphere(TM) Application Server page compiler creates case-sensitive package names, you must use the same case consistently when specifying URLs of JSP files. Although case-sensitivity is not an issue on Windows NT(R), Java itself is case sensitive. When the page compiler creates a package name from the directory specified in the URL, the case of the file names (whether you specify uppercase or lowercase) becomes an important consideration in VisualAge for Java, Version 3.5. For example, if the 'JSP subdirectory' name in your document root directory is in uppercase, enter the following URL when loading the JSP samples:

http://localhost:8080/JSP/index.htm

If the 'JSP subdirectory' name in your document root directory is in lowercase, enter the following URL when loading the JSP samples:

http://localhost:8080/jsp/index.htm

Note: On Windows NT, if the first letter of a directory/file name is in uppercase, then it means that the rest of the file name is also 'hard-coded' as uppercase.

2.4 Importing JSPs/Servlets generated by the IBM(R) Websphere(TM) Studio wizards

You can use the Version 3.5 development and unit test environment to work with code that is generated by the IBM WebSphere Studio wizards.

To work with database servlets generated by the IBM(R) WebSphere Studio database servlet wizard, perform the following steps:

  1. Create a project to contain your WebSphere Studio-generated code.
  2. Import the servlets into your project.
  3. Add this project to the Servlet Engine's project classpath.
  4. Ensure that the JDBC drivers (db2java.zip, if you are using DB2) are available either on the global IDE classpath or directly on Servlet Engine's classpath. (See the online help documentation for more details about this)
  5. Place the WebSphere Studio-generated .html and .jsp input, output, and error files in your document root See the online help documentation for more details about performing this task.
  6. Launch the WebSphere Test Environment Servlet Engine.
  7. In your Web browser, navigate to the HTML input page.

Important! You must place all the resources required by your servlets into the same directory. You must add that directory to Servlet Engine's classpath. It is recommend that you place these resources in the following directory, and add the directory to Servlet Engine's classpath:

IBMVJava35\ide\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\servlets\

where IBMVJava35 is the VisualAge for Java installation directory.

3.0 Limitations and known problems

3.1 "Class Not Found" error occurs when loading JSP files 

To run a class in VisualAge for Java that a JSP file is pointing to, the class must reside inside the IDE. You must add the project that contains the class to your Servlet Engine classpath.

Note: Classes can be contained within .jar files. In this case, the classpath must point to the .jar file itself.

3.2 Getting a "Cannot Load Page Compiled Class" error message in a browser

This problem could be caused by the following:

If you make a classpath property change and apply it BEFORE serving your first JSP page (that is, before the JSP Page Compile Generated Code project has been created), the preinstalled classpath reference will be removed. When you try to serve a JSP page (which will create the JSP Page Compile Generated Code project), the server does not know where to find the generated code, and consequently, will fail to get the compiled page. This causes a "Cannot load page compiled class" message in the browser.

If you get this exception after having changed the classpath, then you can workaround this problem by doing the following:

1. Shut down the WTE Servlet Engine.
2. Add the JSP Page Compile Generated Code project to the project classpath.
3. Restart the Servlet Engine.
4. Serve the JSP page again.

3.3 Getting exceptions reported in a browser after JSP files are changed

If you are getting repeated, unexpected exceptions reported in your browser after serving JSP files, you may need to force the page compile process to recreate new JSP-generated source, and then have the new version imported into VisualAge for Java. To do this, complete the following steps:

  1. Shut down Servlet Engine.
  2. Delete all the packages from the JSP Page Compile Generated Code project, but leave the project itself in
    the workspace.
  3. For the JSP 0.91 specification: Delete the entire directory, where the page compiler writes the generated
    source:

    IBMVJava35 \ide\project_resources\IBM WebSphere Test Environment\temp\default_app\pagecompile
    where IBMVJava35 is the VisualAge for Java installation directory.

    For the JSP 1.0 specification: Delete all of files and its subdirectory, where the page compiler writes the generated source:

    IBMVJava35 \ide\project_resources\IBM WebSphere Test Environment\temp\JSP1_0\default_app
    where IBMVJava35 is the VisualAge for Java installation directory.

    4. Restart Servlet Engine.
    5. Serve your JSP pages again. The newly generated code will then be imported.

3.4 Reverting to an older version of a JSP file

If you make a backup copy of a JSP file, and later need to revert to using this backup copy, you must update the JSP file's last modified time to the present time. To update the file's last modified time to the present time,
edit it and resave it.

3.5 Getting an "Java.io:ClassNotFoundDef error" exception when starting up Servlet Engine

Occasionally, Servlet Engine may throw the above exception upon startup. When this happens, the debugger opens. To work around this problem, close the debugger, close Servlet Engine, and then launch Servlet Engine again. WebSphere will correct the error. The correction will take effect the next time Servlet Engine is started up again.

3.6 Icons in the JSP Execution Monitor are not getting repainted

If you double-click the JSP Source tab in the JSP Execution Monitor, the JSP Source window detaches, and the icons in the JSP Execution Monitor do not get repainted. To workaround this problem, close the detached JSP Source window.

3.7 You cannot save JSP files in a directory whose name contains a "."

If you save a JSP file in such a directory (for example, "JSP1.0"), then the browser will show a compilation error. This is a limitation in the WebSphere Test Environment.

3.8 On Windows 2000, you may encounter problems loading the "Find the Leap Years" sample using the Internet Explorer browser

On Windows 2000, some versions of the Internet Explorer will automatically change the request URL from http://localhost:8080/... to http://local:8080/... When this occurs, the server is unable to find the requested file. If you experience this behavior, use the Netscape browser instead.

3.9 JSP 1.0 engine with the Load generated servlet externally option enabled may cause "Source not available"

When debugging (using the IDE debugger) a JSP file that uses the JSP 1.0 engine with the Load generated servlet externally option enabled, the IDE debugger source pane will display "Source not available" if the JSP file is directly under the document root (that is, the JSP file is not under a subdirectory of the document root).

To workaround the problem, add the JSP 1.0 cache directory to the debugging source path. The debugging source path can be set by:

  1. Select Window > Options.
  2. Select Coding > Debugging from the left pane.
  3. Select the Edit button and add the JSP 1.0 cache directory.
  4. The default JSP 1.0 cache directory is:

    <IBMVJava>/ide/project_resources/IBM WebSphere Test Environment/
    temp/JSP1_0/default_app


    where <IBMVJava> is your installation directory.

3.10 Imported package not found during compilation

In JSP 0.91 support, if a JSP file is using the import tag to import a package and the Retrieve syntax error information option is enabled, then the page compiler will indicate that the imported package is not found during compilation.

To work around the problem, create an empty directory that maps the package name under the directory

<IBMVJava>/ide/project_resources/IBM WebSphere Test Envrionment/temp/temp_dir

You must create the directory temp_dir if it is does not already exist.

For example, for a import package com.ibm.jsp, the directory

<IBMVJava>/ide/project_resources/IBM WebSphere Test Envrionment/temp/temp_dir/com/ibm/jsp

should be created.