>Currently, you need to have a .page file for your page even if you use only
annotations - or Tapestry's page location logic won't find your page.
Now I am confused because I am writing a simple app right now that doesn't
have any .page files and it is navigating from page to page just fine. Take
a look at the following Home.html and Login.html and Login.java. This will
allow the user to click "Login" @PageLink on the Home.html page (note there
is no Home.java) which takes them to the Login.html. When they click the
submit button on the Login.html page the doSubmit() method in Login.java
redirects them to the Home.html page.
Note that I have the following in my hivemodule.xml file. But I don't know
if that is making the difference or not.
<contribution configuration-id="tapestry.url.ServiceEncoders">
<page-service-encoder id="page" extension="html"
service="page" />
</contribution>
Aaron Bartell
http://mowyourlawn.com/blog
...Home.html...
<html jwcid="@Shell" title="Test">
<body>
<a jwcid="@PageLink" page="Login">Login</a>
</body>
</html>
...Login.html...
<html jwcid="@Shell" title="Add New Project">
<body jwcid="@Body">
<h1>Add New Project</h1>
<form jwcid="[EMAIL PROTECTED]" success="listener:doSubmit">
<table>
<tr>
<th>Id</th>
<td>
<input jwcid="@TextField" value="ognl:id" size="40"/>
</td>
</tr>
<tr>
<th>Password</th>
<td>
<input jwcid="@TextField" value="ognl:pw" size="40"/>
</td>
</tr>
</table>
<input type="submit" value="Login"/>
</form>
</body>
</html>
...Login.java...
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;
public abstract class Login extends BasePage {
public abstract String getId();
public abstract void setId(String id);
public abstract String getPw();
public abstract void setPw(String pw);
public void doSubmit(IRequestCycle cycle) {
System.out.println(getId());
System.out.println(getPw());
cycle.activate("Home");
}
}
-----Original Message-----
From: Filip S. Adamsen [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 14, 2006 7:14 AM
To: Tapestry users
Subject: Re: Annotations - No .page file?
Currently, you need to have a .page file for your page even if you use only
annotations - or Tapestry's page location logic won't find your page.
-Filip
Gregg Bolinger wrote:
> I am trying to get a good feel for replacing as much in the .page file
> using annotations. I have a very simple page and I have used
> annotations for the Form and the TextField. I tried removing the
> .page file completely, assuming it was no longer needed, but I got an
exception:
>
> Page 'Home' not found in application namespace.
>
> My question is what can I do, if anything, to lose the .page file
> completely? Or do I have to have one no matter what, just empty.
>
> Thanks.
>
> Gregg
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]