doubt in jsp

i am using javascript in jspi want to access the action fom (struts) values inside the javascript it is possible.if possible please tell me what ihave to dothank yoy
[200 byte] By [kathir226a] at [2007-10-2 5:12:48]
# 1

if you doubt JSP then dont worry its an excellent technology.

If you have a question about javascript you are in the wrong forum but seeing your question ill first answer this:

javascript = CLIENT side

jsp/struts = SERVER side

in no way can both access/use/assign each other.

You can have your JSP/stutrs render HTML that includes Javascript with the needed values. and then have your JAvascript make a request to your webserver so JSP/Struts can do something with it.

example:

<script type="text/javascript">

var ajavascriptvar = <c:out value=${yourstrutsform.yourproperty} />;

</script>

pgeuensa at 2007-7-16 1:15:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Yah..Put the values in Hidden. u can it it in Javascript.regardsDRA
Anna_DRAa at 2007-7-16 1:15:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Yes you can use javascript to access form values. I'm using this method to do client side validation before sending the values to the server.

The form name is the name of the form you gave in the struts-config. Form object name is the same as like what you give using the struts tags. Accessing the attributes of each object is just the same as you would do using javascript. You can retrieve value, set value, etc.

Somemore, you can even use attributes like onclick, onsubmit, etc in your Struts tags.

Oscar_NPa at 2007-7-16 1:15:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Clarification:Javascript cannot access the Struts form, javascript can only access the HTML form Although the Struts form has the same name as the HTMl form its not the same.
pgeuensa at 2007-7-16 1:15:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...