• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot make a static reference to the non-static method setAttribute from the type JspContext

 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to access a attribute from the session scope in the JSP by
<%= PageContext.getAttribute("AccessSession",PageContext.SESSION_SCOPE) %>

The session attribute is set in a servlet and then forwarded the request to the JSP


But i am getting error as
An error occurred at line: 8 in the jsp file: /DifferentScopeAccess.jsp
Cannot make a static reference to the non-static method setAttribute(String, Object) from the type JspContext


Please guide me
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PageContext is a class, pageContext (with lower case p) is the instance of PageContext available to a JSP page...
 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I missed it .. thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic