a question when learning <<spring live >>

4 messages Options
Embed this post
Permalink
tntzht

a question when learning <<spring live >>

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
hi, tutor,
      
       Excuse me to scrouge your time to solve my little question.
      
       My question is: in ch#4, there discuss the UserController class, at the end it

             return new ModelAndView("userList", "users", mgr.getUsers());

       but it can't show the records in userList.jsp when my database have some date.

       the class I changed likes following:


package org.appfuse.web;

import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.appfuse.service.UserManager;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

// Modern IDEs support easy importing
public class UserController implements Controller {
    private static Log log = LogFactory.getLog(UserController.class);
    private UserManager mgr = null;
    public void setUserManager(UserManager userManager) {
        this.mgr = userManager;
    }
    // put handleRequest() method here
    public ModelAndView handleRequest(HttpServletRequest request,
                                      HttpServletResponse response) throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("entering 'handleRequest' method...asdasdf");
            log.debug(mgr.getUsers());
        }
        return new ModelAndView("userList", "users", mgr.getUsers());
    }
}



    You can see I add log.debug(mgr.getUsers()); to test, it can show normally.
   
    I debug it by my way, and in my opinion. Maybe the mgr.getUser() function not return a currect format date for spring.

Is it right? Think you vary much.

    My name is Darcy.Zhang, may I have your name,please?


best wishes,

Darcy Zhang
2007-03-29


   



探索 Windows Vista 的世界 了解更多信息!
mraible

Re: a question when learning <<spring live >>

Reply Threaded More More options
Print post
Permalink
Are you using Equinox 1.0 from the book or a different version?  You
should be using 1.0.

Matt

On 3/29/07, 张涛 <[hidden email]> wrote:

>
> hi, tutor,
>
>        Excuse me to scrouge your time to solve my little question.
>
>        My question is: in ch#4, there discuss the UserController class, at
> the end it
>
>              return new ModelAndView("userList", "users", mgr.getUsers());
>
>        but it can't show the records in userList.jsp when my database have
> some date.
>
>        the class I changed likes following:
>
>
> package org.appfuse.web;
>
> import org.apache.commons.logging.LogFactory;
> import org.apache.commons.logging.Log;
> import org.springframework.web.servlet.mvc.Controller;
> import org.springframework.web.servlet.ModelAndView;
> import org.appfuse.service.UserManager;
>
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import java.util.Map;
>
> // Modern IDEs support easy importing
> public class UserController implements Controller {
>     private static Log log = LogFactory.getLog(UserController.class);
>     private UserManager mgr = null;
>     public void setUserManager(UserManager userManager) {
>         this.mgr = userManager;
>     }
>     // put handleRequest() method here
>     public ModelAndView handleRequest(HttpServletRequest
> request,
>                                       HttpServletResponse
> response) throws Exception {
>         if (log.isDebugEnabled()) {
>             log.debug("entering 'handleRequest' method...asdasdf");
>             log.debug(mgr.getUsers());
>         }
>         return new ModelAndView("userList", "users", mgr.getUsers());
>     }
> }
>
>
>
>     You can see I add log.debug(mgr.getUsers()); to test, it can show
> normally.
>
>     I debug it by my way, and in my opinion. Maybe the mgr.getUser()
> function not return a currect format date for spring.
>
> Is it right? Think you vary much.
>
>     My name is Darcy.Zhang, may I have your name,please?
>
>
> best wishes,
>
> Darcy Zhang
> 2007-03-29
>
>
>
>
>
> ________________________________
> 探索 Windows Vista 的世界 了解更多信息!


--
http://raibledesigns.com
Amir55

Re: a question when learning <<spring live >>

Reply Threaded More More options
Print post
Permalink
In reply to this post by tntzht
hi dear

I have just started to read the book spring live. I am ok in frameworks but if u just  kindly tell me how to use Equinox in eclipse or myeclipse ide then i can go with you all over the book as a colleague or  team work

thnaks

Amir
张涛-3 wrote:
hi, tutor,               Excuse me to scrouge your time to solve my little question.                My question is: in ch#4, there discuss the UserController class, at the end it              return new ModelAndView("userList", "users", mgr.getUsers());       but it can't show the records in userList.jsp when my database have some date.        the class I changed likes following:package org.appfuse.web;import org.apache.commons.logging.LogFactory;import org.apache.commons.logging.Log;import org.springframework.web.servlet.mvc.Controller;import org.springframework.web.servlet.ModelAndView;import org.appfuse.service.UserManager;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.util.Map;// Modern IDEs support easy importingpublic class UserController implements Controller {    private static Log log = LogFactory.getLog(UserController.class);    private UserManager mgr = null;    public void setUserManager(UserManager userManager) {        this.mgr = userManager;    }    // put handleRequest() method here    public ModelAndView handleRequest(HttpServletRequest request,                                      HttpServletResponse response) throws Exception {        if (log.isDebugEnabled()) {            log.debug("entering 'handleRequest' method...asdasdf");            log.debug(mgr.getUsers());        }        return new ModelAndView("userList", "users", mgr.getUsers());    }}    You can see I add log.debug(mgr.getUsers()); to test, it can show normally.        I debug it by my way, and in my opinion. Maybe the mgr.getUser() function not return a currect format date for spring.Is it right? Think you vary much.    My name is Darcy.Zhang, may I have your name,please?best wishes,Darcy Zhang2007-03-29    
_________________________________________________________________
探索 Windows Vista 的世界
http://search.live.com/results.aspx?q=windows+vista&mkt=zh-cn&FORM=LIVSOP
mraible

Re: a question when learning <<spring live >>

Reply Threaded More More options
Print post
Permalink
Sorry it took me so long to respond. The 3rd question in the FAQ should help:

http://wiki.sourcebeat.com/display/SPL/FAQ

Matt

On 4/29/07, Amir55 <[hidden email]> wrote:

>
> hi dear
>
> I have just started to read the book spring live. I am ok in frameworks but
> if u just  kindly tell me how to use Equinox in eclipse or myeclipse ide
> then i can go with you all over the book as a colleague or  team work
>
> thnaks
>
> Amir
>
> 张涛-3 wrote:
> >
> > hi, tutor,               Excuse me to scrouge your time to solve my little
> > question.                My question is: in ch#4, there discuss the
> > UserController class, at the end it              return new
> > ModelAndView("userList", "users", mgr.getUsers());       but it can't show
> > the records in userList.jsp when my database have some date.        the
> > class I changed likes following:package org.appfuse.web;import
> > org.apache.commons.logging.LogFactory;import
> > org.apache.commons.logging.Log;import
> > org.springframework.web.servlet.mvc.Controller;import
> > org.springframework.web.servlet.ModelAndView;import
> > org.appfuse.service.UserManager;import
> > javax.servlet.http.HttpServletRequest;import
> > javax.servlet.http.HttpServletResponse;import java.util.Map;// Modern IDEs
> > support easy importingpublic class UserController implements Controller {
> > private static Log log = LogFactory.getLog(UserController.class);
> > private UserManager mgr = null;    public void setUserManager(UserManager
> > userManager) {        this.mgr = userManager;    }    // put
> > handleRequest() method here    public ModelAndView
> > handleRequest(HttpServletRequest request,
> > HttpServletResponse response) throws Exception {        if
> > (log.isDebugEnabled()) {            log.debug("entering 'handleRequest'
> > method...asdasdf");            log.debug(mgr.getUsers());        }
> > return new ModelAndView("userList", "users", mgr.getUsers());    }}    You
> > can see I add log.debug(mgr.getUsers()); to test, it can show normally.
> > I debug it by my way, and in my opinion. Maybe the mgr.getUser() function
> > not return a currect format date for spring.Is it right? Think you vary
> > much.    My name is Darcy.Zhang, may I have your name,please?best
> > wishes,Darcy Zhang2007-03-29
> > _________________________________________________________________
> > 探索 Windows Vista 的世界
> > http://search.live.com/results.aspx?q=windows+vista&mkt=zh-cn&FORM=LIVSOP
> >
>
> --
> View this message in context: http://www.nabble.com/a-question-when-learning-%3C%3Cspring-live-%3E%3E-tf3484965s2369.html#a10239917
> Sent from the Equinox Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
http://raibledesigns.com