aspose file tools
The moose likes Struts and the fly likes Servlet Context and  Struts - Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Servlet Context and  Struts - Action class" Watch "Servlet Context and  Struts - Action class" New topic
Author

Servlet Context and Struts - Action class

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Hi All,

I am trying to obtain the complete path to the web server and servlet so I can write to the file system. In the past I have done this from a servlet. However, I am now using struts and wanting to seperate logic so I am passing to my bean the path where it can save the files to.

My question is how do I the server path and servlet path information when using the Struts Action class so I can write to the local file system.

Thank you david
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
You can use the same method you're used to with servlets by invoking Action.getServlet() which will return an ActionServlet - a descendant of HttpServlet.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Servlet Context and Struts - Action class
 
Similar Threads
Struts-Tiles Reloading Problem
Writing a log file for my servlet
Stopping unauthorized access of files on the server
Deploying WAR file on Tomcat
Problem running a struts 1.1 tutorial