You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Aronson <jo...@comcast.net> on 2008/12/21 00:59:56 UTC
Error in Tapestry 5 Tutorial
on the page http://tapestry.apache.org/tapestry5/tutorial1/hilo.html
Let's start with the code, and break it down:
src/main/java/org/apache/tapestry5/tutorial/pages/Index.java
package org.apache.tapestry5.tutorial.pages;
import java.util.Random;
import org.apache.tapestry5.annotations.InjectPage;
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);
}
}
How can you have a public class named "Start" in a file named "Index.java"?
I tried creating a Start in "Start.java" but that did not work.
John
Re: Error in Tapestry 5 Tutorial
Posted by Ulrich Stärk <ul...@spielviel.de>.
John Aronson schrieb:
> on the page http://tapestry.apache.org/tapestry5/tutorial1/hilo.html
>
> Let's start with the code, and break it down:
>
> src/main/java/org/apache/tapestry5/tutorial/pages/Index.java
>
> package org.apache.tapestry5.tutorial.pages;
>
>
>
> import java.util.Random;
>
>
>
> import org.apache.tapestry5.annotations.InjectPage;
>
>
>
> 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);
>
> }
>
> }
>
>
>
> How can you have a public class named "Start" in a file named "Index.java"?
>
>
>
> I tried creating a Start in "Start.java" but that did not work.
>
>
>
>
>
> John
>
>
At some point (I don't know when exactly) index pages were introduced. On the package root, this is
called Index. Apparently, the tutorial hasn't been updated completely. Of course it should be a
class Index in the file Index.java with a corresponding Index.tml.
Cheers,
Uli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org