java

Birt Chart Engine Documentation.

Hi all ! I am looking for a complete, precise and accurate documentation about Birt Chart Engine but I cant find anything, all documentations I have encountered are more Birt Designer related or inaccurate or even inexistante. I hope someone can help me... (I precise that I particularly look for a documentation about chart interactivit...

JasperReport Issue using with struts2 - getting null in final PDF file

Hello, i am writing my jasper report problem with struts2. Following is the code that i am trying to execute : struts.xml contains : <action name="myJasperTest1" class="temp.JasperAction1"> <result name="success" type="jasper"> <param name="location">/jasper/our_compiled_template.jasper</param> ...

How to fetch hibernate query result as associative array of list or hashmap

I am developing an application in struts 2 hibernate 3. I have 3 tables Inspection InspectionMission Timeline Inspection is associated with InspectionMission and InspectionMission is associated with Timeline. Now I have following problem. I have written following query in HQL public List getQuartewiseInspectionList(){ Session ses...

Generate certificates, public and private keys with Java

Hi, i'm looking for a java library or code to generate certificates, public and private keys on the fly without to use third party programs (such as openssl). I think something that is doeing keytool+openssl but from Java code. Consider a java servlet based web application secured with ssl and client authentification. I want the se...

Is it better practice to use String.format over string Concatenation in Java?

Is there a perceptable difference between using String.Format and string concatenation in Java? I tend to use String.format but occasionally will slip and use a concat, I was wondering if one was better than the other. The way I see it String.Format gives you more power in "formatting" the string and concatenation means you don't have ...

Convolution Filter - Float Precision C Vs Java

Hey! I'm porting a library of image manipulation routines into C from Java and I'm getting some very small differences when I compare the results. Is it reasonable that these differences are in the different languages' handling of float values or do I still have work to do! The routine is Convolution with a 3 x 3 kernel, it's operated ...

Network Time Synchronization with Java

Hello everyone. I'm creating a p2p audio-midi streaming application using Java (unfortunately) and I'm searching for a way to provide network time synchronization between certain peers (sources) using a reliable protocol implementation (like NTP) but I can't find any related libraries to use.I also have a limited amount of time to spend ...

JPA/Hibernate persist does not appear to work

I'm using JPA (Hibernate implementation) to save objects to the database. Selecting works fine, but for some reason, saving doesn't work. I don't get any errors, but the database doesn't get changed either. This goes for both new entities and existing ones. EPayment pay = new EPayment(); pay.setAmount(payment.getAmount()); ... pay.s...

Is there any init method given for struts action class?

Hello Frieds, Is there any init method provided for struts action class that can be called before every method of that action class? For example, I have an action class for struts 2 as given below import com.opensymphony.xwork2.ActionSupport; public class EmployeeAction extends ActionSupport{ private DepartmentDaoService deptServic...

Hibernate/persistence without @Id

I have a database view thar yields a result set that has no true primary key. I want to use Hibernate/Persistence to map this result set onto Java objects. Of course, because there is no PK, I cannot decorate any field with @Id. When deploying, Hibernate complains about the missing @Id. How can I work around this? ...

Using MediaTracker to cache images in Swing Application

I have a Swing based financial ticker, that will display a financial symbol the price movement and an arrow for either up or down for each counter / company. This ticker can have a lot on counters (up to 100), and see the need to cache the images symbols to boost performance. I have tried following this article but fail to understand i...

Does Apache Rampart work with maven?

In the project I'm working we are using maven to manage dependencies. However we are having problems with the apache rampart which is a security module to Axis2. We have tried to use the following dependencies tags: <dependency> <groupId>org.apache.rampart</groupId> <artifactId>rampart</artifactId> <version>1.3</version> <type>...

Java error: can't find symbol?

I have the following code snippet where some strings are initialized in the if block: String serialmask = request.getParameter( "serialmask"); String serialincrement = request.getParameter( "serialincrement"); if (serialmask == "1") { String tserialmask = "aaa########"; } else { String tserialmask = ""; } if (serialincrement ==...

Collapse Unwieldy Java Classpath

We have some legacy java applications with many class folders and redundant jars on the classpath. One vendor even ships updates via an "overrides" jar that we must prepend to the classpath. Although clean-up ought to be a medium-term goal, I'm wondering if there are any tools out there that will collapse all these directories/jars int...

What field type is the Set Timer field on the Blackberry?

I'm writing an application which has an interval time as a parameter and would like a field similar to the one the Timer has to set its time. Values of a few seconds to a few hours make sense for the application. What type of field should I use? ...

Using SAXON Xpath engine in Java

Hi all. Here is my code : public static void main(String[] args) { // System.setProperty( // "javax.xml.xpath.XPathFactory", // "net.sf.saxon.xpath.XPathFactoryImpl"); String xml="<root><a>#BBB#</a><a>#CCC#</a><b><a>#DDD#</a></b></root>"; try{ JDocument dom = new JDocument(xml); XPathFactory factory = net.sf.saxon.xpath.X...

Negative Cell Value Styles in Apache POI

Using Apache POI to generate a document and i'm having a small problem with cell styles, currentlly i'm using: CellStyle currencyCellStyle=workbook.createCellStyle(); currencyCellStyle.setDataFormat(format.getFormat("$#,##0.00")); Which works totally fine for positive numbers, however I would like to assign a different style to negati...

Java: Is clone() really ever used? What about defensive copying in getters/setters?

Do people practically ever use defensive getters/setters? To me, 99% of the time you intend for the object you set in another object to be a copy of the same object reference, and you intend for changes you make to it to also be made in the object it was set in. If you setDate(Date dt) and modify dt later, who cares? Unless I want some b...

What are the different zlib compression methods and how do I force the default in Java's Deflater?

I am using DeflaterOutputStream to compress data as a part of a proprietary archive file format. I'm then using jcraft zlib code to decompress that data on the other end. The other end is a J2ME application, hence my reliance on third party zip decompression code and not the standard Java libraries. My problem is that some files zip and...

How can I easily delete duplicates in a linked list in java?

How can I easily delete duplicates in a linked list in java? ...