This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Mathias Nilsson

Ranch Hand
+ Follow
since Aug 21, 2004
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 Mathias Nilsson


I need to change the favicon depending on brand and must do it in runtime.

I'm changing this thru DOM.getElementById but that does only work in chrome. Any ideas?
7 years ago
I'm very new to JNA and have just succeded in some simple samples. I
now have this function in my h file

__declspec(dllexport) ADK_ERROR __stdcall AdkGetStr(ADK_DATA* pData,
INT iFieldId, CHAR** ppsValue, INT iLen);

Jnarator project set this up as

ByValue AdkGetStr(ADK_DATA pData, int iFieldId, PointerByReference
ppsValue, int iLen);

The ADK_DATA works already since I have used it in oth calls but I
can't succeed to map the CHAR**. I don't know how to use the

This is what I've got so far.

PointerByReference ref = new PointerByReference();
ByValue b = lib.AdkGetStr(pData, 12, ref , 16);

I have tested a lot of different values for iLen but it should be 16
since the string that is returned is max 16 characters. Any pointers?
10 years ago

But I thought that I could do this without the wsdl. I use jax-ws annotations.
I use the spring-xfire to make the magic happen. Is there anyway I can include classes with annotations?
10 years ago
I have tried

@XmlSeeAlso({Image.class, Table.class}) but that does not work.
10 years ago

I'm trying to generate a webservice client in eclipse. I have developed a Web Service with jax ws and everything works fine except for the following.

My dto are inherited like this.

class Block
class Image extends Block
class Table extends Block

The web service method returns Block and I check instance of in my client. The problem is that the Image class is not included in the wsdl since the webservice method returns the class Block. How can I include the Image, Table in the generated classes.
10 years ago
This is a problem for safari and opera as well.

What I really trying to do is to make and multipart upload. and when the upload is started on the onsubmit I'm checking a ajax request. This is not the same way as posting with ajax because this will not work.
However, it seams that the responsiveness of the browsers stops. (in safari, opera. Not in IE ) So the only way is using an Iframe to get it to work with all browsers


Here is my servlet and ProgressListener

Here is my html and javascript

11 years ago
I think you missunderstand me mainly because of my bad english i suppose.

This is what I do.

Javaworld article about progress bar

It is not an AJAX request with multipart since this doesn't work. I make a post to an IFrame and then start an asyncron AJAX GET to my servlet that uses apache commons upload. My problem is that the session is not always set.

// Mathias
11 years ago
I'm not

I have a form that has an action to the servlet.
in the onSubmit() I call my start() function for ajax. And there I call the Servlet by GET.

11 years ago

I have a servlet that extends HTTPServlet and implements servlet. In the doPost I handle upload with apache commons upload

When trying to access the FILE-UPLOAD-LISTENER in doGet that is called from AJAX I sometimes get null.

The listener is sometimes null. How is this possible and how can I get around this? Any pointers?
11 years ago
Actually, when using a plain servlet with the code I can get it to work in safari.

I have tried to set up this with wicket framework and it seams that safari can not find the resource but all other browsers can. So now I'm building a servlet
for upload instead. Need progressbar
thanks but that didn't work!

I have got this simple script to work in
Firefox pc
Firefox mac
Opera PC
Chrome PC

but not in safari. It's driving me mad. Any pointers?

The onreadystatechange is not getting called in safari.
I want to show it to the user as wysiwyg. If the user inserts a list then I would like to show bullits with indent but the model may look something like this.

<list-item>Some text<c-style color="red">alert</c-style></list-item>

11 years ago
What about not adding childs to a node before expanding?

Let's say we have a root node that is c:\

you need to implement the hasChild, childCount. When clicking the root you load the next step into the tree. This can be done with all the nodes.
If you use as an object in DefaultMutableTree node you should get this to work.
11 years ago