摘要:
一、<s:url> <s:url>可以直接生成一个url或url变量,它会在href的基础上加上应用context 1. <a href="<s:url href="/spitter/register" />">Register</a> 如果应用的context是“spittr”,则会转换为 <a 阅读全文
摘要:
一、 SPRING支持的GENERAL TAG LIBRARY 1. 二、用<s:message>和ReloadableResourceBundleMessageSource实现国际化 1.配置ReloadableResourceBundleMessageSource,它能it has the ab 阅读全文
摘要:
一、 Spring offers two JSP tag libraries to help define the view of your Spring MVC web views. One tag library renders HTML form tags that are bound to 阅读全文
摘要:
一、Spring支持的View Resolver 二、InternalResourceViewResolver Spring supports JSP views in two ways: InternalResourceViewResolver Spring provides two JSP 阅读全文
摘要:
一、 Starting with Spring 3.0, Spring supports the Java Validation API in Spring MVC . No extra configuration is required to make Java Validation work i 阅读全文
摘要:
一、显示注册表单 1.访问资源 1 @Test 2 public void shouldShowRegistration() throws Exception { 3 SpitterRepository mockRepository = mock(SpitterRepository.class); 阅读全文
摘要:
一 1.以path parameters的形式给action传参数 1 @Test 2 public void testSpittle() throws Exception { 3 Spittle expectedSpittle = new Spittle("Hello", new Date()); 阅读全文
摘要:
一、 1.Spring MVC provides several ways that a client can pass data into a controller’s handler method. These include Query parameters Form parameter 阅读全文
摘要:
一、配置文件 1.由于它继承AbstractAnnotationConfigDispatcherServletInitializer,Servlet容器会把它当做配置文件 1 package spittr.config; 2 3 import org.springframework.web.serv 阅读全文
摘要:
一、RequestMapping 1.可以写在方法上或类上,且值可以是数组 1 package spittr.web; 2 3 import static org.springframework.web.bind.annotation.RequestMethod.*; 4 5 import org. 阅读全文
摘要:
一、 二、用Java文件配置web application 1. 1 package spittr.config; 2 3 import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServlet 阅读全文
摘要:
1.AOP是面向对象编程的有力补充,它可以让你把分散在应用中的公共辅助功能抽取成模块,以灵活配置,减少了重复代码,让类更关注于自身的功能 阅读全文
摘要:
一、 1. package concert; public interface CriticismEngine { public String getCriticism(); } 2. 1 package concert; 2 3 public class CriticismEngineImpl i 阅读全文