• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting implicit object

 
Harshana Dias
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

We have pageContext object which is reference to all other JSP implicit object right? So its like in PageContext class methods like getRequest(), getServletConfig(),getSession() etc use for access other implicit objects right?

But in EL implicit object also this same pageContext available know..so in there if we want to access a request property which we have to go through pageContext right?

my problem is i saw this in HFSJ,

so instead shouldnt it be,


or i saw static field REQUEST,

public static final String REQUEST
Name used to store ServletRequest in PageContext name table.

so it should be not ?

Thank You.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Harshana Dias wrote:so instead shouldnt it be,


What would make you say that? Where else have you seen getters being called that way in the EL? Answer: you haven't.

Why would accessing properties of the pageContext be different from accessing properties of any other bean?
 
Harshana Dias
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What would make you say that? Where else have you seen getters being called that way in the EL? Answer: you haven't.


well since the pageContext object has getRequest() method this should be right..isnt it?

Why would accessing properties of the pageContext be different from accessing properties of any other bean?


i didnt get what you said here..
any way, if we want to access a property of a request we should first get the request object know?
by the way this pageContext in JSP and EL both refer to same object right?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you already know the EL? If you learn about it you will see that in order to obtain properties, you simply reference the property, not the property's getter.

For example, if a bean referenced by scoped variable xyz had a getWhatever() method, the whatever property would be otained via;

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic