java

compiling only part of the source tree with ant

Say I have my sources in my src/ tree (and possibly in my test/ tree). Say I would like to compile only part of that tree. The reasons why I might want to do that are various. Just as an example, I might want to create the smallest possible jar (without including certain classes), or I might want the fastest compile time for what I am co...

Finding an Open Source Project to work on

Hi, I am looking for some direction on finding a good open source project to work on. I am experienced in Java and PHP and am currently learning C, however, I don't know if I am comfortable enough in it yet to contribute anything. I tried looking at mediawiki but there wasn't really anything to do as it is such a big project with so man...

What is the mask for emails using swing's MaskFormatter

Using Java swing, what is the string that correspond to a correct email mask when using the MaskFormatter? Is that possible at all to actually use a MaskFormatter for emails? ...

How do I identify immutable objects in Java

In my code, I am creating a collection of objects which will be accessed by various threads in a fashion that is only safe if the objects are immutable. When an attempt is made to insert a new object into my collection, I want to test to see if it is immutable (if not, I'll throw an exception). One thing I can do is to check a few well-...

Testing REST webservices

HI There, My organization is working on building RESTful webservices on JBoss appserver. The QA team is used to testing SOAP webservices so far using SoapUI. SoapUI has a new version that has REST capabilities. We're considering using that. 1) Are there any publicly available RESTful services available on the net for free that someone ...

Java Servlets: Performance

I am working on a web application in Java which gets data from servlets via AJAX calls. This application features several page elements which get new data from the server at fairly rapid intervals. With a lot of users, the demand on the server has a potential to get fairly high, so I am curious: Which approach offers the best performa...

Can you have JSF custom components in different OSGi bundles?

Has anyone used OSGi and JSF together? I ask because JSF uses class-loader magic to find custom components. From a tutorial (emphasis mine): This configuration file will end up being META-INF/faces-config.xml in the .jar file that represents this component. JSF will look for such a file name in each of the .jar files that ...

Can't compile class calling a method in an interface with a generic list argument

Hi everyone, Just got a question about generics, why doesn't this compile when using a generic List? If its not possible, anyway around it? Much appreciate any answer. // Interface used in the ServiceAsync inteface. public interface BaseObject { public String getId(); } // Class that implements the interface public class _ModelDto...

How can I hide extra component span tags in Tapestry?

If I use a span tag to render a component like <span jwcid="@If" .../>, my HTML ends up with a bunch of useless span tags. Most of the time, that's ok, but in some cases, it's interfering with my CSS or making the page invalid. Is there a way to tell Tapestry to process the tag, but not actually render it? ...

How do I remove repeated elements from ArrayList?

I have an ArrayList of Strings, and I want to remove repeated strings from it. How can I do this? ...

64-bit JVM on Server, 32-bit JVM on Client, combination possible?

Hi, I'm having a JBoss EJB3 Application and a Swing client, running in 32-bit Java 6 VM's. We now have to change the Server JVM to 64 bit. May this combination of JVM's cause any trouble (do I need to use 64-bit JVM on the client, too)? Greetings, buzztee ...

Problem checking out (from VSS) and building maven project in Hudson

Hello, I am new to Hudson, perhaps someone knows the solution: I am trying to checkout the parent pom from the VSS in Hudson (vss plugin installed) and now I get class cast exception: FATAL: hudson.maven.MavenModuleSetBuild cannot be cast to hudson.model.Build java.lang.ClassCastException: hudson.maven.MavenModuleSetBuild cannot be ca...

Don't understand how Axis works if I haven't installed it?

Forgive my ignorance - still learning here. I am using Eclipse Ganymede (Java 1.5) and have been experimenting with web services - I have mangaged to get a simple web service up and running and the nice wizard you get in Eclipse generates all the necessary bits and pieces e.g. wsdl file etc - and you can test the service and everthing e...

Java NIO select() returns without selected keys - why?

In writing some test code I have found that Selector.select() can return without Selector.selectedKeys() containing any keys to process. This is happening in a tight loop when I register an accept()ed channel with SelectionKey.OP_READ | SelectionKey.OP_CONNECT as the operations of interest. According to the docs, select() should retur...

Spreadsheet-like control for a web application?

A client of mine is looking to convert a critical 'application' based on multiple (very complex) spreadsheets into a web app. As part of this they'd like some of the web pages they use to enter/model data to resemble a spreadsheet as much as possible. I'd be interested to know if anyone has any experience/recommendations for embeddable...

Best practice to realize a long-term history-mode for a O/RM system(Hibernate)?

I have mapped several java classes like Customer, Assessment, Rating, ... to a database with Hibernate. Now i am thinking about a history-mode for all changes to the persistent data. The application is a web application. In case of deleting (or editing) data another user should have the possibility to see the changes and undo it. Since ...

The best way of storing an image/sound inside a class?

I'm developing a kind of an exchange format between instances of an application so that user could save information to file and restore it later. The whole 'exchange format' is a single class that gets serialized and written to disk. How would you suggest to store graphical/sound information inside that class? I'd like to avoid just put...

Is it possible to unimplement an interface in derived class in Java?

Let's have the following class hierarchy: public class ParentClass implements SomeInterface { } public class ChildClass extends ParentClass { } Then let's have these two instances: ParentClass parent; ChildClass child; Then we have the following TRUE statements (parent instanceof SomeInterface) == true (child instanceof SomeInter...

How to construct a relative path in Java from two absolute paths (or URLs)?

Given two absolue paths, e.g. /var/data/stuff/xyz.dat /var/data How can one create a relative path that uses the second path as its base? In the example above, the result should be: ./stuff/xyz.dat ...

How do I split a string on a fixed character sequence?

Suppose I have following string: String asd = "this is test ass this is test" and I want to split the string using "ass" character sequence. I used: asd.split("ass"); It doesn't work. What do I need to do? ...