Posts

Showing posts from October, 2009

Actions not being called when using 2 view tags

I had a problem where a command button's action was not being called on the managed bean.

When using tiles inside JSF, you may have it set up so that you have a template.jsp and a body.jsp.
The template.jsp, using tiles inserts body.jsp.

template.jsp defines a <f:view> tag as per normal.
Inside body.jsp, whilst you don't technically need a <f:view> tag, you may get some component (namely f:phaseListener) complaining about not having a view root, so you does it asks and defines the <f:view> at the start of the file.

You load up the page, everything renders correctly and you click a submit button. The form validation errors appear as normal, so you fill in some values and click submit again.
This time, NOTHING.
So you try turning on all the logging and still nothing seems wrong.

This happened to me. I wasted quiet a few hours on this one: working out how to log things correctly using eclipse/tomcat and get Java Util Logging working etc. After a ton of breakpoints, it a…