Sunday, November 14, 2010

Facebook Vs Google, its going to be intresting..

Social networking site Facebook may announce its e-mail service as early as Monday, if online buzz is to be believed. Read more

Monday, September 21, 2009

Loading Message Resources From Database

Instead of loading message resource from properties file, here is the code to how to use database as a message resource bundle in struts applcation.

DBPropertyMessageResources.java

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

When I was doing research this morning, I came to know that there is a search engine for API search called gotAPI.com. They have got all kinds of api search like java, database, ajax, frameworks etc. And now, they have launched new beta version of gotAPI.com http://beta.gotapi.com/ this have got lot of new features and included more api's. It will be helpful for developers, so I thought of writing this post.

Friday, September 4, 2009

Java Magic Number

A numerical identifier for the class file. It should always be CAFEBABE, in hex, stored in the first 4 bytes of the class file. The easiest way to corrupt a class file’s magic number is to upload it to your website with FTP failing to turn on the binary option

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

Yahoo launches a microblogging platform which looks like twitter. Now in English version of Yahoo meme

Monday, August 10, 2009

Google Caffeine - New version of Google Search?

Google has just unveiled a “secret project” of “next-generation architecture for Google’s web 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.