Monday, 2 February 2009

[ExtJs] Simple Tree Example (Json as JSP)

=========== test2.html =================
[html]
[head]
[link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css"]
[script type="text/javascript" src="../adapter/ext/ext-base.js"][/script]
[script type="text/javascript" src="../ext-all.js"][/script]
[script type="text/javascript" src="reorder2.js"][/script]
[title]Insert title here[/title]
[/head]
[body]
[div id="tree-div" style="overflow:auto; height:300px;width:250px;border:1px solid #c3daf9;"][/div]
[/body]
[/html]

=============== reorder2.js ====================

Ext.onReady(function(){
// shorthand
var Tree = Ext.tree;

var tree = new Tree.TreePanel({
el:'tree-div',
useArrows:true,
autoScroll:true,
animate:true,
enableDD:true,
// rootVisible: false,
containerScroll: true,
loader: new Tree.TreeLoader({
dataUrl:'json.jsp'
})
});

// set the root node
var root = new Tree.AsyncTreeNode({
text: 'Ext JS',
draggable:false,
iconCls:'conthruAr',
id:'source'
});
tree.setRootNode(root);

// render the tree
tree.render();
root.expand();
});

================ json.jsp =================
[%@page import="java.util.Enumeration"%]
[%
Enumeration ss = request.getParameterNames();
String value;
while(ss.hasMoreElements()){
String key = (String)ss.nextElement();
value = request.getParameter(key);
System.out.println(key+" : "+value+" ");
}

String getS = request.getParameter("node");

System.out.println("ss : "+getS);
if (getS.equals("source")){
%]
[{"text":"1","id":"1","cls":"folder"},{"text":"4","id":"4","leaf":true,"cls":"file"},{"text":"3","id":"3","cls":"folder"},{"text":"2","id":"2","leaf":true,"cls":"file"}]
[%
} else if(getS.equals("3")) {
%]
[{"text":"7","id":"7","leaf":true,"cls":"file"},{"text":"8","id":"8","cls":"folder"}]
[%} %]

Monday, 19 January 2009

[Error] Could not open Hibernate Session for transaction

[Error Message]
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader


Please insert org.hibernate.jdbc pacakge in MENIFEST file

Monday, 5 January 2009

[Error] Can not Start Eclipse

* Error Message
JVM terminated. Exit code=-1 .......
................
.......

- Open eclipse.ini file under eclipse installed folder

change the last line like this
-Xmx256m

http://blog.naver.com/sungback?Redirect=Log&logNo=90033293141

[Error] can not start MS-SQL Service

* Can't start MS-SQL service
- there are some error message that ms-sql can't start

+ Please open control panel > Service
Change running logon user

Thursday, 1 January 2009

[Eclipse] (Plugin)- Java Code Coverage for Eclipse

* This plugin for Code Coverage - especially for Junit

1. Install
http://www.eclemma.org/installation.html

2. Launching (or setting) in Coverage Mode
http://www.eclemma.org/userdoc/launching.html

3. Create "Test" run configuration

4. You should select what kind of project can be generate code coverage report
from "Coverage" tab. (Coverage Run > Converage configurations)

5. When "running" is over , Do not terminate manually !
Type : osgi> exit

Then you will see Coverage report

* error message "No coverage data file has been written"
check "http://www.eclemma.org/faq.html#usage03"


Check all step from this web site

* After running code coverage you should re-compile
the project which is checked for Code Coverage

[Eclipse] - Run (Arguments- Clean)

Eclipse Run configuration option

- Arguments Tab -
* Program arguments
-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -console --clean

* VM arguements
-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dosgi.clean=true

Eclipse [Plug-In] - CheckStyle Eclipse Plugin

* CheckStyle Eclipse Plugin
- CheckStyle Eclipse Plugin help you ensure that your Java code adheres to a set of coding standards.

- Installation document

- Checkstyle file
- format file