ITeye博客

longcxm的博客

longcxm · 共 176 篇文章

Spring整合struts2

spring整合struts2的步骤: (其实很简单,只需要把action的类名换成spring的bean名称即可) 1.在web.xml文件中添加spring的ContextLoaderListener监听器; 2.把acion的class属性改成spring的bean名称; 3.添加相关的依赖包,即可;

2013-05-09 11:11 · J2EE · 评论(0)

java发邮件

发邮件需要用到mail.jar包 import java.util.Properties; import javax.mail.Address; import javax.mail.BodyPart; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBo…

2013-05-07 16:55 · Java相关 · 评论(0)

切入点表达式

execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?) 除了返回类型模式(上面代码片断中的ret-type-pattern),名字模式和参数模式以外, 所有的部分都是可选的。返回类型模式决定了方法的返回类型必须依次匹配一个连接点。 使用的最频繁的返回类型模式是*,它代表了匹配任意的返回类型。 一个全限定的类型名将只会匹配返回给定类型的方法。名字模式匹配的是方法名。 你可以使用*通配符作为所有或者部分命名模式。 参数模式稍…

2013-04-15 16:53 · Spring · 评论(0)

Spring配置文件读取properties文件中的value

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath*:/jdbc.properties</value> <value>classpath*:/mail.properties</value> </list> </property> <property name="fileEncoding" value="utf-8" /> <…

2013-04-15 15:29 · Spring · 评论(0)

dddddddd

但事实上事实上事实上事实上事实上事实上事实上事实上是

2013-04-10 23:57 · 三国地图 · 评论(0)

ViewPart的基本操作

public class AddressView extends ViewPart { private TableViewer viewer; private Action action1; private Action action2; private Action doubleClickAction; class ViewContentProvider implements IStructuredContentProvider { public void inputChanged(Viewer v, Object oldInput, Object newInput) { } public…

2013-01-08 16:00 · eclipse插件 · 评论(0)

PropertyChangeSupport的使用

import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; public class Test01 { private String name; /* * 在事件源的地方顶一个一个PropertyChangeSupport对象,间接地由它负责 * 添加监听、激发事件 */ private PropertyChangeSupport listernts=new PropertyChangeSupport(this); /** * 在事件源上添加监听,实际上是在PropertyChangeS…

2012-12-20 14:06 · Java相关 · 评论(0)

CoolBar

CoolBar是一个容器,里面可以放置多个工具栏,CoolItem代表一个工具栏,基于CoolBar做出的工具栏,可以拖动,改变排放的位置。 final ViewForm vf=new ViewForm(shell, SWT.NONE); vf.setLayout(new FillLayout()); final Text text=new Text(vf, SWT.BORDER|SWT.V_SCROLL); vf.setContent(text); CoolBar cb=new CoolBar(vf, SWT.NONE); ToolBar tb=new ToolBar(cb, SWT.NO…

2012-12-16 15:12 · eclipse插件 · 评论(0)

ViewForm

ViewForm是一个容器,它是编辑器的基座,用来容纳工具栏和文本框,ToolBar是一个工具栏,同时可以容纳一个工具栏按钮ToolItem ViewForm vf=new ViewForm(shell, SWT.NONE); vf.setLayout(new FillLayout()); final Text text=new Text(vf, SWT.BORDER|SWT.V_SCROLL); vf.setContent(text); ToolBar tb=new ToolBar(vf, SWT.NONE); ToolItem ti=new ToolItem(tb, SWT.PUSH);…

2012-12-16 14:53 · eclipse插件 · 评论(0)

SWT容器类

容器类 我们可以通过容器对组件进行统一操作,容器移动,其中的组件也会跟着移动,容器隐藏,组件也会隐藏;容器销毁,组件也会自动销毁。 一、面板Composite类 该类是shell类的父类,常用的方法有: pack()根据容器内组件的时间占地大小,压缩容器多余的空间 二、分组框group 它用于集合多个组件,并显示一个方框,方框上面有一串说明文字 Group group=new Group(shell,SWT.NONE); group.setText("test"); 三、选项卡TabFolder 它也属于容器类 TabFold可以有一个或多个TabItem,TabItem可以通过setCon…

2012-12-16 14:34 · eclipse插件 · 评论(0)

注入的方式

一、依赖注入概述 Dependency injection (DI) is a process whereby objects define their dependencies, that is, the other objects they work with,The container then injects those dependencies when it creates the bean. This process is fundamentally the inverse, hence the name Inversion of Control (IoC).DI exists…

2012-12-10 23:59 · J2EE · 评论(0)

spring概述

一、Spring概述 The Spring Framework is a lightweight solution and a potential one-stop-shop for building your enterprise-ready applications.However, Spring is modular, allowing you to use only those parts that you need, without having to bring in the rest. Spring is designed to be non-intrusive, meanin…

2012-12-10 23:22 · J2EE · 评论(0)

批处理文件链接数据库

@echo off set /p sid=请输入: echo %sid% sqlplus haha/haha@%sid% @test1.sql @pause set 后面跟参数 /p 表示接受用户输入,并把输入的值赋值给sid 后面表示链接数据库后,立即执行test1.sql文件 test1.sql文件内容如下: select sysdate from dual; @test.sql sql文件中还可以引用其他sql文件,如上所示。 test.sql文件的内容如下: select sysdate from dual; exit 执行sql完毕后,exit退出sqlplus

2012-12-04 17:15 · dos · 评论(0)

start命令

很厉害的一段代码 @Echo off SET BPS_HOME=./ start %JAVA_HOME%/bin/javaw -cp "%BPS_HOME%/conf;%JAVA_HOME%/lib/rt.jar;%JAVA_HOME%/lib/jsse.jar" -Djava.ext.dirs="lib" com.test.mainFrame.Launcher set用来设置环境变量,./ 表示当前工作目录,start用于调用其他程序的命令,javaw用于启动java的图形界面程序,-cp知道classpath,-Djava.ext.dirs知道依赖包, 最后是主程序。

2012-12-04 16:41 · dos · 评论(0)

轻松删除某个element

不管前缀是什么,我们都可以轻松删除xml文件中的某个element Document document=DocumentHelper.parseText("xml字符串"); Element root = document.getRootElement(); Element security=root.element("Header").element("Security"); if(security != null) { security.detach(); }

2012-12-04 16:13 · xml技术 · 评论(0)