title: Javascript and scriptlet : can it be done?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5158400/how-to-use-scriptlet-inside-javascript">How to use scriptlet inside javascript</a>  </p>
  </blockquote>
  
  
  
  <pre><code>&lt;%
  if(request.getAttribute("exception")!=null){%&gt;
  
  &lt;script type="text/javascript" &gt;
      alert("hi");
  
      parent.error.document.open();
      parent.error.document.write("bye");
      parent.error.document.write(&lt;%=request.getAttribute("exception").toString()%&gt;);
      parent.error.document.close();
  
  &lt;/script&gt;
  &lt;/form&gt;
  
  
  
  
  &lt;%}%&gt;
  </code></pre>
  
  <p>Is it possible to have this sort of code? Is there any alternative?</p>