Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference in getQueryString and retRequestURI()?  RSS feed

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me
whats the difference between getQueryString and getRequestURI()?

Thanks in advancd
 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you have a look at the documentation of getRequestURI() and getQueryString()??
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say you have a link on your JSP page/menu and on clicking this url is called

http://localhost:7281/myapplication.do?dispatch=goToEmpPage&deptId=12

then If you do request.getQueryString(); result should be:
dispatch=goToEmpPage&deptId=12

and If you do request.getRequestURI(); in the JSP result should be:
/jsp/common/main.jsp

The page uri from where the link was clicked.

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:Did you have a look at the documentation of getRequestURI() and getQueryString()??



No .

Thanks a lot Anurag Blore.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!