Announcement Announcement Module
Collapse
No announcement yet.
404 error on Spring+Weblogic Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 404 error on Spring+Weblogic

    Hi, All
    I'm using spring+hibernate in a web project on weblogic. There is a servlet mapping(InternalResourceViewResolver): from *.jsp => .htm,
    when I open a url http://localhost:7001/app/index.htm (it should be responsed by a spring controller), but Weblogic throw 404 page not found.

    How can I abandon Weblogic finding *.htm request-url as a file?

    thanks for any responses!

  • #2
    You'd have to provide much more information. Show your context, particularly your view resolver configuration.

    Comment


    • #3
      DispatcherServlet define contextConfigLocation:
      <bean id="viewReslover" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
      <property name="viewClass">
      <value>org.springframework.web.servlet.view.JstlVi ew</value>
      </property>
      <property name="prefix">
      <value>/WEB-INF/jsp/</value>
      </property>
      <property name="suffix">
      <value>.jsp</value>
      </property>
      </bean>

      and this is controller mapping:
      <bean id="SimpleUrlMap_framework_query" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping" singleton="true" lazy-init="default" autowire="default" dependency-check="default">
      <property name="mappings">
      <props>
      <prop key="/main.htm">mainController</prop
      </props>
      </property>
      </bean>

      why weblogic12c can't redirect url to my controller?Thranks

      Comment


      • #4
        The missing link is likely your web.xml, then. Show us that.

        Comment


        • #5
          web.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.5"
          xmlns="http://java.sun.com/xml/ns/javaee"
          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">
          <display-name>sys</display-name>
          <description>JSP application</description>
          <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>
          classpath:spring/framework-data.xml,
          classpath:spring/framework-common.xml,
          classpath:spring/framework-query.xml,
          /WEB-INF/spring/sys-portal.xml,
          /WEB-INF/spring/sys-bbs.xml
          </param-value>
          <!--framework-sms.xml-->
          </context-param>
          <!--encoding-->
          <filter>
          <filter-name>sessionFilter</filter-name>
          <filter-class>com.wri.hy.framework.application.framework.s ecurity.controller.SessionFilter</filter-class>
          <init-param>
          <param-name>encoding</param-name>
          <param-value>utf-8</param-value>
          </init-param>
          <init-param>
          <param-name>isCheck</param-name>
          <param-value>true</param-value>
          </init-param>
          </filter>
          <filter-mapping>
          <filter-name>sessionFilter</filter-name>
          <url-pattern>*.htm</url-pattern>
          </filter-mapping>
          <listener>
          <listener-class>com.wri.hy.framework.application.framework.s ecurity.controller.SessionListener</listener-class>
          </listener>

          <!--spring-->
          <servlet>
          <servlet-name>framework</servlet-name>
          <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
          <init-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>classpath:spring/framework-servlet.xml</param-value>
          </init-param>
          <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet>
          <servlet-name>context</servlet-name>
          <servlet-class>org.springframework.web.context.ContextLoade rServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
          </servlet>

          <servlet-mapping>
          <servlet-name>framework</servlet-name>
          <url-pattern>*.htm</url-pattern>
          </servlet-mapping>

          <!--Axis Web Services-->
          <servlet>
          <servlet-name>AxisServlet</servlet-name>
          <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
          </servlet>
          <servlet-mapping>
          <servlet-name>AxisServlet</servlet-name>
          <url-pattern>/servlet/AxisServlet</url-pattern>
          </servlet-mapping>
          <servlet-mapping>
          <servlet-name>AxisServlet</servlet-name>
          <url-pattern>*.jws</url-pattern>
          </servlet-mapping>
          <servlet-mapping>
          <servlet-name>AxisServlet</servlet-name>
          <url-pattern>/services/*</url-pattern>
          </servlet-mapping>

          <session-config>
          <session-timeout>240</session-timeout>
          </session-config>
          <welcome-file-list>
          <welcome-file>index.html</welcome-file>
          <welcome-file>index.htm</welcome-file>
          <welcome-file>index.jsp</welcome-file>
          </welcome-file-list>
          <error-page>
          <error-code>404</error-code>
          <location>/fileNotFound.html</location>
          </error-page>

          </web-app>

          Comment


          • #6
            Which url you firing? and try to change loading order as two servlet at same order(suggestion not solution yet)

            Comment


            • #7
              problem still exists

              404 error problem still exists when request a url like '/main.htm'

              Comment

              Working...
              X