Have root URL render some page other than the "index" page

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Have root URL render some page other than the "index" page

Pratik Patel [C]
Hi All,

Is it possible to override the behavior of tapestry so that root URL
renders some page "foo" instead of "index"?

If some URL is not found then tapestry renders index page. I want to
override this behavior so that instead of "index" page, it renders page
"foo". How can I achieve this?

Thanks,
Pratik
Reply | Threaded
Open this post in threaded view
|

Re: Have root URL render some page other than the "index" page

Pratik Patel [C]
I am using tapestry version 5.3.8.
Reply | Threaded
Open this post in threaded view
|

Re: Have root URL render some page other than the "index" page

Cezary Biernacki
You can use contribute symbol "tapestry.start-page-name" (see
org.apache.tapestry5.SymbolConstants#START_PAGE_NAME), e.g. by adding such
method in your AppModule class:

    public static void
contributeApplicationDefaults(MappedConfiguration<String, Object>
configuration) {
        configuration.add(SymbolConstants.START_PAGE_NAME, "foo");
   }


On Thu, Jan 11, 2018 at 11:27 PM, Pratik Patel <[hidden email]> wrote:

> I am using tapestry version 5.3.8.
>
Reply | Threaded
Open this post in threaded view
|

Re: Have root URL render some page other than the "index" page

Pratik Patel [C]
Thanks. I am using version 5.3.8 which does not have class SymbolConstants.
I tried passing following context-param through web.xml but that is not
working either.

        <context-param>
<param-name>tapestry.start-page-name</param-name>
<param-value>foo</param-value>
</context-param>



On Thu, Jan 11, 2018 at 6:07 PM, Cezary Biernacki <[hidden email]>
wrote:

> You can use contribute symbol "tapestry.start-page-name" (see
> org.apache.tapestry5.SymbolConstants#START_PAGE_NAME), e.g. by adding such
> method in your AppModule class:
>
>     public static void
> contributeApplicationDefaults(MappedConfiguration<String, Object>
> configuration) {
>         configuration.add(SymbolConstants.START_PAGE_NAME, "foo");
>    }
>
>
> On Thu, Jan 11, 2018 at 11:27 PM, Pratik Patel <[hidden email]>
> wrote:
>
> > I am using tapestry version 5.3.8.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Have root URL render some page other than the "index" page

Cezary Biernacki
I am pretty sure that SymbolConstants are  version 5.3 and probably even in
5.0. Anyway you need to put contribution "tapestry.start-page-name" in your
app module class (usually called AppModule if you use default Tapestry
settings in web.xml):

public static void contributeApplicationDefaults(MappedConfiguration<String,
Object> configuration) {
        configuration.add("tapestry.start-page-name", "foo");
   }



On Fri, Jan 12, 2018 at 12:29 AM, Pratik Patel <[hidden email]> wrote:

> Thanks. I am using version 5.3.8 which does not have class SymbolConstants.
> I tried passing following context-param through web.xml but that is not
> working either.
>
>         <context-param>
> <param-name>tapestry.start-page-name</param-name>
> <param-value>foo</param-value>
> </context-param>
>
>
>
> On Thu, Jan 11, 2018 at 6:07 PM, Cezary Biernacki <[hidden email]>
> wrote:
>
> > You can use contribute symbol "tapestry.start-page-name" (see
> > org.apache.tapestry5.SymbolConstants#START_PAGE_NAME), e.g. by adding
> such
> > method in your AppModule class:
> >
> >     public static void
> > contributeApplicationDefaults(MappedConfiguration<String, Object>
> > configuration) {
> >         configuration.add(SymbolConstants.START_PAGE_NAME, "foo");
> >    }
> >
> >
> > On Thu, Jan 11, 2018 at 11:27 PM, Pratik Patel <[hidden email]>
> > wrote:
> >
> > > I am using tapestry version 5.3.8.
> > >
> >
>