Try by placing complete thing in out.println("<script language=\"javascript\"/>). Also try by getting an instance of JSPWriter in the class and use it for writing the script code.
<mild-rant>Why schools insist on teaching stupid things like this is beyond me. When I was teaching, I always made sure that good industry practices were emphasized.</mild-rant>
Step 1: Look at what's delivered to the browser by doing a View Source. Is it correct? Is it well-formed? Are there syntax errors?
Step 2: If so, use the browser's JavaScript debugger to see if the script is running or throwing errors.
In the future please let us know when a question is a school assignment that has strict requirements. Otherwise, time is wasted trying to find out why you are trying to do things the wrong way.
Bear Bibeault wrote:In the future please let us know when a question is a school assignment that has strict requirements. Otherwise, time is wasted trying to find out why you are trying to do things the wrong way.