I need a web interface for configure log4j that gives me:
CRUD of loggers, appenders and filters
when I am OK with the configuration I want to click and download an xml version of the configuration
hierarchical view of the configured loggers which expands as needed (nice to have).
I am aware of this old thread but I can't find the lo...
Given the following program:
import java.io.*;
import java.util.*;
public class GCTest {
public static void main(String[] args) throws Exception {
List cache = new ArrayList();
while (true) {
cache.add(new GCTest().run());
System.out.println("done");
}
}
private byte[] run()...
I have HashMap 1, which contains 5 keys, all of which have Hashmaps as values. I want to add key/value pairs to these sub-Maps.
map1.get(subCategoryMap).put(newKey, newValue);
My thinking is:
map1.get(subCategoryMap);
returns another map. I could split this line into two lines and have:
map2 = map1.get(subCategoryMap);
map2.put(ne...
Here is the question: write a method that swaps two variables. These two variables should be primitives. It doesn't need to be generic e.g. two int variables. Is there a way?!
...
I'm using the com.google.common.collect.ArrayListMultimap<K,V> collection to map Integers to Strings. The class provides a method called containsValue(Object value) which checks if the multimap contains the specified value for any key. Once I determine that is true, what's the best way to retrieve said key?
ArrayListMultimap<String, Int...
class MetaData {
public String version;
public String compression;
}
I make a MetaData object, pass it into a method, and fill the version and compression fields from within the method. And I want these changes to exist outside of the lifetime of the method. In C++ I think I added a & or something to pass the object itself and ...
hi,
I'm looking for a java logging framework which enables to declare your own grammar and automatically generates the associated parser.
Ideally, I would like to use log4j and generates a parser and then be able to manipulate these logs as objects.
I've seen there's a scanner generator for log4j based on events but no parser.
I gue...
Is there a simple or elegant way to grab only the time of day (hours/minutes/seconds/milliseconds) part of a Java Date (or Calendar, it really doesn't matter to me)? I'm looking for a nice way to separately consider the date (year/month/day) and the time-of-day parts, but as far as I can tell, I'm stuck with accessing each field separat...
I have a bean that i want to inject with a named list using Spring util namespace <util:list id="myList"> but Spring is looking for a collection of beans of type String instead. My broken test is:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class ListInjectionTest {
@Autowired @Qualifier("myList") private ...
I am somewhat new to Java so perhaps I misunderstand the use cases for annotations in java. My issue is the following:
After annotating a method I receive class names such as $Proxy31 when inspecting the annotations on the method. I am curious why I am receiving class names for my annotations that are similar to this, and what I can do ...
I'm planning on using client provided UUID's as the primary key in several tables in a MySQL Database.
I've come across various mechanisms for storing UUID's in a MySQL database but nothing that compares them against each other. These include storage as:
BINARY(16)
CHAR(16)
CHAR(36)
VARCHAR(36)
2 x BIGINT
Are there any better option...
I just started working on a project that will run on google app engine (GAE). I'm using java (wicket) with some ajax.
I'm experienced with relational databases and typically use something like iBatis. When going through the docs and examples for the GAE datastore using JDO I see that they're executing stuff like:
String query = "sele...
Hi,
Right now i have my program to clone widgets. problem i am facing is i have to get the data from these widgets(particularly from textbox) on my DB end. But once i clone them i am not sure how do i keep trace on them and know which data goes where as these widgets don't have names(i mean the cloned ones)? Any help is appreciated.
Th...
the field definition
/** Date. */
@Column(columnDefinition = "datetime")
private Date date;
setter
public void setDate(final Date date) {
DateFormat dfmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
this.date = dfmt.parse(dfmt.format(date));
} catch (ParseException e) {
// TODO Auto-generated catc...
I am building/creating a build box in which I want to automate the build process using cruise control.
I have install ClearCase and cruise control. My target application server is WebSphere 6.1.
For this box, do I need to do a full install of WAS 6.1 or can I just copy over parts from another box to this box so that the build will w...
In the process of designing an engine which will be used to translate phrases that are processed by the application.
The ideal is to look for a set element in the XML, identify it by its category and then submit it to a translation engine that will check to see if the phrase has already been converted or needs to be. If it does it will...
Hi I am looking for a simple URL & title extractor from html files in Java. I am trying to parse bookmarks.html (IE,Firefox) etc and add the title & url to a db. I need to do this in java (no 3rd party libraries allowed) so proably I have to use sax/dom/regex.
...
In MVC (such as JSP and Spring), is it bad practice to view related code in the controller?
In my case, the controller does some work and then hands off the results to the view (JSP). In the case of a status message, I can pass the entire message text to the view, or pass a key and let the JSP map it to the message text.
Example:
Mess...
I'm thinking of annotating my Domain Objects. This will ease manipulation of the DOs. Keeping the domain code free from other external stuff is also important for me.
Any comment on the "corruption" of the domain code by adding annotations?
Are you for/against adding annotation to Domain Objects, and why?
...
Hi
I have modified the guestbook example shipped with google app engine (java) to include a parent-child relationship using some sort of a 'self join'.
Now my greeting.java file looks like this
package guestbook;
import java.util.Date;
import java.util.List;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.anno...