Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

different betwen pageContext and application in jsp  RSS feed

 
sam liya
Ranch Hand
Posts: 1271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<% pageContext.setAttribute("var", 2); %>

<% application.setAttribute("var", 2); %>

what is the different betwen above to statement in jsp?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66201
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets. For more information, please read this.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66201
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aruna sameera wrote:what is the different betwen above to statement in jsp?

Exactly what they say: one sets the scoped variable in page context, the other in application context.

And the usual caveat: Java scriptlets in modern JSPs are a no-no.
 
sam liya
Ranch Hand
Posts: 1271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
h hs
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Fluff removed]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66201
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"h hs", please check your private messages for an important administrative matter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!