ITeye博客

2014 年文章归档

共 5 篇文章

JSP杂记

1、请求URL为:http://ip:port**/industry.model/middle/a.b.c.test.ajax?a=b&c=d** request.getContextPath(); //得到:/industry.model request.getServletPath(); //得到:/middle/a.b.c.test.ajax request.getRequestURI(); //得到:/industry.model/middle/a.b.c.test.ajax request.getQueryString(); //得到:a=b&c=d

2014-11-26 17:57 · javaEE 基础学习

各种场景下相对路径获取

Jar包的父级目录 System.getProperty("user.dir"); //返回jar包的父级目录 jar包内的文件应该以Class.getResourceAsStream(path)方式获取 Java工程根目录 System.getProperty("user.dir"); //返回Java工程根目录 Java Web工程根目录 request.getServletContext().getRealPath("/"); //返回JavaWeb根目录,绝对路径 request.getServletContext().getContextPath(); //返回JavaWeb根目录…

2014-10-21 20:25 · javaEE 基础学习 · Java

eclipse利用自身的Equinox创建OSGI环境

环境准备: Eclipse 4.4 操作步骤: 1、打开Eclipse的Run Configurations 2、新建OSGI Framework实例 3、Deselect All,之后勾选以下几项: org.eclipse.osgi org.eclipse.equinox.console org.apache.felix.gogo.runtime org.apache.felix.gogo.shell org.apache.felix.gogo.command 4、点击【Run】按钮 如果出现osgi>的提示符,就说明启动成功了。 Equinox的控制台的部分基本命令如下(区分大小写): …

2014-09-15 14:15 · eclipse插件开发

面向对象编程的几句话

1、抽象与实现分离--API与SPI 2、分层设计--复杂逻辑的编程(垂直划分) 3、模块化设计--复杂逻辑的编程(水平划分)

2014-09-14 08:47 · 编程思想浅感 · 编程

dom4j DOM方式和SAX方式解析带有命名空间XML报文的不同

XML报文如下: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://wsTest"> <soapenv:Header/> <soapenv:Body> <wst:add> <!--Optional:--> <wst:a>2</wst:a> <!--Optional:--> <wst:b>3</wst:b> </wst:add> </soapenv:Body> </soapenv:Envelope> 目标选取:Envelope-->Body-->add-->…

2014-03-04 13:02 · javaEE 基础学习