-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced erxservletadaptor.jar by its source file ERXServletAdaptor.java
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
Frameworks/Core/ERExtensions/Sources/er/extensions/jspservlet/ERXServletAdaptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.