spring 3.1.0.M 注解MVC + filter + AOP + memcache + C3P0

本文详细介绍了如何将Spring 3.1的注解MVC与Filter、AOP、Memcached缓存和C3P0数据源进行整合。通过配置Web.xml和Spring的demo.xml,实现了数据源、过滤器、AOP切面和缓存管理。同时,展示了如何在Controller和Filter中使用这些组件,并在DAO层使用JDBC进行数据操作。
摘要由CSDN通过智能技术生成

spring 3.1的包全导了 + 依赖包 commons-logging-1.1.1.jar  +  servlet-api.jar

AOP需要的几个包 aopalliance.jar  +  aspectjrt.jar  +  aspectjweaver.jar  +  cglib-nodep-2.1_3.jar

memcache 需要的包   java_memcached-release_2.6.1.jar   +依赖包   slf4j-api-1.6.1.jar  +  slf4j-simple-1.6.1.jar   +   commons-pool-1.5.6.jar

C3P0 需要的包 c3p0-0.9.1.2.jar   数据库包  mysql-connector-java-5.1.12-bin.jar


WEB.xml

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">  
  3.   <display-name>springDemo</display-name>  
  4.   <welcome-file-list>  
  5.     <welcome-file>index.do</welcome-file>  
  6.   </welcome-file-list>  
  7.   <listener>  
  8.     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
  9.   </listener>  
  10.   <context-param>  
  11.     <param-name>contextConfigLocation</param-name>  
  12.     <param-value>/WEB-INF/demo.xml</param-value>  
  13.   </context-param>  
  14.   <servlet>  
  15.     <servlet-name>springContent</servlet-name>  
  16.     <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>  
  17.     <init-param>  
  18.       <param-name>contextConfigLocation</param-name>  
  19.       <param-value>/WEB-INF/demo.xml</param-value>  
  20.     </init-param>  
  21.   </servlet>  
  22.   <servlet-mapping>  
  23.     <servlet-name>springContent</servlet-name>  
  24.     <url-pattern>*.do</url-pattern>  
  25.   </servlet-mapping>  
  26.   <filter>  
  27.     <filter-name>DelegatingFilterProxy</filter-name>  
  28.     <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>  
  29.     <init-param>  
  30.       <param-name>targetBeanName</param-name>  
  31.       <param-value>filter_saveuserinfo</param-value>  
  32.     </init-param>  
  33.     <init-param>  
  34.       <param-name>targetFilterLifecycle</param-name>  
  35.       <param-value>true</param-value>  
  36.     </init-param>  
  37.   </filter>  
  38.   <filter-mapping>  
  39.     <filter-name>DelegatingFilterProxy</filter-name>  
  40.     <url-pattern>*.do</url-pattern>  
  41.   </filter-mapping>  
  42. </web-app>  
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>springDemo</display-name>
  <welcome-file-list>
  	<welcome-file>index.do</welcome-file>
  </welcome-file-list>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/demo.xml</param-value>
  </context-param>
  <servlet>
    <servlet-name>springContent</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/demo.xml</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>springContent</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>DelegatingFilterProxy</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
      <param-name>targetBeanName</param-name>
      <param-value>filter_saveuserinfo</param-value>
    </init-param>
    <init-param>
      <param-name>targetFilterLifecycle</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>DelegatingFilterProxy</filter-name>
    <url-pattern>*.do</url-pattern>
  </filter-mapping>
</web-app>


spring配置文件demo.xml

  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  3.     xmlns:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"  
  4.     xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"  
  5.     xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms"  
  6.     xmlns:lang="http://www.springframework.org/schema/lang" xmlns:mvc="http://www.springframework.org/schema/mvc"  
  7.     xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:p="http://www.springframework.org/schema/p"  
  8.     xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx"  
  9.     xmlns:util="http://www.springframework.org/schema/util"  
  10.     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd  
  11.         http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd  
  12.         http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd  
  13.         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd  
  14.         http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd  
  15.         http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd  
  16.         http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd  
  17.         http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsd  
  18.         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd  
  19.         http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd  
  20.         http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd  
  21.         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd  
  22.         http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">  
  23.   
  24.     <context:annotation-config />  
  25.     <context:component-scan base-package="com.netel" />  
  26.     <aop:aspectj-autoproxy />  
  27.       
  28.       
  29.     <!-- C3P0连接池配置 -->  
  30.     <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"  
  31.         destroy-method="close">  
  32.         <property name="driverClass" value="com.mysql.jdbc.Driver" />  
  33.         <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/keyword_list" />  
  34.         <property name="user" value="root" />  
  35.         <property name="password" value="123456" />  
  36.     </bean>  
  37.       
  38.     <bean id="jdbc" class="org.springframework.jdbc.core.JdbcTemplate">  
  39.         <property name="dataSource" ref="dataSource" />  
  40.     </bean>  
  41.   
  42.     <!-- memcache缓存池 -->  
  43.     <bean id="memcachedPool" class="com.danga.MemCached.SockIOPool"  
  44.         factory-method="getInstance" init-method="initialize" destroy-method="shutDown">  
  45.         <constructor-arg>  
  46.             <value>neeaMemcachedPool</value>  
  47.         </constructor-arg>  
  48.         <property name="servers">  
  49.             <list>  
  50.                 <value>127.0.0.1:12111</value>  
  51.             </list>  
  52.         </property>  
  53.         <property name="initConn">  
  54.             <value>20</value>  
  55.         </property>  
  56.         <property name="minConn">  
  57.             <value>10</value>  
  58.         </property>  
  59.         <property name="maxConn">  
  60.             <value>50</value>  
  61.         </property>  
  62.         <property name="maintSleep">  
  63.             <value>30000</value>  
  64.         </property>  
  65.         <property name="nagle">  
  66.             <value>false</value>  
  67.         </property>  
  68.         <property name="socketTO">  
  69.             <value>3000</value>  
  70.         </property>  
  71.     </bean>  
  72.   
  73.     <!-- 缓存客服端 -->  
  74.     <bean id="memcachedClient" class="com.danga.MemCached.MemCachedClient">  
  75.         <constructor-arg>  
  76.             <value>neeaMemcachedPool</value>  
  77.         </constructor-arg>  
  78.     </bean>  
  79.           
  80. </beans>  
<?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:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"
	xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
	xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms"
	xmlns:lang="http://www.springframework.org/schema/lang" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
		http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
		http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
		http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd
		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
		http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-3.1.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">

	<context:annotation-config />
	<context:component-scan base-package="com.netel" />
	<aop:aspectj-autoproxy />
	
	
	<!-- C3P0连接池配置 -->
	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
		destroy-method="close">
		<property name="driverClass" value="com.mysql.jdbc.Driver" />
		<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/keyword_list" />
		<property name="user" value="root" />
		<property name="password" value="123456" />
	</bean>
	
	<bean id="jdbc" class="org.springframework.jdbc.core.JdbcTemplate">
		<property name="dataSource" ref="dataSource" />
	</bean>

	<!-- memcache缓存池 -->
	<bean id="memcachedPool" class="com.danga.MemCached.SockIOPool"
		factory-method="getInstance" init-method="initialize" destroy-method="shutDown">
		<constructor-arg>
			<value>neeaMemcachedPool</value>
		</constructor-arg>
		<property name="servers">
			<list>
				<value>127.0.0.1:12111</value>
			</list>
		</property>
		<property name="initConn">
			<value>20</value>
		</property>
		<property name="minConn">
			<value>10</value>
		</property>
		<property name="maxConn">
			<value>50</value>
		</property>
		<property name="maintSleep">
			<value>30000</value>
		</property>
		<property name="nagle">
			<value>false</value>
		</property>
		<property name="socketTO">
			<value>3000</value>
		</property>
	</bean>

	<!-- 缓存客服端 -->
	<bean id="memcachedClient" class="com.danga.MemCached.MemCachedClient">
		<constructor-arg>
			<value>neeaMemcachedPool</value>
		</constructor-arg>
	</bean>
		
</beans>

controller

  1. package com.netel.web;  
  2.   
  3. import javax.annotation.Resource;  
  4. import javax.servlet.http.HttpServletRequest;  
  5. import javax.servlet.http.HttpServletResponse;  
  6.   
  7. import org.springframework.stereotype.Controller;  
  8. import org.springframework.web.bind.annotation.RequestMapping;  
  9. import org.springframework.web.servlet.ModelAndView;  
  10.   
  11. import com.danga.MemCached.MemCachedClient;  
  12. import com.netel.dao.GetKeyword;  
  13.   
  14. @Controller  
  15. public class Controller_index {  
  16.       
  17.     @Resource(name="memcachedClient")  
  18.     private MemCachedClient client;  
  19.       
  20.     @Resource(name="keyword_dao")  
  21.     private GetKeyword dao;  
  22.       
  23.     public void setClient(MemCachedClient client) {  
  24.         this.client = client;  
  25.     }  
  26.   
  27.     public void setDao(GetKeyword dao) {  
  28.         this.dao = dao;  
  29.     }  
  30.   
  31.   
  32.     @RequestMapping("/index.do")  
  33.     public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {  
  34.         ModelAndView v = new ModelAndView("index.jsp");  
  35.         System.out.println("进入controller");  
  36.         String tmp1 = "controller    " + client;  
  37.         String tmp2 = "controller    " + dao.getAllData();  
  38.         String tmp3 = "controller    " +request.getParameter("name");  
  39.           
  40.         System.out.println(tmp1);  
  41.         System.out.println(tmp2);  
  42.         System.out.println(tmp3);  
  43.           
  44.         v.addObject("tmp1", tmp1);  
  45.         v.addObject("tmp2", tmp2);  
  46.         v.addObject("tmp3", tmp3);  
  47.         return v;  
  48.     }  
  49. }  

filter

  1. package com.netel.web;  
  2.   
  3. import java.io.IOException;  
  4.   
  5. import javax.annotation.Resource;  
  6. import javax.servlet.Filter;  
  7. import javax.servlet.FilterChain;  
  8. import javax.servlet.FilterConfig;  
  9. import javax.servlet.ServletException;  
  10. import javax.servlet.ServletRequest;  
  11. import javax.servlet.ServletResponse;  
  12.   
  13. import org.springframework.stereotype.Component;  
  14.   
  15. import com.danga.MemCached.MemCachedClient;  
  16. import com.netel.dao.GetKeyword;  
  17.   
  18.   
  19. @Component("filter_saveuserinfo")  
  20. public class Filter_saveUserInfo implements Filter {  
  21.       
  22.     @Resource(name="memcachedClient")  
  23.     private MemCachedClient client;  
  24.       
  25.     @Resource(name="keyword_dao")  
  26.     private GetKeyword dao;  
  27.       
  28.     public void setClient(MemCachedClient client) {  
  29.         this.client = client;  
  30.     }  
  31.   
  32.     public void setDao(GetKeyword dao) {  
  33.         this.dao = dao;  
  34.     }  
  35.       
  36.       
  37.     /**  
  38.      * Default constructor.   
  39.      */  
  40.     public Filter_saveUserInfo() {  
  41.     }  
  42.   
  43.     /**  
  44.      * @see Filter#destroy()  
  45.      */  
  46.     public void destroy() {  
  47.     }  
  48.   
  49.     /**  
  50.      * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain)  
  51.      */  
  52.     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {  
  53.         System.out.println("进入filter\t"+ client + "\t" + dao);        
  54.                 chain.doFilter(request, response);  
  55.     }  
  56.   
  57.     /**  
  58.      * @see Filter#init(FilterConfig)  
  59.      */  
  60.     public void init(FilterConfig fConfig) throws ServletException {  
  61.     }  
  62.   
  63. }  

dao  随便写了查询方法

  1. package com.netel.dao;  
  2.   
  3. import java.sql.ResultSet;  
  4. import java.sql.SQLException;  
  5. import java.util.HashMap;  
  6.   
  7. import javax.annotation.Resource;  
  8.   
  9. import org.springframework.dao.DataAccessException;  
  10. import org.springframework.jdbc.core.JdbcTemplate;  
  11. import org.springframework.jdbc.core.ResultSetExtractor;  
  12. import org.springframework.stereotype.Repository;  
  13.   
  14. @Repository("keyword_dao")  
  15. public class GetKeyword_imple implements GetKeyword {  
  16.       
  17.     @Resource(name="jdbc")  
  18.     private JdbcTemplate jdbc;  
  19.   
  20.     public void setJdbc(JdbcTemplate jdbc) {  
  21.         this.jdbc = jdbc;  
  22.     }  
  23.   
  24.   
  25.     @Override  
  26.     public HashMap<String, String> getAllData() {  
  27.         String sql = "SELECT keyword, count( keyword ) as qty FROM keyword_list GROUP BY keyword ORDER BY qty DESC";  
  28.         return (HashMap<String, String>) jdbc.query(sql, new ResultSetExtractor<HashMap<String, String>>(){  
  29.   
  30.             @Override  
  31.             public HashMap<String, String> extractData(ResultSet rs)  
  32.                     throws SQLException, DataAccessException {  
  33.                   
  34.                 HashMap<String, String> map = new HashMap<String, String>();  
  35.                 while (rs.next()) {  
  36.                     map.put(rs.getString("keyword"),  rs.getString("qty"));  
  37.                 }  
  38.                 return map;  
  39.             }  
  40.         });  
  41.     }  
  42.   
  43. }  

AOP

  1. package com.netel.service;  
  2.   
  3. import javax.annotation.Resource;  
  4.   
  5. import org.aspectj.lang.ProceedingJoinPoint;  
  6. import org.aspectj.lang.annotation.After;  
  7. import org.aspectj.lang.annotation.AfterThrowing;  
  8. import org.aspectj.lang.annotation.Around;  
  9. import org.aspectj.lang.annotation.Aspect;  
  10. import org.aspectj.lang.annotation.Before;  
  11. import org.springframework.stereotype.Component;  
  12.   
  13. import com.danga.MemCached.MemCachedClient;  
  14. import com.netel.dao.GetKeyword;  
  15.   
  16. @Aspect  
  17. @Component  
  18. public class AOP_loginfo {  
  19.       
  20.     @Resource(name="memcachedClient")  
  21.     private MemCachedClient client;  
  22.       
  23.     @Resource(name="keyword_dao")  
  24.     private GetKeyword dao;  
  25.       
  26.     public void setClient(MemCachedClient client) {  
  27.         this.client = client;  
  28.     }  
  29.   
  30.     public void setDao(GetKeyword dao) {  
  31.         this.dao = dao;  
  32.     }  
  33.   
  34.     /**  
  35.      * 所有带RequestMapping注解的方法  
  36.      */  
  37.     private final static String el = "@annotation(org.springframework.web.bind.annotation.RequestMapping)";  
  38.   
  39.     @Before(el)  
  40.     public void before() {  
  41.         System.out.println("before\t" + client + "\t" + dao);  
  42.     }  
  43.   
  44.     @After(el)  
  45.     public void after() {  
  46.         System.out.println("after\t" + client + "\t" + dao);  
  47.     }  
  48.   
  49.     @Around(el)  
  50.     public Object around(ProceedingJoinPoint p) {  
  51.         for (Object obj : p.getArgs()) {  
  52.             System.out.println("参数:" + obj);  
  53.         }  
  54.         Object ob = null;  
  55.   
  56.         try {  
  57.             System.out.println("around前\t" + client + "\t" + dao);  
  58.             ob = p.proceed();  
  59.             System.out.println("around后\t" + client + "\t" + dao);  
  60.         } catch (Throwable e) {  
  61.             e.printStackTrace();  
  62.         }  
  63.   
  64.         return ob;  
  65.     }  
  66.       
  67.     @AfterThrowing(value = elthrowing="e")  
  68.     public void throwing(Exception e){  
  69.         System.out.println("出异常了"  + client + "\t" + dao + e);  
  70.     }  
  71.   
  72. }  

 

index.jsp

  1. <%@ page language="java" contentType="text/html; charset=UTF-8"  
  2.     pageEncoding="UTF-8" isELIgnored="false"%>  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
  4. <html>  
  5. <head>  
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
  7. <title>Insert title here</title>  
  8. </head>  
  9. <body>  
  10.     wca..........<br>  
  11.     ${tmp1 }<br>  
  12.     ${tmp2 }<br>  
  13.     ${tmp3 }<br>  
  14.       
  15.     <%=request.getAttribute("tmp1") %> <br>  
  16.     <%=request.getAttribute("tmp2") %> <br>  
  17.     <%=request.getAttribute("tmp3") %> <br>  
  18. </body>  
  19. </html>  
发布。运行。控制台输出

 

 

  1. 进入filter    com.danga.MemCached.MemCachedClient@e6529c  com.netel.dao.GetKeyword_imple@1399ae5  
  2. before  com.danga.MemCached.MemCachedClient@e5f1d   com.netel.dao.GetKeyword_imple@1869929  
  3. 参数:org.apache.catalina.connector.RequestFacade@1b15387  
  4. 参数:org.apache.catalina.connector.ResponseFacade@e2da7a  
  5. around前 com.danga.MemCached.MemCachedClient@e5f1d   com.netel.dao.GetKeyword_imple@1869929  
  6. 进入controller  
  7. controller    com.danga.MemCached.MemCachedClient@e5f1d  
  8. controller    {3=62=4AA=11=11111=14=1, ä¸­=3}  
  9. controller    null  
  10. after   com.danga.MemCached.MemCachedClient@e5f1d   com.netel.dao.GetKeyword_imple@1869929  
  11. around后 com.danga.MemCached.MemCachedClient@e5f1d   com.netel.dao.GetKeyword_imple@1869929  

 

index.jsp页面输出

  1. wca..........  
  2. controller com.danga.MemCached.MemCachedClient@e5f1d  
  3. controller {3=62=4AA=11=11111=14=1, ä¸­=3}  
  4. controller null  
  5. controller com.danga.MemCached.MemCachedClient@e5f1d  
  6. controller {3=62=4AA=11=11111=14=1, ä¸­=3}  
  7. controller null  

 

改变URL地址

  1. http://localhost:8080/AnnotationDemo/index.do?name=aaa  
JSP页面

  1. wca..........  
  2. controller com.danga.MemCached.MemCachedClient@e5f1d  
  3. controller {3=62=4AA=11=11111=14=1, ä¸­=3}  
  4. controller aaa  
  5. controller com.danga.MemCached.MemCachedClient@e5f1d  
  6. controller {3=62=4AA=11=11111=14=1, ä¸­=3}  
  7. controller aaa  
完成。。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值