You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pratik Patel <pr...@semandex.net> on 2018/01/11 22:15:28 UTC

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

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

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

Posted by Cezary Biernacki <ce...@gmail.com>.
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 <pr...@semandex.net> 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 <ce...@gmail.com>
> 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 <pr...@semandex.net>
> > wrote:
> >
> > > I am using tapestry version 5.3.8.
> > >
> >
>

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

Posted by Pratik Patel <pr...@semandex.net>.
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 <ce...@gmail.com>
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 <pr...@semandex.net>
> wrote:
>
> > I am using tapestry version 5.3.8.
> >
>

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

Posted by Cezary Biernacki <ce...@gmail.com>.
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 <pr...@semandex.net> wrote:

> I am using tapestry version 5.3.8.
>

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

Posted by Pratik Patel <pr...@semandex.net>.
I am using tapestry version 5.3.8.