Forums Register Login

Synchronization issue in Jsp

+Pie Number of slices to send: Send
Hi all,

I have a jsp pagewhere I have used an useBean for instantiation of a bean in session scope.
Now the problem is that sometimes this page is giving NullPointerException when multiple user or may be first time hitting this page.
In compiled java file of this jsp there is a synchronized block(synchronized(session)) where the instantiation is occuring.

So I am confused what is happening as because the requests will wait untill instantiation ,so no question of "Null".Please help.



+Pie Number of slices to send: Send
You have created the obj1 using bean and set that in session.
How do the scriplet know "what is obj1"

sometimes this page is giving NullPointerException


Is it sometimes or always ??
+Pie Number of slices to send: Send
ya. It is added as an attribute in session scope.That part is ok.
An coming to your next question it happens sometimes.

Even after 1/2 tries it runs smoother when it gives error.
Water proof donuts! Eat them while reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2300 times.
Similar Threads
Dynamic form/checkbox problem
While click on button action is not reach in LoginAction class
how to print values on jsp page fetched from servlet
Need help with JSTL: setting end attribute dynamically of "substring" tag
Jboss 5.1.0 jsp:root not working
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 20:34:13.