Saturday, October 8, 2011

Ajax

Getting Started with AJAX using Java21/07/2010AJAX is an acronym for Asynchronous JavaScript And XML. AJAX provides an ability to communicate with the server asynchronously. Here asynchronous is the keyword. To explain that in simple terms, you can send a request to server and continue user interaction with the user. You need not wait for response from the server. Once the response arrives, a designated area in UI will update itself and reflect the response information. Whole page need not...

Saturday, May 7, 2011

Online Cricket Watch link

http://www.andhrakings.net/t3218-ipl-official-live-link#9...

Sunday, April 3, 2011

download

import java.io.*; import javax.servlet.ServletOutputStream; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author saravana */ public class download extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response * @throws...

resume upload

import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.IOException ; import java.util.List; import javax.servlet. RequestDispatcher; import javax.servlet. ServletContext; import javax.servlet. ServletException ; import javax.servlet. ServletInputStream; import javax.servlet. ServletOutputStream; import javax.servlet. http.HttpServlet ; import javax.servlet. http.HttpServletRequest; import javax.servlet. http.HttpServletResponse; import org.apache.commons. fileupload.FileItem; import org.apache.commons. fileupload.disk.DiskFileItemFactory; import...

Friday, April 1, 2011

upload Image in java

image.java ------------ import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.commons.fileupload.*; import org.apache.commons.fileupload.disk.*; import org.apache.commons.fileupload.servlet.*; public class image extends HttpServlet { private static final long serialVersionUID = 1L; public void destroy() { super.destroy(); // Just puts "destroy" string in log } @SuppressWarnings("unchecked") public void doPost(HttpServletRequest request,...

Monday, March 28, 2011

Select text file data based on length

import java.io.*; import java.util.*; public class select {     public static void main(String[] args) {         int j=0,i=0,loc=0,col=0;         String line;int []a=new int[15];         try {             FileReader fr = new FileReader("D:\\abc.txt");             BufferedReader br = new BufferedReader(fr);            ...

Wednesday, March 16, 2011

sorting in javascript

<html> <head> <script>     function countInputs() {         var arr=new Array();         arr[0]=document.frm.data1.value;         arr[1]=document.frm.data2.value;         arr[2]=document.frm.data3.value;         arr[3]=document.frm.data4.value;         arr.sort();         document.getElementById('m1').innerHTML=arr[0];    ...

Monday, March 7, 2011

Major Differences

Feature Struts 1 Vs Struts 2 Action classes Ø Struts 1 require Action classes to extend an abstract base class. A common problem in Struts 1 is programming to abstract classes instead of interfaces. Ø A Struts 2 Action may implement an Action interface, along with other interfaces to enable optional and custom services. Struts 2 provide a base Action Support class to implement commonly used interfaces. Albeit, the Action interface is not required. Any POJO object with a execute signature can be used as an Struts...

Swing table

import javax.swing.*; import javax.swing.table.*; import java.io.File; import java.util.Date; public class FileTableDemo {   public static void main(String[] args) {     // Figure out what directory to display     File dir;     if (args.length > 0) dir = new File(args[0]);     else dir = new File(System.getProperty("user.home"));     // Create a TableModel object to represent the contents of the directory     FileTableModel model = new FileTableModel(dir);    ...

Traffic Example in swing

import java.applet.*; import java.awt.*; public class Traffic extends Applet implements Runnable {        static int i = 0;     Thread t1, t2, t3;     public void paint(Graphics g)          {         g.drawOval(50,350,30,30);         g.drawOval(50,300,30,30);         g.drawOval(50,250,30,30);                         ...

Wednesday, February 23, 2011

Generate PDF

import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; import com.lowagie.text.Document; import com.lowagie.text.DocumentException; import com.lowagie.text.pdf.PdfPTable; import com.lowagie.text.pdf.PdfWriter; public class PDFServlet extends HttpServlet {  public void init(ServletConfig config) throws ServletException {   super.init(config);  }  public void doGet(HttpServletRequest request, HttpServletResponse response)    throws ServletException, IOException {   doPost(request,...

Saturday, February 19, 2011

when click a radio button display related text boxes

<html> <head> <script language='javascript'> function display(){         if(document.frmRadio.selType[0].checked){        document.getElementById('div1').style.display = 'block';        document.getElementById('div2').style.display = 'block' ;      }      else{        document.getElementById('div2').style.display =  'none';        document.getElementById('div1').style.display...

Wednesday, February 16, 2011

bat file of project

start firefox "http://localhost:9090/nani/query.ht...

Tuesday, February 15, 2011

Swing table with file data

import java.awt.Color; import java.io.*; import java.util.*; import javax.swing.*; import javax.swing.table.*; public class InsertFileDataToJTable extends AbstractTableModel {     /**      *      */     private static final long serialVersionUID = 1L;     Vector<String> data;     Vector<String> columns;     int i = 1;     public InsertFileDataToJTable() {         String line;   ...