LuckyLuke
LuckyLuke

Reputation: 49077

Sending data with GET in JSF

I have a search form on my website that I build with what I learn in the book I am reading and I have a question about the "name"-part of the query parameters.

After what I have understood I use normal HTML form when I want to send data with GET and I use the <h:inputText id="city" value="#{testBean.city}" /> these tags inside. It is correct that what you normally would write with name="city" in normal HTML tags is the same as id="city"? And it applies for all JSF tags?

Upvotes: 0

Views: 136

Answers (1)

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62864

Yes, that's right. As far as I know, when you write tags with no 'id' attribute, the Renderer generates a automatic 'name' attribute for the corresponding HTML component/tag/smth. But when you register a jsf component with an 'id' attribute, its value is used for the value for the 'name' in the HTML.

Upvotes: 1

Related Questions