xmlrpcservlet does not accept additional init params

This commit is contained in:
Peter Hormanns 2015-08-07 17:44:15 +02:00
parent 71fb0ad06b
commit c533e75061
4 changed files with 22 additions and 29 deletions

View File

@ -11,6 +11,14 @@
<servlet> <servlet>
<servlet-name>Queue Status Servlet</servlet-name> <servlet-name>Queue Status Servlet</servlet-name>
<servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class> <servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class>
<init-param>
<param-name>proxyValidateUrl</param-name>
<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
</init-param>
<init-param>
<param-name>proxyServiceUrl</param-name>
<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
</init-param>
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>
@ -21,14 +29,6 @@
<param-name>enabledForExtensions</param-name> <param-name>enabledForExtensions</param-name>
<param-value>true</param-value> <param-value>true</param-value>
</init-param> </init-param>
<init-param>
<param-name>proxyValidateUrl</param-name>
<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
</init-param>
<init-param>
<param-name>proxyServiceUrl</param-name>
<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
</init-param>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>

View File

@ -11,6 +11,14 @@
<servlet> <servlet>
<servlet-name>Queue Status Servlet</servlet-name> <servlet-name>Queue Status Servlet</servlet-name>
<servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class> <servlet-class>de.hsadmin.core.qserv.QueueStatusReceiverServlet</servlet-class>
<init-param>
<param-name>proxyValidateUrl</param-name>
<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
</init-param>
<init-param>
<param-name>proxyServiceUrl</param-name>
<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
</init-param>
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>
@ -21,14 +29,6 @@
<param-name>enabledForExtensions</param-name> <param-name>enabledForExtensions</param-name>
<param-value>true</param-value> <param-value>true</param-value>
</init-param> </init-param>
<init-param>
<param-name>proxyValidateUrl</param-name>
<param-value>https://@LOGIN_HOST@:@LOGIN_PORT@/cas/proxyValidate</param-value>
</init-param>
<init-param>
<param-name>proxyServiceUrl</param-name>
<param-value>https://@CONFIG_HOST@:@CONFIG_PORT@/hsar/backend</param-value>
</init-param>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>

View File

@ -18,12 +18,14 @@ import javax.naming.Context;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import javax.naming.NamingException; import javax.naming.NamingException;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import de.hsadmin.core.model.TechnicalException; import de.hsadmin.core.model.TechnicalException;
import de.hsadmin.core.model.TicketValidator;
import de.hsadmin.core.model.Transaction; import de.hsadmin.core.model.Transaction;
import de.hsadmin.core.util.Config; import de.hsadmin.core.util.Config;
@ -43,6 +45,10 @@ public class QueueStatusReceiverServlet extends HttpServlet
@Override @Override
public void init() throws ServletException { public void init() throws ServletException {
final ServletConfig cfg = getServletConfig();
final String validateURL = cfg.getInitParameter("proxyValidateUrl");
final String serviceURL = cfg.getInitParameter("proxyServiceUrl");
TicketValidator.getInstance().initialize(validateURL, serviceURL);
isConnected = false; isConnected = false;
messageCount = 0; messageCount = 0;
errorCount = 0; errorCount = 0;

View File

@ -1,28 +1,15 @@
package de.hsadmin.remote; package de.hsadmin.remote;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.metadata.XmlRpcSystemImpl; import org.apache.xmlrpc.metadata.XmlRpcSystemImpl;
import org.apache.xmlrpc.server.PropertyHandlerMapping; import org.apache.xmlrpc.server.PropertyHandlerMapping;
import org.apache.xmlrpc.server.XmlRpcHandlerMapping; import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
import org.apache.xmlrpc.webserver.XmlRpcServlet; import org.apache.xmlrpc.webserver.XmlRpcServlet;
import de.hsadmin.core.model.TicketValidator;
public class HSXmlRpcServlet extends XmlRpcServlet { public class HSXmlRpcServlet extends XmlRpcServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Override
public void init() throws ServletException {
super.init();
final ServletConfig cfg = getServletConfig();
final String validateURL = cfg.getInitParameter("proxyValidateUrl");
final String serviceURL = cfg.getInitParameter("proxyServiceUrl");
TicketValidator.getInstance().initialize(validateURL, serviceURL); }
@Override @Override
protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
throws XmlRpcException { throws XmlRpcException {