My basic intention is to find out whether a dir say A is immediately inside dir B or not. I'm checking it in java so I'm using Pattern and Matcher classes.
let say homeDir = /aa/bb/cc (home dir)
dirB = /aa/bb/cc/dd/ee (not immediately inside home dir)
dirC = /aa/bb/cc/dd (immediately inside home dir)
dirD = /aa/f...
What happens when an exception is thrown and you I have try-finally structure (without catch)
What does this do?
.
public class Bicycle{
private int cadence;
private int gear;
private int speed;
// the part with static:????
static{
something // I don't remember exactly the format
}
//...
Hi,
I am looking for a good unit test framework that I can use to mock private methods that can run under JDK 1.4.2.
Cheers,
...
Here is my implementation in summary
1) all DAOs implemented using HibernateDAO support/ @Transational annotation is only used in Service layer
2) Use MySQL / HibernateTransactionManager
3) Test using main(String args[]) method (do transactions work using this method? )
Transactions does not get rollbacked and invalid entried can be...
HI,
I hope someone could answer my question since I am new to the site.
I have a preloaded listbox which i load on form loading from a HASHMAP,
When I search for the data in my form,
I retrieve values for the listbox,
the problem i am facing is
I have to map the retreived data with the data already present in the ListBox and Show as Sel...
Strings are immutable, meaning, once they have been created they cannot be changed.
So, does this mean that it would take more memory if you append things with += than if you created a StringBuffer and appended text to that?
If you use +=, you would create a new 'object' each time that has to be saved in the memory, wouldn't you?
...
Hello,
I have a String that represents a date in French locale : 09-oct-08 :
I need to parse that String so I came up with this SimpleDateFormat :
String format2 = "dd-MMM-yy";
But I have a problem with the month part, that seems to be expected with a ending dot :
df2.format(new Date());
gives me :
28-oct.-09
What is no...
Hi,
I am trying following
Context ctx = (Context) jndiCntx.lookup(fSTANDARD_ENVIRONMENT);
Object obj = ctx.lookup(fSTANDARD_JNDINAME);
And following code is returning me false
MyClass.class.isAssignableFrom(obj.getClass())
although
MyClass.class.getName().equalsIgnoreCase(obj.getClass().getName()) returns true.
I am not able to...
I have to parse a line which is tab delimited. I parse it using the split function, and it works in most situations. The problem occurs when some field is missing, so instead of getting null in that field I get next value. I was store parsed values in a string array.
String[] columnDetail = new String[11];
columnDetail = column.split("\...
Hi everyone,
I have a question and I hope somebody can help me out here. Well, I'm developing an application with Struts 1.3.10 and I have a struts form with an object that contains a property. That property is declared as the primitive type int and the problem comes when the app shows to the user zeroes(0) instead of nothing when I ret...
I need to use a third party .jar lib in my application: unfortunately the way this third party app is set up makes it well nigh on impossible to test on my windows box (since it's set up for a unix environment - I'll spare the details). So I have refactored it to be able to test it (altered the structure to use maven/spring so the handli...
I'm working with a database that has the limit that the only (numeric) datatype it can store is a double. What I want to do is pick the number for a certain row and put it into an HTTP request. The problem revolves around that I cannot know if this number should or should not have decimals.
For example, if the double is an ID, I cannot ...
we have a J2EE app on which we're still working. It runs on Oracle DB. and the business tier is coded with EJB 2.0 with a rich client interface.
now, the application is going to be deployed on multiple sites. and each site will be creating new items (new contracts, etc.).
what we want to realize is to duplicate all new items added to a...
We are using the Sun RI for JAX-WS (2.1.4) and we have a need for orthogonal web service endpoint interceptors (authentication, extracting SOAP headers for context, etc). Apparently the "normal" JAX-WS way to do this is using the HandlerChain annotation.
This however forces us to modify the WSDL (even if we use the separate binding XML...
I have a multi-module Maven project in a Subversion repository with many developers working on it with Eclipse + M2Eclipse. Now if a developer adds a module, others need to do an SVN update from the command line (as Eclipse doesn't see the common root of the Maven project), and import the new module manually as an Eclipse project.
Is th...
How can I get the next friday with the Joda-Time API.
The LocalDate of today is today. It looks to me you have to decide whever you are before or after the friday of the current week. See this method:
private LocalDate calcNextFriday(LocalDate d) {
LocalDate friday = d.dayOfWeek().setCopy(5);
if (d.isBefore(friday)) {
return d.dayO...
Hi guys,
After following the great advice given in a thread about service beans I have made a Service that is listed under. I've tried putting @Transactional at the interface level, interface method level, class level and class method level. However I do it, I get
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean n...
my hibernate object A has object B, C, and D as properties :
A.getB().getName();
A.getC().getTitle();
now, I want to load A with all its properties without getting a LazyInitializationException.
so, I need to load A's object graph fully.
is there any generic method of retrieving an object's graph in hibernate ?
...
I need to get the AST for the current selection in the java editor fo eclipse.
Basically I want to convert the selected java code in to some other form(maybe some other language or XML etc..). So I guess, I need to get the AST for the selection.
Currently I am able to get the selection as simple text. Is there any way out for such proble...
I've to create hyperlinks in Excel as above. On click of the hyperlink, the data should be populated somewhere down the excel.
Am using Apache POI to generate the excel. is it possible with POI or other tools to generate such hyperlinks.
...