java

searching unicode string

hi, I am working in a application that takes unicode string as a input. I successfully obtained the sets of words as a list. Now i need to search the input string in the given sets of string that are in the list. I tried to compare the given string with each string in the list but only gets the unrecognised characters as an output. I thi...

Java updating JList using BeanBinding Netbeans

Hi, I have this JList (say MyList) in a JFrame. Im using Netbeans6 GUI builder and I've set a binding for this list. When run, the binding works fine, and MyList is populated correctly. Now, what im looking for is a way to add more data to this list from another text box on a button Click. But the problem exists here : W/o binding i ...

http GET parameter SOMETIMES missing when using jsf

i have a servlet filter that handles errors for both vanilla servlets and jsf pages. if an error is detected the user is redirected to an error page where he can give feedback. then i try to read the value in the ErroBean it is there - SOMETIMES. :( about 50% of the time. FacesContext.getCurrentInstance().getExternalContext().getReque...

java string array : is there a size of method?

I come from a php background and in php, there is an array_size() function which tells you how many elements in the array are used. Is there a similar method for a String[] array? thanks ...

Why java people frequently consume exception silently ?

I never do any serious java coding before, but I learned the syntax, libraries, and concept based on my existing skill (delphi & c#). One think I hardly understand is that I've seen soo many many code that silently consume exception after "printStackTrace" like this public void process() { try { System.out.printl...

How do I map a set of string objects using JPA Annotations?

@Entity public class TestClass implements Serializable{ private Integer id; private Set<String> mySet; @Id @GeneratedValue public Integer getId() { return id; } @OneToMany(cascade={CascadeType.ALL}) public Set<String> getMySet() { return mySet; } } I get the following error. Caused by: or...

Effective way to transform a few nodes contents of feeds

Dear all I need to "proxy" a feed and leave most of the nodes unspoiled and transform the content of a few known nodes by calling some java methods and return the transformed feed Of course I prefer to avoid - loading in memory the whole feed - transform other nodes - bad performance It's a kind of java pipe ! Thanks for your re...

SSLEngine and close

Hi, I've implemented an helper module that lets me obtain clean data from a channel used with SSL and write encrypted data into it: this is the relevant interface (I've also some non-abstract methods in that class, so doesn't say to me that "DataProvider should be an interface" ;)): public abstract class DataProvider { // Notify th...

Maven dependency best practices

We're using maven 2.1.0 and I am looking for some best practices with regard to dependency management. I have multiple modules that are completely separate, but still have many common dependencies. Like log4J, but some modules don't need it. I am wondering if it is a good idea to declare all common dependencies in one parent file in t...

how can i cast Long to BigDecimal

hi can any tell me how to cast Long to BigDecimal thanks In Advance ...

How do I add an Implementation-Version value to a jar manifest using Maven?

I'd like to add an Implementation-Version line to a manifest in my jar file that reflects the POM version number. I can't for the life of me work out how to do this using the jar plugin. Is this possible? ...

Passing Information from Java (Servlet) to CGI method?

Hey folks, I have this java servlet that grabs information from a form, I need to then take that information and pass it to a specific method in an .exe program and get the value that method returns. Is there a good way to go about doing this? ...

Testing whether a Font is monospaced in Java

Hi there, I'm trying list all of the monospaced fonts available on a user's machine. I can get all of the font families in Swing via: String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment() .getAvailableFontFamilyNames(); Is there a way to figure out which of these are monospaced? Thank...

Java Imaging Framework

Is there any Open source or Commercial Java frameworks for doing image operations such as converting the images from one format to other and scaling the images etc. There should be no installation.Set of jars that are in classpath that will do the job. I have looked into the java-image-scaling library but it is having issues. Thanks i...

Enabling SSI (ServerSide Includes) in JBoss?

Any of you guys have enabled SSI (ServerSide Includes) in JBoss? I guess it should be not difficult as it is built on top of a Tomcat instance. ...

Multi Module Maven2 Project with WTP

I'm having a hard time to make my Maven2 multi module project, with a deep project structure, appear as a single ear (with its dependencies - which includes 1 war, 2 ejbs and 1 jar) to be deployed in my JBOSS 5 server inside my Eclipse Ganymede (tab Servers). I've been trying to use Maven Eclipse Plugin to turn my projects into a WTP pr...

Hibernate getting Id from createCriteria() result

I have a method that takes a list of entities (Classes) and does some computation. To describe my needs here is the simplest outline of the method (pseudo-code): public void do(List<Class<?> entities) { for (Class<?> entity : entities) { List<?> list = session.createCriteria(entity).list(); for (Object o : list) { Sy...

Java equivalent to .NET System.Net.ServicePointManager

I want to tell a java client request not to care about the remote servers self created SSL cert. In .NET I'm able to do this by manipulating the ServicePointManager. How can I do the same in Java? ...

Why is Java's Method class not generic?

That would allow the invoke method to have the right return type. For instance: class Method<T> { T invoke(Object obj, Object... args); } ...

ANT - Run a single target but without dependencies

I know how to run a single target in ANT, but it also checks the "depends" attribute and runs those before the target. Is there a way to prevent this or a way to structure my ANT file so that I can do this more easily? ...