You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Allen Guo <el...@gmail.com> on 2007/05/19 16:53:20 UTC

Create sub-package base on Tapestry5.0.4

Hi All,

I set the param-name tapestry.app-package=org.opend.bogo in web.xml
So the default page classes have to be put in package org.opend.bogo.pages

Now I create a class named Shop.java and the corresponding Shop.html in
sub-package named org.pend.bogo.pages.admin.
It's working fine when I test it .
But when I try to move it to WEB-INF or WEB-INF/admin it will not work:(
It seems that the Shop.thml must be put under package
org.pend.bogo.pages.admin

I have been thinking we should put these html files together.
So I hope it can be put under web context folder or sub-folder. But I
can't now.

Could anybody give me some suggestion?

from Shanghai
Allen Guo





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


Re: Create sub-package base on Tapestry5.0.4

Posted by Allen Guo <el...@gmail.com>.
I did a lot of test yesterday. I found the real problem is
If the page class start with package name then you put it under 
WEB-INF/<sub package name>, it won't work .
For example,
suppose there is a page class named Admin.java or Admin1.java lie in the 
sub package name is 'org/opend/bogo/pages/admin/' , it won't work if you 
put the Admin.html or Admin1.html in WEB-INF/admin/
It' will throw "HTTP Status 404 - /BogoPro/admin/Admin" exception

By contract, it'll work fine if the page class named Shop.java and the 
Shop.html is put in WEB-INF/admin.

Howard Lewis Ship 写道:
> org.opend.bogo.pages.admin.Shop will search for its template on the
> classpath as org/opend/bogo/pages/admin/Shop.html or in the web 
> context as
> WEB-INF/admin/Shop.html.
>
> I'm pretty sure this works, because I was demoing it for a client 
> recently
> ...
>
> On 5/19/07, Allen Guo <el...@gmail.com> wrote:
>>
>> Hi All,
>>
>> I set the param-name tapestry.app-package=org.opend.bogo in web.xml
>> So the default page classes have to be put in package 
>> org.opend.bogo.pages
>>
>> Now I create a class named Shop.java and the corresponding Shop.html in
>> sub-package named org.pend.bogo.pages.admin.
>> It's working fine when I test it .
>> But when I try to move it to WEB-INF or WEB-INF/admin it will not work:(
>> It seems that the Shop.thml must be put under package
>> org.pend.bogo.pages.admin
>>
>> I have been thinking we should put these html files together.
>> So I hope it can be put under web context folder or sub-folder. But I
>> can't now.
>>
>> Could anybody give me some suggestion?
>>
>> from Shanghai
>> Allen Guo
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: Create sub-package base on Tapestry5.0.4

Posted by Allen Guo <el...@gmail.com>.
It does work if I put the Shop.html inside org/opend/bogo/pages/admin/
But it really doesn't work if put it under WEB-INF/admin :(

I visit the page with "http://localhost/bogo/admin/Shop" , am I right?


Howard Lewis Ship 写道:
> org.opend.bogo.pages.admin.Shop will search for its template on the
> classpath as org/opend/bogo/pages/admin/Shop.html or in the web 
> context as
> WEB-INF/admin/Shop.html.
>
> I'm pretty sure this works, because I was demoing it for a client 
> recently
> ...
>
> On 5/19/07, Allen Guo <el...@gmail.com> wrote:
>>
>> Hi All,
>>
>> I set the param-name tapestry.app-package=org.opend.bogo in web.xml
>> So the default page classes have to be put in package 
>> org.opend.bogo.pages
>>
>> Now I create a class named Shop.java and the corresponding Shop.html in
>> sub-package named org.pend.bogo.pages.admin.
>> It's working fine when I test it .
>> But when I try to move it to WEB-INF or WEB-INF/admin it will not work:(
>> It seems that the Shop.thml must be put under package
>> org.pend.bogo.pages.admin
>>
>> I have been thinking we should put these html files together.
>> So I hope it can be put under web context folder or sub-folder. But I
>> can't now.
>>
>> Could anybody give me some suggestion?
>>
>> from Shanghai
>> Allen Guo
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: Create sub-package base on Tapestry5.0.4

Posted by Howard Lewis Ship <hl...@gmail.com>.
org.opend.bogo.pages.admin.Shop will search for its template on the
classpath as org/opend/bogo/pages/admin/Shop.html or in the web context as
WEB-INF/admin/Shop.html.

I'm pretty sure this works, because I was demoing it for a client recently
...

On 5/19/07, Allen Guo <el...@gmail.com> wrote:
>
> Hi All,
>
> I set the param-name tapestry.app-package=org.opend.bogo in web.xml
> So the default page classes have to be put in package org.opend.bogo.pages
>
> Now I create a class named Shop.java and the corresponding Shop.html in
> sub-package named org.pend.bogo.pages.admin.
> It's working fine when I test it .
> But when I try to move it to WEB-INF or WEB-INF/admin it will not work:(
> It seems that the Shop.thml must be put under package
> org.pend.bogo.pages.admin
>
> I have been thinking we should put these html files together.
> So I hope it can be put under web context folder or sub-folder. But I
> can't now.
>
> Could anybody give me some suggestion?
>
> from Shanghai
> Allen Guo
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

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