Springmvc+freemarker in could not resolve view with name ... Problem solving

Source: Internet
Author: User

Use to Springmvc+freemarker, oneself in doing the demo process reported:

Critical: Servlet.service () for Servlet Springmvc threw exception

Javax.servlet.ServletException:Could not resolve view with name ' UserList ' in servlets with Name ' Springmvc '

At Org.springframework.web.servlet.DispatcherServlet.render (dispatcherservlet.java:1102)

At Org.springframework.web.servlet.DispatcherServlet.doDispatch (dispatcherservlet.java:890)

At Org.springframework.web.servlet.DispatcherServlet.doService (dispatcherservlet.java:792)

At Org.springframework.web.servlet.FrameworkServlet.processRequest (frameworkservlet.java:851)

At Org.springframework.web.servlet.FrameworkServlet.doGet (frameworkservlet.java:756)

At Javax.servlet.http.HttpServlet.service (httpservlet.java:617)

At Javax.servlet.http.HttpServlet.service (httpservlet.java:717)

At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:290)

At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206)

At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:233)

At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:191)

At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:127)

At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:102)

At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109)

At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:298)

At Org.apache.coyote.http11.Http11Processor.process (http11processor.java:857)

At


<!-- freemarker configuration  -->      <bean id= "FreemarkerConfig"  class= "Org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer" >           <property name= "Templateloaderpath"  value= "/WEB-INF/views/"  />          <property name= " Freemarkersettings ">               <props>                   <prop key= "Template_update_delay" >0</prop>                   <prop key= "Default_encoding" >UTF-8</prop>                   <prop key="Number_format" >0.##########</prop>                   <prop key= "Datetime_format" >yyyy-MM-dd HH:mm:ss</ prop>                   <prop key= "Classic_compatible" >true</prop>                   <prop key= "Template_exception_ Handler ">ignore</prop>               </props>          </property>       </bean>      <!--freemarker View parser-->       <bean id= "Viewresolver"  class= " Org.springframework.web.servlet.view.freemarker.FreeMarkerViEwresolver ">          <property name=" cache "  value= "true"/>        <property name= "prefix"   Value= "/web-inf/views/"/>        <property name= "suffix"  value= ". html"/>        <property name= "ContentType"  value= "Text/html;charset=utf-8"  />        <!--if  you want to use the spring freemarker macros, set this  property to true-->        <property name= " Exposespringmacrohelpers " value=" true "/>        <property  name= "Requestcontextattribute"  value= "RequestContext"  />    </bean >   
Problem solving:
because the Freemarker itself is configuredTemplateloaderpathin Viewresolver, no configuration is requiredprefix.


From for notes (Wiz)

Springmvc+freemarker in could not resolve view with name ... Problem solving

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.