In this message, I am going with the assumption that you want to use the URL http://localhost:8080/hellocontrol/. Your source should give you the expected message if you used the URL http://localhost:8080/hellocontrol/HelloController.jpf. I think that there are two issues blocking you: 1) you should put the call to the control in onCreate (rather than the begin) and 2) you need a newer version of Beehive.
Unless you explicitly reference the begin action (by calling into this page flow from another or put the JPF into the URL) then the begin method is not called. You are setting the value of message in begin, but I am guessing that you would rather have onCreate set the value; that way, you get the same message whether you use hellocontrol/, hellocontrol/index.jsp, or hellocontol/HelloController.jpf. You asked about running the samples after building from source. The most important thing to remember is to set $BEEHIVE_HOME to your new distribution. The docs online still refer to the alpha version, so be sure to use the docs that are built when you built the distribution so your docs will match the version of the samples that you have. - jeremiah -----Original Message----- From: Srini [mailto:[EMAIL PROTECTED] Sent: Sunday, March 06, 2005 12:59 PM To: [email protected] Subject: newbie question on Controls Hi, I am a newbie to Beehive . I am trying to test a basic control . I created Hello.java and HelloImpl.jcs ( interface and impl classes) and accessed the generated HelloBean class using JSP and it worked well. I am trying to use the same control in controller. Here is my controller class @Jpf.Controller public class HelloController extends PageFlowController { @Control public apress.beehive.hellocontrol.HelloBean myBean; private String message="THIS IS MESSAGE"; @Jpf.Action( forwards={ @Jpf.Forward(name="success", path="index.jsp") } ) protected Forward begin() { message=myBean.hello(); return new Forward("success"); } public String getMessage() { return message; } public void setMessage(String amsg) { message=amsg; } and my JSP page looks like this <%@ page language="java" contentType="text/html;charset=UTF-8"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%> <%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%> <netui:html> <head> <title>Web Application Page</title> <netui:base/> </head> <netui:body> <p> <netui:content value="${pageFlow.message}"/> </p> </netui:body> </netui:html> Hello.java looks like this import org.apache.beehive.controls.api.bean.ControlInterface; @ControlInterface public interface Hello { public String hello(); public String helloWithParam(String parameter); } I deployed the application in tomcat , but am not seeing the string returned by hello() in the JSP page. and I see the following Warning in the tomcat console Mar 6, 2005 11:45:11 AM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:F:\tomcat5.0\jakarta-tomcat -5.0.25\conf\Catalina\localhost\hellocontrol.xml log4j:WARN No appenders could be found for logger (org.apache.catalina.session.M anagerBase). I am using the Beehive 1.0 alpha binary distribution . Also it will be really helpful if some one can help me out by explaining what exactly should be done after downloading the latest version and making abuild. I mean how to run a sample given in the distribution against the latest version. Thanks in Advance Srini
