wood burning stoves 2.0*
The moose likes JSP and the fly likes Problem while reading variable from application context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem while reading variable from application context" Watch "Problem while reading variable from application context" New topic
Author

Problem while reading variable from application context

Brij Garg
Ranch Hand

Joined: Apr 29, 2008
Posts: 234
jsp code is given below


In the above code image tag is taking src="GetImage"
GetImage is a servlet which is returning an image after compressing the image in out stream. I am setting one variable at application level to read that variable in the jsp.
Code snipet is given

When I run this code first time, value of message in jsp is "null". Why It is so? Since I am setting the message at application level, I think even for this first time, I should get the message in my jsp.

Can somebody suggest some reason for this behavour?

Thanks
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

Which executes first? (the jsp or the code setting the message value)


S.D. MADHAN
Not many get the right opportunity !
 
jQuery in Action, 2nd edition
 
subject: Problem while reading variable from application context
 
Similar Threads
JSTL: remove object from scope
The attribute directive in tag files.
request.getAttribute is null!
Unable to pass variable to java method from jsp
problem with Simple captcha implementation for sub folders directory