Skip to content

Commit

Permalink
Replaced erxservletadaptor.jar by its source file ERXServletAdaptor.java
Browse files Browse the repository at this point in the history
  • Loading branch information
renebock committed May 13, 2015
1 parent c929eb0 commit 098d4db
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package er.extensions.jspservlet;

import java.lang.reflect.Method;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.UnavailableException;

import com.webobjects.jspservlet.WOServletAdaptor;

public class ERXServletAdaptor extends WOServletAdaptor
{
private static final long serialVersionUID = 1L;

public ERXServletAdaptor() throws ServletException {
super();
}

static void invokeApplicationSetupMethod(final ServletContext servletContext) throws UnavailableException {
final ClassLoader classLoader = WOServletAdaptor.class.getClassLoader();
try {
final String applicationClassName = servletContext.getInitParameter("WOApplicationClass");
if (applicationClassName == null || "".equals(applicationClassName)) {
throw new UnavailableException("WOApplicationClass must be defined. Verify your web.xml configuration.");
}

final Class<?> applicationClass = classLoader.loadClass(applicationClassName);
final Method method = applicationClass.getMethod("setup", String[].class);
method.invoke(null, new Object[] {new String[0]});
}
catch (Exception e) {
e.printStackTrace();
throw new UnavailableException("Error initializing ERXServletAdaptor: " + e.getMessage());
}
}

public void init() throws ServletException {
invokeApplicationSetupMethod(this.getServletContext());
super.init();
}
}
1 change: 0 additions & 1 deletion Frameworks/Core/ERJars/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<classpathentry exported="true" kind="lib" path="Libraries/ERFoundation.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/ERWebObjects.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/commons-lang-2.6.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/erxservletadaptor.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/joda-time-2.3.jar" sourcepath="LibrarySources/joda-time-2.3-sources.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/junit-4.10.jar" sourcepath="LibrarySources/junit-4.10-src.jar"/>
<classpathentry exported="true" kind="lib" path="Libraries/icu4j-3_8_1.jar"/>
Expand Down
Binary file not shown.

0 comments on commit 098d4db

Please sign in to comment.