I am building MVC CRUD application. In JSP file I got this error
The tag handler class for "fmt:message"
(org.apache.taglibs.standard.tag.rt.fmt.MessageTag)
was not found on the Java Build Path
Here is my JSP file at the line “fmt:message”
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<title><fmt:message key="title"/></title>
<style>
.error { color: blue; }
</style>
</head>
<body>
<h1><fmt:message key="addprod.heading"/></h1>
<form:form method="post" commandName="addprod">
<table width="95%" bgcolor="f8f8ff" border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="right" width="20%">Add a new Product: (Please enter ID for the new product) </td>
<td width="20%">
<form:input path="productID"/>
</td>
<td width="60%">
<form:errors path="productID" cssClass="error"/>
</td>
</tr>
<tr>
<td align="right" width="20%">Add a new Product: (Please enter name for the new product) </td>
<td width="20%">
<form:input path="productname"/>
</td>
<td width="60%">
<form:errors path="productname" cssClass="error"/>
</td>
</tr>
<tr>
<td align="right" width="20%">Add Price: (Specify price in number) </td>
<td width="20%">
<form:input path="productprice"/>
</td>
<td width="60%">
<form:errors path="productprice" cssClass="error"/>
</td>
</tr>
</table>
<br>
<input type="submit" align="center" value="Add">
</form:form>
<a href="<c:url value="hello.htm"/>">Home</a>
</body>
</html>
Kindly guide me how to solve it. I added all the jars related, But could not understand the error exactly. Thanks
I see two potential problems.
Regarding the specific error you’re seeing, you need to ensure
the appropriate tag library is on your build path. In Eclipse,
right-click your project and select “Properties”. In the dialog that
pops up, select “Java Build Path”. The window should display tabs
representing the various kinds of libraries you can add to your
project. One of those tabs should list the “JSTL” library–my
projects, for instance, use
jstl-1.2.jar. If you don’t see it inany of the libraries on your build path, you may need to add it
manually by copying it to your project’s external library folder and
adding the JAR manually to your build path.
See: http://wiki.eclipse.org/FAQ_How_do_I_add_an_extra_library_to_my_project%27s_classpath%3F for more info.
After you add the library to your build path, you still have to
make sure that the tags it contains are available to your specific
JSP. In your example, you have:
That allows you to use Spring’s
formtag library in your current JSP. I do not see a similar declaration for thefmtlibrary, which I would expect to look something like:It’s possible that you’ve got that in your
include.jspfile; if so you should be fine.Hope this helps.