• 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

getContextpath + getServletpath + getPathinfo

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

getContextpath + getServletpath + getPathinfo

can i get any document/source/link/post where i can get good explaination for them with different type of examples.

I am afraid, i am not getting this concept at all. bit scared about missing this question in exam

Regards,
Ravi
 
Ranch Hand
Posts: 246
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from some online mock exam.....

/myapp getContextPath
/account getServletPath
/* getPathInfo

General Comments
A URI is composed of three parts: contextpath + servletpath + pathinfo
All the three parts start with a /. Context path is the part that is mapped to the webapplication. It is returned by getContextPath() method of HttpServletRequest. Servlet Path is the part that causes the servlet to be invoked. Here, /account/* is mapped to the servlet. Therefore, out of /account/*, only the /account part matches the mapping (Note: a * in the URI does not work as a wild card character. It is treated just as any other character) and thus causes the servlet to be invoked. Hence, /account is the servletpath, which is returned by getServletPath() method of HttpServletRequest. Rest of the uri, /*, is the Path Info, which is returned by getPathInfo() method of HttpServletRequest.

Thanks, Naveen.
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the explaination from Enthuware, anyways thanks for your information.
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic