This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes default struts setting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "default struts setting" Watch "default struts setting" New topic
Author

default struts setting

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
In struts, is "autocomplete" default to true or false ? what's the syntax to reset it for instance ? do I have to customie this value for each input field or can I do it at a page level ?

Thank you.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Autocomplete is supported differently by different browsers. Struts 1 tags do not affect it one way or the other. If you want to turn off autocomplete using a Struts tag, you must write your own extension to the Struts html:form or html:text tag. See this thread for more details on how to do this.


Merrill
Consultant, Sima Solutions
Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
Suppose I really don't want to extend struts tags and just want to fix couple field entries that include html text and html passwrod tag.

Can I

1) view the page that was written by struts html tag, and view source to get its html version

2) use the html version, add autocomplete=off in the INPUT fields

3) replace the struts tag lines by 2) html version with added
autocomplete=off


Does this work ?

Thanks.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Yes, you can use regular HTML <input> tags with autocomplete attributes. Just be aware of the fact that an <html:text> tag automatically sets its value to the value of the ActionForm bean property, whereas an <input> tag does not. You would have to write JSP code to handle this yourself.
Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
Originally posted by Merrill Higginson:
Yes, you can use regular HTML <input> tags with autocomplete attributes. Just be aware of the fact that an <html:text> tag automatically sets its value to the value of the ActionForm bean property, whereas an <input> tag does not. You would have to write JSP code to handle this yourself.


Thanks Merrill. Just want to make sure I understand the 2nd part of what you said -- For me, this html-text field is an user name entry, and I have a form "LogonForm" that encapsulate this field and password field. In my strut-config.xml, I specify this relationship in an "action" entry. Is this enough or do I still miss anything ? Can I assume when I click the login button, the form gets the value of what I entered ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: default struts setting
 
Similar Threads
Struts2-json plugin not serializing action class to json
All about action servlet
Struts 2 + hibernate + validation
Struts jsps in WEB-INF
web.xml configuration question