3 Replies Latest reply on May 26, 2007 10:16 AM by Peter Oates

    dateformat not working?

    Peter Oates Newbie

      Hi all,
      I seem to have an issue with the selectDate tag,when i specify it with the dateformat as dd/mm/yyyy. It works when i submit the entry to my DB,

      however then it reverts to mm/dd/yyyy. Has anyone any idea why this is?

       <s:selectDate for="selectedDate" value ="#{entryBrowser.selectedDate}"
       dateFormat = "dd/MM/yyyy">
      
       <h:graphicImage url="img/dtpick.gif" style="margin-left:10px"/>
       </s:selectDate>
      


       <div class="entry">
       <div class="label"> </div>
       <div class="input">
       <h:commandButton id="confirm" value="Confirm" action="#{entryConfirm.confirm}"/>
       <h:commandButton id="populate" value="Populate" action="#{entryList.getEntries}"/>
       </div>
       </div>
       </h:form>
      


       public void confirm()
       {
       log.info("outside try block");
       System.out.println("inside try block");
       Entry tempEntry = new Entry(user.getUsername());
       tempEntry.setStartdate(entryBrowser.getSelectedDate());
       tempEntry.setPriority(calen.getPriority());
       tempEntry.setStartHour(calen.getStartHour());
       tempEntry.setDesc(calen.getDesc());
       tempEntry.setPriority(calen.getPriority());
      
       try
       {
       em.persist(tempEntry);
       //em.flush();
       }
       catch(Exception e) {log.info("The Entity Manager Encountered an Error");}
      
       facesMessages.add("Thank you, #{user.name}, Entry was a success.");
       log.info("New entry for #{user.username}");
       }
      


       @Factory("entries")
       @Observer("entryConfirmed")
       public void getEntries()
       {
       System.out.println(entryBrowser.getSelectedDate().toString());
       if(searchByDate)
       {
       entries = em.createQuery("select e from Entry e where e.username = :username " +
       "and e.startdate = :searchDate order by e.startHour")
       .setParameter("username", user.getUsername())
       .setParameter("searchDate", entryBrowser.getSelectedDate())
       .getResultList();
       }
       }
      


        • 1. Re: dateformat not working?
          Peter Oates Newbie

          ok, I've tried adding the resource servlet to the web.xml to solve this,however
          I know get this error from the stack trace,

          Is there something else i need to do to get the resource servlet working?

          I'm using Seam 1.1.5.GA and jboss As 4.05.GA

          Any help on this would be greatly appeciated

          avax.faces.FacesException: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.seam.servlet.ResourceServlet
           at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:162)
           at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.getFacesServletMappings(WebXml.java:120)
           at org.apache.myfaces.application.jsp.JspViewHandlerImpl.getServletMapping(JspViewHandlerImpl.java:347)
           at org.apache.myfaces.application.jsp.JspViewHandlerImpl.getViewIdPath(JspViewHandlerImpl.java:294)
           at org.apache.myfaces.application.jsp.JspViewHandlerImpl.getActionURL(JspViewHandlerImpl.java:158)
           at org.jboss.seam.jsf.SeamViewHandler.getActionURL(SeamViewHandler.java:48)
           at com.sun.facelets.FaceletViewHandler.getActionURL(FaceletViewHandler.java:781)
           at org.jboss.seam.ui.HtmlLink.encodeBegin(HtmlLink.java:103)
           at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
           at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
           at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
           at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
           at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
           at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
           at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
           at java.lang.Thread.run(Unknown Source)
          Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.seam.servlet.ResourceServlet
           at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:511)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.ClassLoader.loadClassInternal(Unknown Source)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Unknown Source)
           at org.apache.myfaces.shared_impl.util.ClassUtils.classForName(ClassUtils.java:138)
           at org.apache.myfaces.shared_impl.util.ClassUtils.simpleClassForName(ClassUtils.java:157)
           ... 38 more
          


          • 2. Re: dateformat not working?
            Leo Newbie

            Hi,

            I faced this same problem some weeks ago. After 3 or 4 hours trying to solve, I decided replace seam date component by the netbeans calendar component (aka JCreator).

            • 3. Re: dateformat not working?
              Peter Oates Newbie

              Hi thanks for the reply,
              I ended up just going with the format that it would revert too, My system should be able to work with that aswell,