Help required with Tomcat

H

Huzefa

I am making a small demo website using JSP. I am running Tomcat 5.0.27
Users login to the site and their personal data is displayed.
For this purpose I created an XML file to hold user data.
However, the file is not being read.
I have tried to put the file everywhere, in the WEB-INF directory,
in the classes directory (in the package directory), and also in the
application folder. However, all i get is a 404 message from Tomcat.

When i added a try block to the code, it threw a JspException again
stating the same thing.

Where do I put this file so that it can be read by the JSP code?

Any help would be appreciated.

Thanx

Huzefa Khalil
 
B

Bryce

I am making a small demo website using JSP. I am running Tomcat 5.0.27
Users login to the site and their personal data is displayed.
For this purpose I created an XML file to hold user data.
However, the file is not being read.
I have tried to put the file everywhere, in the WEB-INF directory,
in the classes directory (in the package directory), and also in the
application folder. However, all i get is a 404 message from Tomcat.

When i added a try block to the code, it threw a JspException again
stating the same thing.

Where do I put this file so that it can be read by the JSP code?

It is difficult to determine without knowing exactly what you tried.
Tomcat comes with an example using an XML file for users. Both the
admin and manager web apps use the file <Tomcat
Dir>/conf/tomcat-users.xml file.

Those app's contexts are located in <TOMCAT DIR>/webapps

They are deployed at <TOMCAT DIR>/server/webapps. Check out the
context files and the web.xml to see what they do.
 
S

Shanmuhanathan T

I am making a small demo website using JSP. I am running Tomcat 5.0.27
Users login to the site and their personal data is displayed.
For this purpose I created an XML file to hold user data.
However, the file is not being read.
I have tried to put the file everywhere, in the WEB-INF directory,
in the classes directory (in the package directory), and also in the
application folder. However, all i get is a 404 message from Tomcat.

When i added a try block to the code, it threw a JspException again
stating the same thing.

Where do I put this file so that it can be read by the JSP code?

Any help would be appreciated.

Thanx

Huzefa Khalil

You can put xyz.xml in WEB-INF, and read it using
URL url =
ClassLoader.getSystemClassLoader().getResource("xyz.xml");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top