Monday, October 26, 2009

How to get selected text from the dropdown ?


The below function explains how to get selected text of the drop down menu using javascript.


function getSelectedText(){
     var subText = document.getElementById("subject");
     var selectedText = subText.options[subText.selectedIndex].text
     alert(selectedText);
}
"subText.selectedIndex" gives index of the selected value, By passing that index value to array of the subtext options you will get the selected text from the drop down menu.


Monday, October 12, 2009

Java Try catch block


 /**
 *
 */
package com.myapp.testpackage;


/**
 * @author sunil.chand
 *
 */
public class Exc1 {
  public static void main(String args[]){
      int d,a;
      try{
          d=0;
          a=42/d;
          System.out.println("never printed");
      }
      catch (ArithmeticException e){
          System.out.println("Division by zero not possible"); 
      }
            
  }
}

Monday, October 5, 2009

Struts2 Eclipse plugins

               Struts2 is the Java based framework developed by Apache. This is combination of Struts1.x and the webwork.
              I feel, to develop Struts2 based applications using the Eclipse ide is little bit easy and comfortable. So that i searched for the plugins for eclipse ide. Generally you can dump the struts2 jar files in lib folder of the web application and use the struts2 functionalities.
As we know, plug ins provide the extra functionality in the development.
These are the two links which i felt food.


and



find the installation procedure,  license and terms and conditions over the sites and enjoy the development of Struts 2 applications.


All the best.............