Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Servlet Context and Struts - Action class  RSS feed

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!