• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet context in Tomcat Production server

 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
bhaskarvignesh chandra sekaran
Greenhorn
Posts: 17
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the solution , with the below code

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What on Earth does that have to do with your original question?
 
bhaskarvignesh chandra sekaran
Greenhorn
Posts: 17
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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().
 
reply
    Bookmark Topic Watch Topic
  • New Topic