Is it possible to “execute”/”render” various c:set tags when a certain button is pressed and a redirect will occure?
I dont want to set the properties of the backing bean code-wise, for im filling them with static data. As im not talking about one single button here but about multiple ones, doing this code-wise would produce lots of boilerplated code. Thats the reason why I want to use c:set.
The
<c:set>is the wrong tool for the job you had in mind and therefore insuitable. It doesn’t run during submitting the form, but during building the view.Use
<f:setPropertyActionListener>instead. E.g.A completely different alternative is to just send request parameters by
<f:param>. This allows you creating bookmarkable links which is much better for user experience and SEO.See also: