保存进度!
This commit is contained in:
		@@ -23,15 +23,12 @@
 | 
			
		||||
      <groupId>com.oracle</groupId>
 | 
			
		||||
      <artifactId>ojdbc8</artifactId>
 | 
			
		||||
      <version>19.3.0.0.0</version>
 | 
			
		||||
      <!-- <scope>system</scope>
 | 
			
		||||
      <systemPath>${project.basedir}/lib/ojdbc8.jar</systemPath> -->
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>javax.servlet</groupId>
 | 
			
		||||
      <artifactId>javax.servlet-api</artifactId>
 | 
			
		||||
      <version>4.0.1</version>
 | 
			
		||||
      <scope>provided</scope>
 | 
			
		||||
      <artifactId>servlet-api</artifactId>
 | 
			
		||||
      <version>2.5</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>javax.validation</groupId>
 | 
			
		||||
@@ -44,6 +41,26 @@
 | 
			
		||||
      <version>7.0.1.Final</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
 | 
			
		||||
    <!-- jackson -->
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>com.fasterxml.jackson.core</groupId>
 | 
			
		||||
      <artifactId>jackson-databind</artifactId>
 | 
			
		||||
      <version>2.13.4</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>com.fasterxml.jackson.core</groupId>
 | 
			
		||||
      <artifactId>jackson-core</artifactId>
 | 
			
		||||
      <version>2.13.4</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>com.fasterxml.jackson.core</groupId>
 | 
			
		||||
      <artifactId>jackson-annotations</artifactId>
 | 
			
		||||
      <version>2.13.4</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
 | 
			
		||||
  </dependencies>
 | 
			
		||||
 | 
			
		||||
  <build>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2022-09-28 15:47:02
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @LastEditTime: 2022-09-28 18:55:22
 | 
			
		||||
 * @LastEditTime: 2022-09-28 23:04:17
 | 
			
		||||
 * @FilePath: \car_dealer\src\main\java\com\cpic\xim\car_dealer\controllers\fileupload\FileUploadController.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
@@ -22,7 +22,6 @@ import org.springframework.ui.Model;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Controller
 | 
			
		||||
public class FileUploadController
 | 
			
		||||
{
 | 
			
		||||
@@ -38,8 +37,17 @@ public class FileUploadController
 | 
			
		||||
    public void uploadFile( HttpServletRequest request, HttpServletResponse response,
 | 
			
		||||
            MultipartFile file, Model model ) throws IllegalSelectorException, IOException
 | 
			
		||||
    {
 | 
			
		||||
        response.setContentType( "text/json;charset=UTF-8" );
 | 
			
		||||
        PrintWriter writer = response.getWriter();
 | 
			
		||||
 | 
			
		||||
        if ( file == null)
 | 
			
		||||
        {
 | 
			
		||||
            writer.write( "{\"message\":\"提交方式有误!\"}" );
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            writer.write( file.getOriginalFilename() );
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -13,9 +13,9 @@
 | 
			
		||||
    <mvc:annotation-driven />
 | 
			
		||||
    <mvc:default-servlet-handler />
 | 
			
		||||
 | 
			
		||||
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 | 
			
		||||
    <!-- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 | 
			
		||||
        <property name="prefix" value="/WEB-INF/jsp/" />
 | 
			
		||||
        <property name="suffix" value=".jsp" />
 | 
			
		||||
    </bean>
 | 
			
		||||
    </bean> -->
 | 
			
		||||
 | 
			
		||||
</beans>
 | 
			
		||||
		Reference in New Issue
	
	Block a user