In my previous post I conveyed how to enable a folder in your Oracle application server to serve JSP's. In this post, I assume that you've already enabled your directory and have tested a jsp file successfully.
Normally you'd want to reference external functionality in your JSP files, like external classes packaged in JAR files.
Luckily, this is very easy. In your Jserv conf directory (Jserv is to allow apache to load Java files like jsp and java servlets), which will normally be in the <Oracle_Home>\Apache\Jserv\conf, you'll find a jserv.properties file.
Open this properties file and include a wrapper.classpath statement in order to allow the apache service to find and load the .jar file and it's contained classes:
wrapper.classpath=<ThePathToYourJARFile>
You can then use the packaged classes in your JSP pages/Java servlets after you've referenced the correct packages.
If you ever want to develop jsp files which will be called direclty in your Oracle HTTP server (apache), meaning it will not be called as a portlet, this is the easy way to configure it:
Create a folder in the \portal directory, the folder name for our example will be custom.
Edit httpd.conf file in the \apache\apache\conf folder and ensure that the following entry is there (normally you can just uncomment it):
include \apache\jserv\conf\jserv.conf
This ensures that the JServ config file is included when the apache http server is started up. Jserv is used to enable apache to parse jsp files and java servlets.
We will also need to configure apache to be aware and load your application's directory, which we created as \portal\custom. We'll achieve this by adding the follwing to the same conf file:
Alias /custom/ “\portal\custom/”
\portal\custom/”>
Order Allow, Deny
Allow from All
What I normally do after changing anything is restart the apache instance:
\apache\apache\apache -k restart