java

Adding portlet capabilities

Hi, I am currently working on an existing java web-app. My web app can be deployed on Tomcat, Websphere or Weblogic. I would like to add portlet capabilities to my web app. I know that in order to do so I have to use a portlet container or a portal. The thing is, I would rather avoid installing a new software, I would rather use a thi...

spring: a bean that receives a list of Classes

I want to define in my Spring XML context a bean that has a property of the type List of classes: i.e. List<Class<?>> classes How do I send that bean a number of classes, say java.lang.String and java.lang.Integer? The list needs not be reusable, i.e. I will not refer to it in another bean. ...

ArrayList content to JLabel

Hi all, If i have an ArrayList of type Integer, containing numbers like 1,3,4,9,10 etc... How can i display those on a JLabel, not the sum, but all the numbers in a sequence. So the JLabel would display, in this case: 134910 Thank you in advance for any help. EDIT: Thank you all, ofcourse i should have thought about append. Anyways, ...

EJB Spec Violation

I created an EJB 2 named EvenementBean for test. I then deleted it. and whenever trying to deploy my .ear project now, I get these errors : WARN [verifier] EJB sepc violation: Bean: Evenement Section: 22.2 Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterpri...

Is there a prefabricated magnifying glass cursor for SWT somewhere available?

I would like to use a "magnifying glass" (with + and -) cursor in my SWT application. I'm aware that it is pretty easy to create a cursor for oneself, I just don't want to invest the time right now. Has anyone a link, or a codesnippet with a "zoom in" and "zoom out" cursor which I could use? ...

Continuous Tooltip Update in Swing

I have a custom swing component that is implemented similar to a JTree. It has a ComponentUI that renders an object list using a CellRenderer. The tooltip now correctly shows for each rendered cell, however it doesn't track the mouse as I would like. For instance, if I have boxes layed out like this; [ box A ] [ box B ] [ box C ]...

Using commandButton or commandLink to for Postback and managing the HTML Control Values

In many cases you want to add HTML-Controls or Facelets to your Website, but how easy is it really to just access these when you call upon an action? I have the following commandLink to execute an Action <h:commandLink action="#{MyBean.save}" value=""> <f:verbatim><input type="button" value="Save"/></f:verbatim> <f:param name="...

StringBuilder vs String concatenation in toString() in Java

Given the 2 toString() implementations below, which is prefered public String toString(){ return "{a:"+ a + ", b:" + b + ", c: " + c +"}"; } or public String toString(){ StringBuilder sb = new StringBuilder(100); return sb.append("{a:").append(a) .append(", b:").append(b) .append(", c:").append(c) ...

JRuby Array to Java Array

Hey, I am making a site in JRuby on Rails, I am using some Java classes as well. I have a select form element which passes user selections to the controller. The selections are passed like so: Parameters: {"options"=>["Option One", "Option Two"]} The Java method that I am using requires the options selected to be a String[] (Java S...

JNI Pass By Reference, Is it Possible?

Hey, I have a Java program that calls a C++ program to authenticate users. I would like the program to return either true or false, and if false, update a pointer to an error message variable that i then can grab from the Java program. Another explination: The nataive method would look something like this: public native String takeIn...

How to remove templates in Eclipse

I am learning Java servlets technology. In a bookt that I am reading, they have asked me to work in a notepad for time being. When i Create a servlet in eclipse, it just auto fills some content to that servlet class which I want to write on my own to learn stuff. For example, the doGet and doPost methods and their signatures. I want t...

EJB client error

I created an EJB 2. I deployed it on JBoss-IDE 1.6 and then, I created a JUnit test to access it. here's the code I used for the client : public class DossierBeanTest extends TestCase { protected DossierHome dossierHome; protected Dossier dossier; public DossierBeanTest(String argo){ super(...

Java Multi-Threading Beginner Questions

I am working on a scientific application that has readily separable parts that can proceed in parallel. So, I've written those parts to each run as independent threads, though not for what appears to be the standard reason for separating things into threads (i.e., not blocking some quit command or the like). A few questions: Does this...

Android: Specify two different images for togglebutton using XML

Hi folks, I'm attempting to override the default ToggleButton appearance. Here's the XML that defines the ToggleButton: <ToggleButton android:id="@+id/FollowAndCenterButton" android:layout_width="30px" android:layout_height="30px" android:textOn="" android:textOff="" android:layout_alignParentLeft="true" ...

How to merge wars into one?

In our company, we have a number different modules constructed as separate wars. Each client can pick and choose module he wishes to buy. Since all modules share same session, security context etc, it makes sense to merge them into a single war. Is it possible to automate this process? For example, it should merge web.xml, calculate e...

Getting started with JAX-WS...

Can someone suggest some good tutorials for getting started with JAX-WS? Using various tools like wsgen etc... ...

spring mvc: detect if an exception has been thrown while loading the context

I have a spring mvc application and we run tests with it using jetty. Sometimes the loading of the context totally fails, because bad xml or because Class Not Found exception or because a bean throws an exception in the constructor, setter or init method. In such a case I would like to to stop the application with System.exit(1) or tak...

small footprint dependency injection java

I am looking for a very lightweight dependency injection framework for java. With minimum possible dependencies and minimum features. Just something along the following lines: receive a java.util.List of Classes, instantiate them and just auto-wire all the objects one into the other. ...

extracting contents of ZipFile entries when read from byte[] (Java)

I have a zip file whose contents are presented as byte[] but the original file object is not accessible. I want to read the contents of each of the entries. I am able to create a ZipInputStream from a ByteArrayInputStream of the bytes and can read the entries and their names. However I cannot see an easy way to extract the contents of ea...

On switching out garbage collectors in Java

Recently I heard Kirk Pepperdine speak about changing garbage collectors for better performance -- but what exactly does that mean and what makes one garbage collector better or different than the other? ...