• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in EL's sequence

 
Kidd He
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell me why the output form the code below is:
attribute1:First Value
attribute2:Second Value
attribute3:Third Value
Source of "repeated" attribut:Request



 
Kidd He
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just want to know if I put three attribute with the the name "attr" respectively in the request, session, servletcontext, how can I output all of them using EL in the JSP.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${pageScope.attr}, ${requestScope.attr}, ${sessionScope.attr}, ${applicationScope.attr}
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

While you have got the answer for your second question, let me answer your first question.

${attribute1} uses findAttribute() by default. Thus it first searches for a variable named 'attribute1' in page scope, followed by request, session and application scopes.

That is why values get printed in that manner.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic