Hey guys
I am very new to JSP. I wanted to declare a method in JSP code, but its giving me an error. Error is
org.apache.jasper.JasperException: Unable to compile class for JSP.
An error occurred at line: 76 in the jsp file: /jsp/test20.jsp
Generated servlet error:
Unhandled exception type ParseException
and the code is
<code>
<%!
public String changeDateFormat(String str){
SimpleDateFormat df = new SimpleDateFormat("dd-M-yyyy");
java.util.Date tDate = new java.util.Date();
tDate = df.parse(str);
df = new SimpleDateFormat("dd-MMM-yyyy");
String date1 = df.format(tDate).toUpperCase();
return date1;
}
%>
<%
String theDate;
theDate = changeDateFormat(goodDate);
%>
</code>
its giving me error in line 76 which is the line that contains "<%!". Any thoughts on how to fix this???
I am very new to JSP. I wanted to declare a method in JSP code, but its giving me an error. Error is
org.apache.jasper.JasperException: Unable to compile class for JSP.
An error occurred at line: 76 in the jsp file: /jsp/test20.jsp
Generated servlet error:
Unhandled exception type ParseException
and the code is
<code>
<%!
public String changeDateFormat(String str){
SimpleDateFormat df = new SimpleDateFormat("dd-M-yyyy");
java.util.Date tDate = new java.util.Date();
tDate = df.parse(str);
df = new SimpleDateFormat("dd-MMM-yyyy");
String date1 = df.format(tDate).toUpperCase();
return date1;
}
%>
<%
String theDate;
theDate = changeDateFormat(goodDate);
%>
</code>
its giving me error in line 76 which is the line that contains "<%!". Any thoughts on how to fix this???