Skip to main content

Posts

Showing posts from September, 2010

Tooltip Component Using Java Script & CSS

A simple, small Java Script Component, which you can use to have custom Tooltips on your web page. Well why wait, let get right on to it. First lets see the styles used by the Tooltip popup box.
.toolTipDef, .toolTip {             position: absolute;             background-color: #ccc;             border: 1px solid #000;             padding: 3px;         } .toolTipDef { display: none; } .toolTip { display: block; } All together we’ve to CSS classes, one ‘toolTipDef’ and ‘toolTip’. ‘toolTipDef’ is used when the tooltip need to be hidden, and when user mouse over the text, we’ll use ‘toolTip’ class to make the tooltip popup visible. These styles set standard attributes like background color for the tooltip popup, its border and text padding inside tooltip popup. ‘toolTipDef’ set the ‘display’ property to ‘none’ so that by default the popup is hidden and ‘toolTip’ sets the ‘display’ property to ‘block’ so that when used the tooltip popup gets displayed.
To display tooltip text, we …

Ant Script To Sign A JAR File

To sign a JAR file you need a ‘keystore” first. You can create a sample keystore using the following simple command.
keytool -genkey -keystore <filename.store> -alias <aliasname> After creating the keystore, you can add the following Ant tag to sign the JAR file using it.
<signjar jar="<JAR file to be signed>" alias="<Keystore Alias Name>"                 keystore="<Keystorefile.store>" storepass="<Keystore password>"/> Attributes used are
jar – The JAR file path which needs to be signed.alias – Keystore alias name, given in the ‘keytool’ command to create the keystore.keystore – Path to the keystore file, which was created using the ‘keytool’ command.storepass – Keystore password used while creating the keystore using ‘keytool’ command.

Ajax Form Submit GET/POST Methods

This example explains GET and POST methods of form submit using AJAX. Only code is posted for now, will try to update it later some time. Complete example can be downloaded using the link at the end of the post.
package com.rakesh.ex.dto;
public class EmployeeDTO {     private String empId;     private String name, email;     private String designation, department;
    public EmployeeDTO(String empId) {         this.empId = empId;     }
    public String getEmpId() {         return empId;     }
    public void setEmpId(String empId) {         this.empId = empId;     }
    public String getName() {         return name;     }
    public void setName(String name) {         this.name = name;     }
    public String getEmail() {         return email;     }
    public void setEmail(String email) {         this.email = email;     }
    public String getDesignation() {         return designation;     }
    public void setDesignation(String designation) {         this.designation = d…