Skip to content

Commit

Permalink
Uses name "jakarta" instead of default name for bean MultiPartRequest
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1538540 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
lukaszlenart committed Nov 4, 2013
1 parent ffe9185 commit eb05f9f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public class Dispatcher {
private String multipartSaveDir;

/**
* Stores the value of StrutsConstants.STRUTS_MULTIPART_HANDLER setting
* Stores the value of {@link StrutsConstants#STRUTS_MULTIPART_PARSER} setting
*/
private String multipartHandlerName;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/struts-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful" class="org.apache.struts2.dispatcher.mapper.RestfulActionMapper" />
<bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="restful2" class="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />

<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default"/>
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default"/>

<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDestroyableObjectFactory;
import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collections;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
Expand Down Expand Up @@ -134,6 +137,19 @@ public void testPrepareSetEncodingPropertyWithMultipartRequest() throws Exceptio
assertEquals("utf-8", req.getCharacterEncoding());
}

public void testPrepareMultipartRequest() throws Exception {
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
ServletContext ctx = new MockServletContext();

req.setContentType("multipart/form-data");
Dispatcher du = initDispatcher(Collections.<String, String>emptyMap());
du.prepare(req, res);
HttpServletRequest wrapped = du.wrapRequest(req, ctx);

assertTrue(wrapped instanceof MultiPartRequestWrapper);
}

public void testDispatcherListener() throws Exception {

final DispatcherListenerState state = new DispatcherListenerState();
Expand Down

0 comments on commit eb05f9f

Please sign in to comment.