XHTML 1.0 Validation Error for JSF ViewState
| Posted by watashii | Filed under Java, Programming, WebWhen the <h:form> tag is used in JSF, the ViewState hidden input tag is generated in the XHTML page. However this generates an autocomplete attribute which is an invalid XHTML 1.0 (Strict/Transitional) markup.
Tags: java, jsf, validation, xhtml
Setup Hibernate Log4j on Eclipse (Basic Tutorial)
| Posted by watashii | Filed under Java, ProgrammingDownload the Libraries
Hibernate
Download the Hibernate release bundle. I’m using 3.5.6 Final. Manually extract the following files from the downloaded zip/tar.gz archive:
- - hibernate-distribution-3.5.6-Final\lib\required\antlr-2.7.6.jar
- - hibernate-distribution-3.5.6-Final\lib\required\commons-collections-3.1.jar
- - hibernate-distribution-3.5.6-Final\lib\required\dom4j-1.6.1.jar
- - hibernate-distribution-3.5.6-Final\lib\required\javassist-3.9.0.GA.jar
- - hibernate-distribution-3.5.6-Final\lib\required\jta-1.1.jar
- - hibernate-distribution-3.5.6-Final\lib\required\slf4j-api-1.5.8.jar
Grabbed the JPA library so I can use annotations with my Hibernate:
- - hibernate-distribution-3.5.6-Final\lib\jpa\hibernate-jpa-2.0-api-1.0.0.Final.jar
I also grabbed a sample log4j.properties file from the tutorials section:
- - hibernate-distribution-3.5.6-Final\project\tutorials\web\src\main\resources\log4j.properties
SLF4J
Download SLF4J. I downloaded slf4j 1.5.8 because Hibernate uses this version for its logging. In order to use your chosen logging framework, i.e. Log4j, manually extract the following files from the downloaded zip/tar.gz archive:
- - slf4j-1.5.8\slf4j-log4j12-1.5.8.jar
Log4J
Download Apache Log4J. I’m using the latest version, log4j 1.2.16. Manually extract the following files from the downloaded zip/tar.gz archive:
- - apache-log4j-1.2.16\log4j-1.2.16.jar
Tags: eclipse, hibernate, java, log4j, logging, slf4j
Java Send Email (In a Jar)
| Posted by watashii | Filed under Java, ProgrammingStep 1
Download the JavaMail and Activation Framework library .jar files
• If using Java SE, you’ll need to download JavaMail, eg mail-1.4.3.jar
• If using below Java SE 6, you’ll need to download and include Activation Framework, eg activation-1.1.1.jar
Read the rest of this entry »
Tags: classpath, jar, java, mail
IOGraph – Capture Mouse Movements Into Art
| Posted by watashii | Filed under SoftwareIOGraph is a simple Java application that captures your mouse cursor movements on the screen and plots them on to a blank canvas picture. All you need to do is run the application, minimize it, then perform your usual routines on your computer. After a while you will see a cool looking graphic art that you can export.
The capture displayed here was taken for 1 hour at work on my dual monitor computer. The large black dots represent how long the mouse have paused; the longer, the larger. Notice my right monitor was hardly ever used!
Tags: art, cursor, java, mouse
Reading Portlet Preferences in Weblogic Portal
| Posted by watashii | Filed under Programming, WebPortlet preferences enables portlets to be associated with external application data. This data should generally be used to store (or update) configuration data in a portlet. For example, to store/update dynamic stock codes in a stock quotes portlet. A portlet preference is basically a name-value pair data structure.
Portlet preferences can be added/updated in the following ways:
- During design-time on Workshop for Weblogic Portal (screenshot above)
- Invoked programmatically at request-time using javax.portlet.* API
- Manually during run-time of a portal (via Portal Administration Console when a portal desktop is created)
When we have added our preferences, we can read them using using the Weblogic Portal API’s. The following sample code fragments are for JSP Portlets, and JSF Portlets:




