1. It seems the tutorial is out of date, the class should be called Index.java. ("Start" is a hangover from older days).
2. Make sure your compiled class file and your .tml file are in the same package on the classpath. It's how Tapestry matches the two up (same name in the same package). And as there's no interface for onAction and other "handle" methods - watch out for typos. On 10 May 2010 22:36, aibkwik <phil.mcqui...@gmail.com> wrote: > > Two problems: > > 1. The tutorial says to create Index.java but the class it creates is > "public class Start". I can't even compile the tutorial. Eclipse is > telling me that "Start" should be declared in a separate file. It offers to > rename the class for me. (It wants the class to be called "Index"). > > Here is the content of my Index.java file: > > public class Start > { > private final Random random = new Random(); > > �...@injectpage > private Guess guess; > > Object onAction() > { > int target = random.nextInt(10) + 1; > > return guess.initialize(target); > } > } > > As represented in the tutorial, here is the interesting line from my > Index.tml > > <t:actionlink>Start guessing</t:actionlink> > > 2. If I let eclipse rename the class to "Index" then I can at least compile > it. However, when I run it I get an error when I click on the "Start > Guessing" URL. The error is: > > > Request event 'action' (on component Index:actionlink) was not handled; you > must provide a matching event handler method in the component or in one of > its containers. > > > Can someone tell me what I am doing wrong? > > Thanks! > -- > View this message in context: > http://old.nabble.com/Noob-problem-with-Guessing-Game-tutorial-tp28519315p28519315.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org