JAX-RS:
http://www.vogella.de/articles/REST/article.html
http://www.devx.com/Java/Article/42873
http://137.254.16.27/enterprisetechtips/entry/implementing_restful_web_services_in
http://www.oracle.com/technetwork/articles/javase/index-137171.html
http://www.ibm.com/developerworks/java/tutorials/j-rest/
JAX-WS:
http://java.dzone.com/articles/jax-ws-hello-world
http://www.myeclipseide.com/documentation/quickstarts/webservices_jaxws/
http://docs.oracle.com/javaee/5/tutorial/doc/bnayn.html
http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
Java RMI:
http://www.javacoffeebreak.com/articles/javarmi/javarmi.html
http://www.comp.hkbu.edu.hk/~jng/comp3320/rmi.html
http://java.sun.com/developer/onlineTraining/rmi/RMI.html
http://damies.iteye.com/blog/51778
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Tuesday, December 27, 2011
Thursday, November 17, 2011
Wednesday, November 16, 2011
Monday, July 4, 2011
Thursday, May 5, 2011
Close ResultSet, PreparedStatement, Connection Properly in Java
It is good to close the following in order properly
1. ResultSet
2. PreparedStatement
3. Connection
http://stackoverflow.com/questions/2363785/which-should-i-close-first-the-preparedstatement-or-the-connection
Or use the Common DBUtils class by Apache
http://commons.apache.org/dbutils/examples.html
1. ResultSet
2. PreparedStatement
3. Connection
http://stackoverflow.com/questions/2363785/which-should-i-close-first-the-preparedstatement-or-the-connection
Or use the Common DBUtils class by Apache
http://commons.apache.org/dbutils/examples.html
Wednesday, May 4, 2011
Save RequestStream to file
DataInputStream dataStream = new DataInputStream(req.getInputStream());
byte datas[] = new byte[formDataLength];
int totalBytes = 0;
while (totalBytes < formDataLength) {
int bytes = dataStream.read(datas, totalBytes, formDataLength);
totalBytes += bytes;
}
saveMp3(datas);
public static void saveFile(byte[] datas) throws Exception{
FileOutputStream fileOutputStream = new FileOutputStream("xxxxx");
fileOutputStream.write(datas);
fileOutputStream.flush();
fileOutputStream.close();
}
byte datas[] = new byte[formDataLength];
int totalBytes = 0;
while (totalBytes < formDataLength) {
int bytes = dataStream.read(datas, totalBytes, formDataLength);
totalBytes += bytes;
}
saveMp3(datas);
public static void saveFile(byte[] datas) throws Exception{
FileOutputStream fileOutputStream = new FileOutputStream("xxxxx");
fileOutputStream.write(datas);
fileOutputStream.flush();
fileOutputStream.close();
}
Tuesday, May 3, 2011
Sunday, May 1, 2011
JSP Installation
Tomcat 7 with Eclipse
Follow the instruction to setup the whole development environment:
==========================================
a. Download Java SE 6 with JDK (If you don't use EJB, you don't need the Java EE version)
b. Installation of Tomcat server
Friday, April 29, 2011
Friday, April 30, 2010
Thursday, April 29, 2010
Wednesday, April 21, 2010
Monday, April 19, 2010
Convert java.util.Date to java.sql.Date
java.sql.Date sqlDate = new java.sql.Date(new java.util.Date().getTime());
Thursday, April 8, 2010
Facebook App using Java
http://www.socialjava.com/
http://www.developer.com/java/article.php/10922_3733751_3/Writing-Facebook-Applications-Using-Java-EE.htm
Need Java 1.5 to use the api client
My version: 1.5.0_06
Other Tutorials
http://t-machine.org/index.php/2007/08/02/how-to-make-facebook-apps-using-java-part-1/
http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/
http://www.developer.com/java/article.php/10922_3733751_3/Writing-Facebook-Applications-Using-Java-EE.htm
Need Java 1.5 to use the api client
My version: 1.5.0_06
Other Tutorials
http://t-machine.org/index.php/2007/08/02/how-to-make-facebook-apps-using-java-part-1/
http://t-machine.org/index.php/2007/08/13/how-to-make-facebook-apps-using-java-part-2/
Thursday, March 25, 2010
JSP request.setCharacterEncoding
Today I just find that what I have inserted into database (Chinese characters) is scrambled code.
Finally, the solution is
request.setCharacterEncoding("utf8");
JavaServer Page Implicit Objects
http://www.gulland.com/courses/JavaServerPages/jsp_objects.jsp
Finally, the solution is
request.setCharacterEncoding("utf8");
JavaServer Page Implicit Objects
http://www.gulland.com/courses/JavaServerPages/jsp_objects.jsp
Wednesday, March 24, 2010
Subscribe to:
Posts (Atom)