Ask Your Question

Revision history [back]

This could happen if the session values are being set after the JSP page has already started rendering. In such cases, when the JSP page attempts to access the session value, it may not yet be available and will display as "null". However, on refreshing the page, the session values would have already been set and will now be visible.

To avoid this issue, session values should be set and retrieved in a consistent order, and the JSP page should be designed with this in mind. It is also a good practice to test the page thoroughly, including in scenarios where session values are unset or unset late in the page rendering process.