本帖最后由 wdarren 于 2011-03-11 10:57:27 编辑

解决方案 »

  1.   

    spring mvc :      http://static.springsource.org/spring/docs/2.0.x/reference/mvc.html 官方在线文档,不要太爽哦
      

  2.   


    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <!-- Configures support for @Controllers -->
    <mvc:annotation-driven /> <!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/views/"/>
    <property name="suffix" value=".jsp"/>
    </bean>

    </beans>
    import org.slf4j.Logger;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;@Controller
    @RequestMapping("/Hello")
    public class HelloController {
    private Logger logger = org.slf4j.LoggerFactory.getLogger(HelloController.class);
    @RequestMapping(method=RequestMethod.GET)
    public void Hello(){
    logger.info("Hello Controller is run ");
    }


    }
    sprint3.0以后是通过注解来实现requestmapping的,如上所示,意思就是你访问/Hello这个url,就会映射到/WEB-INF/views/下的Hello.jsp你上面的方法倒是想2.0版本的,指定xxx.do,去找某个c,然后c里面return到指定的jsp。
      

  3.   

    看下源码结构,然后用Xmind写个思维导图。。
      

  4.   

    你说的是视图如何返回的了,我一个请求,它可能会被一些业务逻辑来处理,那么是谁来控制这个请求去找到它对应的业务逻辑里面去的(也就是所谓的Model)?
    <context:annotation-config/>这个标签是用来做什么的?