Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getContextPath  RSS feed

 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using JDK5.0, Tomcat5.5. But when I used this statemnt :

public void init(ServletConfig config) throws ServletException {
...
cp = config.getServletContext().getContextPath();
...

It is said that there was no function named "getContextPath()" ???

Please help me , thanks very much
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method was added in Servlets 2.5, Tomcat 5.5 supports Servlets 2.4
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David O'Meara very much
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!