Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigning Java variable to javascript variable.  RSS feed

 
pawan chopra
Ranch Hand
Posts: 417
jQuery Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a list of objects. I am getting that list in jsp using request object.I want to fetch object from java list object then get a value from that object and assign it to a javascript variable. Is it possible? I have tried following code but Its not working. Also If it is possible how much time it will take if list size is 1500?


 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pawan,

I have tried following code but Its not working


is useless and doesn't provide any clue to anybody here.

Check your HTML generated by the code ( View source of web browser) and see if you could figure it out.

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this





scriptlet in jsp is discourage . set the value into anyscope on servlet . and use EL to read that . Here i use String "Hai"
for example .

Hope this helps
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you are trying to do is possible but not recommended. As seetharaman has told you, try to use EL
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When debugging servlet/jsp/javascript applications it is helpful to use a browser such as FireFox with plugins which let you see EXACTLY what the browser request is actually getting and the JavaScript structures being created.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!