How to get servlet context or similar object in Struts
Dhiren Joshi
Ranch Hand
Joined: Dec 09, 2003
Posts: 463
posted
0
I need handle to ServletContext becuase I need the access to this method . getRealPath() in servlet context. Can any one tell me how I could get this using Struts in my Action classes.
Well, I have never used the getRealPath(String) method, but I have used other methods of ServletContext from our Action classes (execute method) using that construct.
Remember, that was for struts 1.1. You'll need to make sure you can do this for whatever version you are using.
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: How to get servlet context or similar object in Struts