• Post Reply Bookmark Topic Watch Topic
  • New Topic

get context path from JSP  RSS feed

 
Anvar Sosnitski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, fellows,

I have, for example, a URL looking like this: http://localhost:8080/MySite

MySite is the name of the web application or the context path of the web application.

Which API or technique do I have to use to get the context path (the string "MySite"?

Many thanks,

Anvar.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Within a JSP 2.0 page:



within a JSP 1.x page:

 
Anvar Sosnitski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, this was exactly what I needed
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!