Posts

Custom PagingNavigator for SEO friendly URL

Apache Wickets biggest strength is its focus on  components  - Among a very large set of components is PagingNavigator component. It is a Wicket Panel component to draw and maintain a complete page navigation. I found this component very useful but the only problem that compelled me to write my own CustomPagingNavigator is the wicket URLs that are being created by clicking the page links.  The Java Part... public class CustomPaginationLinksPanel<T> extends Panel{   private static final long serialVersionUID = 10002L;   /** Pageable List View to be displayed  */   private PageableListView<T> mainView ;   /** Max count of links  default  value = 5 */   private int linksPerPage = 5;   /**  Page Number currently visible */   private int    currPgNum ;     /** first page number */   private int firstNum ;   /** last page number...

sorting a List containing Object[] elements

Problem Statement:  How can we  sort a List containing Object[] elements? The Solution: Ever wondered how to sort a list full of Object[]? The answer is to use a Comparator I have used an anonymous class which implements compare method to sort the List of Object[] package  example.collections; import  java.util.ArrayList; import  java.util.Collections; import  java.util.Comparator; import  java.util.List; public   class  Sorting {         public   static   void  main(String[] args) {               List<Object[]> list =  new  ArrayList<Object[]>();                             list.add( new  Object[]{123,  "abc" , 212})...

Showing tool-tip on a component in Wicket

Few days back I was working on an application which was using Apache Wicket and there was a requirement to show tool-tip on a component. After googling it for hours I found this really easy solution for my requirement.  The following code snippet shows how you can add a tool tip on a Label component. ... Label lbl = new Label( "myLable" , "My Label Value" ); lbl.add( new  AttributeModifier( "title" , true , new Model<String>( "My Tool-Tip" )));  ...

Enabling HTTPS request on Tomcat Server

Enabling HTTPS Request on Tomcat If you are developing a web application which is handling some sensitive data then you may want to use a secure medium for transferring the sensitive data between the web browser and your web server. SSL or Secure Socket Layer is an easy way to offer security to your users. SSL allows web browsers and web servers to encrypt all information and communicate it over a secured connection.  Hypertext Transfer Protocol Secure ( HTTPS ) is a widely used communication protocol for secure communication over the Internet. It is simply layering of HTTP over SSL protocol. When we say we are using HTTPS for secure connection, we mean to say that the information (request) is first encrypted using SSL and transmitted using HTTP protocol and then the receiver decrypts it using SSL. Apache Tomcat fully supports the SSL protocol and provides document on how to configure Tomcat to use SSL , but somehow I found it a little confusing for first time users. So ...

An introduction to XML

What is XML? XML, or eXtensible Markup Language was created by the World Wide Web Consortium (W3C) to overcome the limitations of HTML. While the HTML tags tell a browser how to display this information, the tags don't tell the browser what the information is . With XML, you can assign some meaning to the tags in the document, which can be processed by the machine. A simple XML File <? xml version = "1.0" encoding = "UTF-8" ?> <blog> <post id = "1" value = "post1" > <title> Serialization in Java </title> <author> Dev </author> <date> 05/06/2012 </date> <url> http://techiesinsight.blogspot.in/2012/06/serialization-in-java.html </url> </post> <post  id = "2" value = "post2" > <title> serialVersionUId in Java Object Serialization </title> <author> Dev </aut...