Yes, I it's recommended to have a pages/ and components/ directory.
You should really only have web.xml in your WEB-INF, but I guess
static html files can go there too.

YourApp/src/main/webapp/WEB-INF/ (web.xml)

YourApp/src/main/java/com/mycompany/myapp/base/  (java classes you
want your components or pages to extend/implement/use, but don't
access directly.)
YourApp/src/main/java/com/mycompany/myapp/components/  (java classes)
YourApp/src/main/java/com/mycompany/myapp/mixins/ (java classes)
YourApp/src/main/java/com/mycompany/myapp/pages/ (java classes)
YourApp/src/main/java/com/mycompany/myapp/services/ (java classes,
like AppModule)

(html files and locally referenced files like abc.properties or
resources for some components)
YourApp/src/main/resources/com/mycompany/myapp/components (html files)
YourApp/src/main/resources/com/mycompany/myapp/pages (html files)
YourApp/src/main/resources/com/mycompany/myapp/ (nothing)


To me, I added two more layers, and it just "feels" right...it even
feels enterprise-ish ;-)  :

YourApp/src/main/webapp/WEB-INF/ (web.xml)

YourApp/src/main/java/com/mycompany/myapp/accounts (packages regarding
logging in)
YourApp/src/main/java/com/mycompany/myapp/model
(charting,reporting,file generation packages)
YourApp/src/main/java/com/mycompany/myapp/wui/tapestry/base/  (java classes)
YourApp/src/main/java/com/mycompany/myapp/wui/tapestry/components/
(java classes)
YourApp/src/main/java/com/mycompany/myapp/wui/tapestry/mixins/ (java classes)
YourApp/src/main/java/com/mycompany/myapp/wui/tapestry/pages/ (java classes)
YourApp/src/main/java/com/mycompany/myapp/wui/tapestry/services/ (java classes)

(html files and locally referenced files like abc.properties or
resources for some components)
YourApp/src/main/resources/com/mycompany/myapp/wui/tapestry/components
(html files)
YourApp/src/main/resources/com/mycompany/myapp/wui/tapestry/pages (html files)
YourApp/src/main/resources/com/mycompany/myapp/wui/tapestry/ (nothing)

This way, if I want to switch to some other display framework, I can have
YourApp/src/main/resources/com/mycompany/myapp/wui/otherdisplayframework/

of if I want to someday do a swing version, I can do:
YourApp/src/main/resources/com/mycompany/myapp/gui/swing/

or if I want to expose some services, (never done it) I guess I could do:
YourApp/src/main/resources/com/mycompany/myapp/soa/something/

It helps me remember the dividing line between the core of my
application, and the business of interacting with the user.

I discovered this by looking at other people's source trees online. =)



On 10/3/07, Robert A. Decker <[EMAIL PROTECTED]> wrote:
> I found some info in the archives of the mailing list:
> http://mail-archives.apache.org/mod_mbox/tapestry-users/200704.mbox/%
> [EMAIL PROTECTED]
>
> However, I don't understand the fix:
> "Layout is a component, not a page.  It goes into the components
> package.  So Layout.java needs to be in foo.bar.components, and so
> does Layout.html."
>
> I have my Layout.java in the right location, but this is the first
> I've heard of a components directory for the html part of components.
> Is there also a pages directory for the html part of pages? I don't
> have one and pages seem to work fine.
>
> What would the path be for the components html directory? Mine is
> currently at:
> project/webapp/WEB-INF/.
> My pages html files are here too.
>
> R
>
>
> On Oct 3, 2007, at 4:27 PM, Robert A. Decker wrote:
>
> > I'm trying to create the simple layout component described here:
> > http://tapestry.apache.org/tapestry5/tapestry-core/guide/
> > templates.html
> > (I've also read the wiki info on components)
> >
> > But I'm getting an exception:
> > java.lang.IllegalStateException
> > This markup writer does not have a current element. The current
> > element is established with the first call to element() and is
> > maintained across subsequent calls.
> >
> >
> > I've created Layout.html in the same location my Start.html file is
> > at:
> >
> > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
> >     <head>
> >         <title>Title</title>
> >     </head>
> >     <body>
> >         <t:body/>
> >     </body>
> > </html>
> >
> >
> > I've also created Layout.java in com.company.project.components:
> >
> > package com.company.project.components;
> > public class Layout {
> >
> > }
> >
> >
> > And I have a file name Main.html that the user is sent to after
> > successfully logging in:
> >
> > <t:layout xmlns:t="http://tapestry.apache.org/schema/
> > tapestry_5_0_0.xsd">
> >
> >   Page Specific Content
> >
> > </t:layout>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to