Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

n00b: Date conversion

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic