关于web.xml中不能识别taglib的问题
2011-05-09 20:39
232 查看
上午在学习struts-i18n的扩展-jstl-i18n的时候遇到一个问题:
The absolute uri: http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the jar files deployed with this application
错误导致页面报告500……
经过查阅得到结果:未引用jar包。
问题解决:将jstl用到的两个jar包jstl.jar和standard.jar copy到WEB-INF下即可。
详述如下:在jsp页面使用jstl标签 fmt 需要首先在jsp页面头部分引用,即<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>。
整个页面代码如下:
The absolute uri: http://java.sun.com/jsp/jstl/fmt cannot be resolved in either web.xml or the jar files deployed with this application
错误导致页面报告500……
经过查阅得到结果:未引用jar包。
问题解决:将jstl用到的两个jar包jstl.jar和standard.jar copy到WEB-INF下即可。
详述如下:在jsp页面使用jstl标签 fmt 需要首先在jsp页面头部分引用,即<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>。
整个页面代码如下:
<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <fmt:setLocale value="${header[accept-language]}"/> <fmt:setBundle basename="resource.MessageResources"/> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GB18030"> <title>Insert title here</title> </head> <body> <form action="login.do" method="post"> <fmt:message key="login.form.filed.username"></fmt:message>:<input type="text" name="username"/><br/> <fmt:message key="login.form.filed.password"></fmt:message>:<input type="text" name="password"/><br/> <input type="submit" value="<fmt:message key="login.form.button.login"/>"/> </form> </body> </html> |
其中 <fmt:setLocale value="${header[accept-language]}"/> <fmt:setBundle basename="resource.MessageResources"/> 是设置国际化文本的来源。 <fmt:message key="login.form.filed.username"></fmt:message> <fmt:message key="login.form.filed.password"></fmt:message> <fmt:message key="login.form.button.login"/> 就是用来显示国际化文本的fmt标签。由于jstl所用的两个jar包,我开始未引用到WEB-INF文件夹下,造成页面显示报错。 参考网址:飞诺网(www.firnow.com):http://dev.firnow.com/course/3_program/java/javajs/2008107/148863.html |
相关文章推荐
- 关于web.xml中不能识别taglib的问题
- 关于web.xml中不能识别taglib的问题
- 关于web.xml中不能识别taglib的问题
- 关于web.xml中不能识别taglib的问题
- 关于web.xml中不能识别<taglib>的问题
- 关于web.xml中不能识别taglib的问题
- 【转】关于web.xml中不能识别taglib的问题
- 关于web.xml中配置404错误跳转页面 在ie不能显示自定义错误页面的问题
- 关于web.xml中配置404错误跳转页面 在ie不能显示自定义错误页面的问题
- web.xml 文件中关于配置问题
- web.xml不识别<taglib>解决办法
- 关于Struts2在web.xml中配置后出现404错误的问题,完美解决方案!
- 关于idea创建struts2中web.xml的filter的url中struts无法解析的问题
- 关于uiautomator的build.xml不能编译的问题
- 关于web.xml里的filter的url-pattern配置问题
- 解决关于Vs.net2003的不能调试WEB项目的问题(转)
- 在web.xml中无法配置<taglib>的问题
- Tomcat迁移JBoss杂症—不识别及不能解析web.xml
- 关于mysql错误1366(不能识别汉字问题)
- 关于web.xml的首页和struts的action的问题