I'm trying to integrate Guice into a JSF 1.2 (Sun RI) application, and I want to be able to do the following to my managed-beans:
Inject dependencies using the Guice @Inject annotation, then
Perform initialisation using the @PostConstruct annotation
My problem is that the @PostConstruct method is always invoked before the @Inject ann...
I wanted to write a program where an Excel sheet is imported onto a webpage. Also the look and feel of the webpage should be the same as that of the Excel sheet. The whole excel sheet should be displayed on the webpage.
Is there any package for Java where we can import the Excel sheet and print its data and its sheet onto the webpage?
...
How to determine whether a file is using?
...
Hello,
I am currently developing my project using Spring, Sutruts2 & Hibernate. Now i want to apply acegi security for authentication & authrization purpose.
But, i m totally new with acegi, so i want to use acegisecurity framework with spring configuration.
If anyone have link for an simple example of acegi with spring, struts2 & hi...
I have a method which returns a document list consisting of all these attributes:
private String activitySource, activitySystemStatus, regionCode, channel,
creatorUserId, displayOnAccessIndicator, documentLocationCode,
extraDetails, keywordList, lastUserId, summaryText,
textTypeIndicator;
H...
I am writing an application that will ship in several different versions (initially around 10 variations of the code base will exist, and will need to be maintained). Of course, 98% or so of the code will be the same amongst the different systems, and it makes sense to keep the code base intact.
My question is - what would be the prefer...
Hello,
I have 2 matrices and I need to multiply them and then print the results of each cell. As soon as one cell is ready I need to print it, but for example I need to print the [0][0] cell before cell [2][0] even if the result of [2][0] is ready first. So I need to print it by order.
So my idea is to make the printer thread wait until...
I know its possible to convert an image to CS_GRAY using
public static BufferedImage getGrayBufferedImage(BufferedImage image) {
BufferedImageOp op = new ColorConvertOp(ColorSpace
.getInstance(ColorSpace.CS_GRAY), null);
BufferedImage sourceImgGray = op.filter(image, null);
return sourceImgGray;
}
however, this is a chokepoint...
I've got a nested loop construct like this:
for (Type type : types) {
for (Type t : types2) {
if (some condition) {
// Do something and break...
break; // Breaks out of the inner loop
}
}
}
Now how can I break out of booth loops. I've looked at similar questions, but none concerns Ja...
I'm using MySQL and have the following entity:
class MyEntity {
@Id
@GeneratedValue(strategy=IDENTITY)
@Column(name="id")
private Integer id;
}
However, I would still like to be able to set the id manually!
The problem is that INSERT will never insert the id column. E.g., when
doing this:
MyEntity e = new MyEntity();...
Analogous to the $? in Linux, is there a way to get the exit status of a program in a Windows batch file (.bat)?
Say for example the program has a System.exit(0) upon successful execution, and a System.exit(1) upon a failure, how do I trap these exit values in a .bat file?
...
Situation is pretty serious, we have a table in DB2 on AS400 which has defined foreign key to another table, so we are entering record which have regular ID of referenced table so when we enter SQL insert through front end tool everything went fine.
Problem arises when this insert is to be done through java application which uses Sprin...
Usage scenario
We have implemented a webservice that our web frontend developers use (via a php api) internally to display product data. On the website the user enters something (i.e. a query string). Internally the web site makes a call to the service via the api.
Note: We use restlet, not tomcat
Original Problem
Firefox 3.0.10 se...
Scenario
I'm going to be as succinct as possible. Basically with reference to this classdiag, I have a facade which manages a list of SocketManager ( which manages one Socket connection). Each SocketManager logs in to a remote server using a unique SocketUserId. Furthermore, each SocketManager will accept messages from clients destined ...
Does anybody know of a open source Java library that will do robust diffing the text parts of pdf files?
Ideally I would like something that would produce a diff in the for of a patch.
...
Is anyone aware of tutorials for walking ANTLR-generated ASTs in C#? The closest I was able to find is this, but it's not terribly helpful.
My goal is to walk through trees that I'm generating based on a domain-specific language that I'm working on, and to use the trees to output generated C# code.
A Java-based tutorial would be helpfu...
I am looking for a tool or java code or class library/API that can generate XSD from XML files. (Something like the xsd.exe utility in the .NET Framework sdk)
...
I've come across some code that I can't share here but it declares a method WITHIN the paramter list of another method. I didnt even know that was possible. I dont really understand why its doing that. Can someone please explain to me some possible uses that you as a programmer would have for doing that? (Note: Since I can't show the cod...
I have this question about best practices in following examples:
interface Request;
interface Service {
void process(Request request)
}
class MyService implements Service;
class YourService implements Service;
class MyRequest implements Request;
class YourRequest implements Request;
But how to ensure that MyService will always rec...
I'm writing a custom flex file to generate a lexer for use with JSyntaxpane.
The custom language I need to lex has different states that can be embedded into each other in a kind of stack.
I.E you could be writing an expression that has a single quoted string in it and then embed another expression within the string using a special tok...