nyte3k
Sep 13th, 2007, 09:51 AM
I have recently started using Spring form tag library, but i've noticed the form action is incorrect now, it points to the actual location of the form.
//This is the jsp page.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
Initial Page
<form:form method="post" commandName="newMemberCommand">
<form:input path="companyName"/>
<input type="submit" value="Try It Now"/>
</form:form>
</body>
</html>
//This is how it is rendered
<html>
<head>
<title>Insert title here</title>
</head>
<body>
Initial Page
<form id="newMemberCommand" method="post" action="/Phonelog/WEB-INF/jsp/index.jsp">
<input id="companyName" name="companyName" type="text" value=""/>
<input type="submit" value="Try It Now"/>
</form>
</body>
</html>
Any ideas why? Is it now required to set the form action? using the older spring:bind tags, this wasn't necessary for me to do.
//This is the jsp page.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
Initial Page
<form:form method="post" commandName="newMemberCommand">
<form:input path="companyName"/>
<input type="submit" value="Try It Now"/>
</form:form>
</body>
</html>
//This is how it is rendered
<html>
<head>
<title>Insert title here</title>
</head>
<body>
Initial Page
<form id="newMemberCommand" method="post" action="/Phonelog/WEB-INF/jsp/index.jsp">
<input id="companyName" name="companyName" type="text" value=""/>
<input type="submit" value="Try It Now"/>
</form>
</body>
</html>
Any ideas why? Is it now required to set the form action? using the older spring:bind tags, this wasn't necessary for me to do.