tags:

views:

25

answers:

1

if i want to set and retrieve value of in struts.

A: 

If I understand you correctly, you want to include <html:text /> in an external javascript file.

That's not possible as a servlet container doesn't iterate through a javascript file and replace JspTags in a javascript file to an html equivalent. This is only done on a jsp or jspx file.

Seeing I don't understand your question, I don't exactly know what to write.

The Elite Gentleman
i finding the solution i asked about <html:text property="username" >value, how to used it in javascript means to retrieve and set and solution is document.forms[0].username.value is used for that. and thanks for shown my question.
vanita
That's not possible @ all as Struts Tags generates html only tags and not javascript declarations.
The Elite Gentleman
it is possible i was checked it.
vanita
You cannot do struts tag on an external javascript file but you can do struts tag inside a `<script>` tag in the JSP file. That's the difference.
The Elite Gentleman
in js file we access the value of textfield using document.forms[0].username.value that is created in jsp like this <html:text property="username" > i want to say that.
vanita
That is correct. I don't understand your question then, can you please clarify further.
The Elite Gentleman