java

Default value for -vm value in the eclipse.ini file

What's the default value for -vm in the eclipse.ini file?. If I don't set this value, where the system will look for this value. Thanks!. ...

How perform Junit tests with Struts - Ibatis

Hello everyone, im using Struts 1.2.x and Ibatis 2.x version for development, so i finish yesterday and now i want to perform test this is my first time trying to work with JUnit, I already make test but in JavaApp not running on server, so how can I simulate or generate mocks with server behavior, and wich mocks are recommended for Stru...

How can I detect the Java runtime installed on a client from an ASP .NET website?

I have an ASP .NET website that hosts a Java applet. The Java applet requires version 1.6 Update 11 of the Java runtime. How can I detect that a client has the appropriate runtime installed so that I can display an informative message if they do not? Thanks, Carl. EDIT: The solution must be platform independant. ...

Velocity and ignoring java method return

I want to add an element to the list in my Velocity macro. Is this only way to avoid 'true' text appearing to the Velocity output? #set($path = []) #set($swallow = "a") #set ($swallow = $path.add("blaablaa")) ...

can I build swing applications on eclipse ?

I used to work on netbeans to build Java applications but now: i am using eclipse. I was was wondering if there a a free good plug-in to help me with swing windows.?? ...

override level of subcategory in log4j configuration

There is some auditing in my application. Every audit event has it's own log4j category with name that is prefixed by same string. EG: general auditing category name: com.company.audit web login category name: com.company.audit.web.login create something: com.company.audit.api.create etc.. some of the categories should be logged by de...

iText page wrapping- changes order of elements

I'm using iText to generate PDF reports - came across this issue, and worked up a simple example to illustrate it. I'm combining simple paragraphs, and images. The height of the images is such that 3 will fit on a PDF page, but when if text is on a page, only 2 images will fit. I create my iText PDF like so Document document = new ...

URL Pattern for servlet mapping in web.xml

I need a workaround with this URL mapping in web.xml to create URLs with a letter, followed by a "_" followed by any combination of alphanumeric characters. I want to map a servlet to something like this: /something_* Instead of: /something/* Using different "somethings" for different JSP's. Example: /search_Something-I-searched...

Tab character in Java

Hi guys, Trying to get a tab character into a JMenuItem using \t but it's not printing. I bet it's something really basic I'm missing. Here's the code menuItem = new JMenuItem("New\tCtrl + N"); Thanks ...

How to find a user's home directory on linux or unix?

How do I find the home directory of an arbitrary user from within Grails? On Linux it's often /home/user. However, on some OS's, like OpenSolaris for example, the path is /export/home/user. ...

Whats the best java date recurrence pattern calculator

Anyone know of a (reliable) date recurrence calculator, we're trying to implement something in our app which would allow a schedule to be created, similar to those for recurring meetings in Outlook. We have tried chronos but discovered some cases where it breaks down, I'd really appreciate knowing if anyone has successfully used any of t...

C++ scanner (string-fu!)

I'm writing a scanner as part of a compiler. I'm having a major headache trying to write this one portion: I need to be able to parse a stream of tokens and push them one by one into a vector, ignoring whitespace and tokenizing special symbols (simple case, lets just consider parentheses and braces) Example: int main(){ ...

Persisting data suited for enums

Most projects have some sort of data that are essentially static between releases and well-suited for use as an enum, like statuses, transaction types, error codes, etc. For example's sake, I'll just use a common status enum: public enum Status { ACTIVE(10, "Active"); EXPIRED(11, "Expired"); /* other statuses... */ /* c...

How do you find all subclasses of a given class in Java?

How does one go about and try to find all subclasses of a given class (or all implementors of a given interface) in Java? As of now, I have a method to do this, but I find it quite inefficient (to say the least). The method is: Get a list of all class names that exist on the class path Load each class and test to see if it is a subcla...

Can I have applications using Java 1.4.2_12 and Java 1.5 on the same windows server

I have a couple of applications running on Java 1.4.2_12 and now need to add an new application that uses Java 1.5. Can I have both java versions on a windows server? ...

Why does Java Web Start not work with 64-bit Java environments?

Java Web Start does not come with 64-bit builds of the JDK. Why is this? What is lacking that keeps it from building and working? ...

How to execute COM+ libraries from Java?

I have a COM+ component developed with VB6. After registering it with the component services manager COM+ application, I can use it from ASP like this Set Comando = Server.CreateObject("JuiciosComando.clsComando") ComandoExecute = Comando.execute(Xml) Set Comando = Nothing That's all I need, the component just receives a (maybe huge)...

Best strategy to multiple CRUD with jsf

Hi, on my company we are developing a ERP-like app using java and jsf, so far the design team has identified about 20 entities,each with diferent properties, usually we'll be building 20 pages of CRUD , is there any better way to do this?, we are using hibernate as db access, so we came up with the idea of a single DAO for this part of t...

How to avoid negative values with JFreeChart fixed auto range

I have a JFreeChart line plot that is updated dynamically with one data point for every iteration of my algorithm. Because the number of data points can quickly become very large, I have used the setFixedAutoRange(double) method on the domain axis. This restricts the graph to displaying the n most recent iterations (200 in my case). T...

Book recommendation for software (java web app) internationalization?

Do you know a good book on this topic? I'm aiming for best practices, common pit falls. ...