• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Tomcat PAth Problem

B

buntyindia

Guest
Hi!

This is my first post.

I am try to find out root Path/Path using the following JSP Program

But i am getting Value NULL . at Tomcat runned by PLest 7.5


Whereas at my local webserver it is working fine & giving me the path of my file...

Why i am getting NULL on my Website?

Why don't u upgrade TOMCAT & JAVA versions in your PLESK. Still it is version 4.1 but in market it is 5.5.12


Please HELP

<%@ page import = "java.io.*, java.util.*,java.net.URL,java.awt.*" %>
<HTML>
<head></head>
<body>

<%

// Read in the text file newsfile.txt
ServletContext context = getServletContext();



String file = (context.getRealPath("/news.txt"));
String filename = application.getRealPath("/news.txt");
out.println ("filename: " + filename);
out.println ("filename: " + file);
String docroot = getServletContext().getRealPath("");
out.println ("Root: " + docroot);

%>


</body>
</html>
 
you may need to add application permissions?

possibly you need to add permissions for your application. you may try adding to the file: /usr/share/tomcat4/conf/catalina.policy

Under the section commented WEB APPLICATION PERMISSIONS add an all permissions line inside the following
grant {
permission java.security.allPermission;

// Required....
...

you may want to research and be more specific on your permission granting if you have multiple users on the system.
 
thanks man.......

Is there any other way to read file using JSP....?

Bunty
 
Back
Top