Bug 66246 - JspC generates invalid web.xml
Summary: JspC generates invalid web.xml
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 9.0.65
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-30 16:19 UTC by Sebastian W.
Modified: 2022-08-31 01:59 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian W. 2022-08-30 16:19:09 UTC
The Jasper-Compiler generates an invalid web.xml file when used with the option "-webxml my-web.xml".

The root tag in the generated file is <web-fragment> but it should be <web-app>. The closing tag at the end of the file is </web-app>, which is correct.

I have tracked down the problem to the resources file in "org/apache/jasper/resources/LocalStrings.properties". The property key "jspc.webxml.header" contains the incorrect value: 

<?xml version="1.0" encoding="{0}"?>\n\
<web-fragment xmlns=...

while it should contain:

<?xml version="1.0" encoding="{0}"?>\n\
<web-app xmlns=...
Comment 1 Han Li 2022-08-31 01:59:41 UTC
Thansk for your feedback.
Fixed in:
- 9.0.x for 9.0.66 onwards