I have a bean that has a set method that takes in a java.sql.Date object.
public void setStartDate(java.sql.Date newValue){
startDate= newValue;
}
This is used in a PreparedStatement to retrieve data from the database.
I am pulling the value from the URL. For example, the url would be:
http://localhost:8080/test/somePage.jsp?startDate=01-APR-2008
Now, in the JSP I am trying to use the fmt:formatDate tag.
<fmt:formatDate value="${param.startDate}" var="startDate" pattern="yyyy-mm-dd"/>
However, I just cannot get it to work. It keeps throwing errors like:
Attempt to convert String "01-Apr-2008" to type "java.util.Date", but there is no PropertyEditor for that type
So after some reading, I decided to try fmt:parseDate. So I then did:
<fmt:parseDate var="startDate" value="${param.startDate}" pattern="yyyy-mm-dd" />
Then I get the error:
In <parseDate>, value attribute can not be parsed: "01-Apr-2008"
All I am trying to do is call:
<jsp:setProperty property="startDate" name="HomeBean" value="${startDate}"/>