Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the JSP support works with newer dependencies #311

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading