java

Increment digit value in String

So, i have some String with digits and another symbols, and i want to increment the value of each digit at 1. For example: "test1check2" from this String i want to recieve "test2check3". And can i make this only with method "replaceAll"? (i.replaceAll("\d", ...) something like that)?, without to use methods such like indexOf, charAt......

I have never seen a software be released as jar, so how can I make a software be released as exe too?

Is everybody thinking that everybody else doesn't release softwares as jar and then releases softwares as exe too? ...

What is a fast and unsupervised way of checking quality of pdf-extracted text?

I am working on a somewhat large corpus with articles numbering the tens of thousands. I am currently using PDFBox to extract with various success, and I am looking for a way to programatically check each file to see if the extraction was moderately successful or not. I'm currently thinking of running a spellchecker on each of them, but ...

Checkbox values and useBean tag

Hi all, I'm a jstl newbie so probably this question will sound to you funny. Anyway, I have a model with a List as property and I'd like to fill this with a list of values (chosen from a list of checkboxes). I'm using the useBean tag in the form-processing jstl page, but doing this: <jsp:useBean id='subscription' class='Subscription'>...

How do I expose bean in JSP?

How can I expose a Java bean to a JSP page by using struts? I know how to configure a StrutsAction to include a form-bean, but I wonder if there are other ways to interact with Java code from a JSP page? I ask this question because I don't understand fully a likely answer to a problem that I have asked here: http://stackoverflow.com/que...

method overriding

class A { int i=10; void show() { System.out.println("class A"); } } class B extends A { int i=5; public void show() { System.out.println("class B"); } } class M { public static void main(String s[]) { A a=new B(); a.show(); System.out.println(a.i); } } OUTPUT= class B 10 If class ...

I need to search for a "customer" in a db, what would be a good design here?

Hi! We're a couple of students trying to implement a design to search for customer-information in a database. When the GUI-class is asking for any customer with the surname "Jensen", would a customer-class then create many objects for each customer with that surname, give all those objects to the GUI-class, let the GUI-class e.g change s...

Where can I find a good HTMLEditorKit tutorial/reference, which actually explains how to edit HTML documents?

My intention is to edit HTML documents, including modifying existing elements, deleting elements and inserting new ones. I've read HTMLEditorKit's and related classes' documentation, as well as the relevant topic in Sun's Java Trail, yet there is very little information about actual HTML document manipulation. Most of the discussion and...

method overriding using Interface

interface I { void show(); } class A implements I { void show() { System.out.println("class A"); } public static void main(String s[]) { I i=new A(); i.show(); i.toString(); } } Q> As interface I does not contain the abstract method toString() but still Th...

JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine.

I am unable to execute the java command in a specific folder , throwing error as below JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine. With same user, I am able to run java in home directory but I am not able to run in application config directory. echo $JAV...

How to implement a HTTPS login page in a web application?

I want to create a secure login/logout mechanism. I started reading the following articles to get an idea of things to take into account: Solving the Logout Problem Properly and Elegantly Revisiting the logout problem These articles make some good points, but I was thinking in using HTTPS in a similar way as the Yahoo mail login pag...

Java Profiler for EJB Applications

I have a Web Application deployed to a local Glassfish server which I would like to profile in order to see which parts of my code is accessed most frequently. The code consists of JSF beans and Remote EJBs, with both being deployed in a single EAR. I tried using VisualVM to profile my Application but, although I can successfully connect...

J2EE Session Management Between Web & EJB Tier

Hi all, I have a J2ee application consisting of 1 web module and 1 EJB module. Inside my EJB module I have a stateful session bean containing my business logic. What I would like is: When a user logs in to my web application and creates a new session in the web tier I want that user to be assigned an instance of my session bean. At t...

Spring 2.5.1 and Xfire 1.2.6 - NoSuchMethodError: <init>

Hi all, Trying to integrate Spring 2.5.5 with Xfire 1.2.6, I'm attempting to inject one of my beans into my service but it's failing on initialisation with the following exception: java.lang.NoSuchMethodError: <init> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:420) at org.spr...

custom and dynamic time zones in java

I have a JSE 6 application that runs on an OS with a custom timezone. TimeZone.getDefaultTimeZone() returns 'GMT' as the timezone altough this is not correct. Does java supports custom time zones? Another problem is that the time zone configuration (daylight saving time transitions) could change while the application is running. Will ...

Is there a right way to manipulate GoogleAppEngine security permissions?

I have a GoogleAppEngine application that is required to connect to another localhost server, but when I'm trying to do this from the server code, I get: java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve) I know that I can specify my additional security grant by using java virtual machine ...

Lock across several jvm ?

Hi, this is a bit related to this question. I'm using make to extract some information concerning some C programs. I'm wrapping the compilation using a bash script that runs my java program and then gcc. Basically, i'm doing: make CC=~/my_script.sh I would like to use several jobs (-j option with make). It's running several processe...

Embed browser in Java based desktop application

How can I embed a browser in a Java based desktop application? Can I communicate with the embedded browser directly (not via localhost)... such as loading html text, capturing onclick events, getting form values? Thanks ...

JSR168 portlet request cuts param value after # symbol

One of parameters for action link looks like: itemUrl=feedLink.html#xtor=RSS-3208 when I execute next code in backend in processAction(): String itemUrl = (String) request.getParameter("itemUrl"); ,that I get next value: feedLink.html e.g. request cuts itemUrl value after # symbol escapeXml="true" in .jsp file doesn't help. ...

Null vs empty collections in Hibernate

Say I have the following Hibernate-mapped class: public class ClassA { @OneToMany(fetch=EAGER) private List<ClassB> bList; } When I read an object of ClassA from a Hibernate session, the bList field is initialized with a PersistentList object, as expected. I find myself with a requirement where in situations where the li...