Beginners Question - SEAM SLSB
pebwindkraft Jul 21, 2009 3:39 PMHi,
I last recently started with SEAM, and got the examples running (booking ...). So far promising. Next step was to use an easy, existing database, along with seam-generate. works ;-)
Now I want to extend it. I want a new action method (via a button), that calls my SLSB - I somehow don't get it ...
I understand I need a calling
xhtml page with the button, a SLSB and a home interface - how do they interact ?
Here is the source code I use:
XHTML page
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="body"> <rich:panel> <f:facet name="header">S V N T E S T</f:facet> </rich:panel> <s:decorate id="svntest" template="layout/edit.xhtml"> <ui:define name="label">svntest</ui:define> <div class="actionButtons"> <h:commandButton id="svntest" value="svntest" action="#{companylist.svntest}"/> </div> </s:decorate> </ui:define> </ui:composition>
and here the JAVA CompanyListAction.java SLSB:
package com.mydomain.Money_Transfer; import javax.ejb.Stateless; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Logger; import org.jboss.seam.faces.FacesMessages; import org.jboss.seam.log.Log; @Stateless @Name("companylist") public class CompanyListAction implements CompanyList { @Logger private Log log; public String CompanyList() { log.info("CompanyList(): Company listing returned"); FacesMessages.instance().add("CompanyList(): Company listing failed"); return "/home.xhtml"; } public String svntest() { log.info("svntest(): svntest ..."); FacesMessages.instance().add("svntest(): in svntest"); return "/home.xhtml"; } }
and here the interface:
package com.mydomain.Money_Transfer; import javax.ejb.Local; @Local public interface CompanyList { public String CompanyList(); public String svntest(); }
I don't see anything in my logs, nor any activity on the html page. I can click the button several times, but nothing happens.
I simply don't understand, how the XHTML button calls
the java code... Can someone shed some light in my knowledge darkness ?
(didn't find it in the tutorials, nor in SEAM in ACTION
explained) - thx