自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(102)
  • 资源 (24)
  • 收藏
  • 关注

原创 Spring portlet 配置文件 一个问题

spring配置portlet比较简单portlet.xml一般放到WEB-INF下面:<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

2011-11-10 15:14:20 485

原创 jquery 跨域 调用服务器js 单点登录 SSO

问题:由于项目实现需要单点登录(SSO)功能,passport服务器与各个应用服务器不在同一个域中,当用户登录了某一台应用服务器,则在访问其他应用时,不需要用户进行再次登录。解决方案:passport服务器在用户浏览器中保存了登录cookie,当用户请求登录passport服务器时,passport服务器读取该cookie来判断是否需要用户输入用户名、口令来登录。遇到的问题,由于各个应

2011-11-02 11:22:06 3519 1

原创 spring unit test autowired

Spring下的单元测试是十分完善的,原来一直困扰的问题是:Service、Controller类使用的基础类都是Autowired,这样就不必在Context.xml中进行配置,调用者也无需写get、set方法,但问题是在进行unitTest过程中,test不能自动加载这些au

2011-10-18 15:40:28 2000

原创 spring-portlet生成pdf文件

生成PDF有两种方式:一种是用java直接产生PDF文件,但不能定制格式;另一种是使用PDF的模板,由java填充数据,好处可以定制输出格式。如下代码是使用PDF模板来填充数据注意在Controller里必须使用ResourceRequest和ResourceResponse来获取输出流需要注意的是,jsp页面上用href来请求下载功能@RequestMapping(params = "actio

2011-09-21 14:09:31 985

原创 pring-flex生成pdf文件

flex中可以生成spring的action的URL,spring而后截获该请求,其对应的requestMap如下:1)由NativeWebRequest request中获取HttpServletResponse2)由HttpServletResponse获取Outpu

2011-09-21 14:08:12 786

原创 手机识别二维码生成到pdf中

Java生成手机可识别的二维码的开源包很多,但把生成的二维码放到pdf中不是很容易。Java生成pdf的方式有两种:直接生成pdf的document,然后输出到outputStream;另一种使用pdf的模板,通过AcroFields form = stamper.get

2011-09-21 14:04:40 2955

原创 程序设计看到的、想到的

本金和利息每位开发人员都开始注意到技术债务 的概念,您可能由此而迫于外部压力(例如日程压力)在设计中有所折衷。技术债务类似于信用卡债务:您目前没有足够的资金,因此您借用未来的资金。同样地,您的项目没有足够的时间来做正确的事情,因此您使用一种及时的解决方案并希望在未来的一段时间

2011-08-04 18:22:30 114

原创 解析XML XStream

解析XML方法很多,XStream是比较简洁的1、把Java类转成XMLimport com.thoughtworks.xstream.XStream;public class ErrorCode { private int errorCode; public Erro

2011-07-21 17:35:00 855

原创 图片 BASE64编码 JSP 显示

对于图片在JSP中显示的问题很常见,用户上传图片,最简单的办法放到数据库中,如何显示?用户需要把图片以BASE64编码的方式放到XML中,然后上传XML,我们需要显示该图片,办法是:1、把图片编码存储到数据库中,然后利用Servlet来显示图片try { MysqlDAO

2011-07-21 17:14:48 4122

原创 Spring通过“注释Annotation”集成 EHCahe

Spring中提供了JDBC包装功能,对于Cache可由程序员选择。通过注释功能使用EHCahe非常简单首先,配置Spring的配置文件加入:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi

2011-07-20 17:35:10 1394

原创 mysql存储过程的中文问题的解决

存储过程中经常会遇到使用中文问题,一般出现的问题有以下几种:1、字段定义不是中文编码2、字段长度不足3、存储信息为乱码,尤其通过执行sql脚本添加数据最为常见4、使用where子句是,对中文字符串进行比较,这个问题也是十分常见对于前两个问题,我没啥话。第3个问题,一定要注意执行脚

2011-07-20 16:58:52 1510

原创 GIS: Openlayer 中使用SLD动态改变地图

首先定义layer var bounds = new OpenLayers.Bounds(73.4469604492188, 3.40847730636597,             135.085830688477, 53.5579261779785);     var options = {         controls : [],         maxExtent : bounds,         maxResolution : 0.340776836

2011-03-11 11:21:00 1391 1

原创 Long Code

o Long method If you have a method with lots of parameters and temporary variables, these elements get in the way of extracting methods. You can often use Replace Temp with Query to eliminate the temps. Long lists of parameters can be slimmed down

2011-02-21 10:19:00 364

原创 Duplicated Code

If you see the same code structure in more than one place, you can be sure that your program will be better if you find a way to unify them. 1. The simplest duplicated code problem is when you have the same expression in two methods of the same class.

2011-02-21 08:47:00 511

原创 Refactoring improving the design of existing code (1)

When you find you have to add a feature to a program, and the program’s code is not structured in a convenient way to add the feature, first refactor the program to make it easy to add the feature, then add the feature. The First Step in Refactoring Whe

2011-02-18 21:35:00 412

原创 OOA&D is about writing great software

Customers are satisfied when their apps WORK. We can get requirements from the customers to make sure that we build them what they ask for. User cases and diagrams are helpful ways to do that, but it’s all about figuring out what the customer wants the a

2011-02-18 14:55:00 294

原创 Delegate

The act of one object forwarding an operation to another object, to be performed on behalf of the first object. What’s the point? Delegation makes your code more reusable. It also lets each object worry about its own funtionality, rather than spreading

2011-02-18 09:11:00 276

原创 Principle of Least Knowledge talk only to your immediate friends.

The principle tells us that we should only invoke methods that belong to : The object itself Objects passed in as a parameter to the method Any object the method creates or instantiates Any components of the object Facade pattern

2011-02-15 09:56:00 417

原创 A factory method Pattern

A factory method handles object creation and encapsulates it in a subclass. This decouples the client code in the superclass from the object creation code in the subclass. public abstract class PizzaStore {        public Pizza orderPizza (String type ) {

2011-02-14 10:16:00 297

原创 Simple factory pattern

This pattern encapsulate object creation when create  many instances according to different types. Such as : Pizza orderPizzal(String type){      Pizza pizza;      if(type.equals(“cheese”)){         pizza = new CheesePizza();      }else if(……

2011-02-14 09:59:00 242

原创 interface programming

<br />「针对接口编程」真正的意思是「针对超类型(s u p e r t y p e)编程」。<br />「针对接口编程」,关键就在多态。<br />    利用多态,程序可以针对超类型编程,执行时会根据实际状况执行到真正的行为,不会被绑死在超类型的行为上。「针对超类型编程」这句话,可以更明确地说成「变量的声明类型,应该是超类型,通常是一个抽象类或者是一个接口,如此,只要是具体实现此超类型的类所产生的对象,都可以指定给这个变量;这也意味着,声明类时,不用理会以后执行时的真正对象类型!」<br />

2011-02-08 09:30:00 315

原创 Spring framework

<br />Spring Values:Spring is a non-invasive framework.   Spring Application code can be run without Spring. Lock-in to Spring minimized.  Migration to higher Spring is easier.Aims to facilitate good programming practice, such as programming to interfaces,

2011-02-08 09:25:00 342

转载 java判断linux下的符号链接

Java 1.6 - determine symbolic links<br /><br />In a DirectoryWalker class I want to find out if a File instance is actually a symbolic link to a directory (assuming, the walker walks on UNIX systems). Given, I already know the instance is a directory

2011-01-25 10:02:00 1084

原创 java抽象类

抽象类是不可实例化,其用途只有一个---继承具体类是不应该用来继承的,整个继承树,叶子节点只应该是具体类,其他节点均为抽象类父类拥有子类的共同代码越多越好,策略模式就是一个例证,抽象策略角色的分量越重越好。抽象类拥有尽可能少的数据子类扩展超类功能,不要Override or Nullify 超类的职责,如出现此情况,抽象出一个新超类,让上述两个类成为其子类

2011-01-16 23:23:00 289

原创 java笔试问题(继承)

<br />java笔试过程中继承问题是必考的:如下一题<br />public abstract class A {<br />  int i=1;<br />  public void printI() {<br />    System.out.println("i="+i);<br />  }<br />}<br /><br />public class B  extneds A{<br />  int i=2;<br />  public stati

2011-01-12 15:39:00 429

转载 让一个脚本自动定时运行,设置、启动 linux定时脚本 (crontab详解)

[root@test1 init.d]# crontab -e 在root文件后面添加一行(含义:每月的18日4:40分执行scott_select.sh)<br />40 4 18 * * /oracle_backup/bin/scott_select.sh<br />0 0 23 * *  /patch to tranferfiles.sh >;tranferfiles.log 设置完了之后不要忘了,启动定时服务(大多数忘了这里)[root@test1 init.d]# service cr

2011-01-12 13:56:00 356

原创 jquery处理xml的ajax方法

<br />ajax的jquery调用总结<br />1)定义ajax的url,利用jstl的标签<br /><c:set var="ChinaCornServlet"><br />    <html:rewrite resourceURL='true' href="${contextPath}/servlet/ChinaCornServlet" /><br /></c:set><br />其中contextPath为pageContext.setAttribute("contextPa

2011-01-04 21:56:00 421

原创 portlet标签导入问题

这个标签在整体页面上只能导入一次如果被引用两次,tomcat会抛出Null 168或者286Tag异常而以下标签必须每个jsp需要时都必须导入,否则不能起作用<%@ taglib uri="http://java.sun.com/jsp/jstl

2010-12-17 10:28:00 550

原创 SVG vs VML

今天才知道VML(Vector Market Language)是MS的1999年9月的语言,是Office与IE的混合产品。SVG是W3C的标准,FF等浏览器支持,MS一直不支持。

2010-12-16 09:10:00 281

原创 通过Eclipse定位浏览Android源代码的方法(转)

http://hi.baidu.com/%C7%E5%BA%AE%D0%C7/blog/item/c9661a58ffd1e9d39d82046a.html2010-06-29 16:36<br />在Eclipse里写代码时,想通过Open Declaration 跳到系统的代码里看看,如何做呢<br /><br />1. 下载android源代码,网上一搜,很多<br />2. 在SDK安装目录下,比如C:/android-sdk-windows-1.6_r1/pl

2010-10-11 15:57:00 573

原创 ListView项目长按的菜单功能总结

<br />ListView上的Item长按弹出菜单或者对话框是常见的功能之一:<br />其实现如下:<br />extends ListActivity{<br /> <br />在方法:<br />@Override<br />public void onCreate(Bundle savedInstanceState) {<br />        super.onCreate(savedInstanceState);<br />        requestWindowFeature(Wi

2010-08-31 09:56:00 3681 1

转载 "Check-in" Apps will become the future of mobile location-based marking

mobile location-based check-in applications

2010-08-30 08:57:00 555

原创 Android processBar的应用

本打算,在下载文件过程中显示进度条,代码如下:do { // Start reading data from the URL stream numread = is.read(buf); if (numread

2010-08-18 16:38:00 2988

原创 滑条自动跳转,显示控件的新条目

滑条自动跳转,显示控件的新条目(:listView)<br /> 经常需要用ListView或者其它显示大量Items的控件实时跟踪或者查看信息,并且希望最新的条目可以自动滚动到可视范围内。通过设置的控件transcriptMode属性可以将Android平台的控件(支持ScrollBar)自动滑动到最底部。<br />源代码:<br /><br /><ListViewandroid:id="@android:id/list"             <br />   

2010-08-18 09:01:00 679

原创 mobile search

<br />Search Addresses the Needs of All: Subscribers, Carriers, and Marketers<br />Mobile search engines will benefit wireless subscribers, marketers and mobile operators by<br />fostering a virtuous cycle where: 1) Subscribers use search to find conte

2010-07-30 18:59:00 566

原创 Andriod PopupWindow中EditText如何获取焦点

<br />package cn.cnic.cerc.search;<br /><br />import java.util.ArrayList;<br /><br />import android.app.Activity;<br />import android.app.AlertDialog;<br />import android.app.Dialog;<br />import android.app.SearchManager;<br />import android.co

2010-07-30 18:12:00 6247 1

原创 实现查询ViewList功能

private static final int MENU_SEARCH = 1;//        @Overridepublic boolean onCreateOptionsMenu(Menu menu) {menu.add(0, MENU_SEARCH, 0, R.string.menu_search).setIcon(android.R.drawable.ic_search_category_default).setAlphabeticShortcut(SearchManager.ME

2010-07-30 17:59:00 743

原创 调用Andriod search UI

<br /><br />1、在Activity中建立菜单<br />@Override<br />    public boolean onCreateOptionsMenu(Menumenu) {<br />        menu.add(0, MENU_SEARCH, 0,R.string.menu_search)<br />               .setIcon(android.R.drawable.ic_search_category_default)<br /> 

2010-07-29 14:23:00 555

原创 contentProvider一例

<br />private void showInputErrorDialog() {<br />        AlertDialog.Builder builder = new AlertDialog.Builder(给出该窗口所依附的对象引用);<br />        builder.setTitle("输入错误");<br />        builder.setIcon(R.drawable.warning);<br />        builder

2010-07-29 14:14:00 331

原创 Andriod AlertDialog

private void showInputErrorDialog() {        AlertDialog.Builder builder = new AlertDialog.Builder(给出该窗口所依附的对象引用);        builder.setTitle("输入错误");        builder.setIcon(R.drawable.warning);        builder.setMessage("用户名或密码不能为空。");        bui

2010-07-27 17:29:00 650

Advanced Flex 3.pdf

Advanced Flex 3 application include: INTEGRATING WITH CLIENT- AND SERVER-SIDE TECHNOLOGIES GAINING REAL ADVANTAGE IN THE NEW WEB

2009-07-16

Thinking in Java 4th

Thinking in Java 4th Edition English pdf, total 16 blocks.

2007-10-25

java_and_flex_integration_bible.pdf

flex与java的完美集成,不可多得的2009最新新书,对于flex程序员是十分有价值的

2009-07-16

C#应用程序开发全程演练

C#应用程序开发全程演练,完整讲述了一个商业网站的建设过程。解释如何向用户提供一个他们想要的产品。

2009-02-13

Andriod Search Dictionary Example

Andriod 上调用内建Search UI的示例

2010-07-29

Andriod 联系人检索

Andriod Search UI onSearchRequested

2010-07-29

Thinking in Java 4th Edition

Thinking in Java 4th Edition English. Total 16 blocks file

2007-10-25

Thinking in Java 4th Edition(12)

Thinking in Java 4th Edition

2007-10-25

Thinking in Java 4th Edition English

Thinking in Java 4th Edition English. Total 16 block.

2007-10-25

Thinking in Java 4th Edition(last)

Thinking in Java 4th Edition

2007-10-25

Thinking in Java 4th Edition(14)

Thinking in Java 4th Edition

2007-10-25

Thinking in Java 4th Edition English

Thinking in Java 4th Edition English. Total 16 block.

2007-10-25

Thinking in Java 4th

Thinking in Java 4th Edition English pdf, total 16 blocks.

2007-10-25

Thinking in Java 4th Edition(13)

Thinking in Java 4th Edition

2007-10-25

Thinking in Java 4th Edition(11)

Thinking in Java 4th Edition.

2007-10-25

Thinking in Java 4th Edition

Thinking in Java 4th Edition English. Total 15 blocks

2007-10-25

Thinking in Java 4th Edition English (8)

Thinking in Java 4th Edition English. Total 15 blocks

2007-10-25

Thinking in Java 4th Edition(10)

Thinking in Java 4th Edition English. Total 15 blocks

2007-10-25

Thinking in Java 4th Edition English

Thinking in Java 4th Edition English. Total 15 blocks

2007-10-25

Thinking in Java 4th Edition English

Thinking in Java 4th Edition English. Total 16 blocks

2007-10-25

ST-DEVELOPMENT pdf

ST DEVELOPMENT CAD

2008-03-27

Cluster Computing - Architectures, Operating Systems, Parallel Processing & Programming Languages Apr 2003

Cluster Computing - Architectures, Operating Systems, Parallel Processing & Programming Languages (v2.4) - Apr 2003 !!! - (By Laxxuss).pdf

2007-10-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除