Skip to content

Commit

Permalink
Ensure that the JSP support works with newer dependencies (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
merks authored Sep 14, 2023
1 parent 10c3708 commit 1a51ae9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.jsp.jasper
Bundle-Version: 1.1.700.qualifier
Bundle-Version: 1.1.800.qualifier
Bundle-Activator: org.eclipse.equinox.internal.jsp.jasper.Activator
Import-Package: javax.servlet;version="[2.4, 5.0)",
javax.servlet.annotation;version="[2.6, 5.0)";resolution:=optional,
javax.servlet.descriptor;version="[2.6, 5.0)";resolution:=optional,
javax.servlet.http;version="[2.4, 5.0)",
javax.servlet.jsp;version="[2.0, 3.0)",
org.apache.jasper.servlet;version="[0, 8)",
Import-Package: com.sun.el;version="3.0.0",
javax.servlet;version="[2.4,5.0)",
javax.servlet.annotation;version="[2.6,5.0)";resolution:=optional,
javax.servlet.descriptor;version="[2.6,5.0)";resolution:=optional,
javax.servlet.http;version="[2.4,5.0)",
javax.servlet.jsp;version="[2.0,3.0)",
org.apache.jasper.servlet;version="[9,10)",
org.osgi.framework;version="1.3.0",
org.osgi.service.http;version="1.2.0",
org.osgi.service.packageadmin;version="1.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* A BundleProxyClassLoader wraps a bundle and uses the various Bundle methods to produce a ClassLoader.
*/
public class BundleProxyClassLoader extends ClassLoader {
private final Bundle activatorBundle = Activator.getBundle(Activator.class);
private Bundle bundle;
private ClassLoader parent;

Expand All @@ -49,6 +50,14 @@ public URL findResource(String name) {

@Override
public Class<?> findClass(String name) throws ClassNotFoundException {
try {
if (name.startsWith("com.sun.el")) { //$NON-NLS-1$
return activatorBundle.loadClass(name);
}
} catch (ClassNotFoundException ex) {
//$FALL-THROUGH$
}

return bundle.loadClass(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void init(ServletConfig config) throws ServletException {
try {
Thread.currentThread().setContextClassLoader(jspLoader);
jspServlet.init(new ServletConfigAdaptor(config));
new org.apache.jasper.servlet.JasperInitializer().onStartup(Collections.emptySet(), getServletContext());

// If a SecurityManager is set we need to override the permissions collection set in Jasper's JSPRuntimeContext
if (System.getSecurityManager() != null) {
Expand Down

0 comments on commit 1a51ae9

Please sign in to comment.