Uncategorized

Including spaces/html entities in JSF component output.

Rather a silly problem but a problem nevertheless, including html entities as spaces special charactes etc… causes them to be escaped by the jsf. So something like getSpacedName(){return “Hello   world”;} will be outputed in the pages exactly as we have entered in out method above. On regulat h:outputText we can use ‘escape’ attribute and set it …

Including spaces/html entities in JSF component output. Read More »

Why do I get a java.sql.SQLException: “Unable to get information from SQL Server” when trying to connect to an SQL Server instance?

Possible solution 1 I am using jtds driver so I would suggest checkingout their proposed solution first here http://jtds.sourceforge.net/faq.html#instanceGetInfo Possible solution 2 Their solution did not for me so here is what I did : From cmd prompt run sqlcmd -L and make sure that the server you are connecting is listed in the returned …

Why do I get a java.sql.SQLException: “Unable to get information from SQL Server” when trying to connect to an SQL Server instance? Read More »

org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager

While setting up a simple web app on JBoss 5 using container manager transaction I run into following exception Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) Well after some …

org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager Read More »

Preventing ViewExpiredException in JSF

When our page is idle for x amount of time the view will expire and throw javax.faces.application.ViewExpiredException to prevent this from happening one solution is to create CustomViewHandler that extends ViewHandler and override restoreView method all the other methods are being delegated to the Parent import java.io.IOException; import javax.faces.FacesException; import javax.faces.application.ViewHandler; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; …

Preventing ViewExpiredException in JSF Read More »

Xpath alternate row colors

This XPath expression will let you alternate row colors Alternate Rows <wr:if select="1+count(preceding-sibling::*) mod 2 = 1"> ROW A Color <wr:else/> ROW B Color </wr:if>Alternate Rows <wr:if select="1+count(preceding-sibling::*) mod 2 = 1"> ROW A Color <wr:else/> ROW B Color </wr:if> Example I will provide complete example soon.

Android ImpulseShopper released

About ImpulseShopper(pre-beta) is application that lets you monitor your favorite daily deals websites like woot.com, 1saleaday.com, dailysteals.com etc… Includes both widget and full blown application. Engine based Filters Product thumbnails Share via SMS, Email, Twitter Notifications Deployed on Google AppEngine Screenshots [nggallery id=7]

HashTable implemented using quadratic probing for collision resolution

Using quadratic probing for collision resolution #define ERROR_TABLE_FULL -1 #define ERROR_RECORD_NOT_FOUND -1 #define ERROR_DUPLICATE_RECORD -1   class HashTable{ public: HashTable(int table_size); int insert(const string &record); int retrieve(const string &record); private: int hash(const string &record); int hash_size; int record_count; string* table; };   /** * Constructor accepting table_size */ HashTable::HashTable(int table_size){ hash_size = table_size; table = …

HashTable implemented using quadratic probing for collision resolution Read More »

HashTable implemented using linear probing for collision resolution

Using linear probing for collision resolution in hashtable   #define ERROR_TABLE_FULL -1 #define ERROR_RECORD_NOT_FOUND -1 #define ERROR_DUPLICATE_RECORD -1   class HashTable{ public: HashTable(int table_size); int insert(const string &record); int retrieve(const string &record);   private: int hash(const string &record); int hash_size; int record_count; string* table; };   /** * Constructor accepting table_size */ HashTable::HashTable(int table_size){ hash_size …

HashTable implemented using linear probing for collision resolution Read More »