问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

Spring高级程序设计的目录

发布网友 发布时间:2022-05-02 02:29

我来回答

2个回答

懂视网 时间:2022-05-02 06:51

main(): """ Main function of sqlmap when running from command line. """ try: checkEnvironment() setPaths(modulePath()) banner() # Store original command line options for possible later restoration cmdLineOptions.update(cmdLineParser().__dict__) initOptions(cmdLineOptions) if hasattr(conf, "api"): # heavy imports from lib.utils.api import StdDbOut from lib.utils.api import setRestAPILog # Overwrite system standard output and standard error to write # to an IPC database sys.stdout = StdDbOut(conf.taskid, messagetype="stdout") sys.stderr = StdDbOut(conf.taskid, messagetype="stderr") setRestAPILog() conf.showTime = True dataToStdout("[!] legal disclaimer: %s " % LEGAL_DISCLAIMER, forceOutput=True) dataToStdout("[*] starting at %s " % time.strftime("%X"), forceOutput=True) init() if conf.profile: profile() elif conf.smokeTest: smokeTest() elif conf.liveTest: liveTest() else: try: start() except thread.error as ex: if "can‘t start new thread" in getSafeExString(ex): errMsg = "unable to start new threads. Please check OS (u)limits" logger.critical(errMsg) raise SystemExit else: raise except SqlmapUserQuitException: errMsg = "user quit" try: logger.error(errMsg) except KeyboardInterrupt: pass except (SqlmapSilentQuitException, bdb.BdbQuit): pass except SqlmapShellQuitException: cmdLineOptions.sqlmapShell = False except SqlmapBaseException as ex: errMsg = getSafeExString(ex) try: logger.critical(errMsg) except KeyboardInterrupt: pass raise SystemExit except KeyboardInterrupt: print errMsg = "user aborted" try: logger.error(errMsg) except KeyboardInterrupt: pass except EOFError: print errMsg = "exit" try: logger.error(errMsg) except KeyboardInterrupt: pass except SystemExit: pass except: print errMsg = unhandledExceptionMessage() excMsg = traceback.format_exc() try: if not checkIntegrity(): errMsg = "code integrity check failed (turning off automatic issue creation). " errMsg += "You should retrieve the latest development version from official GitHub " errMsg += "repository at ‘%s‘" % GIT_PAGE logger.critical(errMsg) print dataToStdout(excMsg) raise SystemExit elif "tamper/" in excMsg: logger.critical(errMsg) print dataToStdout(excMsg) raise SystemExit elif "MemoryError" in excMsg: errMsg = "memory exhaustion detected" logger.error(errMsg) raise SystemExit elif any(_ in excMsg for _ in ("No space left", "Disk quota exceeded")): errMsg = "no space left on output device" logger.error(errMsg) raise SystemExit elif all(_ in excMsg for _ in ("No such file", "_‘", "self.get_prog_name()")): errMsg = "corrupted installation detected (‘%s‘). " % excMsg.strip().split(‘ ‘)[-1] errMsg += "You should retrieve the latest development version from official GitHub " errMsg += "repository at ‘%s‘" % GIT_PAGE logger.error(errMsg) raise SystemExit elif "Read-only file system" in excMsg: errMsg = "output device is mounted as read-only" logger.error(errMsg) raise SystemExit elif "OperationalError: disk I/O error" in excMsg: errMsg = "I/O error on output device" logger.error(errMsg) raise SystemExit elif "_mkstemp_inner" in excMsg: errMsg = "there has been a problem while accessing temporary files" logger.error(errMsg) raise SystemExit elif "can‘t start new thread" in excMsg: errMsg = "there has been a problem while creating new thread instance. " errMsg += "Please make sure that you are not running too many processes" if not IS_WIN: errMsg += " (or increase the ‘ulimit -u‘ value)" logger.error(errMsg) raise SystemExit elif all(_ in excMsg for _ in ("pymysql", "configparser")): errMsg = "wrong initialization of pymsql detected (using Python3 dependencies)" logger.error(errMsg) raise SystemExit elif "bad marshal data (unknown type code)" in excMsg: match = re.search(r"s*(.+)s+ValueError", excMsg) errMsg = "one of your .pyc files are corrupted%s" % (" (‘%s‘)" % match.group(1) if match else "") errMsg += ". Please delete .pyc files on your system to fix the problem" logger.error(errMsg) raise SystemExit elif "valueStack.pop" in excMsg and kb.get("dumpKeyboardInterrupt"): raise SystemExit for match in re.finditer(r‘File "(.+?)", line‘, excMsg): file_ = match.group(1) file_ = os.path.relpath(file_, os.path.dirname(__file__)) file_ = file_.replace("\", ‘/‘) file_ = re.sub(r"../", ‘/‘, file_).lstrip(‘/‘) excMsg = excMsg.replace(match.group(1), file_) errMsg = maskSensitiveData(errMsg) excMsg = maskSensitiveData(excMsg) if hasattr(conf, "api"): logger.critical("%s %s" % (errMsg, excMsg)) else: logger.critical(errMsg) kb.stickyLevel = logging.CRITICAL dataToStdout(excMsg) createGithubIssue(errMsg, excMsg) except KeyboardInterrupt: pass finally: kb.threadContinue = False if conf.get("showTime"): dataToStdout(" [*] shutting down at %s " % time.strftime("%X"), forceOutput=True) kb.threadException = True if kb.get("tempDir"): for prefix in (MKSTEMP_PREFIX.IPC, MKSTEMP_PREFIX.TESTING, MKSTEMP_PREFIX.COOKIE_JAR, MKSTEMP_PREFIX.BIG_ARRAY): for filepath in glob.glob(os.path.join(kb.tempDir, "%s*" % prefix)): try: os.remove(filepath) except OSError: pass if not filter(None, (filepath for filepath in glob.glob(os.path.join(kb.tempDir, ‘*‘)) if not any(filepath.endswith(_) for _ in (‘.lock‘, ‘.exe‘, ‘_‘)))): shutil.rmtree(kb.tempDir, ignore_errors=True) if conf.get("hashDB"): try: conf.hashDB.flush(True) except KeyboardInterrupt: pass if cmdLineOptions.get("sqlmapShell"): cmdLineOptions.clear() conf.clear() kb.clear() main() if hasattr(conf, "api"): try: conf.databaseCursor.disconnect() except KeyboardInterrupt: pass if conf.get("dumper"): conf.dumper.flush() # short delay for thread finalization try: _ = time.time() while threading.activeCount() > 1 and (time.time() - _) > THREAD_FINALIZATION_TIMEOUT: time.sleep(0.01) except KeyboardInterrupt: pass finally: # Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program if threading.activeCount() > 1: os._exit(0)

我们可以看到这里,首先调用了checkEnvironment()函数,根据名字我们知道这个函数的作用是检测环境。我们跟进来看这个函数:

def checkEnvironment():
 try:
 os.path.isdir(modulePath())
 except UnicodeEncodeError:
 errMsg = "your system does not properly handle non-ASCII paths. "
 errMsg += "Please move the sqlmap‘s directory to the other location"
 logger.critical(errMsg)
 raise SystemExit

 if distutils.version.LooseVersion(VERSION) < distutils.version.LooseVersion("1.0"):
 errMsg = "your runtime environment (e.g. PYTHONPATH) is "
 errMsg += "broken. Please make sure that you are not running "
 errMsg += "newer versions of sqlmap with runtime scripts for older "
 errMsg += "versions"
 logger.critical(errMsg)
 raise SystemExit

 # Patch for pip (import) environment
 if "sqlmap.sqlmap" in sys.modules:
 for _ in ("cmdLineOptions", "conf", "kb"):
  globals()[_] = getattr(sys.modules["lib.core.data"], _)

 for _ in ("SqlmapBaseException", "SqlmapShellQuitException", "SqlmapSilentQuitException", "SqlmapUserQuitException"):
  globals()[_] = getattr(sys.modules["lib.core.exception"], _)

调用了module()函数并且判断是否是一个正确的路径,如果不是的话,那么将会打印错误信息并且抛出一个异常终止程序继续运行。

我们继续来看module()函数中做了一些什么:

def modulePath():
 """
 This will get us the program‘s directory, even if we are frozen
 using py2exe
 """

 try:
 _ = sys.executable if weAreFrozen() else __file__ #如果用py2exe封装,那么_为python的绝对路径否则就是当前文件名也就是sqlmap.py
 except NameError:
 _ = inspect.getsourcefile(modulePath)

 return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding() or UNICODE_ENCODING)

我们在注释中可以看到是为了获取程序所在的目录。为了防止乱码,返回unicode编码的路径。

getUnicode()函数在这里:sqlmaplibcorecommon.py。这里就不贴代码了。

然后checkEnvironment()判断版本。接着判断sqlmap.sqlmap是否已经加载,如果加载,那么就获取到cmdLineOptions, conf, kb几个属性并且把它们作为全局变量。

接下来,setPaths(modulePath())设置了一下系统各个部分的绝对路径,并且判断.txt, .xml, .zip为扩展名的文件是否存在并且是否可读。

这里我们来思考一个问题,为什么全局要用绝对路径呢?做过开发的同学就知道了,用绝对路径可以避免很多不必要的麻烦,比如说包含文件时候,用相对路径,互相包含,最后越搞越乱,一旦换了一个目录,就会出问题。也不方便日后的维护。用绝对路径,所有的调用全部放在主入口文件,这样单一入口的原则使得系统不仅调用方便,而且看起来还紧凑有序。

然后就是打印banner的信息。这里还有一个值得注意的点就是AttribDict这个数据类型。是这样定义的:

 

class AttribDict(dict):
 """
 This class defines the sqlmap object, inheriting from Python data
 type dictionary.

 >>> foo = AttribDict()
 >>> foo.bar = 1
 >>> foo.bar
 1
 """

 def __init__(self, indict=None, attribute=None):
 if indict is None:
  indict = {}

 # Set any attributes here - before initialisation
 # these remain as normal attributes
 self.attribute = attribute
 dict.__init__(self, indict)
 self.__initialised = True

 # After initialisation, setting attributes
 # is the same as setting an item

 def __getattr__(self, item):
 """
 Maps values to attributes
 Only called if there *is NOT* an attribute with this name
 """

 try:
  return self.__getitem__(item)
 except KeyError:
  raise AttributeError("unable to access item ‘%s‘" % item)

 def __setattr__(self, item, value):
 """
 Maps attributes to values
 Only if we are initialised
 """

 # This test allows attributes to be set in the __init__ method
 if "_AttribDict__initialised" not in self.__dict__:
  return dict.__setattr__(self, item, value)

 # Any normal attributes are handled normally
 elif item in self.__dict__:
  dict.__setattr__(self, item, value)

 else:
  self.__setitem__(item, value)

 def __getstate__(self):
 return self.__dict__

 def __setstate__(self, dict):
 self.__dict__ = dict

 def __deepcopy__(self, memo):
 retVal = self.__class__()
 memo[id(self)] = retVal

 for attr in dir(self):
  if not attr.startswith(‘_‘):
  value = getattr(self, attr)
  if not isinstance(value, (types.BuiltinFunctionType, types.FunctionType, types.MethodType)):
   setattr(retVal, attr, copy.deepcopy(value, memo))

 for key, value in self.items():
  retVal.__setitem__(key, copy.deepcopy(value, memo))

 return retVal

继承了内置的dict,并且重写了一些方法。然后就可以这样去访问键值对:var.key。感慨 一下,好牛!!!

 

0x01  获取命令行参数选项

这里主要使用了optparse这个函数库。python中十分好用的一个命令行工具。具体可以参考这里:https://docs.python.org/2/library/optparse.html

首先将获取到的命令行参数选项进行判断和拆分以后转变成dict键值对的形式存入到cmdLineOptions。然后开始依据传入的参数进行后续操作。

在获取命令行参数的时候,有很多dirty hack写法,感兴趣可以好好品味。这个层次的认知来源于对底层库函数的熟悉。再次感慨,好牛!!!

这里重要的一个操作是_mergeOptions(),主要的作用是将配置项中的参数和命令行获得的参数选项以及缺省选项进行合并。函数是这么写的:

def _mergeOptions(inputOptions, overrideOptions):
 """
 Merge command line options with configuration file and default options.

 @param inputOptions: optparse object with command line options.
 @type inputOptions: C{instance}
 """

 if inputOptions.pickledOptions:
 try:
  unpickledOptions = base64unpickle(inputOptions.pickledOptions, unsafe=True)

  if type(unpickledOptions) == dict:
  unpickledOptions = AttribDict(unpickledOptions)

  _normalizeOptions(unpickledOptions)

  unpickledOptions["pickledOptions"] = None
  for key in inputOptions:
  if key not in unpickledOptions:
   unpickledOptions[key] = inputOptions[key]

  inputOptions = unpickledOptions
 except Exception, ex:
  errMsg = "provided invalid value ‘%s‘ for option ‘--pickled-options‘" % inputOptions.pickledOptions
  errMsg += " (%s)" % repr(ex)
  raise SqlmapSyntaxException(errMsg)

 if inputOptions.configFile:
 configFileParser(inputOptions.configFile)

 if hasattr(inputOptions, "items"):
 inputOptionsItems = inputOptions.items()
 else:
 inputOptionsItems = inputOptions.__dict__.items()

 for key, value in inputOptionsItems:
 if key not in conf or value not in (None, False) or overrideOptions:
  conf[key] = value

 if not hasattr(conf, "api"):
 for key, value in conf.items():
  if value is not None:
  kb.explicitSettings.add(key)

 for key, value in defaults.items():
 if hasattr(conf, key) and conf[key] is None:
  conf[key] = value

 lut = {}
 for group in optDict.keys():
 lut.update((_.upper(), _) for _ in optDict[group])

 envOptions = {}
 for key, value in os.environ.items():
 if key.upper().startswith(SQLMAP_ENVIRONMENT_PREFIX):
  _ = key[len(SQLMAP_ENVIRONMENT_PREFIX):].upper()
  if _ in lut:
  envOptions[lut[_]] = value

 if envOptions:
 _normalizeOptions(envOptions)
 for key, value in envOptions.items():
  conf[key] = value

 mergedOptions.update(conf)

然后我们来调试一下,打印一下最后的mergedOptions,结果如下:

{‘code‘: None, ‘getUsers‘: None, ‘resultsFilename‘: None, ‘excludeSysDbs‘: None, ‘ignoreTimeouts‘: None, ‘skip‘: None, ‘db‘: None, ‘prefix‘: None, ‘osShell‘: None, ‘googlePage‘: 1, ‘query‘: None, ‘getComments‘: None, ‘randomAgent‘: None, ‘testSkip‘: None, ‘authType‘: None, ‘getPasswordHashes‘: None, ‘parameters‘: {}, ‘predictOutput‘: None, ‘wizard‘: None, ‘stopFail‘: None, ‘forms‘: None, ‘uChar‘: None, ‘authUsername‘: None, ‘pivotColumn‘: None, ‘dropSetCookie‘: None, ‘dbmsCred‘: None, ‘tests‘: [], ‘paramExclude‘: None, ‘risk‘: 1, ‘sqlFile‘: None, ‘rParam‘: None, ‘getCurrentUser‘: None, ‘notString‘: None, ‘getRoles‘: None, ‘getPrivileges‘: None, ‘testParameter‘: None, ‘tbl‘: None, ‘offline‘: None, ‘trafficFile‘: None, ‘osSmb‘: None, ‘level‘: 1, ‘dnsDomain‘: None, ‘skipStatic‘: None, ‘secondOrder‘: None, ‘hashDBFile‘: None, ‘method‘: None, ‘skipWaf‘: None, ‘osBof‘: None, ‘hostname‘: None, ‘firstChar‘: None, ‘torPort‘: None, ‘wFile‘: None, ‘binaryFields‘: None, ‘checkTor‘: None, ‘commonTables‘: None, ‘direct‘: None, ‘paramDict‘: {}, ‘proxyList‘: None, ‘titles‘: None, ‘getSchema‘: None, ‘timeSec‘: 5, ‘paramDel‘: None, ‘safeReqFile‘: None, ‘port‘: None, ‘getColumns‘: None, ‘headers‘: None, ‘crawlExclude‘: None, ‘authCred‘: None, ‘boundaries‘: [], ‘loadCookies‘: None, ‘showVersion‘: None, ‘outputDir‘: None, ‘tmpDir‘: None, ‘disablePrecon‘: None, ‘murphyRate‘: None, ‘invalidLogical‘: None, ‘getCurrentDb‘: None, ‘hexConvert‘: None, ‘proxyFile‘: None, ‘answers‘: None, ‘resultsFP‘: None, ‘host‘: None, ‘dependencies‘: None, ‘cookie‘: None, ‘dbmsHandler‘: None, ‘path‘: None, ‘alert‘: None, ‘optimize‘: None, ‘safeUrl‘: None, ‘limitStop‘: None, ‘search‘: None, ‘uFrom‘: None, ‘requestFile‘: None, ‘noCast‘: None, ‘testFilter‘: None, ‘eta‘: None, ‘dumpPath‘: None, ‘csrfToken‘: None, ‘threads‘: 1, ‘logFile‘: None, ‘os‘: None, ‘col‘: None, ‘proxy‘: None, ‘proxyCred‘: None, ‘verbose‘: 1, ‘crawlDepth‘: None, ‘updateAll‘: None, ‘privEsc‘: None, ‘forceDns‘: None, ‘getAll‘: None, ‘cj‘: None, ‘hpp‘: None, ‘tmpPath‘: None, ‘header‘: None, ‘url‘: u‘www.baidu.com‘, ‘invalidBignum‘: None, ‘regexp‘: None, ‘getDbs‘: None, ‘httpHeaders‘: [], ‘outputPath‘: None, ‘freshQueries‘: None, ‘uCols‘: None, ‘smokeTest‘: None, ‘ignoreProxy‘: None, ‘regData‘: None, ‘udfInject‘: None, ‘invalidString‘: None, ‘tor‘: None, ‘forceSSL‘: None, ‘ignore401‘: None, ‘beep‘: None, ‘noEscape‘: None, ‘configFile‘: None, ‘ipv6‘: False, ‘scope‘: None, ‘scheme‘: None, ‘authFile‘: None, ‘dbmsConnector‘: None, ‘torType‘: ‘SOCKS5‘, ‘regVal‘: None, ‘string‘: None, ‘hashDB‘: None, ‘mnemonics‘: None, ‘skipUrlEncode‘: None, ‘referer‘: None, ‘agent‘: None, ‘regType‘: None, ‘purgeOutput‘: None, ‘retries‘: 3, ‘wFileType‘: None, 
 var cpro_id = "u6292429";
 



                                        

热心网友 时间:2022-05-02 03:59

第一部分 Spring入门

第1章 Spring简介 2
1.1 Spring是什么 2
1.1.1 依赖注入之外的特性 4
1.1.2 使用Spring进行面向方面编程 4
1.1.3 数据访问 5
1.1.4 简化与整合Java EE 5
1.1.5 基于Spring的任务调度 6
1.1.6 Spring对邮件的支持 6
1.1.7 动态语言 6
1.1.8 远程访问 6
1.1.9 事务管理 7
1.1.10 Spring MVC框架 7
1.1.11 Spring Web Flow 7
1.1.12 AJAX技术 7
1.1.13 国际化 8
1.1.14 简化异常处理 8
1.2 Spring项目 8
1.2.1 Spring的起源 8
1.2.2 Spring .NET 8
1.2.3 Spring IDE 9
1.2.4 Spring安全系统(原Acegi) 9
1.2.5 Spring的替代方案 9
1.3 示例代码 10
1.4 小结 10
第2章 Spring入门 11
2.1 获取Spring框架 11
2.1.1 从CVS上签出Spring 11
2.1.2 从源码构建Spring 12
2.1.3 检查Spring发布包 13
2.1.4 Spring发布包 13
2.1.5 Spring依赖的包 14
2.1.6 示例应用 16
2.1.7 配置Spring和IDE 18
2.2 HelloWorld示例 20
2.3 Spring版本的“Hello, World”示例 23
2.3.1 依赖注入 24
2.3.2 Spring的侵入性 26
2.4 小结 26
第3章 控制反转 27
3.1 控制反转和依赖注入 27
3.2 控制反转的类型 27
3.2.1 上下文依赖查找 29
3.2.2 构造方法依赖注入 30
3.2.3 设置方法依赖注入 31
3.2.4 依赖注入与依赖查找 32
3.2.5 设置方法注入与构造方法注入 33
3.3 Spring中的控制反转 34
3.4 基于Spring的依赖注入 34
3.4.1 bean和BeanFactory 34
3.4.2 BeanFactory实现 35
3.4.3 XML bean定义 36
3.4.4 构造方法注入 37
3.4.5 注入参数 40
3.4.6 理解bean的命名 50
3.4.7 bean的实例化模式 52
3.4.8 解析依赖 55
3.4.9 bean的自动装配 57
3.4.10 依赖检查 61
3.4.11 bean的继承 62
3.5 小结 64
第4章 进阶 66
4.1 Spring对应用程序可移植性的影响 67
4.2 管理bean的生命周期 67
4.2.1 嵌入bean的创建 68
4.2.2 嵌入bean的销毁 74
4.3 让bean可被Spring感知 79
4.3.1 使用BeanNameAware接口 80
4.3.2 使用BeanFactoryAware接口 81
4.4 使用方法注入(method injection) 83
4.4.1 查找方法注入 83
4.4.2 方法替换 88
4.5 使用FactoryBean接口 91
4.5.1 MessageDigestFactoryBean类 91
4.5.2 直接访问FactoryBean 94
4.6 BeanFactoryPostProcessor类 94
4.7 JavaBean的属性修改器 101
4.7.1 内建的PropertyEditor 101
4.7.2 创建自定义PropertyEditor 104
4.8 BeanPostProcessor类 108
4.8.1 实现一个BeanPostProcessor 110
4.8.2 使用BeanPostProcessor类的实机选择 114
4.9 Spring ApplicationContext 115
4.9.1 ApplicationContext的实现类 115
4.9.2 使用ApplicationContext-Aware 116
4.9.3 控制bean的初始化 117
4.9.4 使用基于注解的配置 118
4.9.5 使用MessageSource进行国际化 123
4.9.6 在独立应用中使用MessageSource 130
4.9.7 MessageSourceResolvable接口 130
4.9.8 使用应用程序事件 130
4.9.9 对于事件用法的考虑 132
4.9.10 访问资源 133
4.10 小结 134
第5章 Spring AOP基础 135
5.1 AOP概念 136
5.2 AOP的类型 136
5.2.1 静态AOP 137
5.2.2 动态AOP 137
5.2.3 选择一种AOP类型 137
5.3 Spring中的AOP 137
5.3.1 AOP联盟 138
5.3.2 AOP的Hello World 138
5.3.3 Spring AOP架构 140
5.3.4 ProxyFactory类 140
5.3.5 在Spring中创建通知 141
5.4 Spring里的通知者和切入点 155
5.4.1 切入点接口 156
5.4.2 使用ComposablePointcut 172
5.4.3 切入点总结 175
5.5 代理详解 176
5.5.1 理解代理 176
5.5.2 使用JDK动态代理 176
5.5.3 使用CGLIB代理 177
5.5.4 两者的性能比较 177
5.5.5 选用代理 180
5.6 小结 180
第6章 AOP进阶 182
6.1 @AspectJ注解 182
6.2 @AspectJ方面详解 186
6.2.1 切入点 186
6.2.2 切入点表达式 189
6.2.3 探讨切入点表达式 191
6.2.4 在XML中使用@Pointcuts 194
6.2.5 通知的类型 194
6.2.6 参数绑定 201
6.2.7 引入 202
6.2.8 方面的生命周期 208
6.3 AOP的框架服务 209
6.3.1 使用AOP命名空间创建第一个方面 209
6.3.2 AOP命名空间中的切入点 211
6.3.3 使用AOP命名空间创建通知 212
6.3.4 AOP命名空间中的引入 217
6.4 风格选择 219
6.5 使用Spring AOP代理 220
6.6 AspectJ集成 225
6.6.1 创建第一个AspectJ方面 225
6.6.2 编译示例程序 227
6.6.3 AspectJ方面的作用域 229
6.7 加载时织入 230
6.7.1 第一个加载时织入示例 230
6.7.2 LoadTimeWeaver的查找策略 232
6.8 AOP实践 232
6.9 小结 235
第7章 Spring schema与命名空间 236
7.1 新配置的缘由 236
7.2 Spring 2.5包含的schema 238
7.2.1 beans schema 238
7.2.2 上下文schema 239
7.2.3 util schema 239
7.2.4 tx schema 242
7.2.5 aop schema 242
7.2.6 jee schema 242
7.2.7 lang schema 243
7.3 schema背后 244
7.4 自定义schema 246
7.5 IDE配置 249
7.6 小结 252
第8章 Spring模式 253
8.1 目录结构 253
8.1.1 简单应用 253
8.1.2 复杂应用 255
8.1.3 打包和命名 255
8.2 设计模式简介 255
8.2.1 面向接口编程 256
8.2.2 创建模式 256
8.2.3 结构模式 260
8.2.4 行为模式 262
8.3 Spring应用模式 264
8.3.1 分层设计 265
8.3.2 高性能分页 266
8.3.3 多错误报告 268
8.3.4 用户界面事务 271
8.3.5 后台进程 274
8.3.6 邮件通知 278
8.3.7 错误收集和日志 280
8.4 小结 283
第二部分 数据访问

第9章 Spring对JDBC的支持 286
9.1 JDBC的主要概念 286
9.1.1 使用DriverManager和Connection 288
9.1.2 使用PreparedStatement 289
9.1.3 使用CallableStatement类 292
9.1.4 其他JDBC概念 293
9.2 Spring对数据访问支持的概念 293
9.3 Spring对JDBC数据访问的支持 294
9.4 使用JdbcTemplate类 294
9.4.1 JdbcTemplate类的execute方法 296
9.4.2 JdbcTemplate类的query方法和该方法的扩展 299
9.4.3 JdbcTemplat类的update方法 303
9.4.4 JdbcTemplate类的batchUpdate方法 304
9.5 RdbmsOperation子类 305
9.5.1 SqlUpdate子类 306
9.5.2 BatchSqlUpdate子类 311
9.5.3 SqlCall类和StoredProcere子类 312
9.5.4 SqlQuery类和它的子类 314
9.5.5 JdbcTemplate类和RdbmsOperation类的比较 321
9.6 大二进制对象 321
9.7 JdbcDaoSupport类 324
9.8 简单的Spring JDBC 326
9.8.1 SimpleJdbcTemplate类 326
9.8.2 SimpleJdbcCall类 329
9.8.3 SimpleJdbcInsert类 331
9.8.4 SimpleJdbcDaoSupport类 332
9.9 小结 333
第10章 集成iBATIS 334
10.1 iBATIS简述 334
10.1.1 iBATIS版本 334
10.1.2 基础架构和配置 335
10.2 映射文件 335
10.2.1 sqlMap文件 337
10.2.2 配置iBATIS和Spring 339
10.3 查询数据 341
10.3.1 简单查询操作 341
10.3.2 一对一查询操作 344
10.3.3 一对多查询操作 348
10.3.4 多对多查询操作 350
10.4 更新数据 350
10.5 删除数据 353
10.6 插入数据 354
10.7 iBATIS缺少的特性 356
10.8 整体性能 357
10.9 小结 358
第11章 Spring对Hibernate的支持 359
11.1 Hibernate入门 359
11.2 Hibernate打包 360
11.3 Hibernate支持的介绍 361
11.3.1 使用Hibernate Session 363
11.3.2 使用HibernateDaoSupport类 366
11.3.3 HibernateTemplate和Session间的选择 368
11.4 在企业级应用程序中使用Hibernate 372
11.4.1 阻止更新脏数据 372
11.4.2 对象等价性 375
11.4.3 事务支持 378
11.4.4 延迟加载 382
11.5 处理大数据集 392
11.6 处理大对象 394
11.7 使用Hibernate处理其他DAO代码 397
11.8 小结 398
第三部分 企业级应用组件

第12章 基于Spring的任务调度 400
12.1 使用JDK Timer调度任务 401
12.1.1 Timer触发器类型 401
12.1.2 创建一个简单任务 401
12.1.3 Spring对JDK Timer调度的支持 404
12.2 使用OpenSymphony Quartz来调度任务 409
12.2.1 Quartz简介 410
12.2.2 Spring对Quartz的支持 418
12.3 任务调度时需考虑的因素 423
12.3.1 选择一个调度器 423
12.3.2 剥离Job类中的任务逻辑 424
12.3.3 任务执行和线程池 424
12.4 小结 428
第13章 Spring的邮件支持 429
13.1 Spring Mail API结构 430
13.2 发送简单的电子邮件 430
13.2.1 编程式构造和发送电子邮件 431
13.2.2 声明式构造电子邮件 433
13.3 构造并发送MIME消息 436
13.3.1 发送基本的HTML消息 438
13.3.2 发送带有内嵌图片的HTML消息 439
13.3.3 发送带有附件的消息 441
13.3.4 发送带有可替换纯文本的HTML消息 442
13.3.5 发送复杂MIME消息 445
13.4 深入了解企业级电子邮件处理 449
13.5 小结 458
第14章 动态语言 459
14.1 支持的动态语言概览 459
14.1.1 BeanShell 459
14.1.2 Groovy 461
14.1.3 JRuby 462
14.2 使用动态语言定义Spring bean 463
14.2.1 动态语言支持的幕后 465
14.2.2 代理动态语言bean 466
14.2.3 性能 466
14.3 可刷新bean(refreshable bean) 468
14.4 基于BeanShell的bean 470
14.5 基于JRuby的bean 472
14.6 基于Groovy的bean 473
14.7 动态语言在Spring程序中的典型应用 473
14.8 小结 477
第四部分 Java EE 5应用开发

第15章 Spring远程访问 480
15.1 Spring Remoting架构 481
15.2 远程方法调用 482
15.2.1 开放任意的服务 482
15.2.2 通过代理访问RMI服务 484
15.2.3 开放CORBA服务 486
15.2.4 访问CORBA服务 488
15.3 使用JAX-RPC实现Web服务 490
15.3.1 Apache Axis简介 490
15.3.2 使用ServletEndpoint- Support创建Web服务 490
15.3.3 使用代理访问RPC风格的Web服务 494
15.3.4 与Axis服务的JavaBean交互 497
15.4 使用JAX-WS Web服务 500
15.4.1 通过SimpleJaxWsService-Exporter公开Web服务 501
15.4.2 使用XFire公开Web服务 501
15.4.3 访问JAX-WS Web服务 503
15.4.4 从其他客户端访问Java Web服务 504
15.5 使用HTTP Invoker创建Web服务 507
15.5.1 开发简单服务 508
15.5.2 通过代理访问HTTP Invoker服务 510
15.5.3 在HTTP Invoker服务中使用任意对象 511
15.5.4 使用HTTP基本认证 513
15.6 远程架构的选择 516
15.7 小结 517
第16章 事务管理 518
16.1 Spring事务抽象层简介 518
16.2 分析事务属性 519
16.2.1 探索TransactionDefinition接口 519
16.2.2 使用TransactionStatus接口 520
16.2.3 PlatformTransactionManager的实现 521
16.3 对一个事务管理示例的探索 521
16.4 编程式事务管理 529
16.4.1 使用TransactionTemplate类 531
16.4.2 编程式事务管理小结 532
16.5 声明性事务管理 532
16.5.1 使用TransactionProxy-FactoryBean 532
16.5.2 在事务管理中使用代理的含义 534
16.6 AOP事务管理 535
16.6.1 使用基于注解的AOP事务管理 535
16.6.2 使用XML AOP事务管理 537
16.6.3 tx:advice标签简介 538
16.6.4 XML AOP小结 539
16.7 在多个事务性资源上使用事务 540
16.8 实现你自己的事务同步 541
16.9 小结 548
第17章 基于Spring MVC的Web应用开发 549
17.1 MVC架构 549
17.2 Spring MVC介绍 550
17.3 使用处理器映射 551
17.4 Spring控制器 553
17.4.1 AbstractController类 554
17.4.2 ParameterizableView-Controller类 555
17.4.3 MultiActionController类 555
17.5 * 558
17.6 视图、本地化和主题 559
17.6.1 以编程的方式使用视图 559
17.6.2 使用视图解析器 561
17.6.3 使用本地化消息 565
17.6.4 使用Locale 565
17.6.5 使用主题 565
17.7 命令控制器 567
17.7.1 使用表单控制器 568
17.7.2 探索AbstractWizardForm- Controller 类 574
17.7.3 文件上传 578
17.8 处理异常 581
17.9 Spring与其他Web技术 583
17.9.1 使用JSP 583
17.9.2 使用Velocity 600
17.9.3 FreeMarker 604
17.9.4 使用XSLT视图 608
17.9.5 使用PDF视图 609
17.9.6 实现PDF视图 610
17.9.7 使用Excel视图 611
17.9.8 使用Tiles 613
17.9.9 JasperReports报表引擎 623
17.10 Spring的约定优于配置 627
17.10.1 控制器约定 628
17.10.2 MultiActionController约定 628
17.10.3 模型约定 629
17.10.4 视图约定 630
17.11 使用注解配置控制器 631
17.11.1 @Controller注解 631
17.11.2 @RequestMapping注解 632
17.11.3 @RequestParam注解 633
17.11.4 @ModelAttribute注解 633
17.11.5 使用注解配置命令控制器 634
17.12 小结 635
第18章 Spring Web Flow 636
18.1 Spring Web Flow简介 637
18.1.1 核心概念 637
18.1.2 获取Spring Web Flow 640
18.1.3 Spring Web Flow依赖 642
18.2 Hello, Web Flow! 642
18.3 探索状态 646
18.3.1 view状态 647
18.3.2 decision状态 647
18.3.3 end状态 648
18.4 处理转换 648
18.5 高级概念 650
18.5.1 表达式语言和范围 650
18.5.2 实现action 653
18.5.3 模型数据绑定 654
18.5.4 局部视图刷新 658
18.5.5 映射流的输入与输出参数 658
18.5.6 使用子流 659
18.6 幕后的Spring Web Flow 660
18.6.1 流执行架构 660
18.6.2 流执行者 662
18.6.3 流定义注册表 662
18.6.4 流执行仓库 665
18.7 集成Spring MVC 666
18.7.1 流处理 666
18.7.2 视图解析 667
18.8 使用Spring Security构建安全的流 668
18.8.1 第一步:添加SecurityFlow- ExecutionListener 668
18.8.2 第二步:处理基本的认证和授权 668
18.8.3 第三步:在流定义中定义安全规则 670
18.9 问题解决 672
18.9.1 带状态的导航控制 672
18.9.2 浏览器导航栏支持和双提交(double submit) 672
18.10 测试流定义 673
18.11 小结 674
第19章 Spring与AJAX 675
19.1 DWR 675
19.2 安装DWR 676
19.3 针对DWR的Spring配置 676
19.4 关于完整示例 677
19.5 测试DWR配置 682
19.6 运行完整示例 682
19.7 DWR脚本基础 683
19.7.1 使用简单的回调函数 683
19.7.2 调用元数据对象 684
19.8 engine.js文件 684
19.8.1 调用批处理 684
19.8.2 调用顺序 684
19.8.3 错误和警告处理 684
19.9 util.js脚本 685
19.10 DWR的安全性 685
19.11 DWR的优缺点 686
19.12 小结 687
第20章 使用Spring JMX 688
20.1 JMX进阶 688
20.2 开放Java Bean 689
20.2.1 MBeanExporter类 689
20.2.2 MBeanServer FactoryBean类 691
20.2.3 在已有的MBean服务器上开放Bean 692
20.2.4 Bean注册行为 692
20.3 控制对象名 693
20.4 控制管理接口 693
20.4.1 MBeanInfoAssembler接口 693
20.4.2 MethodNameBasedMBean-InfoAssembler接口 694
20.4.3 用Java接口来控制管理接口 696
20.4.4 使用源码级元数据 698
20.5 远程使用Spring JMX 701
20.5.1 开放远程MBean 701
20.5.2 访问远程MBean 702
20.5.3 代理MBean 702
20.6 Spring JMX通知 703
20.6.1 通知* 703
20.6.2 发布通知 704
20.7 小结 708
第21章 使用Spring进行测试 709
21.1 进行单元测试 709
21.2 单元测试 711
21.3 集成测试 715
21.3.1 使用AbstractSpring- ContextTests 722
21.3.2 使用AbstractDependency- InjectionSpringContext-Tests类 723
21.3.3 使用AbstractTransac-tionalSpringContextTest 726
21.3.4 使用AbstractAnnotation-AwareTransactionalTest 728
21.3.5 JNDI 731
21.4 Spring TestContext Framework 733
21.4.1 应用上下文及使用TestContext Framework进行依赖注入 733
21.4.2 使用TestContext Framework进行依赖注入 735
21.4.3 TestContext Framework中的事务 736
21.4.4 支持类 738
21.5 测试覆盖 740
21.6 小结 740
第22章 Spring性能调优 741
22.1 性能与响应 741
22.2 探索企业应用的性能问题 741
22.3 测量Java EE应用的性能 742
22.3.1 测量目标 742
22.3.2 确定必要的数据集 747
22.3.3 改善数据访问层 748
22.3.4 提高事务管理 757
22.3.5 控制远程调用的性能 758
22.3.6 了解视图性能 758
22.4 使用缓存 759
22.5 性能测试 760
22.6 监控应用程序的状态和性能 762
22.7 更多的性能调优资源 764
22.8 小结 764

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
迷茫时发朋友圈的句子 戴尔Precision M4600(酷睿I5 2520M/4GB/500GB/1366x768)基本参数_百度... 发动机通电不自检,,风扇一直转 决战平安京铃鹿御前技能介绍 最强射手正式上线 ...顺序介绍_《决战!平安京》泷夜叉姬技能连招顺序是什么 如何去除牙石?溶解牙石疗法有哪些啊? 暴力罗曼史剧情简介 暴力罗曼史中到第几集大家发现朴武烈的保姆是坏人的? 暴力罗曼史 爱普生635k针式打印机 用的进销存软件 打印出单据来不正不是偏左就是... 顾家家居为什么交货期是两个月 一男二女三人闺密双重影头像 哪位好心人可以赐我三个头像,要求不多,是和男朋友还有闺蜜一起用的。头像里必须是人 各位大神们,有没有可以和闺蜜还有自己男朋友一起用的头像(因为不想扔下任何一个人)? 福州哪位养狗狗的人不想养了 或者狗狗数量太多了的?我想养一只 一个一天能关注多少个公众账号? 在福州有什么工作适合小伙子 福州森林公园可以带狗狗吗 公司同时运营多个公众号,每次都要频繁切换十分麻烦,有平台可以直接管理多个账号吗? 福州信誉度高的宠物店或狗舍 如何把两个公众账号合并成为一个 请问福州比较大的狗场在哪里? 福州哪里能够买到宠物狗 7月大比熊要打几针疫苗??福州哪家打疫苗好?哪种1疫苗?? 一个身份证可以申请多少个公众服务帐号,如何申请多个公众帐号 福州哪里有宠物店好 养比熊好吗? 比熊和泰迪哪个更聪明?在福州的价位分别在多少? 福州半买半送 比熊。4个多月大的DD 疫苗全部打完 剃了胎毛 希望找个好主人 狗贩滚开 QQ:470501489 什么狗适合养在福州呀 王者荣耀s23赛季初现在代练平台对于打手的要求都有什么? 西安怎么办商品的条形码?需要提供哪些手续?费用大概是多少? 西安申请增加条码。公司条码用完了,现在要增加条码,去哪买?要带什么手续? 如何导出苹果手机里的照片到电脑 苹果电脑连接苹果手机怎么导出照片 如何把两个公众账号合并成为一个 一个一天能关注多少个公众账号? 欧洲航天局祝贺“天问一号”探测器成功着陆火星,火星是个什么样的星球? 火星到底是待开发的星球,还是已经被遗弃的星球? 求宠物小精灵石英联盟,橘子联盟,成都联盟的全集,日文版 想要去火星很难,这是为什么呢? 火星并不是离地球最近的天体,为什么人类对火星的探索却从未停止? 火星是什么天体类型? 火星为什么被认为是最有可能存在生命的星球 JJ是不是出写真集了啊?? 火星为什么被认为是最有可能存在生命的星球呢? 火星是天体吗? 火星是一个什么样的星球 JJ比赛 WWWJJCN注册过商标吗?还有哪些分类可以注册? 在耐卡影音论坛上登陆了QQ,QQ会被盗吗?我电脑没有病毒