javax.servlet.ServletException: Could not resolve view with name 'xxxxx'in servlet with name 'xxx'
2017-12-18 10:33
405 查看
在请求的返回值中加入 @ResponseBody
如果还是没有
则需要对springMvc 配置文件进行配置
<bean id="freemarkerConfig"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/templates/" />
<property name="defaultEncoding" value="utf-8" />
模版加载地址配置是否正确 value="/templates/"
在controller中返回的页面地址需去掉默认加载路径 ( templates/login.ftl) 需去掉 templates
如果还是没有
则需要对springMvc 配置文件进行配置
第一,springmvc的配置文件中
<bean id="freemarkerConfig"class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/templates/" />
<property name="defaultEncoding" value="utf-8" />
模版加载地址配置是否正确 value="/templates/"
在controller中返回的页面地址需去掉默认加载路径 ( templates/login.ftl) 需去掉 templates
第二,返回json格式的数据的时候需注意 在配置文件中配置的
<property name="defaultContentType" value="text/html" />改为<property name="defaultContentType" value="application/json" />
相关文章推荐
- javax.servlet.ServletException: Could not resolve view with name 'xxxxx'in servlet with name 'xxx'
- javax.servlet.ServletException: Could not resolve view with name 'xxx' in servlet with name
- javax.servlet.ServletException: Could not resolve view with name 'login' in servlet with name 'XXX'
- javax.servlet.ServletException: Could not resolve view with name 'qq' in servlet with name 'WeiXin'
- javax.servlet.ServletException: Could not resolve view with name 'destination/isOtherExist' in servl
- javax.servlet.ServletException: Could not resolve view with name 'ok' in servlet with name 'spring'
- javax.servlet.ServletException: Could not resolve view with name‘ XXXX’in servlet with name 'spring'的解决方案-----SKY
- springMVC+freemarker 中 Could not resolve view with name 'XXX.ftl' in servlet with name 'SpringMVC'
- 16 Could not resolve view with name 'XXX.ftl' in servlet with name 'SpringMVC'
- Could not resolve view with name 'pcir/del' in servlet with name 'forum'
- Could not resolve view with name 'pcir/del' in servlet with name 'forum'
- Could not resolve view with name 'ok' in servlet with name 'spring'
- Could not resolve view with name 'bok.html' in servlet with name 'spring'
- Could not resolve view with name '***' in servlet with name 'dispatcher'
- Could not resolve view with name 'sys/menu/user' in servlet with name 'dispatcher'
- Spring 4.0.2 + Apache Tiles 3.0.3 [Could not resolve view with name "xxx"]
- javax.naming.NameNotFoundException: Name spring.liveBeansView.mbeanDomain is not bound in this Conte
- Could not resolve view with name
- Solving “javax.naming.NameNotFoundException: Unable to resolve ‘jdbc.SOAAppUserDataSource’ “ with Oracle SOA Suite 11g Adapter S
- reason: 'Could not load NIB in bundle: "XXXXXXX" with name 'xxCell'