Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP w/ Date and Calendar

 
Michael Brewer
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to build a calendar application using JSP and JavaBeans. I have the following code in my JSP page:

Pattern is a JavaBean I made that implements an insertPattern method that takes a Calendar and int as arguments. Pattern.java successfully compiles into Pattern.class. There errors I get when loading the JSP are below:

I'm stumped. getInstance is a method of Calendar. set is a method of Calendar. And insertPattern is a method in my JavaBean and the signature is correct.
Can someone please explain to me how to use Date and/or Calendar to create a Date; get its separate date, month, year values; increment the Date by a day; and so on?
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You just need to import java.util.Calendar like this:
<%@ page import="java.util.Calendar" %>
Add that to the top of your .jsp file
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!