• Post Reply Bookmark Topic Watch Topic
  • New Topic

n00b: Date conversion  RSS feed

 
Tracy Nelson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I've got about two days of JSF experience under my belt, and I'm having a (presumably) simple problem. I've got a simple JSF data entry page that has a couple of date fields in it. When I submit the page, I get an error "Can't set property 'startDate' on class 'com.foo.entity.Task' to value '8/23/06 12:00 AM'. I've got setters in the Task class that take a String, a java.util.Date, and a java.sql.Date (java.sql.Date is the type I ultimately want). The field in the JSP is defined as:

<h:inputText id="startDate" value="#{task.task.startDate}" title="StartDate" >
<f:convertDateTime pattern="dd-MMM-yyyy" type="date"/>
</h:inputText>

Any pointers? Is there something I need to add to the converter to handle this? FWIW, I'm using NetBeans 5.5-beta2, and its built-in JSF generator to create the JSF page, controller and converter, so I really have no idea what I'm doing....
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, please don't use the word n00b.

Second, I'm using NetBeans 5.5-beta2, and its built-in JSF generator to create the JSF page, controller and converter, so I really have no idea what I'm doing....

I'd say that is the bulk of your problem. Typically, IDE's that generate a bunch of code for you are never a good tool when trying to learn a technology.

And third, you'll want to show us your JSP and backing bean code and possibly a bit more of the stack trace.

I'd also advise that you take a gander at this so that you can help us help you. Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!