Hmm;
   
   Matt, this may be where my naivete shows itself. I could add something like 
the following to PersonController's handleRequest method as you suggest below:
   
  return new ModelAndView().addAllObjects(personManager.getAll());
   
  I also tested the contents of personManager as follows:
   
  List list = personManager.getAll();
  Iterator i = list.iterator();
  System.out.println("printing personManager's contents: " + list.size());
   
  The list size comes back as zero. I can try setting more breakpoints, but at 
this point I'm feeling that maybe I'm missing some configuration step? My 
config is below. Again, the ApplicationContext.xml is:
   
  <?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"; 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
  http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";> 
  
  <bean id="personManager" class="org.appfuse.service.impl.GenericManagerImpl"> 
  <constructor-arg> 
  <bean class="org.appfuse.dao.hibernate.GenericDaoHibernate" 
autowire="byType"> 
  <constructor-arg value="com.ss.relisting.model.Person"/> 
  </bean> 
  </constructor-arg> 
  </bean> 
  
  </beans> 
   
   Perhaps I could look at the tutorial example code and try a comparison of 
the files. 
   
  Regards;
   
  Marshall

Matt Raible <[EMAIL PROTECTED]> wrote:
  What happens if you use new ModelAndView().addAllObjects() - do you
get the same error?

Matt

On 5/22/07, marshall wrote:
> Interestingly, when I debug the ModelMap, the object has null values.
>
> Matt Raible wrote:
> If you print out the contents of ModelMap, what does it have in there?
> You might try debugging your test and setting a breakpoint to
> inspect.
>
> Matt
>
> On 5/22/07, marshall wrote:
> > Sure;
> >
> > Here it is:
> >
> > package com.ss.webapp.controller;
> >
> >
> > import javax.servlet.http.HttpServletRequest;
> > import javax.servlet.http.HttpServletResponse;
> >
> > import org.apache.commons.logging.Log;
> > import org.apache.commons.logging.LogFactory;
> > import org.appfuse.service.GenericManager;
> > import com.socialsplendor.relisting.model.Person;
> >
> > import org.springframework.web.servlet.ModelAndView;
> > import org.springframework.web.servlet.mvc.Controller;
> >
> >
> > public class PersonController implements Controller {
> >
> > private final Log log = LogFactory.getLog(PersonController.class);
> > private GenericManager personManager = null;
> >
> > public void setPersonManager(GenericManager
> > personManager) {
> > this.personManager = personManager;
> > }
> >
> > public ModelAndView handleRequest(HttpServletRequest
> > request, HttpServletResponse response) throws Exception {
> > log.debug("entering 'handleRequest' method...");
> >
> > return new ModelAndView().addObject(personManager.getAll());
> > }
> > }
> >
> >
> > Marshall
> >
> >
> > Matt Raible wrote:
> > The problem likely occurs in PersonController.java - can you post the
> > code for that?
> >
> > Thanks,
> >
> > Matt
> >
> > On 5/22/07, marshall wrote:
> > > Sure Matt;
> > >
> > > I'll include a few things just in case, starting with the
> > > PersonControllerTest class:
> > >
> > > package com.ss.webapp.controller;
> > >
> > > import java.util.List;
> > > import
> > > org.appfuse.webapp.controller.BaseControllerTestCase;
> > > import org.springframework.ui.ModelMap;
> > > import org.springframework.web.servlet.ModelAndView;
> > >
> > > public class PersonControllerTest extends BaseControllerTestCase {
> > > private PersonController c;
> > >
> > > public void setPersonController(PersonController c) {
> > > this.c = c;
> > > }
> > >
> > > public void testHandleRequest() throws Exception {
> > > ModelAndView mav = c.handleRequest(null, null);
> > > ModelMap m = mav.getModelMap();
> > > assertNotNull(m.get("personList"));
> > > assertTrue(((List) m.get("personList")).size() > 0);
> > > }
> > > }
> > >
> > > and the core/src/main/resources/applicationContext.xml
> > >
> > >
> > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > >
> >
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> > >
> >
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
> > >
> > > > class="org.appfuse.service.impl.GenericManagerImpl">
> > >
> > > > autowire="byType">
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > and my dispatcher-servlet.xml configuration for personController:
> > >
> > > > class="com.ss.webapp.controller.PersonController">
> > >
> > >
> > >
> > > I hope this if enough information for you.
> > >
> > > thanks;
> > >
> > > Marshall
> > >
> > > Matt Raible wrote:
> > > What does the handleRequest() method of your PersonController look like?
> > >
> > > Matt
> > >
> > > On 5/22/07, marshall wrote:
> > > > Hey all;
> > > >
> > > > I'm pretty new to appfuse. I'm going thru the tutorial, using a
> modular
> > > > spring MVC archetype. I've created a PersonController and
> > > > PersonControllerTest in the respective directories in the web/
> > component.
> > > > I've also modified the dispatcher-servlet.xml for the proper mapping.
> > > > When I run mvn test -Dtest=PersoncontrollerTest I'm getting an
> > > > AssertionfailedError on the following line in PersonControllerTest:
> > > >
> > > > assertNotNull(m.get("personList"));
> > > >
> > > > Is there another configuration setting that I've overlooked?
> > > >
> > > > Thanks;
> > > >
> > > > Marshall
> > > >
> > > > ________________________________
> > > > Finding fabulous fares is fun.
> > > > Let Yahoo! FareChase search your favorite travel sites to find flight
> > and
> > > > hotel bargains.
> > > >
> > > >
> > >
> > >
> > > --
> > > http://raibledesigns.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > > ________________________________
> > > Park yourself in front of a world of choices in alternative vehicles.
> > > Visit the Yahoo! Auto Green Center.
> > >
> > >
> >
> >
> > --
> > http://raibledesigns.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > Shape Yahoo! in your own image. Join our Network Research Panel today!
> >
> http://us.rd.yahoo.com/evt=48517/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
> > hot CTA = Join our Network Research Panel
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ________________________________
> Looking for a deal? Find great prices on flights and hotels with Yahoo!
> FareChase.
>
>


-- 
http://raibledesigns.com

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



 
---------------------------------
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.

Reply via email to