the method of debug jar package in MyEclipse
1 select the jar in Referenced Lib of the project
2 into it's properities
3 In java source attachment you can specify the localtion of the source code.
posted @
2009-11-01 23:30 桂湖山 阅读(227) |
评论 (0) |
编辑 收藏
VO是独立的Java Object。
PO是由Hibernate纳入其实体容器(Entity Map)的对象,它代表了与数
据库中某条记录对应的Hibernate实体,PO的变化在事务提交时将反应到实
际数据库中。
如果一个PO与Session对应的实体容器中分离(如Session关闭后的PO),那么
此时,它又会变成一个VO。
一般而言,应该避免直接PO传递到系统中的其他层面,一种解决办法是,通
过一个VO,通过属性复制使其具备与PO相同属性值,并以其为传输媒质(实际上,
这个VO被用作Data Transfer Object,即所谓的DTO),将此VO传递给其他层
面以实现必须的数据传送。
属性复制可以通过Apache Jakarta Commons Beanutils
(http://jakarta.apache.org/commons/beanutils/)组件提供的属性批
量复制功能,避免繁复的get/set操作。
下面的例子中,我们把user对象的所有属性复制到anotherUser对象中:
TUser user = new TUser();
TUser anotherUser = new TUser();
user.setName("Emma");
user.setUserType(1);
try {
BeanUtils.copyProperties(anotherUser,user);
System.out.println("UserName => "
+anotherUser.getName()
);
System.out.println("UserType => "
+ anotherUser.getUserType()
);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
posted @
2009-10-26 23:03 桂湖山 阅读(513) |
评论 (0) |
编辑 收藏
DLL劫持现象:
1 打开IE(或者IE搜索页)出现不知名的网站
2 清空临时文件夹,断开网络,打开IE依旧出现此网页
3 启动项目不存无可疑
解决:
1 用Windows自带工具搜索“*.*”,包含内容则COPY一段不知名网页的内容
2 此时一般会搜索出一两个DLL文件(一般在system32目录下)
3 安全模式或者DOS下,删!
4 在Windows安全模式在注册表搜索相关DLL文件的键值,删!
5 回到Windows,OK~
摘自:http://bbs.ikaka.com/showtopic-4294296.aspx
posted @
2009-10-11 11:03 桂湖山 阅读(209) |
评论 (0) |
编辑 收藏
Make it right before you make it faster.
Keep it right when you make it faster.
Make it clear before you make it faster.
Do not sacrifice clarity for small gains in efficiency.
Brian Kernighan
摘自“一个程序员的奋斗历程”
http://topic.csdn.net/u/20090908/18/09923fa2-6ace-45dd-bac0-5551c19f21b4.html
posted @
2009-10-09 10:05 桂湖山 阅读(97) |
评论 (0) |
编辑 收藏
在使用ExtJs中,其
<script> XXX.js </script>
的放置位置将影响Ext.onReady()的执行;
对于要使用jsp中的控件的onReady,需要将有关的<script>脚本放置到
JSP文件的</body>后。
posted @
2009-09-27 11:01 桂湖山 阅读(222) |
评论 (0) |
编辑 收藏
from
http://www.queness.com/post/152/simple-jquery-image-slide-show-with-semi-transparent-caption
1. HTML
My ultimate objective is - to keep the html as simple as possible.
So, the final product is as following. The first image has a class
called "show". Class show has higher z-index, so image with this class
will display on top, thus image with this class will always display on
top of the rest. The second thing you need to know is the DIV with
"caption" class. It has the highest z-index. That DIV will be used to
display the caption. The caption is retrieve from the REL attribute in
the img element. You can put html element in the REL attribute. Be
aware of extra padding and margin of the html elements you used. (eg
h1, p).
Have a look at the html code:
- <div id="gallery">
-
- <a href="#" class="show">
- <img src="images/flowing-rock.jpg" alt="Flowing Rock" alt="" title="" width="580" height="360" rel="<h3>Flowing Rock</h3>You can put html element
- inside the REL attribute."/></a>
- </a>
-
- <a href="#">
- <img src="images/grass-blades.jpg" alt="Grass Blades" alt="" title="" width="580" height="360" rel="<h3>Grass Blades</h3>description"/>
- </a>
-
- ......
- ......
- ......
-
- <div class="caption"><div class="content"></div></div>
- </div>
- <div class="clear"></div>
2
CSS
In this section, I declared a container #gallery for this image
slide show. The CSS for this tutorial is pretty straight foward, the
most importance thing is the z-index. You have to make sure the "show"
class z-index is lower than the "caption" z-index.
- body{
- font-family:arial
- }
-
- .clear {
- clear:both
- }
-
- #gallery {
- position:relative;
- height:360px
- }
- #gallery a {
- float:left;
- position:absolute;
- }
-
- #gallery a img {
- border:none;
- }
-
- #gallery a.show {
- z-index:500
- }
-
- #gallery .caption {
- z-index:600;
- background-color:#000;
- color:#ffffff;
- height:100px;
- width:100%;
- position:absolute;
- bottom:0;
- }
-
- #gallery .caption .content {
- margin:5px
- }
-
- #gallery .caption .content h3 {
- margin:0;
- padding:0;
- color:#1DCCEF;
- }
-
3. Javascript
Finally, the Javascript code. I have added comments in each line to explain what it does. My concept for this image slide show:
- Hide all the images
- Display the first image and caption
- Find the image with "show" class, and grab the next image using next() method
- Add "show" class to next image
- Animate the image (fadeout the current image, fadein next image)
- And, it repeats above steps over and over again
- $(document).ready(function() {
-
-
- slideShow();
-
- });
-
- function slideShow() {
-
-
- $('#gallery a').css({opacity: 0.0});
-
-
- $('#gallery a:first').css({opacity: 1.0});
-
-
- $('#gallery .caption').css({opacity: 0.7});
-
-
- $('#gallery .caption').css({width: $('#gallery a').find('img').css('width')});
-
-
- $('#gallery .content').html($('#gallery a:first').find('img').attr('rel'))
- .animate({opacity: 0.7}, 400);
-
-
- setInterval('gallery()',6000);
-
- }
-
- function gallery() {
-
-
- var current = ($('#gallery a.show')? $('#gallery a.show') : $('#gallery a:first'));
-
-
- var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#gallery a:first') :current.next()) : $('#gallery a:first'));
-
-
- var caption = next.find('img').attr('rel');
-
-
- next.css({opacity: 0.0})
- .addClass('show')
- .animate({opacity: 1.0}, 1000);
-
-
- current.animate({opacity: 0.0}, 1000)
- .removeClass('show');
-
-
- $('#gallery .caption').animate({opacity: 0.0}, { queue:false, duration:0 }).animate({height: '1px'}, { queue:true, duration:300 });
-
-
- $('#gallery .caption').animate({opacity: 0.7},100 ).animate({height: '100px'},500 );
-
-
- $('#gallery .content').html(caption);
-
posted @
2009-08-21 10:08 桂湖山 阅读(524) |
评论 (0) |
编辑 收藏
Struts Menu中基于角色的权限管理
参见其文档;
/docs/security.html
或学网的中文翻译
http://www.xue5.com/itedu/200702/92774.html
posted @
2009-06-22 08:54 桂湖山 阅读(267) |
评论 (0) |
编辑 收藏
将project's properties 中的java Build Path 中的错误路径删除掉,并加入足够的类库即可。
转自:http://support.microsoft.com/kb/274188/zh-cn
解决孤立用户问题的步骤
- 为前一步中的孤立用户运行以下命令:
Use Northwind
go
sp_change_users_login 'update_one', 'test', 'test'
这样,就将服务器登录“test”与 Northwind 数据库用户“test”重新连接起来。sp_change_users_login 存储过程还可以使用“auto_fix”参数对所有孤立用户执行更新,但不推荐这样做,因为 SQL Server 会尝试按名称匹配登录和用户。大多数情况下这都是可行的;但是,如果用户与错误登录关联,该用户可能拥有错误的权限。
- 在上一步中运行代码后,用户就可以访问数据库了。然后用户可以使用 sp_password 存储过程更改密码:
Use master
go
sp_password NULL, 'ok', 'test'
此存储过程不能用于 Microsoft Windows NT 安全帐户。通过 Windows NT 网络帐户连接到 SQL Server 服务器的用户是由 Windows NT 授权的;因此,这些用户只能在 Windows NT 中更改密码。
只有 sysadmin 角色的成员可以更改其他用户的登录密码。
posted @
2008-12-22 11:23 桂湖山 阅读(93) |
评论 (0) |
编辑 收藏
1 use Cache Var such as
detailE1
2 use Class
contentPanel
default contains all the items such as below:
items:[
//from basic.js
start,absolute,accordion,anchor,border,cardTabs,cardWizard,column,fit,form,table,
//form custom.js
rowLayout,centerLayout,
//from combination.js
absoluteForm,tabsNsetedLayouts
]
treePanel
use “
loader:new Ext.tree.TreeLoader ({dataUrl:'tree-date.json'})” property the load the data
detailsPanel
3 use Viewport to contain all the panels
items:[treePanel,detailsPanel]
4 use treePanel.on('click',function(n){...}) to deal the event
in event handle:
use Ext.getCmp('content-panel').layout.setActiveItem(n.id+'-panel') to active the selected Item
use detailE1.hide().update(Ext.getDom(n.id+'-details').innerHTML).slideIn('1',{stopFx:true,duration:.2})
to show the notes of the treeNode.
类的定义
Employee = function(name){
- this.name = name;
- this.addEvents({
- "fired" : true,
- "quit" : true
- });
- }
各控件的定义
如 arv={
id: ..
title: ..
layout: ..
xtype: see below
items: [ json,json2,... ]};
All visual widgets that require rendering into a layout should subclass Component (or Ext.BoxComponent if managed
box model handling is required).
Every component has a specific
xtype, which is its Ext-specific type name, along with methods for checking the
xtype like getXType and isXType. This is the list of all valid xtypes:
- xtype Class
- ------------- ------------------
- box Ext.BoxComponent
- button Ext.Button
- colorpalette Ext.ColorPalette
- component Ext.Component
- container Ext.Container
- cycle Ext.CycleButton
- dataview Ext.DataView
- datepicker Ext.DatePicker
- editor Ext.Editor
- editorgrid Ext.grid.EditorGridPanel
- grid Ext.grid.GridPanel
- paging Ext.PagingToolbar
- panel Ext.Panel
- progress Ext.ProgressBar
- propertygrid Ext.grid.PropertyGrid
- slider Ext.Slider
- splitbutton Ext.SplitButton
- statusbar Ext.StatusBar
- tabpanel Ext.TabPanel
- treepanel Ext.tree.TreePanel
- viewport Ext.Viewport
- window Ext.Window
- Toolbar components
- ---------------------------------------
- toolbar Ext.Toolbar
- tbbutton Ext.Toolbar.Button
- tbfill Ext.Toolbar.Fill
- tbitem Ext.Toolbar.Item
- tbseparator Ext.Toolbar.Separator
- tbspacer Ext.Toolbar.Spacer
- tbsplit Ext.Toolbar.SplitButton
- tbtext Ext.Toolbar.TextItem
-
- Form components
- ---------------------------------------
- form Ext.FormPanel
- checkbox Ext.form.Checkbox
- combo Ext.form.ComboBox
- datefield Ext.form.DateField
- field Ext.form.Field
- fieldset Ext.form.FieldSet
- hidden Ext.form.Hidden
- htmleditor Ext.form.HtmlEditor
- label Ext.form.Label
- numberfield Ext.form.NumberField
- radio Ext.form.Radio
- textarea Ext.form.TextArea
- textfield Ext.form.TextField
- timefield Ext.form.TimeField
- trigger Ext.form.TriggerField
//显式创建所容纳的组件
var panel = new Ext.Panel({
...
items: [
new Ext.Button({
text: 'OK'
})
]
};
//使用xtype创建
var panel = new Ext.Panel({
...
items: [{
xtype: 'button',
text: 'OK'
}]
};
第一个例子中,面板初始化的同时,按钮总是会立即被创建的。如果加入较多的组件,这种方法很可能界面的渲染速度。第二例子中,按钮直到面板真正在浏览器上显示才会被创建和渲染。
如果面板从未显示(例如有个tab一直是隐藏的),那么按钮就不会被创建,不会消耗任何资源了。
posted @
2008-11-25 10:07 桂湖山 阅读(1403) |
评论 (1) |
编辑 收藏