1 Reply Latest reply on Dec 28, 2014 4:42 PM by Daniel Cunha (soro)

    [forge-dev] FacesScaffoldProvider

    Daniel Cunha (soro) Novice

      Hi folks,

       

      About FORGE-2072.

       

      The problem is:

      We have this method: ErrorPageType getOrCreateErrorPage();

      I’ll propose create a ErrorPageType getOrCreateErrorPage(String erroCode);

       

      The getOrCreteErroPage only check if web.xml has an error-page. This case,

      if I want do that:

       

      String errorLocation =

      getAccessStrategy().getWebPaths(web.getWebResource(ERROR_XHTML)).get(1);

      servletConfig.getOrCreateErrorPage().errorCode("404").location(errorLocation);

      servletConfig.getOrCreateErrorPage().errorCode("500").location(errorLocation);

       

      The shrinkwrap only put an error-page. This case, only 404.

       

      I fixed the FORGE-2072 with 2 methods because we need specify the

      WebAppDescriptor for servelet-api version, but this case erro-page is a

      common feature for two version of the api. No make sense sense to have two

      interface to this method.

       

      Look this:

      https://github.com/danielsoro/core/blob/FORGE-2072/javaee/faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L1044-L1062

       

      I think better to have:

      WebAppDescriptorCommons

       

         - getOrCreateErrorPage()

         - createErroPage()

         - etc..

       

      WebAppDescriptor30 extends WebAppDescriptorCommons

       

         - methodETC()…

       

      WebAppDescritptor31 extends WebAppDescriptorCommons

       

         - methodETC()..

       

      I don’t think a valid idea create a descriptor in forge if we have the

      shrinkwrap for that.

      IMHO.

       

      If it is a good suggestion, please.. open an issue in shrinkwrap.

      --

      Daniel Cunha (soro)

       

        • 1. Re: [forge-dev] FacesScaffoldProvider
          Daniel Cunha (soro) Novice

          Hey!

           

          I think that I didn't have attention.. I'm seeing the project, it has a

          WebAppCommonDescriptor. NICE!

          But, I would like to suggest: ErrorPageType.getOrCreateErrorPage(String

          erroCode).

          I'll suggest.

           

           

          On Sun, Dec 28, 2014 at 9:23 PM, Daniel Cunha <danielsoro@gmail.com> wrote:

           

          Hi folks,

           

          About FORGE-2072.

           

          The problem is:

          We have this method: ErrorPageType getOrCreateErrorPage();

          I’ll propose create a ErrorPageType getOrCreateErrorPage(String erroCode);

           

          The getOrCreteErroPage only check if web.xml has an error-page. This case,

          if I want do that:

           

          String errorLocation = getAccessStrategy().getWebPaths(web.getWebResource(ERROR_XHTML)).get(1);

          servletConfig.getOrCreateErrorPage().errorCode("404").location(errorLocation);

          servletConfig.getOrCreateErrorPage().errorCode("500").location(errorLocation);

           

          The shrinkwrap only put an error-page. This case, only 404.

           

          I fixed the FORGE-2072 with 2 methods because we need specify the

          WebAppDescriptor for servelet-api version, but this case erro-page is a

          common feature for two version of the api. No make sense sense to have two

          interface to this method.

           

          Look this:

          https://github.com/danielsoro/core/blob/FORGE-2072/javaee/faces/src/main/java/org/jboss/forge/addon/scaffold/faces/FacesScaffoldProvider.java#L1044-L1062

           

          I think better to have:

          WebAppDescriptorCommons

           

             - getOrCreateErrorPage()

             - createErroPage()

             - etc..

           

          WebAppDescriptor30 extends WebAppDescriptorCommons

           

             - methodETC()…

           

          WebAppDescritptor31 extends WebAppDescriptorCommons

           

             - methodETC()..

           

          I don’t think a valid idea create a descriptor in forge if we have the

          shrinkwrap for that.

          IMHO.

           

          If it is a good suggestion, please.. open an issue in shrinkwrap.

          --

          Daniel Cunha (soro)

           

           

           

           

          --

          Daniel Cunha (soro)