0

Recently I moved from struts2.3.35 to struts2.5.26 and along with this I moved to spring boot app from spring which was using external tomcat and now it's using embedded one.

So whenever I try to upload file on action class is returning null even though I have setter method on action class.

index.jsp

<s:form action="SubmitForm" theme="simple" method="post" enctype="multipart/form-data">
    <fieldset>
        <legend><b>Trust File</b></legend>
        <table>
            <tr>
                <td><label for="uploadedFile"><b>Trust File</b></label></td>
                <td><s:file name="uploadedFile" id="tobFile" size="30"/></td>
            </tr>
            <tr>
                <td><label for="tobFileSheet"><b>Sheet Name</b></label></td>
                <td><s:textfield name="tobFileSheet" id="tobFileSheet" size="30"/></td>
            </tr>
            <tr>
                <td><label for="tobTrustee "><b>Trustee Name</b></label></td>
                <td><s:select name="trustee" list="trustees" listValue="value" listKey="value" emptyOption="true" /></td>
            </tr>
            <tr><td colspan="2"><hr/></td></tr>
            <tr>
                <td colspan="2" align="right">
                    <s:url var="submit" value="reports/upload.action"/>
                    <sj:submit targets="formResults" value="Submit" indicator="indicator"/>
                </td>
            </tr>
        </table>
    </fieldset>
</s:form>

struts.xml :-

<package name="/" namespace="/" extends="struts-default">
    <action name="" class="com.action.reports.LoginAction">
        <result name="success">/index.jsp</result>
        <result name="error">/index.jsp</result>
    </action>
    <action name="SubmitForm" class="com.action.reports.SubmitFormData">
        <result name="success">success.jsp</result>
        <interceptor-ref name="defaultStack">
            <param name="fileUpload.maximumSize">10485760</param>
        </interceptor-ref>
    </action>
</package>

LoginAction.java

public class LoginAction extends ActionSupport implements ValidationWorkflowAware, SessionAware, ServletRequestAware, ServletResponseAware, ParameterAware, ServletContextAware {

private static final long serialVersionUID = 2470772975261583161L;
protected Map<String, Object> session;
protected HttpServletRequest request;
protected HttpServletResponse response;
protected Map<String, String[]> parameters;

public String execute() throws IOException {
    System.out.println("inside LoginAction login page");
    try
    {
        response.sendRedirect("index.jsp");
    }
    catch (Exception e)
    {
        System.out.println(e.getMessage());
    }
    return null;
}

public void setSession(Map<String, Object> session) {
    this.session = session;
}

public void setServletRequest(HttpServletRequest request) {
    this.request = request;
}

public void setServletResponse(HttpServletResponse response) {
    this.response = response;
}

@Override
public void setServletContext(ServletContext context) {
    // TODO Auto-generated method stub
    
}

@Override
public void setParameters(Map<String, String[]> parameters) {
    // TODO Auto-generated method stub
    
}

@Override
public String getInputResultName() {
    // TODO Auto-generated method stub
    return null;
}

}

SubmitFormData.java

public class SubmitFormData extends ActionSupport implements ValidationWorkflowAware, SessionAware, ServletRequestAware, ServletResponseAware, ParameterAware, ServletContextAware {

private static final long serialVersionUID = 1L;
private File uploadedFile; 
private String uploadedFileName;
private String tobFileSheet;

protected Map<String, Object> session;
protected HttpServletRequest request;
protected HttpServletResponse response;
protected Map<String, String[]> parameters;
private String localDir="C:\\testFile";

public String execute() {
    System.out.println(request);
    System.out.println(response);
    System.out.println(session);
    System.out.println(uploadedFile);
    System.out.println(uploadedFileName);
    System.out.println(tobFileSheet);
    File localFile=new File(localDir,"1.txt");
    try {
        FileUtils.copyFile(uploadedFile, localFile);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return "success";
}

public File getUploadedFile() {
    return uploadedFile;
}

public void setUploadedFile(File uploadedFile) {
    this.uploadedFile = uploadedFile;
}

public String getUploadedFileName() {
    return uploadedFileName;
}

public void setUploadedFileName(String uploadedFileName) {
    this.uploadedFileName = uploadedFileName;
}

public String getTobFileSheet() {
    return tobFileSheet;
}

public void setTobFileSheet(String tobFileSheet) {
    this.tobFileSheet = tobFileSheet;
}
public void setSession(Map<String, Object> session) {
    this.session = session;
}

public void setServletRequest(HttpServletRequest request) {
    this.request = request;
}

public void setServletResponse(HttpServletResponse response) {
    this.response = response;
}

@Override
public void setServletContext(ServletContext context) {
    // TODO Auto-generated method stub
    
}

@Override
public void setParameters(Map<String, String[]> parameters) {
    // TODO Auto-generated method stub
    
}

@Override
public String getInputResultName() {
    // TODO Auto-generated method stub
    return null;
}

}

When i am switching spring starter parent dependency to 1.5.10.RELEASE in pom the file setter method inside SubmitForm class get called and below is the output :-

org.apache.catalina.connector.ResponseFacade@93026c {} \tmp\upload_f27febb6_35bd_42c7_8643_a1cf2df1feaa_00000002.tmp null test

and when i am switching to 2.0.3.RELEASE spring-boot version it's not even calling settler method and above file object is null.

pom.xml

<modelVersion>4.0.0</modelVersion>
<groupId>somename</groupId>
<artifactId>spring-boot-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<properties>
    
    <org.apache.struts.version>2.5.26</org.apache.struts.version><!-- 2.3.35/ 
        2.5.26 -->
    <tiles.version>3.0.7</tiles.version><!-- 2.2.2 / 3.0.7 -->
</properties>
 <parent> 
        <groupId>org.springframework.boot</groupId> 
        <artifactId>spring-boot-starter-parent</artifactId> 
        <!-- <version>1.5.10.RELEASE</version> -->
        <version>2.0.3.RELEASE</version>
</parent>

<dependencies>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
      <!-- <version>4.1.6.RELEASE</version> -->
      <version>2.0.3.RELEASE</version>
      <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.0.3.RELEASE</version>
        <!-- <version>4.1.6.RELEASE</version> -->
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
    </dependency>
    <!-- Struts dependencies -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- struts2-json-plugin-2.3.35.jar -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-json-plugin</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
            </exclusion>
        </exclusions>

    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.17.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.17.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>2.17.1</version>
        <exclusions>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-1.2-api</artifactId>
        <version>2.17.1</version>
    </dependency>
    <!-- struts2-convention-plugin-2.3.35.jar -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-convention-plugin</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- struts2-config-browser-plugin-2.3.35.jar -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-config-browser-plugin</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- struts2-spring-plugin-2.3.35.jar -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-spring-plugin</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- struts2-tiles-plugin-2.3.35.jar -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-tiles-plugin</artifactId>
        <version>${org.apache.struts.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- struts2-jquery-grid-plugin-3.7.1.jar -->
    <dependency>
        <groupId>com.jgeppert.struts2.jquery</groupId>
        <artifactId>struts2-jquery-grid-plugin</artifactId>
        <version>3.7.1</version>
        <exclusions>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>


    <!-- struts2-jquery-plugin-3.7.1.jar -->
    <dependency>
        <groupId>com.jgeppert.struts2.jquery</groupId>
        <artifactId>struts2-jquery-plugin</artifactId>
        <version>3.7.1</version>
    </dependency>

    <!-- struts-menu-2.4.3.jar -->
    <dependency>
        <groupId>struts-menu</groupId>
        <artifactId>struts-menu</artifactId>
        <version>2.4.3</version>

        <exclusions>
            <exclusion>
                <groupId>velocity</groupId>
                <artifactId>velocity</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.mchange</groupId>
                <artifactId>c3p0</artifactId>
            </exclusion>
            <exclusion>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
            </exclusion>

        </exclusions>

    </dependency>

    <!-- tiles-api-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-api</artifactId>
        <version>${tiles.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl104-over-slf4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- tiles-core-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-core</artifactId>
        <version>${tiles.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <!-- tiles-el-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-el</artifactId>
        <version>${tiles.version}</version>
    </dependency>

    <!-- tiles-freemarker-2.2.0.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-freemarker</artifactId>
        <version>${tiles.version}</version>
    </dependency>

    <!-- tiles-jsp-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-jsp</artifactId>
        <version>${tiles.version}</version>
    </dependency>


    <!-- tiles-ognl-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-ognl</artifactId>
        <version>${tiles.version}</version>
    </dependency>

    <!-- tiles-request-api-1.0.6.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-request-api</artifactId>
        <version>1.0.6</version>
    </dependency>
    <!-- tiles-request-servlet-1.0.6.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-request-servlet</artifactId>
        <version>1.0.6</version>
    </dependency>

    <!-- tiles-servlet-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-servlet</artifactId>
        <version>${tiles.version}</version>
    </dependency>

    <!-- tiles-template-2.2.2.jar -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-template</artifactId>
        <version>${tiles.version}</version>
    </dependency>
    <!-- activation-1.1.1.jar -->
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>

    <!-- antlr-2.7.6rc1.jar -->
    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.6rc1</version>
    </dependency>

    <!-- aopalliance-1.0.jar -->
    <dependency>
        <groupId>aopalliance</groupId>
        <artifactId>aopalliance</artifactId>
        <version>1.0</version>
    </dependency>

    <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy</artifactId>
        <version>1.9.12</version>
    </dependency>



    <!-- cglib-2.2.jar -->
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
        <exclusions>
            <exclusion>
                <groupId>asm</groupId>
                <artifactId>asm</artifactId>
            </exclusion>
        </exclusions>
    </dependency>


    <!-- cglib-nodep-2.1_3.jar -->
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.1_3</version>
    </dependency>


    <!-- classmate-1.5.0.jar -->
    <dependency>
        <groupId>com.fasterxml</groupId>
        <artifactId>classmate</artifactId>
        <version>1.5.0</version>
    </dependency>
    <!-- common-util-1.0.4.jar -->
    <dependency>
        <groupId>com.healthmarketscience.common</groupId>
        <artifactId>common-util</artifactId>
        <version>1.0.4</version>
    </dependency>

    <!-- hibernate-commons-annotations-5.1.0.Final.jar -->
    <!-- https://mvnrepository.com/artifact/org.hibernate.common/hibernate-commons-annotations -->


    <!-- commons-beanutils-1.7.0.jar -->  <!-- 1.7 was EOL in SEAL -->
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.9.4</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.2</version>
        <exclusions>
            <exclusion>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox</artifactId>
        <version>2.0.24</version>
    </dependency>
    <!-- MK-Utils.jar -->
    <dependency>
        <groupId>someName</groupId>
        <artifactId>MK-Utils</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>jakarta-regexp</groupId>
        <artifactId>jakarta-regexp</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>someName</groupId>
        <artifactId>janusweb</artifactId>
        <version>3.6.0.0</version>
    </dependency>
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.13.0</version>
    </dependency>
    <dependency>
        <groupId>javax.sql</groupId>
        <artifactId>jdbc-stdext</artifactId>
        <version>2.0</version>
    </dependency>

    <!-- jms-1.1.jar -->
    <!-- https://mvnrepository.com/artifact/javax.jms/jms -->
    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>jms</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>ognl</groupId>
        <artifactId>ognl</artifactId>
        <version>3.0.19</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.5</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>xalan</groupId>
        <artifactId>xalan</artifactId>
        <version>2.7.2</version>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.12.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans</artifactId>
        <version>3.0.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>javax.servlet.jsp-api</artifactId>
        <version>2.3.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.jacoco</groupId>
        <artifactId>org.jacoco.agent</artifactId>
        <version>0.8.0</version>
        <classifier>runtime</classifier>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <!-- added for mockHttpServelet -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.atlassian.activeobjects</groupId>
        <artifactId>activeobjects-spi</artifactId>
        <version>1.4.0</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>net.bytebuddy</groupId>
        <artifactId>byte-buddy-agent</artifactId>
        <version>1.9.7</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>2.6</version>
        <scope>test</scope>
    </dependency>

    
    <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.55</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.1.0</version>
        </plugin>
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.0</version>
            <executions>
                <execution>
                    <id>default-instrument</id>
                    <goals>
                        <goal>instrument</goal>
                    </goals>
                    <configuration>
                        <excludes>
                            <exclude>*</exclude>
                        </excludes>
                    </configuration>
                </execution>
                <execution>
                    <id>default-restore-instrumented-classes</id>
                    <goals>
                        <goal>restore-instrumented-classes</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <dataFile>${basedir}/target/jacoco.exec</dataFile>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
                <excludes>
                    <exclude>**/*IntegrationTest.java</exclude>
                </excludes>
                <systemPropertyVariables>
                    <slate.db.user>${slate.db.user}</slate.db.user>
                    <slate.db.password>${slate.db.password}</slate.db.password>
                    <tecmp.db.user>${tecmp.db.user}</tecmp.db.user>
                    <tecmp.db.password>${tecmp.db.password}</tecmp.db.password>
                    <tecmview.db.user>${tecmview.db.user}</tecmview.db.user>
                    <tecmview.db.password>${tecmview.db.password}</tecmview.db.password>
                    <woprview.db.user>${woprview.db.user}</woprview.db.user>
                    <woprview.db.password>${woprview.db.password}</woprview.db.password>
                    <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
                    <testEnvironment>true</testEnvironment>
                </systemPropertyVariables>
            </configuration>
        </plugin>

    </plugins>
    <finalName>spring-boot</finalName>
</build>

<profiles>
    <profile>
        <id>uat</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <build.environment>uat</build.environment>
        </properties>
    </profile>

    <profile>
        <id>prod</id>
        <properties>
            <build.environment>prod</build.environment>
        </properties>
    </profile>
</profiles>
  • There's not enough information here to help; I just see the form. I would start by turning on debug logging and checking the logs, checking the content of the request itself (e.g., in the network tab), and the request params values on the Java side. – Dave Newton Mar 04 '22 at 14:53
  • Did you move struts2 jQuery plugin along with? – Roman C Mar 06 '22 at 19:48
  • Yes i am using struts2 jQuery plugin as well. now i found the root cause. the issue is spring boot version. so when i am using spring-boot-1.5.x version i am able to get the file in request and when i am using spring-boot2.x vesion or any latest version i am not getting file content at all in the request. – priya gupta Mar 09 '22 at 04:57
  • @DaveNewton, yes i can see file going in the request on network tab of browser and somehow when it's going to server i.e in java it's getting lost. – priya gupta Mar 09 '22 at 04:59
  • here is my struts.xml : – priya gupta Mar 09 '22 at 05:02
  • How did you integrate Struts2 with Spring Boot? Is it only version problem? – Roman C Mar 15 '22 at 18:47
  • yes.. it's only version problem i feel because when i am changing spring boot version to 1.5.x the upload thing works fine but i am not able to figure out what changed in spring boot 2.0.x or spring 5.x version which is causing this issue. – priya gupta Mar 16 '22 at 13:08

0 Answers0