Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
titleGrouping pages and folder structures
public abstract class UseCase1Wizard implements ViewConfig
{
    @Page
    public final class Step1 extends Wizard
    {
    }

    @Page
    public final class Step2 extends Wizard
    {
    }
}

... leads to the following view-ids: /useCase1wizard/step1.xhtml and /useCase1wizard/step2.xhtml.
That means - if you rename the folder useCase1wizard, you just have to rename a single class and everything is in sync again.

Note
titleHint

While the nested classes lead to the final path of the file, the inheritance allows to configure a bunch of pages.

Code Block
java
java
titleGrouping pages and folder structures

@Page(navigation = REDIRECT)
public abstract class Wizard implements ViewConfig
{
    @Page
    public final class Step1 extends Wizard
    {
    }

    @Page
    public final class Step2 extends Wizard
    {
    }
}

... leads to redirects as soon as navigation is triggered and Step1 or Step2 are the targets. You can centralize all available configs. Some of them can be replaced at a more concrete level (in the example above it would be possible to override the redirect mode e.g. for Step1 or Step2) whereas others will be aggregated (like AccessDecisionVoter s}.

Note
titleHint

Besides this naming convention you can use basePath to force a different name. Furthermore, @Page allows to adjust the navigation mode (forward (= default) vs. redirct) and the file extension (default: xhtml) as well as the name of the page itself.

...