Monthly Archives: January 2014

JBoss AS 7.1 and UTF-8 encoding

Today I faced an interesting problem at work. It was JSP + Spring MVC 4 + Apache Tiles 2 + JBoss AS 7.1 application. JSP pages contain UTF-8 encoded Russian text encoding and should be displayed in UTF-8 in browser. I placed  @Page directive in some pages:

<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

Pages with above directive started to display non-English text perfectly fine. Others continued to show me unreadable rubbish instead (in default JBoss ISO-8859-1). So I already had a solution:

Solution 1 – modify every JSP page in the project to add proper @page directive.

Continue reading

JFreeChart: CandlestickChart example

From time to time I use JFreeChart library. This is a CandlestickChart sample to copy paste from here in future.

Maven dependencies in pom.xml

<dependency>
   <groupId>jfree</groupId>
   <artifactId>jcommon</artifactId>
   <version>1.0.16</version>
</dependency>
<dependency>
   <groupId>jfree</groupId>
   <artifactId>jfreechart</artifactId>
   <version>1.0.13</version>
</dependency>
 

 

Continue reading