Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to supply jsp variable to Javascript function  RSS feed

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I have developed jsp file which contains javascript as below.


One.jsp[/b]




1. Initially i have called the above jsp, So there is no session value. then writeRichText('rte1', '', 380, 100, true, false) called successfully, I got output. Suppose if it will redirect to another page, in that page session is set some value(i have written code to set session scope in another jsp page) then redirect to One.jsp file. At this movement we have session scope value. So obviously if condition is true. But writeRichText('rte1', '<%=str_htmlValue1%>', 380, 100, true, false) is not called.

Please tell me the reason & give solution for this problem.



Thanks inadvance.
Satyaprasad
 
Ranch Hand
Posts: 307
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Poor practice to write Java code in JSPs, everything you are doing you can do it with JSTL tags.

I don't know if it is obvious that second time you have the attribute in the session, have you debug it to check that you actually have it? What's the generated html you get for that piece of page?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!