Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

example of source code for insert a date  RSS feed

 
asmaa kellal
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I need a simple example of source code to insert a date into a database using jsf what do I have to put in backing bean and page jsf ( i need juste a date )

thanks
 
Milan Mendpara
Greenhorn
Posts: 7
Java Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it might work for you by casting it to GregorianCalendar .........

<ace:dateTimeEntry value="#{backBean.urDate}">
<f:convertDateTime dateStyle="short" pattern="MM/dd/yyyy" type="date" />
</ace:dateTimeEntry>


Calendar cal = Calendar.getInstance();
cal.setTime(urDate);
XMLGregorianCalendar xcal = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) cal);
obj.setDate(xcal);
// your code
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!