Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSP Session in JavaScript variable problem

843840Nov 17 2007 — edited Nov 18 2007
Hi,


I have a session variable msgSize that is being set by a Java file in the session.
aRequest.getSession().setAttribute("msgSize", msgSize);
It's value is variable depends on record count of recordset.


In JSP page where I have to assign it's value to a javascript variable. I am doing this a s follows. I have done this in the JSP file.
<script type="text/javascript" >
<!--
function getVal()
{
 m=${msgSize};
}
-->
</script>
First Problem is I am unable to get this value inside a External JS file. It throws error but inside jsp it is working. How can i use this inside External JS?

Second problem is once the above code executed value never refreshed to new value?
Means first time it executed it get value 200 next time again i executed the code the real recordset is 105 but still displaying 200. But when I restart the server next time it takes value 105 by itself....

How I tackle this problem.?


Regards,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2007
Added on Nov 17 2007
2 comments
203 views