]
George Gastaldi closed FORGE-2072.
----------------------------------
Resolution: Done
Setting servletVersion to 3.1 generate as many <error-page> as
entity scaffolds
-------------------------------------------------------------------------------
Key: FORGE-2072
URL:
https://issues.jboss.org/browse/FORGE-2072
Project: Forge
Issue Type: Bug
Components: Java EE
Affects Versions: 2.12.0.Final
Reporter: Antonio Goncalves
Assignee: Daniel Cunha (soro)
Fix For: 2.13.1.Final
Take the following scripts. It creates a project, sets up servlet version to 3.1,
generates two entities and scaffolds them.
{code}
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
{code}
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.
{code}
<?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>
{code}
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