Uploaded image for project: 'Forge'
  1. Forge
  2. FORGE-2072

Setting servletVersion to 3.1 generate as many <error-page> as entity scaffolds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 2.13.1.Final
    • 2.12.0.Final
    • Java EE
    • None

    Description

      Take the following scripts. It creates a project, sets up servlet version to 3.1, generates two entities and scaffolds them.

      project-new --named testwebxml
      
      servlet-setup --servletVersion 3.1
      
      jpa-new-entity --named Category ;
      jpa-new-field --named name --length 100 ;
      
      scaffold-generate --webRoot /admin --targets org.testwebxml.model.Category
      
      jpa-new-entity --named Publisher ;
      jpa-new-field --named name --length 30 ;
      
      scaffold-generate --webRoot /admin --targets org.testwebxml.model.Publisher
      

      We end up with a web.xml file that has the <error-page> duplicated. In fact, Forge will duplicate this block each time we scaffold an entity.

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.1" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
      <display-name>module07</display-name>
        <session-config>
        <session-timeout>30</session-timeout>
        </session-config>
        <mime-mapping>
        <extension>ico</extension>
          <mime-type>image/x-icon</mime-type>
        </mime-mapping>
        <error-page>
        <error-code>404</error-code>
          <location>/faces/error.xhtml</location>
        </error-page>
        <error-page>
        <error-code>500</error-code>
          <location>/faces/error.xhtml</location>
        </error-page>
        <context-param>
        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
          <param-value>true</param-value>
        </context-param>
        <error-page>
        <error-code>404</error-code>
          <location>/faces/error.xhtml</location>
        </error-page>
        <error-page>
        <error-code>500</error-code>
          <location>/faces/error.xhtml</location>
        </error-page>
      </web-app>
      

      If you don't setup the servlet to 3.1 but leave the default (3.0) then it works fine, the <error-page> block is not duplicated

      Attachments

        Activity

          People

            danielcunha Daniel Cunha (soro) (Inactive)
            agoncal Antonio Goncalves (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: