You can publish Java Server Pages on your CCSE Web Page. You just have to put your JSPs inside your public_html directory of your CCSE Unix Home Directory. Your Java Server Pages will be viewable through your usual CCSE web page URL, for example, http://www.ccse.kfupm.edu.sa/UnixUserName/. You will also have to put your WEB-INF directory inside your public_html directory. WEB-INF directory is the standard directory for Tomcat web applications for putting Java beans class files, applications local settings (web.xml) and other Java libraries used by the application. If you are not familiar with the format of deploying Web applications on Tomcat, then visit Tomcat's home page at http://jakarta.apache.org/tomcat/
Steps to Publish/Update JSP:
Following is the summary of steps for publishing JSPs on your CCSE Website:
- Create WEB-INF directory inside your public_html directory . You can follow the following command sequence by logging-in to any CCSE Unix machine (for example: linux-lab1, remote1, sunfire1 etc.):
% cd public_html
% mkdir WEB-INF
% cd WEB-INF
% mkdir classes
% mkdir lib
% cd ..
% chmod -R 755 WEB-INF
- An alternative approach is to develop your JSP based web application on your own PC and then upload it to your public_html directory (see here ) for instructions on uploading files to public_html). You have to make sure that your WEB-INF directory must be directly under your public_html directory and not inside any of its subdirectories. We recommend you to use Tomcat version 5.00 or above for developing.
- Put your JSPs inside your public_html directory. You can put your JSPs any where inside your public_html directory. Make sure that you don't use any absolute paths inside your JSP pages.
- Put your Java Beans class files inside WEB-INF/classes directory. After Tomcat version 5.00, you cannot use package-less classes. You have to define all your Java Beans class files inside packages. In other words, you cannot place .class files directly inside WEB-INF/classes directory. For example, the Simple Form example below uses a Java Bean named SimpleBean.class. It has been defined inside the package simplebean. So the path to the SimpleBean is WEB-INF/classes/simplebean/SimpleBean.class. If we put SimpleBean.class directory under WEB-INF/classes, Tomcat-5.00 cannot access it.
- Put any Java libraries (in JAR format) inside WEB-INF/lib directory. Any Java libraries that your application need to use have to be put inside WEB-INF/lib directory. All these libraries must be in JAR format.
- Make all your JSP pages and WEB-INF directory World-Readable. The simplest way to make your JSP pages and WEB-INF directory World-Readable is to change the permissions of everything inside your public_html directory as follows: % chmod -R 755 public_html
- Now you can view your Java Server Pages through your usual CCSE web page URL, for example, http://www.ccse.kfupm.edu.sa/YourUnixUserName/.
Using Databases with JSP:
You can connect to a database from your Java Server Pages. Unfortunately, Microsoft Access databases cannot be accessed from the JSP pages on CCSE Web Server, as it is Unix based. If you want to use a database from your JSPs, then we recommend you to use MySQL or ORACLE database systems available in CCSE. You can get account and table space on CCSE database server (for Oracle and SQL Server) by contacting Mr Garba Yau, in building 22, room 336-2. For getting account on MYSQL server, contact firstname.lastname@example.org .