Pregunta

<bean:write name="<%=(String) currentItr.next()%>" property="<%=(String) currentItr.next()%>"/>

The above code prints the values aka : Nicholas...$100000...45....Actor

How can i assgin Nicholas to a javascript variable?

I tried

var audition = <%=(String) currentItr.next()%>.<%=(String) currentItr.next()%>;

and it prints out the column header like so : Name...Salary...Age...Occupation

what am i doing wrong?

¿Fue útil?

Solución

You should try this , if you are assigning string value then use ' ' or " " . For Number value what you wrote was correct .

var audition = "<%=(String) currentItr.next()%>.<%=(String) currentItr.next()%>";

Otros consejos

@LandLane Why don't you set this scriptlet value into hidden text box, and call the value from JS. How do you calling the javascript from java? If you are using logic:iterate tag means there may be n number of values like nicholas. Post your code, unless nobody can't diagnose it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top