Manoj: on the Open Source world
Sunday, November 14, 2010
Facebook Vs Google, its going to be intresting..
Monday, September 21, 2009
Loading Message Resources From Database
public class DBPropertyMessageResources extends MessageResources {
public DBPropertyMessageResources(MessageResourcesFactory factory, String config,boolean returnNull) {
super(factory, config,returnNull);
this.factory=factory;
this.config=config;
this.returnNull=false;
}
public String getMessage(Locale locale, String key) {
String result = DBPropertyMessageService.getMessage(locale, key,
returnNull);
// we need to flush the cache of the super class MessageResource as
//we want to have real dynamic data here (no caches
//except the one in DBPropertyMessageService)
formats.clear();
return result;
}
}
DBPropertyMessageResourcesFactory.java
public class DBPropertyMessageResourcesFactory extends
MessageResourcesFactory {
public MessageResources createResources(String config) {
return new DBPropertyMessageResources(this, config, this.returnNull);
}
}
DBPropertyMessageService.java
public class DBPropertyMessageService {
public static String getMessage(Locale locale, String key, boolean returnNull) {
key=null;
returnNull=true;
locale=null;
// do the jdbc coding to get the value from the database using the key
return "sparkle software";
}
}
struts-config.xml
<message-resources factory="com.sparkle.resources.DBPropertyMessageResourcesFactory" parameter="param1"/>
Sunday, September 6, 2009
Search Engine for API Search
Friday, September 4, 2009
Java Magic Number
Sometimes during the transmission of files, the connection may be aborted, or may be scrambled, causing class loading to fail. Sometimes when copying files over to a web server, they may become garbled or a disk error might occur. For this reason, special care is taken by the JVM and the class loader, to verify that classes are intact. One of the precautions is that every class definition contains at the beginning the magic number, a sequence of four bytes that identify a file as a Java class definition file.
Yahoo meme
Monday, August 10, 2009
Google Caffeine - New version of Google Search?
What's New
The categories for the new search engine on are as follows: speed, accuracy, temporal relevancy, and index size. Here’s how we define those:
Speed: How fast can the new search engine load results?
Accuracy: Which set of results is more accurate to the search term?
Temporal Relevancy: Is one version of search better at capturing breaking news?
Index Size: Is it really more comprehensive than the last version of Google?
Please visit the web developer preview of Google's new infrastructure at http://www2.sandbox.google.com/ and try searches there.
Tuesday, August 4, 2009
Servlets vs Portlets
- Portlets are not accessible by a URL. Portlets are intended to be part of a page, as opposed to being independent pages.
- Browsers and web clients interact with portlets through the portal server. Portlets can neither set HTTP headers, nor be aware of the client URL.
- The portal server provides a customized subset of the request object to a portlet.
- Portlets only contribute a fragment of the HTML page that is eventually presented to the browser, and not the whole page. A portal server aggregates these fragments from various portlets to create a final page.
- Portlets come with certain modes and window states that make them function independently of the whole page behavior.
- Portlets have access to some specialized functionality that allows storage of states and preferences across requests and sessions.