views:

270

answers:

0

Hi I have a Spring sample application. In the controller,I'm having a ModelMap map = new ModelMap(); map.put("samplebean", sampleBean);

Where samplebean is a bean .

I have a tag which has an attribute name. and the name is actually the bean name. In jsp if I access alert('${samplebean.value}'), then it alerts the correct value. But this samplebean here in alert i'm hardcoding. I want to take it from the attribute of the tag. So I had tried in java script, var testNmae='${name}'; alert(testName); which is fine Now var testValue=testNmae +'.'+value which is same as samplebean.value, alert('${testValue}') returns me null. How do I access this?