Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

got confused with requstscope and param

 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody please explain me.. what is requestscope and what is param .. and when parameters will go to requestscope..when Should we excess values from requestscope and when from param..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parameters are submissions to the request. They can either be fields from a form, or data on the query string. Parameters have nothing to do with request scope.

Scoped variables are Java objects placed in a scoped context (such as request scope) by code using the setAttribute() method of the scoped contexts.
[ August 01, 2007: Message edited by: Bear Bibeault ]
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this means if I am passing some parameters to include page soemthing like this --

<jsp:include page="elements/comments_display_inc.jsp">
<jsp:param name="url" value="deal_journal.jsp"/>
<jsp:param name="dealDescriptionId" value="${param['dealDescriptionId']}"/>
<jsp:param name="entityType" value="Deal"/>
<jsp:param name="entityCode" value="${resolver['/util/paramHash'].dealId}"/>

</jsp:include>

then i can't access entityType, entityCode and others usinf requestscope.. I should use param only...
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct, those would be parameters (just the same as if they were part of the query string). Which, I believe, is how jsp:param is implemented in Tomcat.




[BONK]
[ August 01, 2007: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. Parameters have nothing to do with request scope.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for confirmation..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic