java

How to test that observer of org.jboss.seam.postInitialization works correctly

Hi I've created SEAM component which checks that at least one user with global admin rights exists and creates one if no. @Name("installer") @Stateless public class InstallerBean implements Installer, Serializable{ @Observer("org.jboss.seam.postInitialization") public void install() { ... } public boolean isInstalled...

what libraries do i need to run this keygenerator class

which libraries do i need to import for this class KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); if you dont want to spoon feed me atleast tell me how can i find out about the libraries myself. i use eclipse ...

Functional depedency analysis

Developers who have used eclipse cannot miss out the Cntrl+Shift+G combo - the easiest way to find all references to a particular member/method/class in your workspace. Consider a scenario where you are a new guy maintaining a web application written in java. Now, you are about to change a method signature, and you do a Cntl+Shift+G to ...

Replace the line containing the Regex

Hi, I have an input string containing multiple lines(demarcated by \n). I need to search for a pattern in the lines and if its found, then replace the complete line with empty string. My code looks like this, Pattern p = Pattern.compile("^.*@@.*$"); String regex = "This is the first line \n" + "And this is second ...

array as hidden variable

can array be used as hidden variable on jsp.....like I have a form i.e a simple java class,I want it to be as hidden variable can I do it.. Thanks in advance ...

what is this error on open declaration ?

KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); // 192 and 256 bits may not be available in eclipse when i select KeyGenerator and right click open declaration i get this window opened click here to see error image can you explain whats wrong here ? btw here is the complete code package org.temp2.cod1; ...

How to tie the Lifecycle for a Spring Bean to the webapps' lifecycle ?

I want to create a bean that has start() and stop() methods. When the webapp's context is active, start() is called during Spring's runtime bootup. When the webapp is undeployed or stopped, the stop() method is invoked. Is this correct: I annotate my start() method with @PostConstruct and the stop() method with @PreDestroy ? Normally ...

help understanding this comment .

I'm trying to understand this comment from AES implementation code: /** * This program generates a AES key, retrieves its raw bytes, and * then reinstantiates a AES key from the key bytes. * The reinstantiated key is used to initialize a AES cipher for * encryption and decryption. */ I dont understand following points: what doe...

i want to continously run my java threads

I am running my java application where i have used threads... i am running this application using ant command on the terminal.. But when i close my terminal or press ctrl+c,then java program which was running stops... Please help me out to solve this as i want to run this program continously... ...

'javac' cannot be found problem

I have a Java application hosted on a remote tomcat instance that executes a bat file which contains the following line javac filename.java I receive the following error :- 'javac' is not recognized as an internal or external command, operable program or batch file. I have set the path in the environmental variables. I tri...

query must begin with SELECT or FROM: delete [delete

I am using JPA in addition to spring(3.0.0.M4). While deleting multiple records using query.executeUpdate() i am getting the following exception. org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.QueryException: query must begin with SELE...

Rewrite spring-security redirect URLs

I'm trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I've got is that when spring-security notices that an anonymous user is trying to access a protected resource it redirects to a URL which includes the servlet path. What I'd like is, by example: > GET http://localhost:8080/my-context/protected-resource...

Grabing text from non java application

Is it possible to grab textarea using java from another non-java application? Known way is OCR with java.awt.Robot in my opinion is too complex and non effective if grabbed area is in the minimized window. P.S. Linux environment is preferred but not mandatory for solution. ...

Issues with re-rendering objects on a canvas - Java

Hi, guys. I'm having some serious problems with this, have been working on it for some time now - about 2 weeks - and I just can't see the issue I'm having here. I'm sure I'm making a dumb mistake somewhere. Anyhow, enough of my rambling. I'm having trouble with the code below, in that it doesn't want to update the world. WHat I mean is...

Eclipse all jobs listener

I'm trying to develop a plugin that will do some work when any kind of eclipse job is scheduled. Basically I want to be able to know when a job is in the progress dialog and monitor it. Is there a listener that can be set up to catch the begging and end of such jobs? ...

java configuration file

I have a method : private String getProperty(String property) throws IOException,ConfigException{ //first test if the config file exists. String propertyFile = "DataTransfer/Config/DataTransfer.properties"; if(!new File(propertyFile).exists()){ throw new ConfigException("the config file doesn't exist." + " Make sure the file...

VTD XML inner XPath Expressions

Hi I have a xml file for example like this <root> <test> <bla>test1</bla> </test> <test> <bla>test2</bla> </test> <test> </test> </root> Now I want to parse it with the vtd-xml-parser by using XPath Expressions. First I search for the test tags by VTDNav vn = vg.getNav(); AutoPilot ap = new AutoPilot(vn); ap.selectXPath("//...

OpenXava - create list with all modules

Hi, Is there any way I can create simple start page for OpenXava. I mean page with links to all modules for example: People Invoices Etc... Would be great to have solution out of the box. I haven't found anything in documentation with this topic. Thanks ...

Suggest me a link to learn Java GUI creation

Suggest me a link to learn Java GUI creation. ...

how can access data from a webserver using a windows application.

Hi, I would like to create a touch screen application.It will be a windows application, so using that how can i get data from a web server? ...