Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-06-2009, 06:48 PM
Member
 
Join Date: Jan 2009
Posts: 1
Rep Power: 0
tman563 is on a distinguished road
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 07:01 PM.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 02-17-2009, 03:59 PM
Member
 
Join Date: Feb 2009
Location: Delhi
Posts: 62
Rep Power: 0
neeraj.singh is on a distinguished road
Default
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
thanks
/\/
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding <br> html tag to string newbieal New To Java 7 10-14-2008 03:51 PM
How can I include a html file in html textarea? surya_dks New To Java 2 10-04-2008 08:20 AM
How to make Java see a string as html matpj Java Applets 4 09-26-2008 04:40 AM
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String) baltimore New To Java 2 09-18-2008 08:30 AM
Using java.util.Scanner to search for a String in a String Java Tip Java Tips 0 11-20-2007 05:59 PM


All times are GMT +2. The time now is 07:24 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org