Posted in Java, JavaScript on Sep 7th, 2007 3 Comments »
One of the key factor for site performance optimization is keeping number of requests low. Each request for css file or image contributes to overall slowness of your site. But it is especially critical to minimize number of JavaScript files because browsers never download them in parallel with any other content. That is if you [...]
Posted in Java, Linux on Feb 6th, 2007 No Comments »
In one project when I was writing procedure for FTP-uploading I faced a very restrictive FTP proxy. All attempts to use standard libraries from apache did not succeed. Itried to connect with FAR manager and failed as well. Sysadmin confirmed that that none of ftp clients will work non-unanimously through FTP. So the only option [...]
Posted in Java, Spring on Feb 6th, 2007 1 Comment »
While working on various web projects many times I felt guilty for writing controllers that perform one-two rows of the code.
It must be easier way! And when I read and tried Spring WebFlow I really liked their approach for defining how to call methods on any exposed bean.
It is what I was looking for. Simple [...]
Posted in AJAX, Java on Feb 6th, 2007 No Comments »
When building web sites you often have to produce POST request on user's actions. Many times without having user - editable form fields. Server just expects you to send POST. The standard solution is to make hidden form, hardcode some fields value and dynamically populate other values when user presses submit button. It does the [...]
Posted in Java, Spring on Feb 6th, 2007 No Comments »
Spring MVC is not taken seriously jet because of almost absent documentation. For 2.0 version they wrote couple more paragraphs. But still only pages 214-250 devoted to Spring MVC itself. Many features left undocumented.
For my recent project I had to build a form having 6 different sets of fields. Depending on selected value in combo-box [...]
Posted in JSON, Java on Feb 6th, 2007 No Comments »
During debugging one of my porjects I've spoted the following code in BeanSerializer.java from JSON-RPC library:
PLAIN TEXT
JAVA:
public Object unmarshall(SerializerState state, Class clazz, Object o){
...
Method setMethod = (Method)bd.writableProps.get(field);
if(setMethod != null) {
...
setMethod.invoke(instance, invokeArgs);
...
}
}
The class is responsible of transforming Json notation to your Java Bean. Looking at [...]
Posted in Australia, Java, Sydney on Feb 6th, 2007 No Comments »
Here is just some numbers from jobserve.com.au. All keywords were prefixed with Sydney AND Java AND statement. The search for Sydney AND Java only gives 500 matching jobs.
AppServer:
WebSphere - 56
WebLogic - 47
Tomcat - 41
JBoss - 32
Sun -21
JRun - 3
GlassFish - 0
Geronimo - 0
DataBase:
Oracle - 146
Sybase - 69
DB2 - 24
MySql - 18
MS Sql - 10
Postgres - [...]
Posted in Java, Spring on Feb 6th, 2007 No Comments »
Since Java 5 introduced new generics feature many aspects of our Java coding has changed. DRY approach to many tiers in J2EE soared and become common place. Even such a conservative monsters as IBM come up with nice generic-based patterns. Have a look at this really good article Dont repeat the DAO. They did not [...]
Posted in Java on Feb 6th, 2007 2 Comments »
Once I've read about funny question for interview. "If you have to become a core Java class, which one would you choose? And why?". You are on job interview. It is not really good idea to ask interviewer about his last visit to psychologist. Moreover the question is not as silly as it seems to [...]
Posted in Java on Feb 6th, 2007 No Comments »
Q: Write equation function for class
PLAIN TEXT
JAVA:
public class Customer {
private int id;
private String name;
private float balance;
}
A1: What for? It is already implemented in Object class.
A2: Why me? My favourite IDE generates such staff for me.
A3: You think for a while and write classical equation code with null-checking, casting and equation of values [...]