• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

default struts setting

 
Raj Ohadi
Ranch Hand
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raj Ohadi
Ranch Hand
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 316
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic