You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/08/18 02:54:55 UTC

[Bug 53737] New: Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

          Priority: P2
            Bug ID: 53737
          Assignee: dev@tomcat.apache.org
           Summary: Use ServletContext.getJspConfigDescriptor() in Jasper
                    instead of XML-parsing of merged web.xml
          Severity: enhancement
    Classification: Unclassified
                OS: Windows XP
          Reporter: knst.kolinko@gmail.com
          Hardware: PC
            Status: NEW
           Version: trunk
         Component: Jasper
           Product: Tomcat 8

In Tomcat 7.0.29 in ContextConfig#webConfig() a merged web.xml file is
serialized into String and is put as an attribute into ServletContext.

[[[
        String mergedWebXml = webXml.toXml();
        sContext.setAttribute(
               org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML,
               mergedWebXml);
]]]

Then in JspConfig#processWebDotXml() of Jasper it is parsed again from XML into
objects.

It would be better to access the necessary configuration through Servlet 3.0
API methods such as ServletContext.getJspConfigDescriptor().

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
The fix wasn't as simple as it first appeared due to having to support JspC.
The original fix has been reverted pending a re-think.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

--- Comment #3 from Jeremy Boynes <jb...@apache.org> ---
Created attachment 30504
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30504&action=edit
Add support for JspConfig to JspC's ServletContext

Related to r1377509 (reverted), this patch adds support for identifying the
effective version of an application and for setting up a JspConfigDescriptor
for JspC that would match the one returned by a container at runtime.

This should mean that Mark's original change would also work in JspC, allowing
the two implementations to be consolidated.

This patch does not yet attempt to merge in web-fragment.xml files as that
functionality is not supported by the current JspC implementation either. I
plan to add that later if this looks like a good way to go.

There is also some duplication with implementations in o.a.c.core. Jasper does
not have any dependencies on catalina so I did not reuse those. However, these
could potentially be moved to o.a.tomcat.util and shared.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml [PATCHES]

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

Christopher Schultz <ch...@christopherschultz.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Use                         |Use
                   |ServletContext.getJspConfig |ServletContext.getJspConfig
                   |Descriptor() in Jasper      |Descriptor() in Jasper
                   |instead of XML-parsing of   |instead of XML-parsing of
                   |merged web.xml              |merged web.xml [PATCHES]

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

--- Comment #5 from Jeremy Boynes <jb...@apache.org> ---
Created attachment 30568
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30568&action=edit
Incremental, adds merging of fragments and scanning using ServletContext

Increment on prior patch to add merging of jsp-config found in web-fragments.

Also change to JspC to scan for JSPs based on resources found in the
ServletContext. This currently works just for resources in the main webapp but
not for those in META-INF/resources in jars - work is still needed in
JspCServletContext to map those.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

Jeremy Boynes <jb...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30504|0                           |1
        is obsolete|                            |

--- Comment #4 from Jeremy Boynes <jb...@apache.org> ---
Created attachment 30533
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30533&action=edit
Add changes from r1377509

Update previous patch to merge in changes from r1377509 that were reverted due
to issues with JspC. This removes need for Jasper's compiler to parse a
web.xml, instead relying on a ServletContext provided by the container or now
by the JspC shell. Jasper's WebXml class was deprecated in r1377509, it is not
longer referenced in Jasper and could be removed.

Ran test-bio with no failures, and ran JspC separately on a simple webapp to
verify <jsp-config> is being handled (checked default-content-type is picked up
from web.xml).

Patch still has todo's to add web-fragment support when JspC builds its
ServletContext.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

--- Comment #7 from Mark Thomas <ma...@apache.org> ---
Support for web fragments has been added.

Support for annotations is not required as they do not affect JspC.

Support for JSPs in resource JARs is still to do.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

--- Comment #6 from Mark Thomas <ma...@apache.org> ---
This has been partially fixed using a combination of the original fix, the
patches here and patches from violetagg.

web-fragment and annotations are still TODO so the code is effectively in the
same place funcitonaly as before the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53737] Use ServletContext.getJspConfigDescriptor() in Jasper instead of XML-parsing of merged web.xml

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53737

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk and 7.0.x and will be included in 7.0.30 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org