I want to show the dates between DateA and DateB in a jsp table
For example:
DateA = 23-01-2014 DateB = 26-01-2014
Output:
Dates
- 23-01-2014
- 24-01-2014
- 25-01-2014
- 26-01-2014
So far I've done this:
index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form name="datepickeer" action="showdates.jsp" method="POST">
<table>
<tr><td>Date début :</td> <td><input type = "date" name = "dateA">
</td><tr>
<tr><td><input type = "submit" name = "submit" value = "submit">
</td></tr>
</table>
</form>
</body>
</html>
showDates.jsp
<%@ page import = "java.util.Date,java.text.SimpleDateFormat,java.text.ParseException"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<% String dateStr = request.getParameter("dateA");
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
Date result = formater.parse(dateStr);
SimpleDateFormat newFormater = new SimpleDateFormat("dd-MM-yyyy");
out.println(newFormater.format(result));
%>
</body>
</html>
Output when i choose the second of april 2014 is :
02-04-2014
After creating the DateA I should do the same for DateB ,then,what should I do next??