2015-09-07 3 views
2

Я работаю с распоркой-спящего проектом и успешно развернуто на нескольких серверах веба-приложениях, как, Tomcat, JBoss, WAS и т.д.Weblogic 10.3.6 Проблемы с пользовательским Servlet фильтры

Вот что-то странный вопрос я получаю, когда развернуло одно и то же приложение на сервере WebLogic 10.3.6.

У меня есть несколько фильтров в web.xml для обработки запроса перед классами действий. Эти фильтры инициализируются при загрузке приложения (debug идет в методе init), когда я нажимаю URL-адреса, он должен сначала использовать методы doFilter для моих классов фильтров, но в случае weblogic он не работает.

То же самое работает на других серверах веб-приложений.

web.xml

<?xml version="1.0" encoding="ISO-8859-1"?> 

    <!DOCTYPE web-app PUBLIC 
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
      "http://java.sun.com/dtd/web-app_2_3.dtd"> 

    <web-app> 

    <!-- Parameter for JSTL resource bundle usage. --> 
    <context-param> 
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> 
    <param-value>app_resources</param-value> 
    </context-param> 

    <!-- Parameters related to application configuration. --> 
    <context-param> 
    <param-name>configFile</param-name> 
    <param-value>/WEB-INF/app-config.xml</param-value> 
    </context-param> 
    <context-param> 
    <param-name>configClass</param-name> 
    <param-value>org.apache.struts.apps.ajaxchat.AjaxChatConfig</param-value> 
    </context-param> 


    <filter> 
     <filter-name> 
      Logging Filter 
     </filter-name> 
     <description> 
      Filter used to log each user action 
     </description> 
     <filter-class> 
      com.mypackage.ActivityLoggingFilter 
     </filter-class> 
    </filter> 

    <!-- Use this if you want db authentication --> 
    <filter> 
     <filter-name> 
      AuthFilter 
     </filter-name> 
     <description> 
      Filter handling custom user authentication 
     </description> 
     <filter-class> 
      com.mypackage.AuthenticationFilter 
     </filter-class> 
     <init-param> 
      <param-name>auth_uri</param-name> 
      <param-value>/Login.do</param-value> 
     </init-param> 
     <init-param> 
      <param-name>password_change_uri</param-name> 
      <param-value>/PasChangeExp.do</param-value> 
     </init-param> 
    </filter> 

    <filter-mapping> 
     <filter-name>AuthFilter</filter-name> 
     <servlet-name>action</servlet-name> 
    </filter-mapping> 
    <filter-mapping> 
     <filter-name>AuthFilter</filter-name> 
     <servlet-name>tcode</servlet-name> 
    </filter-mapping> 
    <filter-mapping> 
     <filter-name>AuthFilter</filter-name> 
     <servlet-name>help</servlet-name> 
    </filter-mapping> 

    <!-- Map the filter to a Servlet or URL --> 

    <filter-mapping> 
     <filter-name>Logging Filter</filter-name> 
     <servlet-name>action</servlet-name> 
    </filter-mapping> 

    <!-- Listeners --> 
    <!-- 
    <listener> 
     <listener-class>com.mypackage.HibernateListener</listener-class> 
    </listener> 
    --> 
    <listener> 
     <listener-class> 
      com.mypackage.SessionListener 
     </listener-class> 
    </listener> 
    <listener> 
     <listener-class>com.mypackage.ContextListener</listener-class> 
    </listener> 

    <listener> 
    <listener-class>javawebparts.listener.AppConfigContextListener</listener-class> 
    </listener> 

    <servlet> 
     <servlet-name>Log4JInitServlet</servlet-name> 
     <servlet-class>com.mypackage.Log4JInitServlet</servlet-class> 
     <init-param> 
      <param-name>log4j-properties-location</param-name> 
      <param-value>/WEB-INF/classes/logging.properties</param-value> 
     </init-param> 

     <load-on-startup>1</load-on-startup> 
    </servlet> 


    <servlet> 
     <servlet-name>action</servlet-name> 
     <servlet-class>com.mypackage.InheritanceActionServet</servlet-class> 

     <init-param> 
      <param-name>config</param-name> 
      <param-value>/WEB-INF/modules/main/config/struts-config.xml</param-value> 
     </init-param> 
     <init-param> 
      <param-name>config/main/user</param-name> 
      <param-value>/WEB-INF/modules/main/modules/user/config/struts-config.xml</param-value> 
     </init-param> 
     <init-param> 
      <param-name>config/main/group</param-name> 
      <param-value>/WEB-INF/modules/main/modules/group/config/struts-config.xml</param-value> 
     </init-param> 
     <init-param> 
      <param-name>config/main/profile</param-name> 
      <param-value>/WEB-INF/modules/main/modules/profile/config/struts-config.xml</param-value> 
     </init-param> 

     <load-on-startup>3</load-on-startup> 
    </servlet> 

    <servlet> 
     <servlet-name>MenuInitServlet</servlet-name> 
     <servlet-class>com.mypackage.MenuInitServlet</servlet-class> 
     <load-on-startup>4</load-on-startup> 
    </servlet> 

    <servlet> 
     <servlet-name>JnlpDownloadServlet</servlet-name> 
     <servlet-class>com.sun.javaws.servlet.JnlpDownloadServlet</servlet-class> 
    </servlet> 

    <servlet> 
     <servlet-name>tcode</servlet-name> 
     <servlet-class>com.mypackage.TcodeServiceImpl</servlet-class> 
    </servlet> 

    <servlet> 
     <servlet-name>help</servlet-name> 
     <servlet-class>com.mypackage.HelpServlet</servlet-class> 
    </servlet> 

    <!-- servlet-mapping> 
     <servlet-name>JnlpDownloadServlet</servlet-name> 
     <url-pattern>*.jnlp</url-pattern> 
    </servlet-mapping --> 

    <servlet-mapping> 
     <servlet-name>action</servlet-name> 
     <url-pattern>*.do</url-pattern> 
    </servlet-mapping> 

    <servlet-mapping> 
     <servlet-name>tcode</servlet-name> 
     <url-pattern>/tcode/*</url-pattern> 
    </servlet-mapping> 

    <servlet-mapping> 
     <servlet-name>help</servlet-name> 
     <url-pattern>/static/help/*</url-pattern> 
    </servlet-mapping> 

    <session-config> 
      <session-timeout>15</session-timeout> 
    </session-config> 

    <welcome-file-list> 
     <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 

    <error-page> 
     <error-code>400</error-code> 
     <location>/ErrorPage.do</location> 
    </error-page> 

    <error-page> 
     <error-code>404</error-code> 
     <location>/ErrorPage404.do</location> 
    </error-page> 

    <error-page> 
     <error-code>500</error-code> 
     <location>/ErrorPage500.do</location> 
    </error-page> 

    <taglib> 
     <taglib-uri>/tags/struts-bean</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/struts-html</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/struts-logic</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/struts-tiles</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/struts-nested</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/struts-nested.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/menu</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/menu.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/navigator</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/navigator.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/list</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/list.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/table</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/table.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/monitor</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/client.tld</taglib-location> 
    </taglib> 
     <taglib> 
     <taglib-uri>/tags/alerts</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/alerts.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/custom</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/customFields.tld</taglib-location> 
    </taglib> 
    <taglib> 
    <taglib-uri>/tags/filter</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/filter.tld</taglib-location> 
    </taglib> 
    <taglib> 
    <taglib-uri>/tags/selectChoices</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/selectChoices.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/matrix</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/matrix.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/report</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/report.tld</taglib-location> 
    </taglib> 
    <taglib> 
     <taglib-uri>/tags/listWithActionTag</taglib-uri> 
     <taglib-location>/WEB-INF/tlds/listWithActionTag.tld</taglib-location> 
    </taglib> 

    <!-- resource --> 
    <!--resource-ref> 
     <res-ref-name>jdbc/prototype</res-ref-name> 
     <res-type>javax.sql.DataSource</res-type> 
     <res-auth>Container</res-auth> 
    </resource-ref--> 

</web-app> 

weblogic.xml

<?xml version="1.0" encoding="UTF-8"?> 
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"> 
    <context-root>mps</context-root> 
    <container-descriptor> 
     <prefer-web-inf-classes>true</prefer-web-inf-classes> 
     <show-archived-real-path-enabled>true</show-archived-real-path-enabled> 
    </container-descriptor> 
</weblogic-web-app> 
+0

Рассматривали ли вы добавление '/*' или ' REQUEST' к вашему фильтру? Кажется, что картинка не работает –

+0

Да, я тоже это пробовал, но не надеюсь. –

ответ

0

Я обнаружил, что при расширении класса фильтра, требовалось, чтобы добавить @Override аннотацию выше метод класса фильтра. Добавление этой проблемы разрешило мою проблему.

Смежные вопросы