1

In my understanding the method findAttribute(String) of the class PageContext searches for findings in all scopes (Session, Request, Pagecontext..).

Is that really so?

I have a JSP with the following code

String foo = request.getParameter("foo"); %>
<%= pageContext.findAttribute("foo") %> -- <%= foo %> -- ${foo}

So in my understanding if I previously set the requests parameter foo to anything like boo and the session and pagecontext is clean, all 3 outputs would deliver boo.

But in my case only the output in the middle says boo. <%= pageContext.findAttribute("foo") %> and ${foo} have no o

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Gundon
  • 2,081
  • 6
  • 28
  • 46
  • How exactly is "parameter" the same as "attribute"? They have different wording, right? Wouldn't that mean that they have a different meaning? In any way, put your mouse above the `[el]` tag which you've put below the question and click the *info* link in the popbox. – BalusC Mar 05 '12 at 18:12

1 Answers1

2

pageContext.findAttribute will retrieve attributes which are different than parameters.

See Difference between getAttribute() and getParameter() for more details.

Community
  • 1
  • 1
Zack Macomber
  • 6,682
  • 14
  • 57
  • 104