JSP - Scope attribute name same as EL implicit object -
JSP - Scope attribute name same as EL implicit object -
can please explain me behavior ? setting request attribute in servlet , reading in jsp .
1) dispatcher servlet code :
request.setattribute("somename", someobject);
naturally , can read in jsp ${somename}
2) if set attribute name same el implicit object name, like
request.setattribute("requestscope", someobject);
then have read ${requestscope.requestscope}
!
why container able map attribute in case#1 straight in case attribute name el implicit object name need nest reference ${requestscope.requestscope}
?
el first check if given variable name 1 of reserved (implicit) variable names , utilize per specification. if not, in ${somename}
, el automatically search attribute name in respectively page, request, session , application scope.
you seem expect works other way round, i.e. first attribute , implicit objects. not true. otherwise break working of implicit el objects.
jsp el
Comments
Post a Comment