質問

<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?

役に立ちましたか?

解決

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()%>";

他のヒント

@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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top