| Author |
Servlet context in Tomcat Production server
|
bhaskarvignesh chandra sekaran
Greenhorn
Joined: Jun 27, 2009
Posts: 17
|
|
hi,
i have hosted a web application in Tomcat using Jsp/servlet. My problem is am not able to access the ServletContext path. My jsp code is
My guess is that they have deployed my context app in a folder other than tomcat/web-app
how to access the my context
Please help
|
SCJP, SCWCD,preparing for SCDJWS
View my facebook profile
http://www.facebook.com/bhaskarvignesh
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56193
|
|
Did you give the web app a display name in the deployment descriptor?
What would this have to do with where the app was deployed?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
bhaskarvignesh chandra sekaran
Greenhorn
Joined: Jun 27, 2009
Posts: 17
|
|
I got the solution , with the below code
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56193
|
|
|
What on Earth does that have to do with your original question?
|
 |
bhaskarvignesh chandra sekaran
Greenhorn
Joined: Jun 27, 2009
Posts: 17
|
|
how to access the my context
What on Earth does that have to do with your original question?
The thing on Earth is that , Since i got access to my context, am able to create directories and upload files in them in my actual web-hosting space provided.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56193
|
|
That certainly is a disconnect from your first post which asked about the web app display name, not the context path.
In any case, what you've got coded won't work in the general case. It will only work when the context path coincides with the file path of the web app, which is often not the case in production.
Rather, you should investigate getRealPath().
|
 |
 |
|
|
subject: Servlet context in Tomcat Production server
|
|
|