Sunday, August 15, 2004

JSF question

Got yet another problem on my JSF homework. The following is from the email I sent to the instructor:
The general question is: what is the best way to setup JSF views and forms in the 3 jsp pages (banner, main, and footer)?

I use a filter to generate banner and footers for pages. The java code is like this:
   bannerRd.include(request, response);
   chain.doFilter(request, response);
   footerRd.include(request, response);

Currently in my banner.jsp I have something like this:
   <f:view>
   <h:form id="xxx">
   ...
   <h:commandLink...><f:verbatim>Community </f:verbatim> </h:commandLink>
   ...
   </h:form>
   </f:view>

In my login.jsp page I have:
   <f:view>
   <h:form id="yyy">
   ...
   <table><tr><td>
   ...
   <h:outputText value="#{Message.labels_login}" styleClass="fieldname" />:
   ...
   </td></tr></table>
   </h:form>
   </f:view>
I used a table to format the login form.

The actual login works fine in the application except that for the login.jsp, the JSF components are displayed outside the table. So I have the form labels (also displayed using JSF tags) and fields by separated out by themselves followed by the table HTML and the ":" characters. I don't want to surround the HTML elements with tags.

I hope the instructor answers my question even though he might not care for the class anymore.