Bram Maes

Ranch Hand
+ Follow
since Sep 27, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bram Maes

Hi Lester,

Thanks for the quick reply!

I actually do need a signature with the corresponding certificate added to the request. I already checked the wss4j lib, but the I also need xalan, log4j, ... and the appletsize would be at least about 10MB - I would like to avoid this if possible. I would need a very lightweight framework with no dependencies

11 years ago
Dear fellow ranchers,

For a particular use case where I need real end-to-end security I am calling an external webservice. I mocked the webservice on my machine on another port (without security requirements). I am able to call the webservice (without any web service security implemented) as I signed my jar.

The problem is that I need to implement WSS to get the request signed in order to call the 'real' webservice. I am wondering how this could be done, bearing in mind that my applet should not get too large as it is an applet - so preferably without using any frameworks. Any body has any resources or experience on this? I'm not really sure what would be the best approach to get this started.

Thanks a lot!
B.

11 years ago
Dear fellow ranchers,

I am having an exception I do not understand. I'm afraid I'm missing something fundamental here.

I created the following annotation:



When the constraint gets violated, I get the following exception:




I declared the "com.company.constraints.nrnvalidation" property within my resourcebundle, but to me it seems as I can only put a number there? When I did put a number there, everything worked out fine, but in my webapp the error message was "20", what clearly is not what I want.

If anybody has a clue, please share your thoughts!

thanks a lot,
Bram.
12 years ago
Hi ranchers,

I have the following issue (which took me already quite some time to figure out):
In my JUnit tests, I'm using a pretty-printed version of an input file. On the server the xml String has no spaces or newlines between the different elements. This is causing differences in behaviour when using for ex. Document.getChildNodes.item(0).getChildNodes.item(0). In latter case where the XML is pretty printed, I may get an empty text-node. In the other case, I get an element node.

Now I am looking for an easy way to or either :
- have the perfect regex to undo the pretty-print in the string before building the Document. (Now I'm using

to undo the pretty-print but this is not covering the case where there are tabs instead of spaces, and probably some other cases that I have overseen

or

- Remove the empty text nodes once the Document has been built.

If anybody could help me out, you're very welcome to do so.

thanks.
Ok thanks. Makes sense.
14 years ago
Hi all,

I'm having the following line of code :



Where Document is a org.w3c.dom.Document and template also a valid org.w3c.dom.Document.
Now this doesn't compile as it says that "clone() is undefined for type Document".

Anyone has an idea what is the cause of this error? Doesn't every Object has a clone() method?

thanks.
14 years ago
That did the trick indeed. This doesn't feel really naturally to me... Guess I'm the only one having this feeling:)

thanks a lot.
regards,
Bram.
Hi everyone,

My code looks like this :



What I see now is that alle the elements get separately added when I execute the createElement statements and they to the document while I only want the e1 element added (that has the other elements as children).

I'm sure there must be a simple way to do this but for the moment I don't see it. Can someone please help?

thanks.
Problem solved. Apparently when using the getElementsByTagNameNS the setNamespaceAware should be set to true while this is not important for getElementsByTagName.

Sorry for bothering all of you.

regards,
Bram.
Hi all,

Can someone explain the following :






works well while




throws a NullPointerException... I don't get it...

regards,
Bram.
[ April 07, 2008: Message edited by: Bram Maes ]
Hi ranchers,

I'm having a problem with calling the getElementsByTagName on a Document. In the xml-file sometimes there is a namespace and sometimes there's not. Now if i'm calling doc.getElementsByTagName("products") and there is a namespace, I don't get a result. If there isn't a namespace, I do get a result.

Is there a way to receive in both cases a result without modifying the "products" parameter? (I've set documentBuilder.setNamespaceAware(true);)

thanks in advance,
Bram.
Hi folks,

I wrote a program that needs to parse one line of text that contains several thousands of characters. I have some delimiters in the file that I use to split the String.

Now I have the following problem:
When i call scanner.match().start(), the starting index is correctly returned when the index is smaller than +/- 1000. Then it looks like the internal counter is reset to 0. I have a list of matches like this :
232, 389, 608, 804, 54, ...

the last 54 should be a number > 1000.

I googled this problem but without success. Does anyone of you know if there are any known issues with very large strings when using Scanner?

thanks in advance,
Bram.
[ March 17, 2008: Message edited by: Bram Maes ]
14 years ago
I think this is strange because I thought the rule is to take the 'old style' when there's a doubt. So i'd think the compiler would take long..., because widening existed long time before autoboxing. Apparently I'm missing something here...
These are the kind of questions I hate. Really those subtle differences. Half a second losing your attention and bang...

And of course thanks a lot for the clarification!
[ October 27, 2006: Message edited by: Bram Maes ]
So this(2) should work then ?