Help coderanch get a
new server
by contributing to the fundraiser

Kristof Camelbeke

Ranch Hand
+ Follow
since Nov 28, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kristof Camelbeke

As the name suggests this method allows you to reset your form properties....

the api says it all:


Reset bean properties to their default state, as needed. This method is called before the properties are repopulated by the controller.

The default implementation does nothing. In practice, the only properties that need to be reset are those which represent checkboxes on a session-scoped form. Otherwise, properties can be given initial values where the field is declared.

14 years ago
Hello,

Anybody has an idea what the cause of this problem is?

Thanks...
14 years ago
is your log4j file added in the classpath?
14 years ago
I've added the indexed setters/getters on my bean but they never get called... I even added them on the ActionForm but also no result....

here's the generated html output:



To resume my 'aDto' has a List 'aList' wich references Object items where serial number is a String property.
I've added indexed getter/setters in this dto for the list and for the properties of the Object items but they never get called.

When debugging I see that the public Object getIndexedProperty(Object bean, String name) method is called from the PropertyUtilsBean and that the line return (getIndexedProperty(bean, name, index)); contains the bean with index 2 and the index 3 which causes the ArrayOutOfBoundsExcption....


14 years ago
It's on my pc at work and since they don't give us laptops I don't have any other option than to wait till monday morning
14 years ago
Thanks Bear for the link to the article.

I have a getXX(index) method which is called for the existing items but I have no setter and that might be the problem for the ArrayIndexOutOfBoundsException as mentionned in the article:

The indexed getter and setter methods may throw a java.lang.ArrayIndexOutOfBoundsException runtime exception if an index is used that is outside the current array bounds. In order to change the size of the array you must use the array setter method to set a new (or updated) array.



I'll try this first out thing monday morning...
14 years ago
Hello I don't know if this is the correct forum since it's a jsp-struts-javascript issue...

Anyway here's the situation.

A page is loaded with a form which contains a List....

This list is iterated as follows:




The properties of this list are stored and passed via <html:hidden> properties to the javascript function where the html code is generated.
Here's an example of the generated html output for 1 property:


All works well when I submit the form without adding a new element

When the the user decides to create a new element the same javascript function is called to create the html code indexing the proper form elements.
When the submit is done I get an ArrayOutOfBoundsException at org.apache.commons.beanutils.PropertyUtilsBean.getIndexedProperty(PropertyUtilsBean.java:433)

So how do you increment the list size? I use the getXXX(index) in my form but it never gets there when the index is larger thant the list size.
I've seen many examples but most are for editing the current list not adding new elements...

Any input is mostly appreciated!

Thank you
14 years ago
You mean that the data is lost after submitting the confirmation screen ?
If this is the case you might want to use the session scope instead of the request...

Hope this helps
17 years ago
Hi,

I've implemented this example and it's working fine.
But I have a question concerning the threading. I've read that if your deploying a webApp on an application server that it's not appropriate to start your own threads...

So is there another way to do this without starting a new thread ?
17 years ago
I have a question concerning on how to deal with threads...

Situation: a webbapplication (Struts-Spring). The business layer consists of spring beans and struts is used for the front-end handling.
The webApp is deployed on an application server (Weblogic), which takes care of all the threading issues if I'm not mistaken.

At one time in the application there is a call to a webservice, and since this may take a while I have created an 'in progress page' which keeps refreshing until the result has been retrieved.

I have created a spring bean which implements Runnable :



implementation of Runnable :

This is called from a Struts action as follows :



here's a fragment of the applicationContext :



This works fine but I don't like the following line



I've also heard that it is not proper to work with threads in a managed application server like weblogic.
So I think I might run into concurrency issues when many clients are calling the webservice.
And I'm not sure if it's proper to let a Spring bean implement Runnable ?

I've done some searching on the forum and somebody suggested to work with the ThreadPoolTaskExecutor, but Isn't this more related for 'tasks'.
And I don't think this is possible in a 1.4 JDK environment, is this
correct ?

Any information is welcome !

Thanks.

Kristof

[ November 28, 2006: Message edited by: Kristof Camelbeke ]
[ November 28, 2006: Message edited by: Kristof Camelbeke ]
If I understand correctly I think you'll have to use a url encoder like java.net.URLEncoder to encode the url with the parameters so for example the spaces in your parameters are transformed to +...

Hope this helps
18 years ago
Hi,

I want to store a user password encrypted in the database.
I've created a class based on an example using JCE.. Here are some code extracts :

It works fine in my junit test which encrypts a given value and decrypts it to it's original.

The problem arrives when I save the encrypted password in the database (oracle). When I try to retrieve the encrypted String and try to decrypt it I receive the following Exception :



The column in the database is of type varchar2 and has a length of 255.
I think it has something to do with the storage in the database since I can do the encryption/decryption in a unit test.

Any help is highly appreciated...

Thanks.

Kristof
18 years ago
Hello...

I don't know, I'm just using the ojdbc14_g.jar and it's not in there like you said...

I've tried something else instead of working with WebLogicNativeJdbcExtractor


I now work with the SimpleNativeJdbcExtractor :

and this gives me another error :


and in my Spring logging I see a message of dehydrating entity and then "the Connection [null] for given Connection handle"



BTW thanks for looking into this ! :-)
Hi lars,

Thanks for the info.
I'm using JDK1.4 and the oracle driver used in the client application is :
odjbc14_g.jar. If I use the odjbc14.jar I get an 'java.lang.ArrayIndexOutOfBoundsException' so it's still not working.

Kristof