Kwa Kil On Swa

Friday, December 29, 2006

Setup P6spy for an(y) application(s)

see http://www.p6spy.com/documentation/install.htm#unspec for more info

- set CLASSPATH=C:\apps\p6spy\p6spy.jar;%CLASSPATH%
- set CLASSPATH=.;%CLASSPATH%
- make sure C:\apps\p6spy\spy.properties use the correct native driver
realdriver=...
- COPY C:\apps\p6spy\spy.properties .
- change the driver class use in software connection (e.g. in ant for DDL Utils)

Saturday, December 16, 2006

wacky characters in webwork struts

%{}
===============================================

<s:textfield label="%{getText('eqnm.label')}" name="query.equipmentNm" value="%{query.equipmentNm}" />

See also page 234 in web work in action

The %{} allows you to put in an ongl expression between the baces embedded within a string.
(ognl is in struts2/webwork).


From: http://cwiki.apache.org/WW/tag-syntax.html
Using an expression to set the label
<s:textfield label="%{getText("postalCode.label")}" name="postalCode"/>
The expression language (OGNL) lets us call methods and evaluate properties.
The method getText is provided by ActionSupport, which is the base class for most Actions.
Since the Action is on the stack, we can call any of its methods from an expression, including getText.


#parameters.size
==============================================


<%= %>
==============================================
Standard Jsp expressions (not used in appfuse)
<%= ((ShoppingCart) session.get("cart")).getId() %>




Velocity uses $member.firstName.
Freemarker uses ${member.firstName}

Wednesday, December 13, 2006

Javascript object dump

USeful to look inside an object:

alert(DWRUtil.toDescriptiveString(someObject,2));

If there is too much info to fit inside the alert box then use
function popitup2(s) {
newwindow2=window.open("",'name','height=600,width=850');
var tmp = newwindow2.document;
tmp.write('<html><head><title>popup</title>');
tmp.write('<link rel="stylesheet" href="js.css">');
tmp.write('</head><body><p>this is once again a popup.</p>');
tmp.write('<p>' + s + '</p>');
tmp.write('</body></html>');
tmp.close();
}
popitup2(DWRUtil.toDescriptiveString(someObject, 2));

Friday, December 08, 2006

appfuse - tip for modifying css stuff

(From http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseEclipse)

Quote:
For major design changes, I usually run the app, view source on a page and save it to a "sandbox" folder in the same directory as my project. Then I do a find/replace and change all "/appfuse/" references to "../web/". This allows me to change CSS and JS files and just refresh the file in the sandbox.

Tim: I tried this it works beautifully with the aptana html editor.

Labels: