Spring file upload goes to Access denied page

Spring file upload goes to Access denied page

When Spring security is enabled, when I upload a file using multipart, SpringSecurity redirects me to Access denied url.

Refer to https://stackoverflow.com/questions/28225359/file-upload-spring-security
I amend my Initializer as follows!

public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer{
protected void beforeSpringSecurityFilterChain(ServletContext servletContext) {
insertFilters(servletContext, new MultipartFilter());

This error disappears. I landed in another problem. I’m resolving it now!!


Spring 5 migration: Unable to find setter method for attribute: [commandName]

Spring 5 Migration brings this pain. You will get this error during form submission.

Unable to find setter method for attribute: [commandName]

Command object does not work anymore.

Refer to https://stackoverflow.com/questions/46989072/org-apache-jasper-jasperexception-web-inf-views-home-jsp-line-25-column/48364974

commandName is dead in Spring 5. Replace it with modelAttribute

<form:form modelAttribute="customer" action="customerView" method="post">

It worked! I need to make this change in my workspace now!