applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd";>
<beans>
 <bean id="idCalendarBean" class="de.fhb.calendar.CalendarBean">
   <property name="firstDate" value="null"/>
 </bean>
</beans>

faces-config.xml
        <managed-bean>
                <managed-bean-name>CalendarBean</managed-bean-name>
                <managed-bean-class>
                        de.fhb.calendar.CalendarBean
                </managed-bean-class>
                <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>

CalendarBean
public class CalendarBean implements Serializable {
   /**
    * serial id for serialisation
    */
   private static final long serialVersionUID = 1L;

   private Date firstDate;

   public Date getFirstDate() {
                return firstDate;
        }

   public void setFirstDate(Date firstDate) {
                this.firstDate = firstDate;
        }

        public String submitMethod()
   {
       return "submit";
   }
}

jsp file
       <h:form id="calendarForm">
           <t:inputCalendar monthYearRowClass="yearMonthHeader"
weekRowClass="weekHeader"
               currentDayCellClass="currentDayCell"
value="#{calendarBean.firstDate}"/>
       </h:form>

but i found something about this:

http://issues.apache.org/struts/browse/SHALE-192

stephan

2006/7/7, Gary VanMatre <[EMAIL PROTECTED]>:
>From: "stephan opitz" <[EMAIL PROTECTED]>

> thx, but how i register them?
>

To register a managed bean using JSF, look in the /WEB-INF/faces-config.xml.  
Try something like this:

 <managed-bean>
   <managed-bean-name>calendarBean</managed-bean-name>
   <managed-bean-class>org.acme.CalendarBean</managed-bean-class>
   <managed-bean-scope>request</managed-bean-scope>
 </managed-bean>

A few more examples:
http://svn.apache.org/viewvc/shale/trunk/shale-apps/shale-usecases/src/main/webapp/WEB-INF/faces-config.xml?view=log
http://svn.apache.org/viewvc/shale/trunk/shale-apps/shale-clay-usecases/src/main/webapp/WEB-INF/faces-config.xml?view=log

Gary


> 2006/7/7, Gary VanMatre :
> > >hello,
> > >
> > >i followed your instructions with the tomahawk-view-config.xml and
> > >include it into web.xml
> > >also i added tomahawk 1.11 libary into lib folder...
> > >
> > >now i wanted to use the calendar!
> > >
> > >i copied CalendarBean from simple example... also i a configured als
> > >rules. managed beans etc.
> > >
> > >already little code like this:
> > >
> > > > > >weekRowClass="weekHeader"
> > > currentDayCellClass="currentDayCell"
> > >value="#{calendarBean.firstDate}"/>
> > >
> > >
> > >throws exception:
> > >14:04:42,015 ERROR [[jsp]] Servlet.service() for servlet jsp threw 
exception
> > >javax.faces.el.EvaluationException: Cannot get value for expression
> > >'> > >weekRowClass="weekHeader"
> > > currentDayCellClass="currentDayCell"
> > >value="#{calendarBean.firstDate}"/>'
> > >
> > >Caused by: java.lang.IllegalStateException: No WebApplicationContext
> > >found: no ContextLoaderListener registered?
> > >at
> >
> 
>org.springframework.web.jsf.FacesContextUtils.getRequiredWebApplicationContext(
> F
> > >acesContextUtils.java:78)
> > > at
> >
> 
>org.springframework.web.jsf.DelegatingVariableResolver.getWebApplicationContext
> (
> > >DelegatingVariableResolver.java:134)
> > >
> > >no final solution found for the
> > >No WebApplicationContext found: no ContextLoaderListener registered?
> > >
> > >problem in this context.
> > >
> >
> > I think the problem is that you have the shale-spring.jar in your classpath
> but your have not registered any spring beans.
> >
> >
> >
> > contextConfigLocation
> >
> >
> >
> >
> > The "calendarBean", managed bean is not registered in the faces-config or
> spring config.
> >
> >
> > >stephan
> >
> > Gary
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to