You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gregg Bolinger <ta...@gmail.com> on 2006/01/13 20:32:58 UTC

Annotations - No .page file?

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

Re: Annotations - No .page file?

Posted by Chris Chiappone <ch...@gmail.com>.
Make sure you have something like this in your .application file:

  <meta key="org.apache.tapestry.visit-class"
      value="your.package.Visit"/>
   <meta key="org.apache.tapestry.page-class-packages"
      value="your.package.pages"/>
   <meta key="org.apache.tapestry.component-class-packages"
      value="your.package.components"/>

~chris

On 1/13/06, Gregg Bolinger <ta...@gmail.com> 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
>
>


--
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Annotations - No .page file?

Posted by Aaron Bartell <al...@gmail.com>.
>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="form@Form" 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:filip@stubkjaer-adamsen.dk] 
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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Annotations - No .page file?

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
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
> 

Re: Annotations - No .page file?

Posted by Gregg Bolinger <ta...@gmail.com>.
Yep, here is what I have.

reverse.application

<?xml version="1.0"?>
<!DOCTYPE application PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<application>
    <meta key="org.apache.tapestry.page-class-packages" value="
com.gthought.pages"/>
</application>

And my Home.class is package com.gthought.pages.Home;

web.xml is

<servlet>
            <description>Application Servlet for Tapestry</description>
            <servlet-name>reverse</servlet-name>
            <servlet-class>org.apache.tapestry.ApplicationServlet
</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
            <servlet-name>reverse</servlet-name>
            <url-pattern>/app</url-pattern>
        </servlet-mapping>




On 1/13/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> Can Tapestry locate your Home class; did you configure it with the
> corrent package(s) to search?  org.apache.tapestry.page-class-packages
>
> On 1/13/06, Gregg Bolinger <ta...@gmail.com> 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
> >
> >
>
>
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Jakarta Tapestry
> Creator, Jakarta HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Annotations - No .page file?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Can Tapestry locate your Home class; did you configure it with the
corrent package(s) to search?  org.apache.tapestry.page-class-packages

On 1/13/06, Gregg Bolinger <ta...@gmail.com> 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
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org