Hi,
Does anyone know how to generate an HTMLDocument object programmatically in Java without resorting to generating a String externally and then using HTMLEditorKit#read to parse it? Two reasons I ask:
Firstly my HTML generation routine needs to be very fast and I assume that parsing a string into an internal model is more costly than...
How can I swap two characters in a String? For example, "abcde" will become "bacde". Thanks.
...
I am writing a video application in Java by executing ffmpeg and capturing its output to standard output. I decided to use Apache Commons-Exec instead of Java's Runtime, because it seems better. However, I am have a difficult time capturing all of the output.
I thought using pipes would be the way to go, because it is a standard way o...
Is there a way to specify an ANT file to run only one/some/all of its sections?
...
I am connecting to a webservice which has a service deifnition of the following format
<main>
<header>
<data>xyz</data>
</header>
<test>
<![CDATA[<xml><a></a><b></b></xml>]]>
</test>
</main>
How do I use jaxb to create class file for the cdata strcture
...
Hi everyone,
I'm using BeanUtils.copyProperties to copy the entire content of one object into another that inherit from it.
Here is the context, the domain object from which the values are copied contains a Set of objects of custom type Xref. That custom type has an embedded class with various fields of various class types.
For some...
We have a vendor-provided Jar that contains a class we wish to extends and/or modify via AOP. The default Sun JVM security model does not allow code that is unsigned or signed by someone else to extend classes in a signed jar. We can easily remove the signatures from the jar file, but I would prefer to configure the JVM to ignore jar s...
I do the below steps to get the security token from browser for Single Sign on authentication.
I am able to find the Token from http header. My question is:
a) How do I verify this token with active directory?
b) How do I find username from this token?
While googling it seems Java API has Kerberos5 login module to do what I was expecti...
lets say, I have a lot of stuff within my spring application context which looks like that
<bean name="foo.0001" class="com.example.MyClass">
<property name="name" value="foo.name.0001"/>
<property name="zap">
<bean class="com.example.Other">
<property name="name" value="foo.name.0001"/>
</bean>
<...
Is there any way to run the Eclipse cleanup rules on a whole set of classes/packages instead of individual classes?
(Preferences > Java > Code Style > Clean Up)
I right-click on the class and invoke Source-Clean Up, but it sure would be nice to invoke it on a set of classes.
...
Is there something similar to the Eclipse cleanup rules ((Preferences > Java > Code Style > Clean Up) in NetBeans?
The cleanup rules in eclipse will allow you to clean things up like organizing imports, removing unnecessary casts, adding missing override annotations etc.
Also can you do that on a whole set of classes/packages instead o...
When a certain user tries to view our web page, a NullPointerException with the message 'charsetName' is thrown when we call response.getWriter(). I decompiled our web server's response class (JRun 3.1) and found that this error is being thrown when it does this:
s = getCharacterEncoding(); // returns 'x-mac-roman' I believe
try
{
...
The NetBeans IDE still seems to offer Maven Archetypes only for Apache MyFaces or the "deprecated" WoodStock JSF framework. For future development or migration of existing Woodstock projects, Sun is officially endorsing ICEfaces as the replacement technology for Woodstock.
I have not yet found a Maven Archetype which would set up a ne...
I would like to extract out the labels, error messages, button text etc from out the java code. There is too much discrepancy right now and changing things is a pain.
There are too many of these Strings to be implemented as constants in a java file. Ideally I would like it be something like a properties file.
Should I be using the Reso...
I am revisiting a project and need to limit it to Java 1.4 (unfortunately). I was interested in introducing a MVC framework to improve ease of maintenance in the future.
Besides Struts 1, what options do I have? The lightweight the framework, the better.
Not to dismiss Struts off hand, I've just heard a lot of bad things about it. If a...
i am trying to bind a new customer menu dialog box to a newCustomer button in my application ,
any ideas?
thanks
...
Hey everyone, I'm new to persistence / hibernate and I need your help.
Here's the situation. I have a table that contains some stuff. Let's call them Persons.
I'd like to get all the entries from the database that are in that table.
I have a Person class that is a simple POJO with a property for each column in the table (name, age,..)
...
For instance, how would you declare a triple map like-
Map<String, Map<String, Map<Boolean, String>>>, with the keys being someKey1, someKey2, and someKey3 (true/false)?
I know until this-
<util:map
id="someMap"
map-class="java.util.HashMap"
key-type="java.lang.String"
value-type="java.lang.String">
<entry key="...
Can you run the YUICompressor from within a Java application?
I am new to Java programming so the answer may be obvious but it has alluded me.
...
Possible Duplicate:
Do you prefix your instance variable with 'this' in java ?
Coding standards question. Maybe should be Wiki, let me know. Should I qualify all my instance properties and methods with this. or should I leave it off. Do you think it makes statements more readable and traceable? Or is it just a few wasted key...