Comments (17)
- Issue Imported From: https://github.com/javaee/servlet-spec/issues/2
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
from servlet.
@glassfishrobot Commented
Reported by eirbjor
from servlet.
@glassfishrobot Commented
eirbjor said:
Discussion on [email protected] :
http://java.net/projects/servlet-spec/lists/users/archive/2011-06/thread/1
from servlet.
@glassfishrobot Commented
eirbjor said:
I now have a working implementation of this based on Glassfish trunk.
I'll upload a patch, but I need to review the code and do some more testing first.
For now, here's a summary of changes/additions made:
M deployment/schemas/src/main/resources/glassfish/lib/schemas/javaee_6.xsd
M deployment/schemas/src/main/resources/glassfish/lib/schemas/web-common_3_0.xsd
Added support for new XML syntax com.example..
(I know these will need to be moved to the 3.1 / jeee7 versions of these files, but I decided not to do that now after a few failed attempts.
A + deployment/dol/src/main/java/com/sun/enterprise/deployment/node/web/ResourceLoaderNode.java
M deployment/dol/src/main/java/com/sun/enterprise/deployment/node/web/WebCommonNode.java
M deployment/dol/src/main/java/com/sun/enterprise/deployment/node/DescriptorFactory.java
A + deployment/dol/src/main/java/com/sun/enterprise/deployment/AppResourceLoaderDescriptorImpl.java
A + deployment/dol/src/main/java/com/sun/enterprise/deployment/web/AppResourceLoaderDescriptor.java
M deployment/dol/src/main/java/com/sun/enterprise/deployment/WebBundleDescriptor.java
M deployment/dol/src/main/java/com/sun/enterprise/deployment/xml/WebTagNames.java
Changes related to parsing the new and nodes and representing them as an AppResourceLoaderDescriptor. I pretty much stole the code from since they're structurally the same.
M web/javax.servlet/src/main/java/javax/servlet/ServletContext.java
A web/javax.servlet/src/main/java/javax/servlet/ResourceLoader.java
Added the ResourceLoader interface and ServletContext.addResourceLoader.
M web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java
M web/web-core/src/main/java/org/apache/catalina/core/ApplicationContext.java
M web/web-core/src/main/java/org/apache/catalina/core/ApplicationContextFacade.java
M web/web-core/src/main/java/org/apache/catalina/servlets/DefaultServlet.java
M web/web-core/src/main/java/org/apache/catalina/Context.java
M web/web-core/src/main/resources/org/apache/catalina/core/LocalStrings.properties
- Added support for adding resource loaders, programmatically or from a class name given via XML
- Consult resource loaders when looking up resources in ServletContext's getResource*, getRealPath methods.
- Consult resource loaders when serving resources in DefaultServlet.serveResource
M web/web-glue/src/main/java/com/sun/enterprise/web/TomcatDeploymentConfig.java
Register the context's resource loaders by using the information available in AppResourceLoaderDescriptor
from servlet.
@glassfishrobot Commented
eirbjor said:
When adding support for resource loaders to DefaultServlet, I found the serveResource method to be hard to work with.
I've filed an issue in the Glassfish Jira for this, with some suggestions for improvements:
http://java.net/jira/browse/GLASSFISH-16871
from servlet.
@glassfishrobot Commented
eirbjor said:
Patch includes API changes to the Servlet spec and a working Glassfish implementation of the changes
from servlet.
@glassfishrobot Commented
eirbjor said:
Demo web application project. The webapp tests that the container implements resourceloader according to the specification.
The project also includes a demo of hot deployment of JSPs from OSGi bundles.
from servlet.
@glassfishrobot Commented
eirbjor said:
Including post to user list for reference:
Thinking about it, my resource loader proposal for Servlet 3.1 might
have a multi-tenancy story as well as a dynamic deployment story.
I initially focused on a single tenant being able to dynamically
(hot)deploy resources. However, being able to define custom resource
loaders will also enable resource sharing across multiple tenants
without having to use container specific hacks or custom builds of
webapps.
I've uploaded a patch to the Jira issue which adds the ResourceLoader
interface and the ServletContext.addResourceLoader method. The patch
also includes a working implementation of resource loader support in
Glassfish trunk.
Finally, I've also uploaded a proof-of-concept web application. This
application tests the container's implementation of the ResourceLoader
API. And just for fun, I threw in a ResourceLoader backed by OSGi
bundles using Apache Felix.
from servlet.
@glassfishrobot Commented
eirbjor said:
Updated poc with improved tests and getResourcePaths() implementation for OSGi
from servlet.
@glassfishrobot Commented
eirbjor said:
Patch implementing ResourceLoader support for Jetty 8
from servlet.
@glassfishrobot Commented
eirbjor said:
Updates to Jetty's 3.0 Servlet Spec module adding ResourceLoader
from servlet.
@glassfishrobot Commented
File: resourceloader-poc-2011-12-15.zip
Attached By: eirbjor
from servlet.
@glassfishrobot Commented
File: SERVLET_SPEC_2-2011-12-11.patch
Attached By: eirbjor
from servlet.
@glassfishrobot Commented
File: SERVLET_SPEC_2_JETTY_8_2011-12-15.patch
Attached By: eirbjor
from servlet.
@glassfishrobot Commented
File: SERVLET_SPEC_2_JETTY_servlet-spec_2011-12-15.patch
Attached By: eirbjor
from servlet.
@glassfishrobot Commented
This issue was imported from java.net JIRA SERVLET_SPEC-2
from servlet.
@gregw I would favor for the deployment model to stick to WAR file or WAR file exploded in a directory to be the 2 ways that have to be supported. Any other really should be left up to the vendor.
from servlet.
Related Issues (20)
- Some ServletContext getters still throw UnsupportedOperationException HOT 1
- TCK Challenge: Cookie setMaxAgePositiveTest using incorrect CookiePolicy for Date parsing HOT 7
- TCK Challenge: doHeadTest shouldn't validate optional payload header fields HOT 7
- TCK Challenge: isTrailerFields JavaDoc and default implementation inconsistent HOT 7
- Add read/write from/to ByteBuffer HOT 1
- [TCK Challenge] invalidateHttpSessionxTest HOT 4
- [TCK Challenge] A number of cross context HTTP session tests are failing HOT 14
- [TCK Challenge] dispatchAfterCommitTest4 HOT 2
- [TCK Challenge] dispatchAfterCommitTest5 HOT 2
- [TCK Challenge] object identity test on ServletRequests in listeners vs servlets HOT 6
- [TCK Challenge] inconsistent testing of cookies HOT 7
- Is the maintenance plan updated for jakarta servlet-4.0.x? HOT 3
- Add PATCH support in HttpServlet.java HOT 3
- Session 9 (Dispatching Requests) is missing information on jakarta.servlet.*.mapping request attributes
- HttpServletRequest and changes to attributes event HOT 1
- ServletContext - getContext(String uripath) method confusing javadoc HOT 4
- [TCK Challenge] check for object identity in dispatcher test HOT 2
- [TCK Challenge] attempting to writing more than content-length bytes HOT 1
- License oddities in `jakarta.servlet-api-6.0.0.jar`
- Couldn't resolve specified result-set mapping name HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servlet.