使用spring表单标签库时出现的一个错误

错误信息:
org.apache.jasper.JasperException: No WebApplicationContext found: no ContextLoaderListener registered?

解决办法:
在web.xml中除了需要配置表单标签库之外还需要加入以下代码,否则资源文件加载不进来。

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>?

在web应用的web.xml文件中声明一个ContextLoaderListener的作用是:
在系统启动时执行该Listener,读取spring的xml配置文件

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>