2 baidu 35952075 baidu_35952075 于 2016.09.25 14:22 提问

weblogic ServletException 找不到视图,求大神!

我将tomcat下的spring+springmvc+mybatis项目部署到weblogic,

访问界面时一直报ServletException找不到视图,

访问数据时可以出现,搞不懂,求大神指教!

报错信息:

 javax.servlet.ServletException: Could not resolve view with name 'index' in servlet with name 'SpringMVC'
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1227)
    at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
返回数据信息:
[{"????":[{"topic":"??????2016???????????????????","remark":"","tp":"atth/1000011354tp_center.jpg","code":"1000006643","atth_path":""},{"topic":"??????????????????","remark":"","tp":"atth/1000011352tp_center.jpg","code":"1000006642","atth_path":""},{"topic":"???????????????","remark":"","tp":"atth/1000011346tp_center.jpg","code":"1000006641","atth_path":""},{"

虽然有乱码,但也出来了,但是视图一直出不来,,,

1个回答

baidu_35952075
baidu_35952075   2016.09.25 14:47

web.xml 配置如下:

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

    <display-name>上海政府采购</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <!-- Spring和mybatis的配置文件 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:com/spring/spring-myBatis.xml,
            classpath:com/spring/applicationContext.xml
        </param-value>
    </context-param>

    <!-- 编码过滤器 -->
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <!-- <async-supported>true</async-supported> -->
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- Spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- 防止Spring内存溢出监听器 -->
    <listener>
        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
    </listener>

    <!-- Spring MVC servlet -->
    <servlet>
        <servlet-name>SpringMVC</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:com/spring/spring-mvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
        <!-- <async-supported>true</async-supported> -->
    </servlet>
    <servlet-mapping>
        <servlet-name>SpringMVC</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!-- Tomcat -> default ; WebLogic -> FileServlet -->
    <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.css</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.gif</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.jpg</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.js</url-pattern>
     </servlet-mapping>

    <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.ttf</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.woff</url-pattern>
     </servlet-mapping>

    <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.woff2</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.eot</url-pattern>
     </servlet-mapping>

     <servlet-mapping>
         <servlet-name>FileServlet</servlet-name>
         <url-pattern>*.svg</url-pattern>
     </servlet-mapping>

</web-app>
Csdn user default icon
上传中...
上传图片
插入图片