Results 1 to 2 of 2
  1. #1
    tman563 is offline Member
    Join Date
    Jan 2009
    Rep Power

    Default Java String to html var

    So i have a scriptlet that does some stuff and ends with a String called results. Within the scriptlet I do

    session.setAttribute("result", results);

    I need to access the String results outside of the scriptlet, to perform some action in the html portion of the page with it. So after the scriptlet I have

    var word = '<% session.getAttribute("result"); %>'

    This however gives me a blank string or undefined, I tested doing alert(word). I have also tried some of the following

    var word = '<% StringFormat.toHTMLString((String) session.getAttribute("result")); %>'
    var word = '<%= with session.get and stringformat.toHTML %>'

    I guess the problem is the formating difference from java string to html's var format. How do I do this?
    Last edited by tman563; 01-06-2009 at 06:01 PM.

  2. #2
    neeraj.singh is offline Member
    Join Date
    Feb 2009
    Rep Power


    what you exactly want to do?
    you want to put the java var value to a html form var value? or what?

    please clear your query

Similar Threads

  1. adding <br> html tag to string
    By newbieal in forum New To Java
    Replies: 7
    Last Post: 10-14-2008, 02:51 PM
  2. How can I include a html file in html textarea?
    By surya_dks in forum New To Java
    Replies: 2
    Last Post: 10-04-2008, 07:20 AM
  3. How to make Java see a string as html
    By matpj in forum Java Applets
    Replies: 4
    Last Post: 09-26-2008, 03:40 AM
  4. Replies: 2
    Last Post: 09-18-2008, 07:30 AM
  5. Replies: 0
    Last Post: 11-20-2007, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts