Rich Internet Applications (RIAs) are web applications that have most of the characteristics of desktop applications, typically delivered either by way of a standards based web browser, via a browser plug-in, or independently via sandboxes or virtual machines.[1] Examples of RIA frameworks include Ajax, Curl, GWT, Adobe Flash/Adobe Flex/AIR, Java/JavaFX,[2] Mozilla's XUL, OpenLaszlo and Microsoft Silverlight.[3]
These are web application that have characteristics of desktop applications.Rich Internet applications (RIAs) offer a rich, engaging experience that improves user satisfaction and increases productivity. Using the broad reach of the Internet, RIAs can be deployed across browsers and desktops.The key difference between RIAs and other Internet applications is the amount of interaction in the interface. In a traditional page-based Internet application, interaction is limited to a small set of standard controls such as checkboxes, radio buttons, form fields and buttons. This severely limits our ability to create usable and engaging applications, and most Internet applications have been clumsier and more difficult to use than their desktop counterparts.
List
OpenLaszlo
Flex 2
Apollo
JavaFX
ZK
Windows Presentation Foundation (WPF)
Silverlite
Search This Blog
Wednesday, January 27, 2010
RIA [ Rich Internet Applications ]
JavaFX
JavaFX is a rich client platform for building cross-device applications and content. Designed to enable easy creation and deployment of rich Internet applications (RIAs) with immersive media and content, the JavaFX platform ensures that RIAs look and behave consistently across diverse form factors and devices.
Download and install the current release of JavaFX 1.2.1 SDK : http://javafx.com/downloads/
IDE Plugin : http://javafx.com/downloads/eclipse-plugin/
Eclipse : http://www.eclipse.org/downloads
Further Details : http://javafx.com/docs/gettingstarted/eclipse-plugin/index.jsp#whatisjavafx
Download and install the current release of JavaFX 1.2.1 SDK : http://javafx.com/downloads/
IDE Plugin : http://javafx.com/downloads/eclipse-plugin/
Eclipse : http://www.eclipse.org/downloads
Further Details : http://javafx.com/docs/gettingstarted/eclipse-plugin/index.jsp#whatisjavafx
Tuesday, January 26, 2010
Web Service with Tomcat
//with tomcat
software
*****************************************************************
1. axis2.war from [ axis2-1.5.1-war.zip ] deploy into tomcat
2. axis2-1.5.1-bin.zip extract into d:\axis2-1.5.1-bin
3. set environment
AXIS2_HOME=d:\axis2-1.5.1-bin
PATH=d:\axis2-1.5.1-bin\bin;
CLASS_PATH=d:\axis2-1.5.1-bin\lib\*
TOMCAT_HOME=d:\tomcat6.0
*****************************************************************
1. service program
~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\com\abi> edit HelloWorld.java
package com.abi;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
2. services.xml
~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\META-INF> edit services.xml
<service>
<description>
This is my first service, which says hello
</description>
<parameter name="ServiceClass">com.abi.HelloWorld</parameter>
<operation name="sayHello">
<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
3. D:\temp\aaxis> jar cvf HelloWorld.aar *
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. copy that HelloWorld.aar into tomcat/webapps/axis2/WEB-INF/services
5. restart tomcat
6. http://localhost:8080/axis2/
7. http://localhost:8080/axis2/services/listServices
8. http://localhost:8080/axis2/services/HelloWorld?wsdl //copy this url
9. D:\temp\aaxis>wsdl2java -uri http://localhost:8080/axis2/services/HelloWorld?wsdl -o client
10. write client program
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\client\src\com\abi> edit Test.java
package com.abi;
import com.abi.*;
import com.abi.HelloWorldStub.SayHello;
public class Test {
public static void main(String[] args) throws Exception {
HelloWorldStub stub = new HelloWorldStub();
//Create the request
com.abi.HelloWorldStub.SayHello request = new com.abi.HelloWorldStub.SayHello();
request.setArgs0("vijay Kumar");
//Invoke the service
com.abi.HelloWorldStub.SayHelloResponse response = stub.sayHello(request);
System.out.println("Response : " + response.get_return());
}
}
11. compile with auto generate ant via wsdl2java tool
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\temp\aaxis\client> ant
OR
(manual) D:\temp\aaxis>edit build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="antwsdl2java" default="gen" basedir=".">
<path id="axis2.classpath">
<fileset dir="D:/temp/axis2">
<include name="**/*.jar" />
</fileset>
</path>
<target name="gen">
<taskdef name="axis2-wsdl2java" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="axis2.classpath" />
<axis2-wsdl2java wsdlfilename="http://localhost:8080/axis2/services/HelloWorld?wsdl" output="d:/temp/aaxis" />
</target>
</project>
// RUN Manual Script and write the client program and then do steps for execute
D:\temp\aaxis> ant
12. //Execute the client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\temp\aaxis\build\classes>java -Djava.ext.dirs=D:/axis2-1.5.1/lib/ com.abi.Test
software
*****************************************************************
1. axis2.war from [ axis2-1.5.1-war.zip ] deploy into tomcat
2. axis2-1.5.1-bin.zip extract into d:\axis2-1.5.1-bin
3. set environment
AXIS2_HOME=d:\axis2-1.5.1-bin
PATH=d:\axis2-1.5.1-bin\bin;
CLASS_PATH=d:\axis2-1.5.1-bin\lib\*
TOMCAT_HOME=d:\tomcat6.0
*****************************************************************
1. service program
~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\com\abi> edit HelloWorld.java
package com.abi;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
2. services.xml
~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\META-INF> edit services.xml
<service>
<description>
This is my first service, which says hello
</description>
<parameter name="ServiceClass">com.abi.HelloWorld</parameter>
<operation name="sayHello">
<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
3. D:\temp\aaxis> jar cvf HelloWorld.aar *
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. copy that HelloWorld.aar into tomcat/webapps/axis2/WEB-INF/services
5. restart tomcat
6. http://localhost:8080/axis2/
7. http://localhost:8080/axis2/services/listServices
8. http://localhost:8080/axis2/services/HelloWorld?wsdl //copy this url
9. D:\temp\aaxis>wsdl2java -uri http://localhost:8080/axis2/services/HelloWorld?wsdl -o client
10. write client program
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:\temp\aaxis\client\src\com\abi> edit Test.java
package com.abi;
import com.abi.*;
import com.abi.HelloWorldStub.SayHello;
public class Test {
public static void main(String[] args) throws Exception {
HelloWorldStub stub = new HelloWorldStub();
//Create the request
com.abi.HelloWorldStub.SayHello request = new com.abi.HelloWorldStub.SayHello();
request.setArgs0("vijay Kumar");
//Invoke the service
com.abi.HelloWorldStub.SayHelloResponse response = stub.sayHello(request);
System.out.println("Response : " + response.get_return());
}
}
11. compile with auto generate ant via wsdl2java tool
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\temp\aaxis\client> ant
OR
(manual) D:\temp\aaxis>edit build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="antwsdl2java" default="gen" basedir=".">
<path id="axis2.classpath">
<fileset dir="D:/temp/axis2">
<include name="**/*.jar" />
</fileset>
</path>
<target name="gen">
<taskdef name="axis2-wsdl2java" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="axis2.classpath" />
<axis2-wsdl2java wsdlfilename="http://localhost:8080/axis2/services/HelloWorld?wsdl" output="d:/temp/aaxis" />
</target>
</project>
// RUN Manual Script and write the client program and then do steps for execute
D:\temp\aaxis> ant
12. //Execute the client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\temp\aaxis\build\classes>java -Djava.ext.dirs=D:/axis2-1.5.1/lib/ com.abi.Test
Friday, January 22, 2010
List of Java Framework
Echo Cocoon Millstone OXF
Struts SOFIA Tapestry WebWork
RIFE Spring MVC Canyamo Maverick
JPublish JATO Folium Jucas
Verge Niggle Bishop Barracuda
Shocks TeaServlet wingS Action Framework
Expresso Bento jStatemachine jZonic
OpenEmcee Turbine Scope Warfare
JWAA Jaffa Jacquard Macaw
Smile MyFaces Chiba JBanana
Jeenius JWarp Genie Melati
Dovetail Cameleon JFormular Xoplon
Japple Helma Dinamica WebOnSwing
Nacho Cassandra Baritus Stripes
Click GWT
Friday, January 8, 2010
Bangalore / Chennai Software Company Address
Email : drvijayy2k2@gmail.com
Thursday, January 7, 2010
Open Source Web Frameworks in Java
Tapestry
Tapestry is a powerful, open-source, all-Java framework for creating leading edge web applications in Java.
Cocoon
Apache Cocoon is a web development framework built around the concepts of separation of concerns and component-based web development.
MyFaces
MyFaces is an implementation of JavaServer(tm) Faces (JSR 127), a new and upcoming web application framework that accomplishes the MVC paradigm
Spring
Spring is a layered Java/J2EE application framework, based on code published in Expert One-on-One J2EE Design and Development.
Google Web Toolkit
Google Web Toolkit (GWT) is a Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't speak browser quirks as a second language.
Turbine
Turbine is a servlet based framework that allows experienced Java developers to quickly build secure web applications.
WebOnSwing
WebOnSwing is a revolutionary multiple environment application framework that allows you to create web applications in the same way you develope a desktop one. You dont need to use JSP files, special tags, XML files, requests, posts, etc.
ThinWire
ThinWire is a development framework that allows you to easily build applications for the web that look and feel like the desktop applications you're familiar with.
Induction
Induction is a powerful, high performance, Java MVC web application framework. Induction supports dynamic application reloading, type-based dependency injection and dependency analysis between models, views and controllers.
jZeno
jZeno is an open source java development framework that offers the ability to develop rich web applications.
Aurora
Aurora is an open-source MVC framework that is aimed at writing configurable, fully object-oriented form controllers using the Spring Framework.
Vroom
Vroom is a framework for HTML/JSP and Java code binding. It's extremely simple to use and very powerful. It can control your HTML widgets on the fly. It can be applied independently as JSP/Servlet Model or can be integrated with Struts, JSF, YUI etc. No custom tags, no complex configurations, just simple binding configuration file and backing beans.
Struts
The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach, a variation of the classic Model-View-Controller (MVC) design paradigm.
Millstone
a nice alternative to struts like framework you do not need to write a single HTML line
Wicket
Wicket is a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level. Wicket pages can be mocked up, previewed and later revised using standard WYSIWYG HTML design tools. Dynamic content processing and form handling is all handled in Java code using a Swing-like component model backed by POJO data beans that can easily be persisted with Hibernate.
SwingWeb
Swingweb is an implementation of AWT toolkit that enables AWT/Swing application to be operating inside a web container and presented as a web application to the web browser, purely in HTML/CSS/javascript.
JSPWidget
JSPWidget is a JSP Framework that provides event-driven,view state retained,server-side GUI controls to make JSP development as intuitive as in traditional client forms or in client-based Web applications.
OpenXava
XML / Java Framework to develop J2EE business applications rapidly and easily. It is based in business components defined with XML. Feature rich and flexible since is used for years to create real business applications.
ZK
ZK is an AJAX-based, event-driven, XUL-compliant, all Java framework for enabling Web applications to have the rich user experiences. With intuitive event-driven model, you represent your application in feature-rich XUL components, and manipulate these components by listening to events triggered by users, as simple as you did for years in desktop applications. No JavaScript. No replication of business logic at the clients. No proprietary components. No compilation. ZK works with existent frameworks and technologies, such as JSF and Portals, so the pace of adapting it is all under your control.
ztemplates
ztemplates is a framework for creating web-applications based on Java 1.5. Features:
* new and unique action processing module
* clean, technology agnostic urls
* fully JSP, Velocity and AJAX compatible
Aranea Web Framework
Aranea is an Open Source (APL 2.0) Java Hierarchical Model-View-Controller Web Framework that provides a common simple approach to building the web application components, reusing custom or general GUI logic and extending the framework.
RSF
RSF is an open source web programming framework, with roughly the scope of Sun's JSF. RSF is written in Java, and is built on the Spring framework. RSF features a pure-HTML templating engine named IKAT,
Flower framework
A minimalistic framework that helps you in converting your Spring beans into HTTP-accessible controllers using one servlet and a few additional lines in your XML application context. This framework uses Extensible XML authoring feature available in Spring and allows you to expose the bean using just one additional XML attribute on your bean.
Tapestry is a powerful, open-source, all-Java framework for creating leading edge web applications in Java.
Cocoon
Apache Cocoon is a web development framework built around the concepts of separation of concerns and component-based web development.
MyFaces
MyFaces is an implementation of JavaServer(tm) Faces (JSR 127), a new and upcoming web application framework that accomplishes the MVC paradigm
Spring
Spring is a layered Java/J2EE application framework, based on code published in Expert One-on-One J2EE Design and Development.
Google Web Toolkit
Google Web Toolkit (GWT) is a Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't speak browser quirks as a second language.
Turbine
Turbine is a servlet based framework that allows experienced Java developers to quickly build secure web applications.
WebOnSwing
WebOnSwing is a revolutionary multiple environment application framework that allows you to create web applications in the same way you develope a desktop one. You dont need to use JSP files, special tags, XML files, requests, posts, etc.
ThinWire
ThinWire is a development framework that allows you to easily build applications for the web that look and feel like the desktop applications you're familiar with.
Induction
Induction is a powerful, high performance, Java MVC web application framework. Induction supports dynamic application reloading, type-based dependency injection and dependency analysis between models, views and controllers.
jZeno
jZeno is an open source java development framework that offers the ability to develop rich web applications.
Aurora
Aurora is an open-source MVC framework that is aimed at writing configurable, fully object-oriented form controllers using the Spring Framework.
Vroom
Vroom is a framework for HTML/JSP and Java code binding. It's extremely simple to use and very powerful. It can control your HTML widgets on the fly. It can be applied independently as JSP/Servlet Model or can be integrated with Struts, JSF, YUI etc. No custom tags, no complex configurations, just simple binding configuration file and backing beans.
Struts
The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach, a variation of the classic Model-View-Controller (MVC) design paradigm.
Millstone
a nice alternative to struts like framework you do not need to write a single HTML line
Wicket
Wicket is a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level. Wicket pages can be mocked up, previewed and later revised using standard WYSIWYG HTML design tools. Dynamic content processing and form handling is all handled in Java code using a Swing-like component model backed by POJO data beans that can easily be persisted with Hibernate.
SwingWeb
Swingweb is an implementation of AWT toolkit that enables AWT/Swing application to be operating inside a web container and presented as a web application to the web browser, purely in HTML/CSS/javascript.
JSPWidget
JSPWidget is a JSP Framework that provides event-driven,view state retained,server-side GUI controls to make JSP development as intuitive as in traditional client forms or in client-based Web applications.
OpenXava
XML / Java Framework to develop J2EE business applications rapidly and easily. It is based in business components defined with XML. Feature rich and flexible since is used for years to create real business applications.
ZK
ZK is an AJAX-based, event-driven, XUL-compliant, all Java framework for enabling Web applications to have the rich user experiences. With intuitive event-driven model, you represent your application in feature-rich XUL components, and manipulate these components by listening to events triggered by users, as simple as you did for years in desktop applications. No JavaScript. No replication of business logic at the clients. No proprietary components. No compilation. ZK works with existent frameworks and technologies, such as JSF and Portals, so the pace of adapting it is all under your control.
ztemplates
ztemplates is a framework for creating web-applications based on Java 1.5. Features:
* new and unique action processing module
* clean, technology agnostic urls
* fully JSP, Velocity and AJAX compatible
Aranea Web Framework
Aranea is an Open Source (APL 2.0) Java Hierarchical Model-View-Controller Web Framework that provides a common simple approach to building the web application components, reusing custom or general GUI logic and extending the framework.
RSF
RSF is an open source web programming framework, with roughly the scope of Sun's JSF. RSF is written in Java, and is built on the Spring framework. RSF features a pure-HTML templating engine named IKAT,
Flower framework
A minimalistic framework that helps you in converting your Spring beans into HTTP-accessible controllers using one servlet and a few additional lines in your XML application context. This framework uses Extensible XML authoring feature available in Spring and allows you to expose the bean using just one additional XML attribute on your bean.
Spring
Spring focuses around providing a way to manage your business objects.
Spring is an ideal framework for test driven projects
Applications built using Spring are very easy to unit tes
Spring can make the use of EJB an implementation choice, rather than the determinant of
application architecture. You can choose to implement business interfaces as POJOs or local
EJBs without affecting calling code
Spring provides a consistent framework for data access
this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important
APIs.
Spring's main aim is to make J2EE easier to use and promote good programming practice
no logging packages in Spring, no connection pools, no distributed transaction coordinator
Spring container manages relationships between objects
Dependency Injection is a form of IoC that removes explicit dependence on container API, two
major flavors of Dependency Injection are Setter Injection (injection via JavaBean setters);
and Constructor Injection (injection via constructor arguments)
highly configurable MVC web framework
Spring's MVC model is most similar to that of Struts, although it is not derived from Struts
Spring Controller is similar to a Struts Action in that it is a multithreaded service object
Spring provides a very clean division between controllers, JavaBean models, and views
Spring MVC is truly view-agnostic. You don't get pushed to use JSP if you don't want to; you
can use Velocity, XLST or other view technologies
custom view mechanism - for example, your own templating language - you can easily implement
the Spring View interface to integrate it
Spring is an ideal framework for test driven projects
Applications built using Spring are very easy to unit tes
Spring can make the use of EJB an implementation choice, rather than the determinant of
application architecture. You can choose to implement business interfaces as POJOs or local
EJBs without affecting calling code
Spring provides a consistent framework for data access
this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important
APIs.
Spring's main aim is to make J2EE easier to use and promote good programming practice
no logging packages in Spring, no connection pools, no distributed transaction coordinator
Spring container manages relationships between objects
Dependency Injection is a form of IoC that removes explicit dependence on container API, two
major flavors of Dependency Injection are Setter Injection (injection via JavaBean setters);
and Constructor Injection (injection via constructor arguments)
highly configurable MVC web framework
Spring's MVC model is most similar to that of Struts, although it is not derived from Struts
Spring Controller is similar to a Struts Action in that it is a multithreaded service object
Spring provides a very clean division between controllers, JavaBean models, and views
Spring MVC is truly view-agnostic. You don't get pushed to use JSP if you don't want to; you
can use Velocity, XLST or other view technologies
custom view mechanism - for example, your own templating language - you can easily implement
the Spring View interface to integrate it
Friday, December 18, 2009
Logger in JSP
Apply log4j within jsp.
Information
none
Operating system used
Windows XP Home Edition Version 5.1 SP 2
Software prerequisites
Tomcat
Jakarta log tag library
Log4j 1.2.9
Procedure
1. Download the Jakarta log tag library: jakarta-taglibs-log-1.0.zip
2. Extract this archive file, e.g.: C:\Tools\jakarta-taglibs-log-1.0
The archive contains the following files:
LICENSE
log-doc.war
log-examples.war
README
taglibs-log.jar
taglibs-log.tld
3. Download Log4j 1.2.9: logging-log4j-1.2.9.zip
4. Extract this archive file, e.g.: C:\Tools\logging-log4j-1.2.9
The archive contains serveral files. The most important one is: C:\Tools\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar
5. Install Tomcat. Follow guide "Installing Tomcat 4.1.31".
6. Create a simple a Tomcat web application called "demo":
* Create the following directories inside the Tomcat "webapps" directory:
C:\Tools\Tomcat 4.1\webapps\demo
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF\classes
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF\lib
* Copy the tag library descriptor file "taglibs-log.tld" into WEB-INF.
* Copy the tag library JAR file "taglibs-log.jar" into WEB-INF/lib.
* Copy the log4j JAR file "log4j-1.2.9.jar" into WEB-INF/lib.
* Create a web.xml file in the WEB-INF directory:
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Demonstration log4j usage in jsp
index.jsp
http://jakarta.apache.org/taglibs/log-1.0
/WEB-INF/taglibs-log.tld
Note: You MUST add a element in the web.xml file:
http://jakarta.apache.org/taglibs/log-1.0
/WEB-INF/log.tld
* Create a log4j.properties file in the WEB-INF/classes directory:
# ***** Set root logger level to DEBUG and its two appenders to stdout and R.
log4j.rootLogger=debug, stdout, R
# ***** stdout is set to be a ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# ***** stdout uses PatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%c] %p - %m%n
# ***** R is set to be a RollingFileAppender.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/demo.log
# ***** Max file size is set to 100KB
log4j.appender.R.MaxFileSize=100KB
# ***** Keep one backup file
log4j.appender.R.MaxBackupIndex=1
# ***** R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%c] %p - %m%n
Note:
The location of the log file is set in:
log4j.appender.R.File=${catalina.home}/logs/demo.log
* Create two jsp files in the C:\Tools\Tomcat 4.1\webapps\demo directory:
File 1: index.jsp
<%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
Demonstration log4j usage in jsp
Show DEBUG message.
Show INFO message.
Show WARN message.
Show ERROR message.
Show FATAL message.
Message embedded within the open and close tags.
Using category attribute.
The log messages are shown in the Tomcat console and in the
${catalina.home}/logs/demo.log file.
File 2: test.jsp
<%@ page import="org.apache.log4j.Logger" %>
Demonstration log4j usage in jsp
<%
Logger log = Logger.getLogger("com.mobilefish.demo.test");
log.debug("Show DEBUG message");
log.info("Show INFO message");
log.warn("Show WARN message");
log.error("Show ERROR message");
log.fatal("Show FATAL message");
%>
The log messages are shown in the Tomcat console and in the
${catalina.home}/logs/demo.log file.
7. (Re)start Tomcat.
8. Access the index.jsp file:
http://localhost:8080/demo/index.jsp
9. The following log messages are shown in the Tomcat console and in the ${catalina.home}/logs/demo.log file.
2006-06-03 17:28:43,379 [root] DEBUG - Show DEBUG message.
2006-06-03 17:28:43,409 [root] INFO - Show INFO message.
2006-06-03 17:28:43,409 [root] WARN - Show WARN message.
2006-06-03 17:28:43,409 [root] ERROR - Show ERROR message.
2006-06-03 17:28:43,419 [root] FATAL - Show FATAL message.
2006-06-03 17:28:43,419 [root] FATAL - Message embedded within the open and close tags.
2006-06-03 17:28:43,419 [root] FATAL - Message passed as an attribute to the tag
2006-06-03 17:28:43,419 [com.mobilefish.demo.index] FATAL - Using category attribute.
10. Access the test.jsp file:
http://localhost:8080/demo/test.jsp
11. The following log messages are shown in the Tomcat console and in the ${catalina.home}/logs/demo.log file.
2006-06-03 17:55:43,379 [com.mobilefish.com.test] DEBUG - Show DEBUG message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] INFO - Show INFO message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] WARN - Show WARN message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] ERROR - Show ERROR message.
2006-06-03 17:55:43,419 [com.mobilefish.com.test] FATAL - Show FATAL message.
12. Change the root logger level to WARN in the log4j.properties file and restart Tomcat:
log4j.rootLogger=warn, stdout, R
When the index.jsp page is reloaded in your browser only the following messages are shown:
2006-06-03 17:48:43,409 [root] WARN - Show WARN message.
2006-06-03 17:48:43,409 [root] ERROR - Show ERROR message.
2006-06-03 17:48:43,419 [root] FATAL - Show FATAL message.
2006-06-03 17:48:43,419 [root] FATAL - Message embedded within the open and close tags.
2006-06-03 17:48:43,419 [root] FATAL - Message passed as an attribute to the tag
2006-06-03 17:48:43,419 [com.mobilefish.demo.index] FATAL - Using category attribute.
Information
none
Operating system used
Windows XP Home Edition Version 5.1 SP 2
Software prerequisites
Tomcat
Jakarta log tag library
Log4j 1.2.9
Procedure
1. Download the Jakarta log tag library: jakarta-taglibs-log-1.0.zip
2. Extract this archive file, e.g.: C:\Tools\jakarta-taglibs-log-1.0
The archive contains the following files:
LICENSE
log-doc.war
log-examples.war
README
taglibs-log.jar
taglibs-log.tld
3. Download Log4j 1.2.9: logging-log4j-1.2.9.zip
4. Extract this archive file, e.g.: C:\Tools\logging-log4j-1.2.9
The archive contains serveral files. The most important one is: C:\Tools\logging-log4j-1.2.9\dist\lib\log4j-1.2.9.jar
5. Install Tomcat. Follow guide "Installing Tomcat 4.1.31".
6. Create a simple a Tomcat web application called "demo":
* Create the following directories inside the Tomcat "webapps" directory:
C:\Tools\Tomcat 4.1\webapps\demo
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF\classes
C:\Tools\Tomcat 4.1\webapps\demo\WEB-INF\lib
* Copy the tag library descriptor file "taglibs-log.tld" into WEB-INF.
* Copy the tag library JAR file "taglibs-log.jar" into WEB-INF/lib.
* Copy the log4j JAR file "log4j-1.2.9.jar" into WEB-INF/lib.
* Create a web.xml file in the WEB-INF directory:
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Note: You MUST add a
* Create a log4j.properties file in the WEB-INF/classes directory:
# ***** Set root logger level to DEBUG and its two appenders to stdout and R.
log4j.rootLogger=debug, stdout, R
# ***** stdout is set to be a ConsoleAppender.
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# ***** stdout uses PatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d [%c] %p - %m%n
# ***** R is set to be a RollingFileAppender.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/demo.log
# ***** Max file size is set to 100KB
log4j.appender.R.MaxFileSize=100KB
# ***** Keep one backup file
log4j.appender.R.MaxBackupIndex=1
# ***** R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%c] %p - %m%n
Note:
The location of the log file is set in:
log4j.appender.R.File=${catalina.home}/logs/demo.log
* Create two jsp files in the C:\Tools\Tomcat 4.1\webapps\demo directory:
File 1: index.jsp
<%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
Using category attribute.
The log messages are shown in the Tomcat console and in the
${catalina.home}/logs/demo.log file.
File 2: test.jsp
<%@ page import="org.apache.log4j.Logger" %>
<%
Logger log = Logger.getLogger("com.mobilefish.demo.test");
log.debug("Show DEBUG message");
log.info("Show INFO message");
log.warn("Show WARN message");
log.error("Show ERROR message");
log.fatal("Show FATAL message");
%>
The log messages are shown in the Tomcat console and in the
${catalina.home}/logs/demo.log file.
7. (Re)start Tomcat.
8. Access the index.jsp file:
http://localhost:8080/demo/index.jsp
9. The following log messages are shown in the Tomcat console and in the ${catalina.home}/logs/demo.log file.
2006-06-03 17:28:43,379 [root] DEBUG - Show DEBUG message.
2006-06-03 17:28:43,409 [root] INFO - Show INFO message.
2006-06-03 17:28:43,409 [root] WARN - Show WARN message.
2006-06-03 17:28:43,409 [root] ERROR - Show ERROR message.
2006-06-03 17:28:43,419 [root] FATAL - Show FATAL message.
2006-06-03 17:28:43,419 [root] FATAL - Message embedded within the open and close tags.
2006-06-03 17:28:43,419 [root] FATAL - Message passed as an attribute to the tag
2006-06-03 17:28:43,419 [com.mobilefish.demo.index] FATAL - Using category attribute.
10. Access the test.jsp file:
http://localhost:8080/demo/test.jsp
11. The following log messages are shown in the Tomcat console and in the ${catalina.home}/logs/demo.log file.
2006-06-03 17:55:43,379 [com.mobilefish.com.test] DEBUG - Show DEBUG message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] INFO - Show INFO message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] WARN - Show WARN message.
2006-06-03 17:55:43,409 [com.mobilefish.com.test] ERROR - Show ERROR message.
2006-06-03 17:55:43,419 [com.mobilefish.com.test] FATAL - Show FATAL message.
12. Change the root logger level to WARN in the log4j.properties file and restart Tomcat:
log4j.rootLogger=warn, stdout, R
When the index.jsp page is reloaded in your browser only the following messages are shown:
2006-06-03 17:48:43,409 [root] WARN - Show WARN message.
2006-06-03 17:48:43,409 [root] ERROR - Show ERROR message.
2006-06-03 17:48:43,419 [root] FATAL - Show FATAL message.
2006-06-03 17:48:43,419 [root] FATAL - Message embedded within the open and close tags.
2006-06-03 17:48:43,419 [root] FATAL - Message passed as an attribute to the tag
2006-06-03 17:48:43,419 [com.mobilefish.demo.index] FATAL - Using category attribute.
Monday, December 14, 2009
Different between jdk 1.1 to jdk 1.4 jdk 1.5 jdk 1.6
JDK 1.0 (january 23, 1996) oak
- Initial release
JDK 1.1 (february 19, 1997)
- Retooling of the AWT event model
- Inner classes added to the language
- JavaBeans
- JDBC
- RMI
J2SE 1.2 (December 8, 1998)
This and subsequent releases through J2SE 5.0 were rebranded retrospectively Java 2 & version name "J2SE"
(Java 2 platform, Standard edition) replaced JDK to distinguish the base platform from
J2EE (java 2 platform, enterprise edition) and J2ME (java 2 platform, micro edition).
- Strictfp keyword
- Reflection
- Swing api integration into the core classes
- JVM equipped with a jit compiler
- Java plug-in
- Java IDL
- An IDL implementation for corba interoperability
- Collections Framework
J2SE 1.3 (may 8, 2000)
- Hotspot jvm included
- JavaSound
- JNDI included in core libraries
- Java platform debugger architecture (jpda)
- RMI was modified to support optional compatibility with corba
J2SE 1.4 (february 6, 2002)
- assert keyword
- Regular expressions
- Exception chaining (allows an exception to encapsulate original lower-level exception)
- Internet protocol version 6 (IPV6) support
- Non-blocking nio (new input/output)
- Logging API
- Image i/o api for reading and writing images in formats like jpeg and png
- Integrated XML parser and XSLT processor (JAXP)
- Integrated security and cryptography extensions (JCE, JSSE, JAAS)
- Java web start
J2SE 5.0 (september 30, 2004) tiger [originally numbered 1.5]
- Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion).
- Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities.
- Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer).
- Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern).
- Swing: new skinnable look and feel, called synth.
- Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string... Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.
- Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory.
- Automatic stub generation for rmi objects.
- Static imports concurrency utilities in package java.util.concurrent.
- Scanner class for parsing data from various input streams and buffers.
- Assertions
- StringBuilder class (in java.lang package)
- Annotations
Java SE 6 (december 11, 2006)
sun replaced the name "J2SE" with java se and dropped the ".0" from the version number.
Beta versions were released in february and june 2006, leading up to a final release that occurred on december 11, 2006.
The current revision is update 14 which was released in may 2009.
- Support for older win9x versions dropped.
- Scripting lang support: Generic API for integration with scripting languages, & built-in mozilla javascript rhino integration
- Dramatic performance improvements for the core platform, and swing.
- Improved web service support through JAX-WS JDBC 4.0 support
- Java compiler API: an API allowing a java program to select and invoke a java compiler programmatically.
- Upgrade of JAXB to version 2.0: including integration of a stax parser.
- Support for pluggable annotations
- Many GUI improvements, such as integration of swingworker in the API, table sorting and filtering, and true swing double-buffering (eliminating the gray-area effect).
Java se 6 update 10
A major enhancement in terms of end-user usability.
- Java Deployment Toolkit, a set of javascript functions to ease the deployment of applets and java web start applications.
- Java Kernel, a small installer including only the most commonly used jre classes. Enhanced updater.
- Enhanced versioning and pack200 support: server-side support is no longer required.
- Java quick starter, to improve cold start-up time.
- Improved performance of java2D graphics primitives on windows, using direct3D and hardware acceleration.
- A new Swing look and feel called NIMBUS and based on synth.
- Next-generation java plug-in: applets now run in a separate process and support many features of web start applications.
Java se 6 update 12
This release includes the highly anticipated 64-bit java plug-in (for 64-bit browsers only), windows server 2008 support,
and performance improvements of java and JAVAFX applications.
- Initial release
JDK 1.1 (february 19, 1997)
- Retooling of the AWT event model
- Inner classes added to the language
- JavaBeans
- JDBC
- RMI
J2SE 1.2 (December 8, 1998)
This and subsequent releases through J2SE 5.0 were rebranded retrospectively Java 2 & version name "J2SE"
(Java 2 platform, Standard edition) replaced JDK to distinguish the base platform from
J2EE (java 2 platform, enterprise edition) and J2ME (java 2 platform, micro edition).
- Strictfp keyword
- Reflection
- Swing api integration into the core classes
- JVM equipped with a jit compiler
- Java plug-in
- Java IDL
- An IDL implementation for corba interoperability
- Collections Framework
J2SE 1.3 (may 8, 2000)
- Hotspot jvm included
- JavaSound
- JNDI included in core libraries
- Java platform debugger architecture (jpda)
- RMI was modified to support optional compatibility with corba
J2SE 1.4 (february 6, 2002)
- assert keyword
- Regular expressions
- Exception chaining (allows an exception to encapsulate original lower-level exception)
- Internet protocol version 6 (IPV6) support
- Non-blocking nio (new input/output)
- Logging API
- Image i/o api for reading and writing images in formats like jpeg and png
- Integrated XML parser and XSLT processor (JAXP)
- Integrated security and cryptography extensions (JCE, JSSE, JAAS)
- Java web start
J2SE 5.0 (september 30, 2004) tiger [originally numbered 1.5]
- Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion).
- Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities.
- Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer).
- Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern).
- Swing: new skinnable look and feel, called synth.
- Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string... Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.
- Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory.
- Automatic stub generation for rmi objects.
- Static imports concurrency utilities in package java.util.concurrent.
- Scanner class for parsing data from various input streams and buffers.
- Assertions
- StringBuilder class (in java.lang package)
- Annotations
Java SE 6 (december 11, 2006)
sun replaced the name "J2SE" with java se and dropped the ".0" from the version number.
Beta versions were released in february and june 2006, leading up to a final release that occurred on december 11, 2006.
The current revision is update 14 which was released in may 2009.
- Support for older win9x versions dropped.
- Scripting lang support: Generic API for integration with scripting languages, & built-in mozilla javascript rhino integration
- Dramatic performance improvements for the core platform, and swing.
- Improved web service support through JAX-WS JDBC 4.0 support
- Java compiler API: an API allowing a java program to select and invoke a java compiler programmatically.
- Upgrade of JAXB to version 2.0: including integration of a stax parser.
- Support for pluggable annotations
- Many GUI improvements, such as integration of swingworker in the API, table sorting and filtering, and true swing double-buffering (eliminating the gray-area effect).
Java se 6 update 10
A major enhancement in terms of end-user usability.
- Java Deployment Toolkit, a set of javascript functions to ease the deployment of applets and java web start applications.
- Java Kernel, a small installer including only the most commonly used jre classes. Enhanced updater.
- Enhanced versioning and pack200 support: server-side support is no longer required.
- Java quick starter, to improve cold start-up time.
- Improved performance of java2D graphics primitives on windows, using direct3D and hardware acceleration.
- A new Swing look and feel called NIMBUS and based on synth.
- Next-generation java plug-in: applets now run in a separate process and support many features of web start applications.
Java se 6 update 12
This release includes the highly anticipated 64-bit java plug-in (for 64-bit browsers only), windows server 2008 support,
and performance improvements of java and JAVAFX applications.
Friday, November 6, 2009
Differences between Spyware Adware Malware
Adware: Adwares are software applications that are supported by advertisements (Advertising Software). It automatically display advertisement when the software is running. It is one of the way a programmer can offer his application at a reduce cost or even for free. Most of the time, a license can be bought to remove the advertisement permanently.
Spyware: Spywares are a progression from adwares. In order to provide the user of adwares with more targeted advertisements, various forms of statistics and information on user's activity on the system is tracked and sent to advertising companies. Sometimes these are done under the hood without user's knowledge and consent. Like spying on your habits and activities on your computer. Thus the term spying software.
Malware: Malware are malicious software that affects the normal functionality of your system. Sometimes, annoying pop up will appear out of no where to direct you to some sales sites. Sometimes emails spams will automatically be sent from your system. Adware and spyware progress to a malicious state if it start to affect the use of your system actively instead of just showing you passive advertisement.
Subscribe to:
Posts (Atom)