- 浏览: 1014042 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (394)
- OSGI (14)
- 多线程 (10)
- 数据库 (30)
- J2ME (1)
- JAVA基础知识 (46)
- 引用包 (1)
- 设计模式 (7)
- 工作流 (2)
- Ubuntu (7)
- 搜索引擎 (6)
- QT (2)
- Ubuntu下编程 (1)
- 小程序 (2)
- UML (1)
- Servlet (10)
- spring (16)
- IM (12)
- 文档视频转为flash格式在线播放 (19)
- Maven (8)
- 远程调用 (2)
- PHPRPC (1)
- EXTJS学习 (2)
- Hibernate (16)
- 技术文章 (38)
- flex (5)
- 海量数据处理 (5)
- FTP (8)
- JS (10)
- Struts (1)
- hibernate search (13)
- JQuery (2)
- EMail (3)
- 算法 (4)
- SVN (7)
- JFreeChart (4)
- 面试 (4)
- 正规表达式 (2)
- 数据库性能优化 (10)
- JVM (6)
- Http Session Cookie (7)
- 网络 (12)
- Hadoop (2)
- 性能 (1)
最新评论
-
hy1235366:
能够随便也发一下,你退火算法程序使用的DistanceMatr ...
模拟退火算法总结(含例子)(转) -
梅强强:
感谢分享。。帮大忙了
swftools转换文件时线程堵塞问题的解决方法 -
wenlongsust:
openoffice和文件不在同一个服务器上,用过吗?
[JODConverter]word转pdf心得分享(转) -
2047699523:
如何在java Web项目中开发WebService接口htt ...
利用Java编写简单的WebService实例 -
abingpow:
唉,看起来好像很详细很不错的样子,可惜不是篇面向初学者的文章, ...
Spring与OSGi的整合(二)(转)
昨天对Spring注解有了一个整体认识,至少完成了一个简单的web应用搭建。当然,还不完善,这仅仅只是个开始!
今天看了Spring 3.0的注解,我感觉自己被颠覆了。多年前,为了减少代码依赖我们用配置文件进行模块间耦合,降低模块之间的黏度。现如今,所有可配置的内容都塞进了代码中,我只能说:这多少有点顾此失彼,有点倒退的意思!使用注解的好处是:代码通读性增强。这既是优势也是劣势!如果我要改一段配置,就要打开代码逐行扫描;如果恰巧这是别人封装的jar包,那我只好反编译;如果碰巧遇上这个jar包经过了混淆,那我只好求助于AOP了。 为了这么一个配置,我的代码观几乎将要被颠覆!
相关参考:
Spring 注解学习手札(一) 构建简单Web应用
Spring 注解学习手札(二) 控制层梳理
Spring 注解学习手札(三) 表单页面处理
Spring 注解学习手札(四) 持久层浅析
Spring 注解学习手札(五) 业务层事务处理
Spring 注解学习手札(六) 测试
言归正传,研究一下注解下的控制层。
我习惯于使用JSTL展示页面,因此需要在原lib基础上增加jstl.jar和standard.jar,详细lib依赖如下:
aopalliance-1.0.jar
commons-logging-1.1.1.jar
log4j-1.2.15.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-context-support-2.5.6.jar
spring-core-2.5.6.jar
spring-tx-2.5.6.jar
spring-web-2.5.6.jar
spring-webmvc-2.5.6.jar
standard.jar
jstl.jar
上一篇文中,我们定义了控制器AccountController:
AccountController.java
- /**
- * 2010-1-23
- */
- package org.zlex.spring.controller;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.ServletRequestUtils;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.zlex.spring.service.AccountService;
- /**
- *
- * @author <a href="mailto:zlex.dongliang@gmail.com">梁栋</a>
- * @version 1.0
- * @since 1.0
- */
- @Controller
- @RequestMapping("/account.do")
- public class AccountController {
- @Autowired
- private AccountService accountService;
- @RequestMapping(method = RequestMethod.GET)
- public void hello(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
- String username = ServletRequestUtils.getRequiredStringParameter(
- request, "username");
- String password = ServletRequestUtils.getRequiredStringParameter(
- request, "password");
- System.out.println(accountService.verify(username, password));
- }
- }
/** * 2010-1-23 */ package org.zlex.spring.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.zlex.spring.service.AccountService; /** * * @author <a href="mailto:zlex.dongliang@gmail.com">梁栋</a> * @version 1.0 * @since 1.0 */ @Controller @RequestMapping("/account.do") public class AccountController { @Autowired private AccountService accountService; @RequestMapping(method = RequestMethod.GET) public void hello(HttpServletRequest request, HttpServletResponse response) throws Exception { String username = ServletRequestUtils.getRequiredStringParameter( request, "username"); String password = ServletRequestUtils.getRequiredStringParameter( request, "password"); System.out.println(accountService.verify(username, password)); } }
先说注解@RequestMapping
这里使用注解@RequestMapping(method = RequestMethod.GET)指定这个方法为get请求时调用。同样,我们可以使用注解@RequestMapping(method = RequestMethod.POST)指定该方法接受post请求。
- @Controller
- @RequestMapping("/account.do")
- public class AccountController {
- @RequestMapping(method = RequestMethod.GET)
- public void get() {
- }
- @RequestMapping(method = RequestMethod.POST)
- public void post() {
- }
- }
@Controller @RequestMapping("/account.do") public class AccountController { @RequestMapping(method = RequestMethod.GET) public void get() { } @RequestMapping(method = RequestMethod.POST) public void post() { } }
这与我们久别的Servlet很相像,类似于doGet()和doPost()方法!
我们也可以将其改造为多动作控制器,如下代码所示:
- @Controller
- @RequestMapping("/account.do")
- public class AccountController {
- @RequestMapping(params = "method=login")
- public void login() {
- }
- @RequestMapping(params = "method=logout")
- public void logout() {
- }
@Controller @RequestMapping("/account.do") public class AccountController { @RequestMapping(params = "method=login") public void login() { } @RequestMapping(params = "method=logout") public void logout() { }
这样,我们可以通过参数“method”指定不同的参数值从而通过请求("/account.do?method=login"和"/account.do?method=logout")调用不同的方法!
注意:使用多动作控制器必须在配置文件中加入注解支持!
- <bean
- class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
当然,我们也可以将注解@RequestMapping指定到某一个方法上,如:
- @Controller
- public class AccountController {
- @RequestMapping("/a.do")
- public void a() {}
- @RequestMapping("/b.do")
- public void b() {}
- }
@Controller public class AccountController { @RequestMapping("/a.do") public void a() {} @RequestMapping("/b.do") public void b() {} }
这样,请求“a.do”和“b.do”将对应不同的方法a() 和b()。这使得一个控制器可以同时承载多个请求!
@RequestMapping("/account.do")是@RequestMapping(value="/account.do")的简写!
再说输入参数!
这里的方法名可以随意定义,但是参数和返回值却又要求!
为什么?直接看源代码,我们就能找到答案!
AnnotationMethodHandlerAdapter.java部分源代码——有关参数部分:
- @Override
- protected Object resolveStandardArgument(Class parameterType, NativeWebRequest webRequest)
- throws Exception {
- HttpServletRequest request = (HttpServletRequest) webRequest.getNativeRequest();
- HttpServletResponse response = (HttpServletResponse) webRequest.getNativeResponse();
- if (ServletRequest.class.isAssignableFrom(parameterType)) {
- return request;
- }
- else if (ServletResponse.class.isAssignableFrom(parameterType)) {
- this.responseArgumentUsed = true;
- return response;
- }
- else if (HttpSession.class.isAssignableFrom(parameterType)) {
- return request.getSession();
- }
- else if (Principal.class.isAssignableFrom(parameterType)) {
- return request.getUserPrincipal();
- }
- else if (Locale.class.equals(parameterType)) {
- return RequestContextUtils.getLocale(request);
- }
- else if (InputStream.class.isAssignableFrom(parameterType)) {
- return request.getInputStream();
- }
- else if (Reader.class.isAssignableFrom(parameterType)) {
- return request.getReader();
- }
- else if (OutputStream.class.isAssignableFrom(parameterType)) {
- this.responseArgumentUsed = true;
- return response.getOutputStream();
- }
- else if (Writer.class.isAssignableFrom(parameterType)) {
- this.responseArgumentUsed = true;
- return response.getWriter();
- }
- return super.resolveStandardArgument(parameterType, webRequest);
- }
@Override protected Object resolveStandardArgument(Class parameterType, NativeWebRequest webRequest) throws Exception { HttpServletRequest request = (HttpServletRequest) webRequest.getNativeRequest(); HttpServletResponse response = (HttpServletResponse) webRequest.getNativeResponse(); if (ServletRequest.class.isAssignableFrom(parameterType)) { return request; } else if (ServletResponse.class.isAssignableFrom(parameterType)) { this.responseArgumentUsed = true; return response; } else if (HttpSession.class.isAssignableFrom(parameterType)) { return request.getSession(); } else if (Principal.class.isAssignableFrom(parameterType)) { return request.getUserPrincipal(); } else if (Locale.class.equals(parameterType)) { return RequestContextUtils.getLocale(request); } else if (InputStream.class.isAssignableFrom(parameterType)) { return request.getInputStream(); } else if (Reader.class.isAssignableFrom(parameterType)) { return request.getReader(); } else if (OutputStream.class.isAssignableFrom(parameterType)) { this.responseArgumentUsed = true; return response.getOutputStream(); } else if (Writer.class.isAssignableFrom(parameterType)) { this.responseArgumentUsed = true; return response.getWriter(); } return super.resolveStandardArgument(parameterType, webRequest); }
也就是说,如果我们想要在自定义的方法中获得一些个“标准”输入参数,参数类型必须包含在以下类型中:
ServletRequest
ServletResponse
HttpSession
Principal
Locale
InputStream
OutputStream
Reader
Writer
当然,上述接口其实都是对于HttpServletRequest和HttpServletResponse的扩展。
此外,我们还可以定义自己的参数。
注意:自定义参数必须是实现类,绝非接口!Spring容器将帮你完成对象初始化工作!
比如说上文中,我们需要参数username和password。我们可以这么写:
- @RequestMapping(method = RequestMethod.GET)
- public void hello(String username,String password) {
- System.out.println(accountService.verify(username, password));
- }
@RequestMapping(method = RequestMethod.GET) public void hello(String username,String password) { System.out.println(accountService.verify(username, password)); }
如果参数名不能与这里的变量名保持一致,那么我们可以使用注解@RequestParam进行强制绑定,代码如下所示:
- @RequestMapping(method = RequestMethod.GET)
- public void hello(@RequestParam("username") String u,
- @RequestParam("password") String p) {
- System.out.println(accountService.verify(u, p));
- }
@RequestMapping(method = RequestMethod.GET) public void hello(@RequestParam("username") String u, @RequestParam("password") String p) { System.out.println(accountService.verify(u, p)); }
这比起我们之前写的代码有所简洁:
- @RequestMapping(method = RequestMethod.GET)
- public void hello(HttpServletRequest request, HttpServletResponse response)
- throws Exception {
- String username = ServletRequestUtils.getRequiredStringParameter(
- request, "username");
- String password = ServletRequestUtils.getRequiredStringParameter(
- request, "password");
- System.out.println(accountService.verify(username, password));
- }
@RequestMapping(method = RequestMethod.GET) public void hello(HttpServletRequest request, HttpServletResponse response) throws Exception { String username = ServletRequestUtils.getRequiredStringParameter( request, "username"); String password = ServletRequestUtils.getRequiredStringParameter( request, "password"); System.out.println(accountService.verify(username, password)); }
ServletRequestUtils类的工作已经由Spring底层实现了,我们只需要把参数名定义一致即可,其内部取参无需关心!
除了传入参数,我们还可以定义即将传出的参数,如加入ModelMap参数:
- @SuppressWarnings("unchecked")
- @RequestMapping(method = RequestMethod.GET)
- public Map hello(String username, String password, ModelMap model) {
- System.out.println(accountService.verify(username, password));
- model.put("msg", username);
- return model;
- }
@SuppressWarnings("unchecked") @RequestMapping(method = RequestMethod.GET) public Map hello(String username, String password, ModelMap model) { System.out.println(accountService.verify(username, password)); model.put("msg", username); return model; }
这时,我们没有定义页面名称,Spring容器将根据请求名指定同名view,即如果是jap页面,则account.do->account.jsp!
不得不承认,这样写起来的确减少了代码量!
接着说输出参数!
通过ModelMap,我们可以绑定输出到的页面的参数,但最终我们将要返回到何种页面呢?再次查看AnnotationMethodHandlerAdapter源代码!
AnnotationMethodHandlerAdapter.java部分源代码——有关返回值部分:
- @SuppressWarnings("unchecked")
- public ModelAndView getModelAndView(Method handlerMethod, Class handlerType, Object returnValue,
- ExtendedModelMap implicitModel, ServletWebRequest webRequest) {
- if (returnValue instanceof ModelAndView) {
- ModelAndView mav = (ModelAndView) returnValue;
- mav.getModelMap().mergeAttributes(implicitModel);
- return mav;
- }
- else if (returnValue instanceof Model) {
- return new ModelAndView().addAllObjects(implicitModel).addAllObjects(((Model) returnValue).asMap());
- }
- else if (returnValue instanceof Map) {
- return new ModelAndView().addAllObjects(implicitModel).addAllObjects((Map) returnValue);
- }
- else if (returnValue instanceof View) {
- return new ModelAndView((View) returnValue).addAllObjects(implicitModel);
- }
- else if (returnValue instanceof String) {
- return new ModelAndView((String) returnValue).addAllObjects(implicitModel);
- }
- else if (returnValue == null) {
- // Either returned null or was 'void' return.
- if (this.responseArgumentUsed || webRequest.isNotModified()) {
- return null;
- }
- else {
- // Assuming view name translation...
- return new ModelAndView().addAllObjects(implicitModel);
- }
- }
- else if (!BeanUtils.isSimpleProperty(returnValue.getClass())) {
- // Assume a single model attribute...
- ModelAttribute attr = AnnotationUtils.findAnnotation(handlerMethod, ModelAttribute.class);
- String attrName = (attr != null ? attr.value() : "");
- ModelAndView mav = new ModelAndView().addAllObjects(implicitModel);
- if ("".equals(attrName)) {
- Class resolvedType = GenericTypeResolver.resolveReturnType(handlerMethod, handlerType);
- attrName = Conventions.getVariableNameForReturnType(handlerMethod, resolvedType, returnValue);
- }
- return mav.addObject(attrName, returnValue);
- }
- else {
- throw new IllegalArgumentException("Invalid handler method return value: " + returnValue);
- }
- }
@SuppressWarnings("unchecked") public ModelAndView getModelAndView(Method handlerMethod, Class handlerType, Object returnValue, ExtendedModelMap implicitModel, ServletWebRequest webRequest) { if (returnValue instanceof ModelAndView) { ModelAndView mav = (ModelAndView) returnValue; mav.getModelMap().mergeAttributes(implicitModel); return mav; } else if (returnValue instanceof Model) { return new ModelAndView().addAllObjects(implicitModel).addAllObjects(((Model) returnValue).asMap()); } else if (returnValue instanceof Map) { return new ModelAndView().addAllObjects(implicitModel).addAllObjects((Map) returnValue); } else if (returnValue instanceof View) { return new ModelAndView((View) returnValue).addAllObjects(implicitModel); } else if (returnValue instanceof String) { return new ModelAndView((String) returnValue).addAllObjects(implicitModel); } else if (returnValue == null) { // Either returned null or was 'void' return. if (this.responseArgumentUsed || webRequest.isNotModified()) { return null; } else { // Assuming view name translation... return new ModelAndView().addAllObjects(implicitModel); } } else if (!BeanUtils.isSimpleProperty(returnValue.getClass())) { // Assume a single model attribute... ModelAttribute attr = AnnotationUtils.findAnnotation(handlerMethod, ModelAttribute.class); String attrName = (attr != null ? attr.value() : ""); ModelAndView mav = new ModelAndView().addAllObjects(implicitModel); if ("".equals(attrName)) { Class resolvedType = GenericTypeResolver.resolveReturnType(handlerMethod, handlerType); attrName = Conventions.getVariableNameForReturnType(handlerMethod, resolvedType, returnValue); } return mav.addObject(attrName, returnValue); } else { throw new IllegalArgumentException("Invalid handler method return value: " + returnValue); } } }
返回值的定义十分庞大,或者说可怕的if-else多少有点让我觉得厌恶!
我们可以定义以下类型的返回值:
ModelAndView
Model
View
Map
String
null
ModelAndView、Model和View都是Spring之前版本所特有的元素,Map对应于传入参数ModelMap,String定义页面名称,null即对应void类型方法!
最常用的实现方式如下:
- @SuppressWarnings("unchecked")
- @RequestMapping(method = RequestMethod.GET)
- public String hello(String username, String password, ModelMap model) {
- System.out.println(accountService.verify(username, password));
- model.put("msg", username);
- return "account";
- }
@SuppressWarnings("unchecked") @RequestMapping(method = RequestMethod.GET) public String hello(String username, String password, ModelMap model) { System.out.println(accountService.verify(username, password)); model.put("msg", username); return "account"; }
当然,对于我来说在返回值中写入这么一个字符串多少有点不能接受,于是我还是乐于使用输入参数ModelMap+输出参数Map的方式。
给出一个完整的AccountController实现:
AccountController.java
- /**
- * 2010-1-23
- */
- package org.zlex.spring.controller;
- import java.util.Map;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.ModelMap;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.zlex.spring.service.AccountService;
- /**
- *
- * @author <a href="mailto:zlex.dongliang@gmail.com">梁栋</a>
- * @version 1.0
- * @since 1.0
- */
- @Controller
- @RequestMapping("/account.do")
- public class AccountController {
- @Autowired
- private AccountService accountService;
- @SuppressWarnings("unchecked")
- @RequestMapping(method = RequestMethod.GET)
- public Map hello(String username, String password, ModelMap model) {
- System.out.println(accountService.verify(username, password));
- model.put("msg", username);
- return model;
- }
- }
/** * 2010-1-23 */ package org.zlex.spring.controller; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.zlex.spring.service.AccountService; /** * * @author <a href="mailto:zlex.dongliang@gmail.com">梁栋</a> * @version 1.0 * @since 1.0 */ @Controller @RequestMapping("/account.do") public class AccountController { @Autowired private AccountService accountService; @SuppressWarnings("unchecked") @RequestMapping(method = RequestMethod.GET) public Map hello(String username, String password, ModelMap model) { System.out.println(accountService.verify(username, password)); model.put("msg", username); return model; } }
最后说注解@Session
如果想将某个ModelMap中的参数指定到Session中,可以使用@Session注解,将其绑定为Session熟悉,代码如下所示:
- @Controller
- @RequestMapping("/account.do")
- @SessionAttributes("msg")
- public class AccountController {
- @Autowired
- private AccountService accountService;
- @SuppressWarnings("unchecked")
- @RequestMapping(method = RequestMethod.GET)
- public Map hello(String username, String password, ModelMap model) {
- System.out.println(accountService.verify(username, password));
- model.put("msg", username);
- return model;
- }
- }
@Controller @RequestMapping("/account.do") @SessionAttributes("msg") public class AccountController { @Autowired private AccountService accountService; @SuppressWarnings("unchecked") @RequestMapping(method = RequestMethod.GET) public Map hello(String username, String password, ModelMap model) { System.out.println(accountService.verify(username, password)); model.put("msg", username); return model; } }
当然,我们还需要配置一下对应的视图解析器,给出完整配置:
servelt.xml
- <?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:p="http://www.springframework.org/schema/p"
- xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
- <context:component-scan
- base-package="org.zlex.spring.controller" />
- <bean
- id="urlMapping"
- class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
- <bean
- class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
- <bean
- id="jstlViewResolver"
- class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:viewClass="org.springframework.web.servlet.view.JstlView"
- p:prefix="/WEB-INF/page/"
- p:suffix=".jsp" />
- </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:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="org.zlex.spring.controller" /> <bean id="urlMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <bean id="jstlViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:viewClass="org.springframework.web.servlet.view.JstlView" p:prefix="/WEB-INF/page/" p:suffix=".jsp" /> </beans>
这里使用了JstlView作为视图解析器。同时,指定前缀路径为"/WEB-INF/page/",后缀路径为".jsp"。也就是说,Spring容器将会在这个路径中寻找匹配的jsp文件!
注意加入xmlns:p="http://www.springframework.org/schema/p"命名空间!
再给出页面内容:
taglib.jsp
-
spring bean的生命周期(转)
2011-04-13 11:26 1370分为定义,初始化,使用,消亡 写个例子测试一下: 第一 ... -
反射实现 AOP 动态代理模式(Spring AOP 的实现 原理)(转)
2011-04-13 10:13 1044好长时间没有用过Spring了. 突然拿起书.我都发现自己对A ... -
从spring的IOC说起(二)——spring的Bean的基础配置(转)
2011-03-27 00:38 1330上次简单的说了下spring的IOC,也说到了spring ... -
从spring的IOC说起(一)(转)
2011-03-26 23:37 1015这段时间也着实好 ... -
Spring mvc 转发、重定向(转)
2011-01-24 16:29 2588spring控制器最后返 ... -
SSH整合,"sessionFactory " or "hibernateTemplate " is required异常
2010-11-11 15:35 3264将ssh整合时,出现如下异常: 2010-11-11 ... -
spring tx:advice 和 aop:config 配置事务(转)
2010-11-08 16:39 1942<?xml version="1.0&q ... -
spring依赖注入不成功,spring 窗口管理
2010-10-11 09:05 2561有时我们使用spring的注入的时候不成功,如我们在一个地方实 ... -
Org.springframework.orm.hibernate3.*类讲解(转)
2010-10-08 10:04 1467org.springframework.orm.hiberna ... -
spring与hibernate配置jar包功能详解(转)
2010-09-12 22:14 1249近搞SSH和一个框架的整 ... -
Spring 注解学习手札(六) 测试
2010-08-04 21:45 1554既然系统基于注解自成一体,那么基于Spring的测试是否可以依 ... -
Spring 注解学习手札(五) 业务层事务处理
2010-08-04 21:45 1903控制器层、持久层都有了一些介绍,剩下的就是业务层了! 业务层中 ... -
Spring 注解学习手札(四) 持久层浅析
2010-08-04 21:44 1184今天,我们玩玩数据库,搞搞持久层。不搞太复杂的东西,Sprin ... -
Spring 注解学习手札(三) 表单页面处理
2010-08-04 21:43 1285昨天小歇一天,看着两篇博客迅速飙升的点击率,十分欣慰。今天来研 ... -
Spring 注解学习手札(一) 构建简单Web应用
2010-08-04 21:39 1176这个系列学习笔记皆来源于大牛的博客:http://snowol ...
相关推荐
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
前端分析-2023071100789
基于kinect的3D人体建模C++完整代码.cpp
搞机工具箱10.1.0.7z
GRU+informer时间序列预测(Python完整源码和数据),python代码,pytorch架构,适合各种时间序列直接预测。 适合小白,注释清楚,都能看懂。功能如下: 代码基于数据集划分为训练集测试集。 1.多变量输入,单变量输出/可改多输出 2.多时间步预测,单时间步预测 3.评价指标:R方 RMSE MAE MAPE,对比图 4.数据从excel/csv文件中读取,直接替换即可。 5.结果保存到文本中,可以后续处理。 代码带数据,注释清晰,直接一键运行即可,适合新手小白。
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
基于ANSYS LSDyna的DEM-SPH-FEM耦合模拟滑坡入水动态行为研究,基于ANSYS LSDyna的DEM-SPH-FEM耦合的滑坡入水模拟分析研究,基于ansys lsdyna的滑坡入水模拟dem-sph-fem耦合 ,基于ANSYS LSDyna; 滑坡入水模拟; DEM-SPH-FEM 耦合,基于DEM-SPH-FEM耦合的ANSYS LSDyna滑坡入水模拟
auto_gptq-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
复件 复件 建设工程可行性研究合同[示范文本].doc
13考试真题最近的t64.txt
好用我已经解决报错问题
# 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!
auto_gptq-0.4.2-cp38-cp38-win_amd64.whl
自动立体库设计方案.pptx
# 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
在日常的工作和学习中,你是否常常为处理复杂的数据、生成高质量的文本或者进行精准的图像识别而烦恼?DeepSeek 或许就是你一直在寻找的解决方案!它以其高效、智能的特点,在各个行业都展现出了巨大的应用价值。然而,想要充分发挥 DeepSeek 的优势,掌握从入门到精通的知识和技能至关重要。本文将从实际应用的角度出发,为你详细介绍 DeepSeek 的基本原理、操作方法以及高级技巧。通过系统的学习,你将能够轻松地运用 DeepSeek 解决实际问题,提升工作效率和质量,让自己在职场和学术领域脱颖而出。现在,就让我们一起开启这场实用又高效的学习之旅吧!
# 踏入C语言的奇妙编程世界 在编程的广阔宇宙中,C语言宛如一颗璀璨恒星,以其独特魅力与强大功能,始终占据着不可替代的地位。无论你是编程小白,还是有一定基础想进一步提升的开发者,C语言都值得深入探索。 C语言的高效性与可移植性令人瞩目。它能直接操控硬件,执行速度快,是系统软件、嵌入式开发的首选。同时,代码可在不同操作系统和硬件平台间轻松移植,极大节省开发成本。 学习C语言,能让你深入理解计算机底层原理,培养逻辑思维和问题解决能力。掌握C语言后,再学习其他编程语言也会事半功倍。 现在,让我们一起开启C语言学习之旅。这里有丰富教程、实用案例、详细代码解析,助你逐步掌握C语言核心知识和编程技巧。别再犹豫,加入我们,在C语言的海洋中尽情遨游,挖掘无限可能,为未来的编程之路打下坚实基础!