mardi 24 février 2015

Spring taglib not working

When i include spring taglib in my jsp page, its showing the whole jsp code at my localhost.Am unable to find what is wrong in it. I have given jstl dependency in maven pom.xml file.


Please suggest me solutions to this.



addEmployee.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://ift.tt/IED0jK" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ift.tt/kTyqzh">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>Add Employee</h1>
<form:form commandName="employee">
<table>
<tr>
<td>Firstname:</td>
<td><form:input path="firstname"/></td>
</tr>
<tr>
<td>Lastname:</td>
<td><form:input path="lastname"/></td>
</tr>

<tr>
<td>Date of Birth:</td>
<td><form:input path="dob" type="date"/></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Add Employee">
</td>
</tr>
</table>
</form:form>
</body>
</html>


servlet-config.xml



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:p="http://ift.tt/1jdM0fE"
xmlns:context="http://ift.tt/GArMu7"
xmlns:mvc="http://ift.tt/1bHqwjR"
xsi:schemaLocation="http://ift.tt/1bHqwjR http://ift.tt/JWpJWM
http://ift.tt/GArMu6 http://ift.tt/1jdM0fG
http://ift.tt/GArMu7 http://ift.tt/1bGeTcI">

<mvc:annotation-driven/>
<mvc:resources location="assets" mapping="/assets/**"/>
<context:annotation-config/>
<context:component-scan base-package="com.employee.controller"/>

<mvc:default-servlet-handler/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>

Aucun commentaire:

Enregistrer un commentaire