java

Java for the web

I posted this question: http://stackoverflow.com/questions/418597/java-and-net-for-php-programmer and the answers I was given didn't really help me out. I read a few of the tutorials at sun. The basic syntax I understand. The thing I don't understand and really need to (because I think my company is going to tell me start working with ...

How can I best lay out these components in Swing?

Hi All, What would be the best approach / LayoutManager for a JPanel that needed to display the components shown in the image? (Note that the fields should resize horizontally when the size of the window is changed, but not the labels). I'm currently trying (and struggling) to do it with a GridBagLayout. Is this the correct approach o...

How to programmatically change urls of images in word documents

I have a set of word documents that contains a lot of non-embedded images in them. The url that the images point to no longer exist. I would like to programmatically change the domain name of the url to something else. How can I go about doing this in Java or Python ? ...

Java web service frameworks

This is my first time with Web services. I have to develop web services in java which should be having good WS-* standards, should loosely-coupled, scalable, highly secure, fast response time. I know I've to consider trade-offs. I have checked on some frameworks like Axis2, CXF, Spring WS. Please share your experiences and views on these...

What are some good Java web development tools (across the board)

For web development what are some standard/good java tools. That apply to all aspects of development. For example, The IDE (Eclipse, RAD, Intellij) is important, but what else is there. Ant is a good one. Cygwin, Linux OS possibly. ...

Best practicies for JUnit and RMI Apps, RMI Registry

I'm looking to write a set of system integration tests for an RMI client application. I'd like to start the RMI server in JUnit 3.8.2 and then run those tests. Has anyone done this? I'm using something like this in a pojo with main: import java.rmi.registry.*; .... //setup try { java.rmi.registry.LocateReg...

Do you know any open source projects that use Java Web Services ?

For my diploma project I am creating a tool that will study a Java project and extract the parts that declare or use Web Services in order to study the classes that communicate in this way other the network, the communication channels that are created, etc. In order to test my tool I need some open source projects because I would like t...

Need to execute shell script from webapp and display console output in page

I am looking for java examples or library that will help me integrate this into a Struts2/Spring application. Many build systems such as Luntbuild or Hudson have this functionality, I thought I would ask if any one knows of a standalone example before I attempted to dig it out of one of those. I glanced at Quartz job scheduling framewo...

How can I increment a date by one day in Java?

I am getting date in the format as yyyy-mm-dd. I need to increment this by one day. How can I do this? ...

auto-detecting components using spring annotations

I've managed to configure to spring to auto-detect my components using the @Autowire annotation. However the problem is that not all the components are being Auto wired. Specifically My DAO's are being bound but my service objects aren't. I have to explicitly create a bean for my service object in the spring xml config file. Any clu...

Generating absolute URLs from Seam emails

Is there a way to coax either the h:outputLink or s:link tags into generating absolute URLs? In a Seam email message, I want to be able to do something like <s:link view="/someView.xhtml"> <f:param name="a" value="#{a.nastyParam}" /> <f:param name="b" value="#{b.nastyParam}" /> <h:outputText value="Come do something awesome...

Is it safe to assume that Spring MessageSource implementations are thread-safe?

Is it safe to assume that all implementations of org.springframework.context.MessageSource interface are thread-safe after initialization? I would expect that it's safe, but now I'm looking through Spring source code, and there's org.springframework.context.support.ReloadableResourceBundleMessageSource which reloads properties from time...

Calling methods of "parent" component in Java

I have the following situation I think would be best to show in sample program code. I have a Java class that extends JPanel. In this class are two objects which are two more JPanels. In one of the JPanel objects is a JTable object. I added a listener to this JTable that detects a double click. When it detects a double click, I want...

Resizing TYPE_CUSTOM BufferedImages?

When I read a JPEG from disk, Java sometimes gives me a BufferedImage whose getType() returns TYPE_CUSTOM -- that is, it has a custom color model. I'd like to resize this BufferedImage but I'm not sure how to construct the destination object. Can someone please provide sample code for using the following constructor? BufferedImage(Color...

What are the minimum security precautions to put in place for a startup?

I'm working with a start-up, mostly doing system administration and I've come across a some security issues that I'm not really comfortable with. I want to judge whether my expectations are accurate, so I'm looking for some insight into what others have done in this situation, and what risks/problems came up. In particular, how critical ...

Is there a file descriptor leak when using sockets on a linux platform?

If I open and close a socket by calling for instance Socket s = new Socket( ... ); s.setReuseAddress(true); in = s.getInputStream(); ... in.close(); s.close(); Linux states that this socket is still open or at least the file descriptor for the connection is presen. When querying the open files for this process by lsof, there is an en...

XML Diff and Merge

Hello, I think i have a rather unique problem to solve. Well, i cant find enough information using Google. So here it goes, I work on a JEE SOA application which stores XML documents as XML using Oracle XML DB. Whenever the XML changes, i increment the version and throw the previous version into a different table. The requiremen...

In Java, can Class.forName ever return null?

In Java, can Class.forName ever return null, or will it always throw a ClassNotFoundException or NoClassDefFoundError if the class can't be located? ...

Why doesn't Java support unsigned ints?

Why doesn't Java include support for unsigned integers? It seems to me to be an odd omission, given that they allow one to write code that is less likely to produce overflows on unexpectedly large input. Furthermore, using unsigned integers can be a form of self-documentation, as they indicate that the value that the unsigned int was i...

Need a basic audio & video player library in Java

I need to display a series of images (perhaps BufferedImages) with variable frame rates as a video, synchronized with uncompressed audio. I also need the basic media controls of play, pause, seek, audio volume, etc. Since I don't need to encode, decode, read or write video files, I would prefer to avoid large libraries such as JMF or FM...