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

Discussion in 'Java' started by Edward, Apr 3, 2006.

  1. Edward

    Edward Guest

    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
     
    Edward, Apr 3, 2006
    #1
    1. Advertising

  2. Edward

    ge0rge Guest

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

    Edward wrote:
    > 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.

    --
    Alimony is a system by which, when two people make a mistake, one of
    them keeps paying for it.
    -- Peggy Joyce
     
    ge0rge, Apr 3, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Taylor

    JSP include and expression language

    Jeff Taylor, Apr 6, 2004, in forum: Java
    Replies:
    0
    Views:
    581
    Jeff Taylor
    Apr 6, 2004
  2. Replies:
    1
    Views:
    942
    Chris Smith
    Jun 9, 2005
  3. David

    Expression Language in JSP

    David, Sep 13, 2005, in forum: Java
    Replies:
    1
    Views:
    2,745
    David
    Sep 26, 2005
  4. Replies:
    6
    Views:
    6,101
  5. Lord0
    Replies:
    0
    Views:
    1,089
    Lord0
    Jan 15, 2007
Loading...

Share This Page