Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

Leonardo Postacchini

+ Follow
since Mar 30, 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 Leonardo Postacchini

Hello again,
Thanks for the reply, after reading Erich's reply I went about trying to configure the visitor to validate the model, but I was not able to do so.

I created an <Model Class Name>-validation.xml file next to the model class, with the validation for the model, in the action validation file I created a configuration for the model, I tried to use the field-name as the class name, as "model"(since the action property for the model is surprisingly model).

I tried to configure it without using prefix, using prefix as model. In none of my attempts the validation fired for the model properties. I was unable to find proper documentation on the usage of the visitor field, being the only one:

But the documentation is lacking, for example it does not tell me if I have to have one visitor to each field or just one visitor to each model object regardless of the number of fields that must be validated against.

Anyone has pointers to were look for more info? Like books or a sample aplication that actually use visitor?

10 years ago
Hello there,

We are building a system on struts 2.0.9 with model aware design but we cant figure how to setup the validation, I have blundered in struts wiki for quite some time now and even on xwork code but I havent figured it.

Anyone have any idea or can point were to look for such information?

Thank in advance,
10 years ago
Setting references to null does not help anything and it is a Bad Pratice(TM), methods variables live in the stack along with the method that defined it. Once the method exits, that section of memory is cleaned and leaves no trace of the reference and thus it is no concern to the garbage collector and those references will not slow by any bit the collection.

About having two piles of methods in the same stack, and having references to diferent objects "confusing" the garbage collector, I would like to see some real data about that as on the stack there can be only one pile of methods, and a method is either pushed over an existing or an existing one is removed and the a new method is pushed in the cleaned space. There is no reference confusion, there is no two methods living in the same level.

About the Garbage collector being slow and calls to explicitly gc being able to optmize that, as was already pointed out, is absurd. Garbage collections are expensive and the more often they happen, the more inefective they are, for that reason the usual strategy is to as much as possible to execute garbage collection and this way execute them as few as it is possible(usually when the memory becomes full). That makes the cost of the garbage collection over cheaper, the flaw on this aproach is that when the collection happens it takes long. That can be bad on systems where you need to be responsive, thus the alternative algorithm is presented, allowing the JVM to collect when the system becomes idle, that does make the system to "seem" more responsive, as there is no freezes sometimes, but this aproach does consume more CPU processing.

In the end, there is no magic, at one extreme you have low cpu consuming algorithm with eventual freezes, at the other and you have cpu intensive algorithm wint no sensible freeze(unless you overloads the machine).

Even if your calls to gc does take efect(which is not guaranteed as per API documentation) you would just push the algorithm towards the processing ineficience with aparent better response.

And then, I would thrust the JVM implementation to do a good job on this, as it is written by experts on the subject, rather than on a programer making assumptions based on personal feelings and myths.
12 years ago
Hi Remani!

If you STFW will find out that this question was asked many times over and the reply to this is you can't.

At least with good pratices. Use swing instead.
13 years ago
Hi, Jay!!

The while loop body will never be reached, depending on the compiler this is set to result on error, you can either set your compiler to treat it as a warning(or ignore it - but that would be very stu ) or change the code.

This is not a language error though.

May the code be with you.
Hello there!!!
I am getting the same exception.
Can anybody help with this?
14 years ago