Adding content to a JSP project

JavaServer Page (JSP) projects include web applications built on JavaServer Pages.

About this task

To scan JSP projects successfully, the JavaServer Pages must be in a valid web application structure. This section describes the file structure under the web context root required for a successful scan. You should be familiar with the web application structure before configuring your JSP projects.

A web application deployed into a web application server, such as Tomcat, requires a standard directory structure. The deployed application can be a set of files arranged in a directory structure or a WAR file. In the case of a WAR file, the directory structure is contained in the ZIP file, with web context root as the root of the directory structure.

Beneath a web context root, you find the following standard directories:

Table 1. Web context root directories
<web-context-root>\
	WEB-INF\
		classes\
Java™ class files arranged in directories (packages)
		lib\
Jar files added to the class path
		web.xml
web.xml describes resources available to the application

Other directories contain necessary files that may also exist. For example, you often see a directory for the content (JSP and HTML files), and for tag libraries:

Table 2. Other directories
<web-context-root>\
		jsp\
Contains JavaServer Pages in the application
		WEB-INF\
			tld\
Contains tag libraries used in the application

In addition to these standard web application directories, a web application server can have special directories where it expects to find class files and JAR files shared by all deployed web applications. For example, Tomcat 7 places these JAR files in the common\lib or common\endorsed directories. The location of these nonstandard directories is specific to each application server.

Important: Before scanning JavaServer Pages, confirm that all necessary files exist in the web context root. AppScan® Source for Analysis only scans JavaServer Pages in the web context root.

Procedure

  1. Copy the files, if necessary, to the appropriate location under the web context root.
  2. Specify the web context root as either the directory or a WAR file containing all of the JavaServer Pages.
  3. Be certain that the class path includes the JAR or class file directories.
  4. Configure the project properties.

Results

AppScan Source for Analysis adds the WEB-INF\classes directory and all JAR files in WEB-INF\lib to the class path, for JSP only. You can add items that are not included in the Web-INF path, but that are necessary to compile the JSP. These JAR files are similar to weblogic.jar or a vendor JAR file placed in the common directory for an application server.

JSP sources are the JavaServer Pages under the web context root that you want to scan. The source files are relative to the web context root. You are limited to the set of files within the web context root when specifying the JSP sources.

JSP project sources consist of the directories in which you find the project files and any additional individual files to include in the project.

  • Specify the subset of the JavaServer Pages in the web context root. If this is not done, all files will scan.
  • If the JavaServer Pages depend on Java code, you must specify these sources.
  • JSP files include jsp and jspx files.