Don Quixote
Don Quixote

Reputation: 4458

(How) can I access struts action fields directly in Javascript?

I used hidden variables to achieve this before. But I wanted to remove the hidden variables for security reasons and hence I have to be able to access the action fields without using hidden fields. How can I do that?

Upvotes: 2

Views: 1680

Answers (1)

Dandy
Dandy

Reputation: 684

You can initialize the js variables using the action fields like -

<script>
var item = '<s:property value="item" />';
....
</script> 

where the Action class has a getItem() method.

Upvotes: 2

Related Questions