baidu_35952075 2016-09-25 06:22 采纳率: 0%
浏览 1104

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 2016-09-25 06: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>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥30 用arduino开发esp32控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿