views:

43

answers:

2

Hello, in my jsp I have a

<body onload(...)> ...

and I want to send a parameter from my action

A: 

just put your parameter in there like this:

<%= yourParameter %>

(assuming the parameter is a String or has a usable toString() method)

Simon Groenewolt
+1  A: 

Your HTML syntax is wrong. It should be

<body onload="..."> ...

If you are actually passing a string parameter don't forget to quote and escape it:

<body onload="someJSFunction('<%= StringEscapeUtils.escapeJavaScript(someObject.getSomeAttribute()) >')")>
RoToRa