Codemunchies.com is a blog written and maintained by Aleksander Stensby and Jaran Nilsen.
We are both working as lead Software Developers at Integrasco AS in Norway, and this blog is our way of sharing our experiences and useful code snippets. Our idea is that every day you can save several minutes spent writing boiler plate code, or wondering what is the best pattern for your implementation. Through this blog we will provide ideas and experiences that has helped us getting our work done, and which may help you save those precious minutes – and in return we hope you will comment and give us feedback that can help us save some lines of code as well.
We want Codemunchies.com to be a place where great minds share their experience and knowledge. We’re not limited to any platform and are huge fans of diversity. If you have something you would like to share through our blog, don’t hesitate to contact us.
Disclaimer
This blog (codemunchies.com, codemunchies.net and codemunchies.org) is a joint project started by Aleksander Stensby and Jaran Nilsen. Any opinions or views expressed through this blog is by no means representing the official opinion or view of our employer(s) or any businesses or projects that we are affiliated with. Any comments made by third parties on this blog is the property of the comment author. Any copyright infringements, insults or inaccuracies are not the responsibility of the blog owners. Comments are moderated, but freedom of speech is highly respected. If you have inquiries regarding the content on this blog, please contact us using the information available on the Contact page.


I wish this would work with Gigaspaces. Its spring based….so perhaps one day.
Doesn’t it work with GigaSpaces? Is there a reason it shouldn’t?
Thanks for the Guava series; I find it a very useful to understand and use the library;
Hi Jaran,
Nice finding.
Asked the two authors about integration into Polarion ALM.
BR
Robert
Hi, great post. I have a question.
What is the sintax for the errors messaged keys in the resouce boundle?
{key} = Name must be provided
Thanks
Hi, Augustin.
The syntax for the error message keys is as follows:
Constraint.CommandName.FieldNameExample:
NotEmpty.userForm.nameHope this helps.
Jaran
Using the code provided, I couldn’t get it to work until I added the generics to the ConstraintValidator:
public class UrlValidator implements ConstraintValidator {
@Override
public void initialize(final Url target) {
}
@Override
public boolean isValid(final String url,
final ConstraintValidatorContext context) {
return url.startsWith("http");
}
}
@Chad You are absolutely right, and the generics were there when the post was created. It seems Wordpress decided to remove them in the saving process
Fixed it now. Thanks for pointing it out!
How about using validation groups?
if errors presence, it goes back to same page. But i am loosing my drop down values. Should I set all the form data related fields (eg: drop down values, etc) again in the if block (if (results.hasErrors()) ??