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

Doubt regarding use of beans and JSP tags inside JavaScript  RSS feed

 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I am using a jsp page in which the user is presented with a list of options. upon selecting an option, another set of sub options is shown (this is done by retrieving a list from the server).

I hope to do this by using a javascript function to determine the selected option and pass it on to a bean, which will retrieve a list from the server. From this list i want to dynamically add option buttons to each and every item in the list.

I want to know if <jsp:usebean> can be used inside javascript and if yes, please help me out with it

Thanks to all in advance
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know if <jsp:usebean> can be used inside javascript

No. jsp:useBean is server-side, so you won't access it via Javascript.
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is there an alternate way to display radio buttons on the client side based on the list retrieved from the server
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well could someone tell me if there's any other way to do this thing. I mean how else can i dynamically display the radio buttons for the list retrieved from the server???
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why dont you do with simple scriptlets with if conditions or <c:if> tag? I think that should do!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,
JSTL provides both looping and conditional tags.
These can be (along with EL's tertiary operator) make it easy to either not write the source for your radio button tags or to toggle the visibility or display properties.

Why don't you show us what you've got so far and maybe someone can suggest the best approach for what you're doing.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!