jean-gobert de coster

Ranch Hand
+ Follow
since Dec 04, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jean-gobert de coster

Campbell Ritchie wrote:Maybe a regular expression to match those hex numbers? I am not used to seeing x0020, but usually see %20 in URLs.

But if it is working . . . leave well alone

the _x0020_ are XPath encoding, but the ISO9075.decode() method makes sure they are translated

Yeah I'll leave it thanks for the help anyways ;-)
12 years ago
from the getPath method I'm calling before decodint, I get a String that looks like this


what i need is to turn this into

\folder 1\0054321.pdf

so yes I need to match /.*?:

My example was simplified but I based myself of what I know from playing around with the log outputs. If I simply remove the .replaceAll("/","\\\\") the log gives this as output:

/app:company_home/cm:folder 1/cm:0054321.pdf
/folder 1/0054321.pdf

adding the .replaceAll("/","\\\\") and the log gives this output

/app:company_home/cm:folder 1/cm:0054321.pdf
/folder 1/0054321.pdf

but nevermind this, since the second code example makes those things work just right, and is actually better in all aspects.
12 years ago
ok, so it seems to be working fine with you :-( which is good news because that's how it's supposed to work...

I was doing some more treatments to the string before, so that may be the problem.

My original code was this:

I changed it to

and now it works... go figure
12 years ago
I have a string

String myString="/folder 2";

and I'm trying to replace the / with a \

myString= myString.replaceAll("/","\\\\");

but in the end, nothing is replaced and myString is still "/folder 2"

I really don't understand why this isn't working, anyone has a clue?
12 years ago

Martijn Verburg wrote:You'll want to probably be able to do this as a long term solution (your local repo is temporary after all). Nexus and Artifactory are two highly recommended dependency managers to try.

Thanks for the input, I've hear of Nexus before and will definitely take it into consideration. My intent is to convince my boss and co-workers that maven is good for us, but I need to tame the beast if I want to present it
12 years ago
OK will do

I didn't think of adding them to my local, that's brilliant (and simple) thanks
12 years ago

Martijn Verburg wrote:Sorry, didn't have my coffee yet In that case you need to add in that 3rd party jar as a dependency in your pom.xml file.

Is it possible to add that as a directory or do I have to add all the .jar manually one by one?
12 years ago

Martijn Verburg wrote:Does your pom.xml for the war project have the built jar as a dependency?

the pom.xml in my previous post is that of my war project
12 years ago

Peter Johnson wrote:What are the contents of the file? Do you have this line:

more like

Somewhere in your pom you are referencing org.someother.project.package, where is that?

I'm not sure I can reference org.someother.project.package in my pom.xml, since that package is not a maven project, it's not in any repository.

my pom.xml looks like this:

What I did do, in the build path of the project, was to link the .jar in which org.someother.project.package is. So I have a symbolic link "lib" source folder in my project.

As I said, Eclipse doesn't seem to mind, however I noticed that I don't have any .class files generated (even though auto build is on).
12 years ago
Hi, I created a maven project and did some coding (yay) which required me to use some libraries that are in any maven repository (:sad:)

so I imported the .jar files of those libraries and did happily code without Eclipse complaining about anything (except for staying up too late).

then now I'm proudly trying to build my very first .war with maven, I run -> maven build... clean package and then I get a whole bunch of errors saying that

FAILED for project:
/Users/me/Documents/myproject/src/main/java/com/mydomain/myclass/[17,36] package org.someother.project.package does not exist

what is wrong? How can this be? I'm in despair, save my friday the 13th
12 years ago
Thanks a lot for all these answers. I like the subtelty of execute delegation (got tons to learn yet about design patterns). I do have the Spring Framework available for use. I guess there are lots of interesting things I could use from there. Initially I wanted to do an MVC design but my boss told me not to spend time doing that. But still I guess I can use some utility classes. The whole difficulty is to find quickly which things in the framework can solve my problems.

Thanks guys

James Clark wrote:

Is there not a better cleaner, more flexible way to do this?

Sure there is, just use the Struts framework. This will enable you to focus on the business requirements and leave the "plumbing" code to the experts.

Yeah that would be nice, but I'm just stuck with that legacy code. My employer doesn't want me to spend time re-doing things and he doesn't care that taking those extra days re-doing stuff will mean losing less days in the future.

I guess we all know this paradox, so for now I try to spend time seamlessly improving small parts of the code (a HttpServlet implementing 3 different makeQuery(<insert endless list of parameters here>) methods... yuck!!! ).
Hi all,

I always feel stupid when I create a new class and I wonder in which package I should set it. So I was wondering if there were any conventions (beside the obvious <domain>.<company>.<project> prefix) regarding package structures.

I do have some conventions I use:

.domain for POJO
.controller for controllers (duh)
.service for interfaces

but then I have all the things like utility classes, implementations of my interfaces, comparators, data access layer etc... I guess there must be a default package architecture where anybody would find his way, but what would that be? How do YOU organize your classes?
12 years ago
There is a naming convention already, action names are in the following form

action types can be "search", "open", "sort", ... and object corresponds to an object in the domain.

so actually the doStuff() method is more like MyObjectManager.doStuff()
Hi all,

currently I' looking to clean up legacy code from a former colleague and I'm facing the following problem:

I recieve an HttpRequest containing an "action" parameter. Depending on the value of "action" the controller should call the right method that will in turn produce a .jsp returned as response.

Currently this is implemented in a doAction(String action) method that is just a huge sequence of

Is there not a better cleaner, more flexible way to do this?