aspose file tools*
The moose likes Servlets and the fly likes Servlet context in Tomcat Production server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet context in Tomcat Production server " Watch "Servlet context in Tomcat Production server " New topic
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: 61220
    
  66

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 61220
    
  66

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: 61220
    
  66

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().
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet context in Tomcat Production server