- This topic has 9 replies, 3 voices, and was last updated 16 years, 11 months ago by Riyad Kalla.
-
AuthorPosts
-
Peter BennettParticipantI have been following the JSF example shown at: –
http://www.myeclipseide.com/images/tutorials/demos/community_one_2007/community_one_2007.htm
And I have created a web module with a mapping of a VAT table (vatid, rate and description columns) and added the getAllVat() method to the Vat managed bean, just like the getAllPosts() method in the example. I then created the vatlist.jsp file using the JSF template, with the right tag libraries included, the snippet of the loop in the JSP to display the table contents is below: –vatlist.jsp (faces) fragment: –
<body> <f:view> <h1>VAT Rates</h1> <hr/> <c:forEach var="vat" items="#{vat.allVat}" > <strong> <h:outputText id="id" value="#{vat.vatid}"></h:outputText> </strong> <br/> <h:outputText id="rate" value="#{vat.rate}"></h:outputText> <hr /> <h:outputText id="description" value="#{vat.description}"></h:outputText> </c:forEach> </f:view> </body>
VAT Managed bean excerpt (net.dsps.cmWeb.Vat.java): –
public List<Vat> getAllVat() { logger.info("VAT About to call the findAll."); return new VatDAO().findAll(); }
faces-config.xml extract: –
<managed-bean> <managed-bean-name>vat</managed-bean-name> <managed-bean-class>net.dsps.cmWeb.Vat</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean>
And the following in the web.xml file as well (partly to test another way of
accessing the database with a very naughty SQL tag library, which works)<resource-ref> <description>DB2ProjectConnection</description> <res-ref-name>jdbc/project</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
However, when I run the JSP shown above, I get the log4j entries: –
2007-11-20 20:52:34 [INFO ] [http-8080-1] [net.dsps.cmWeb.Vat] [2535765] [] – VAT zero argument Constructor called
2007-11-20 20:52:34 [INFO ] [http-8080-1] [net.dsps.cmWeb.CmwebFilter] [2535890] [] – Request for /cmWeb/vatList.faces took : 6.187 seconds.
So, the Vat managed bean does get the constructor called, but the JSP doesn’t list any objects, and there is no log4j output from the getAllVat() method.
The managed bean was derived from the table through the database explorer, just as per the example, but when I deploy it to either the MyEclipse Tomcat, or an external Tomcat 6.0.14 instance, I just get no data returned and the log4j output shown above.
What (apart from a handful of IQ points) am I missing?Peter Bennett
DSPS
Riyad KallaMemberThis message has not been recovered.
tonikoMemberThis message has not been recovered.
Peter BennettParticipantThis message has not been recovered.
Peter BennettParticipantThis message has not been recovered.
Riyad KallaMemberThis message has not been recovered.
Peter BennettParticipantThis message has not been recovered.
Riyad KallaMemberThis message has not been recovered.
Peter BennettParticipantThis message has not been recovered.
Riyad KallaMemberThis message has not been recovered.
-
AuthorPosts