typeof allows the identifier to never been declared before
if (typeof obj == "undefined")
instead of
if(obj == null) // will throw an error due to never declared
Java, Struts 1 & 2, Spring, Hibernate, iBatis, Jasper Reports, RDBMS, JDBC, JSP, Servlet, HTML, JS, AJAX, JQuery
typeof allows the identifier to never been declared before
if (typeof obj == "undefined")
instead of
if(obj == null) // will throw an error due to never declared
To make it unique for each passes, we can place in a random number behind the url as shown below
$.get('remoteUrl.do?'+Math.random()+, function(data){
$('#msg'+id).html(data);
}, 'html');
Set cache:false
$.ajax({
url: 'remoteUrl.do',
cache: false,
success: function(data){
$('#resultDiv').append(data);
} });
$.ajaxSetup({
cache: false
});
Disable caching using html meta tag:
Supported formats, MS Word, Excel, Powerpoint, Txt, Csv, Flash, ODT, RTF, PDF.. etc.
Here is the code:
long startTime1 = System.currentTimeMillis();
// connect to an OpenOffice.org instance running on port 8100
OpenOfficeConnection connection = new SocketOpenOfficeConnection(SocketOpenOfficeConnection.DEFAULT_PORT);
connection.connect();
DocumentConverter converter1 = new OpenOfficeDocumentConverter(connection);
File inputFile = new File("C:\\Miral\\temp\\myDocument.doc"));
File outputFile = new File("C:\\Miral\\temp\\myPortDocument.pdf");
totalFileSize+=(inputFile.length()/1024*100000)/100000;
converter1.convert(inputFile, outputFile);
System.out.println("Total File Size(kb): "+totalFileSize);
long endTime1 = System.currentTimeMillis();
System.out.println("Conversion Time: "+(endTime1-startTime1));
// close the connection
connection.disconnect();
<!-- Now call this method -->
Reader rd = Resources.getResourceAsReader("SqlMapConfig.xml");
SqlMapClient smclient = SqlMapClientBuilder.buildSqlMapClient(rd);
int invoiceNo = 1;
System.out.println("Getting item information from db");
Items itm = (Items)smclient .queryForObject ("Items.getItemInfo", invoiceNo);