Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for issue #445 #467

Merged
merged 2 commits into from

3 participants

@marceloemanoel

this should fix issue #445 according to the bug description

@lucascs
Collaborator

Thanks!

@lucascs lucascs merged commit e471518 into from
@garcia-jj
Collaborator

Needs fixed in servlet uploaded too.

@marceloemanoel

new pull request with servlet upload error message correction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 ...or-core/src/main/java/br/com/caelum/vraptor/interceptor/multipart/CommonsUploadMultipartInterceptor.java
@@ -42,6 +42,7 @@
import br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor;
import br.com.caelum.vraptor.ioc.RequestScoped;
import br.com.caelum.vraptor.resource.ResourceMethod;
+import br.com.caelum.vraptor.validator.I18nMessage;
import br.com.caelum.vraptor.validator.Validations;
import com.google.common.base.Strings;
@@ -147,12 +148,7 @@ private boolean isNotEmpty(FileItem item) {
* @param e
*/
protected void reportSizeLimitExceeded(final SizeLimitExceededException e) {
- validator.checking(new Validations() {
- {
- that(false, "upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize());
- }
- });
-
+ validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize()));
logger.warn("The file size limit was exceeded.", e);
}
View
3  ...ore/src/test/java/br/com/caelum/vraptor/interceptor/multipart/CommonsUploadMultipartInterceptorTest.java
@@ -36,6 +36,7 @@
import br.com.caelum.vraptor.http.InvalidParameterException;
import br.com.caelum.vraptor.http.MutableRequest;
import br.com.caelum.vraptor.resource.ResourceMethod;
+import br.com.caelum.vraptor.validator.I18nMessage;
import br.com.caelum.vraptor.validator.Validations;
/**
@@ -240,7 +241,7 @@ public void shouldValidateWhenSizeLimitExceededExceptionOccurs() throws Exceptio
interceptor.intercept(stack, method, instance);
- verify(validator).checking(any(Validations.class));
+ verify(validator).add(any(I18nMessage.class));
}
@Test
Something went wrong with that request. Please try again.