Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet or path info confusion.

 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
in my web.xml i have a mapping for "/*" and suppose my app name is "APP" and i gave a request li.. http.. /APP/ so in this case..

Context path is APP i got this..
Servlet Path .. is ???
Path Info.... is ???

can some body pelase calrify this..!!!
 
Surajsingh Thakur
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friend...
lets take your URL to be..
http://www.helloworld.com/APP/resourses/hi.jsp

1: Context Path = /APP
2: Servlet Path = /resourses <because only /* and no specific path given>
3: Path Info = /hi.jsp
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suraj.. tanks for the info.. and what if the url has additional info like..
http://www.helloworld.com/APP/resourses/hi.jsp?par1=name&par2=job

in this case does the patinfo includes those parameters alsoo??
 
Surajsingh Thakur
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i dont think it will have parameters...
Path Info remains d same...
 
Sargunan Rswamy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Surajsingh Thakur:
Well i dont think it will have parameters...
Path Info remains d same...


http://www.helloworld.com/APP/resourses/hi.jsp?par1=name&par2=job

Request_URI = Context_Path+Servlet_Path+Path_Info+Query_String

Context Path : APP -->HttpServletRequest.getContextPath()
Servlet Path : resources -->HttpServletRequest.getServletPath()
path info : hi.jsp -->HttpServletRequest.getPathInfo()
Query String : par1=name&par2=job-->HttpServletRequest.getQueryString()





Sargunan
 
Surajsingh Thakur
Ranch Hand
Posts: 124
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Sargunan is perfectly right..
Only missing think is '/' before ever thing...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic