JSP problem: <script language="JavaScript"> '<%=expression%>' </script>

E

Edward

Is it possible to use the JSP expression tags <%= %> within <script>
</script> tags?

I'm trying to embed a JavaScript wysiwyg text editor into a JSP, I need it
to be populated with form data - hence the expresion within the script tags.

Your assistance is appreciated!

Edward
 
G

ge0rge

Edward said:
Is it possible to use the JSP expression tags <%= %> within <script>
</script> tags?

I believe you can. Think of the sequence -
On the server side, the JSP engine kicks in and processes all the JSP
tags and ignores all the html tags including the <script> tag. It will
however process the JSP tags wherever they are.
What then gets sent to the client is the data stream contaning the html
tags and javascript.
The client browser picks up the data stream and executes the javascript
and renders the web page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top