How to set global variable in Tomcat 5.5.17

2007-03-06 Thread Kathy Lo

Hi,

I setup Tomcat 5.5.17 in Linux Fedora Core 4 and develop a Web
Application under /webapps directory.

I have so many configuration files that need to be loaded into my web
application. These configuration files are in a self-defined format
and I wrote some Java classes to parse these configuration files and
save the parsing result in a linked list (java.util.List or
java.util.Map). These configuration files are static (not change).

In my web application, when a user session created, I call these Java
classes to parse these configuration files and save the linked lists
into the session. So, every user sessions contain the same set of
linked list and, as a result, it reads these files every time when
session created (so many I/O access, if many session created as the
same time, it will slow down the server).

Now, I want to save these linked lists as a global variables in Tomcat
so that each JSP and Servlet can access these global variables and
reduce I/O access and memory usage.

So, would you please tell me how to set global variables in Tomcat and
initialize them using the Java classes that I wrote.

Thanks

--
Kathy Lo

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Urgent! Compile JSP Problem

2006-08-14 Thread Kathy Lo

Dear,

I encounter a strange problem.

I developed a web application using tomcat 5.5.17 and jdk-1.5.0_06 in
Linux Fedora Core 4.

I wrote some JSP files in the following directory structure

/usr/apache-tomcat-5.5.17/webapps/test/index.jsp
/usr/apache-tomcat-5.5.17/webapps/test/error/get_ref_fail.jsp
/usr/apache-tomcat-5.5.17/webapps/test/ok/gen_file_ok.jsp

In all of these JSP file, i imported utils.* package and use
UserSession class inside this package.

utils package is located in the following directory

/usr/apache-tomcat-5.5.17/webapps/test/WEB-INF/classes/utils/UserSession.class

And, i edit server.xml to set the URL of this web application as following

Context path= docBase=/usr/apache-tomcat-5.5.17/webapps/test
workDir=/usr/apache-tomcat-5.5.17/webapps/test/work reloadable=yes
/

When I load the web application, index.jsp can be compiled and loaded
correctly. When I load get_ref_fail.jsp using the following URL

www.abc.org/error/get_ref_fail.jsp, or, www.abc.org/ok/gen_file_ok.jsp

Unable to compile JSP error occurred and the server reported that it
cannot resolve UserSession class.

This problem is only occurred when I load JSP from /error or /ok
subdirectory. When I load JSP from root directory (i.e.
/usr/apache-tomcat-5.5.17/webapps/test), this problem disappear.

How I can solve this problem?

Please help me!

--
Kathy Lo

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]