test lzz

springboot-pom.xml---------------------------------------------------------------------------------------------

<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.lzz</groupId>
  <artifactId>springboot-jsp</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
  </parent>
  
  <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
  
  <dependencies>
  <!-- web支持: 1、web mvc; 2、restful; 3、jackjson支持; 4、aop ........ -->
   <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-web</artifactId>
   </dependency>
   <!-- spring boot devtools 依赖包. -->
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <optional>true</optional>
   <scope>true</scope>
</dependency>
   <!-- servlet依赖. -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- 引入jstl的依赖 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- tomcat的支持.-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- 添加Spring boot的插件 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
            <!-- 热部署生效 -->
               <fork>true</fork>
            </configuration>
</plugin>
<!-- 资源文件拷贝插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>


pom.xml-----------------------------------------------------------------------------------------------------------

<dependencies>
  <dependency>
  <groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.1</version>
  </dependency>
  <dependency>
<groupId>commons-io</groupId>
   <artifactId>commons-io</artifactId>
   <version>1.3.2</version>
</dependency>
  <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<!-- JSP相关 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- 配置Tomcat插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/</path>
<port>8080</port>
    </configuration> 
</plugin>
<!-- java编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>

</build>

springmvc.xml-------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
    http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-4.2.xsd">

<!-- 加载配置文件 -->
<context:property-placeholder location="classpath:config/*.properties" />

<!-- 配置注解驱动 :处理器适配器和映射器就不用在配置-->
<mvc:annotation-driven />

<!-- 配置包扫描器,扫描@Controller注解的类 -->
<context:component-scan base-package="obs.controller"/>

<!-- 视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>

<!-- 配置静态资源映射 -->
<mvc:default-servlet-handler/>

<!-- 配置multipart的解析器:文件上传 -->
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="defaultEncoding" value="UTF-8"/>
    <!-- <property name="maxUploadSize" value="5242880"/> -->
    </bean>

</beans>

web.xml--------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">  
  <display-name>obs_manager</display-name>


  <!-- 加载spring的配置文件 -->
  <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:spring/applicationContext-*.xml</param-value>
  </context-param>
  <!-- 配置spring的监听器 -->
  <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  
  <!-- springMVC前端控制器_RESTful风格 -->
  <servlet>
  <servlet-name>obs_manager</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:spring/springmvc.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
  </servlet> 
  <servlet-mapping>
  <servlet-name>obs_manager</servlet-name>
  <url-pattern>/</url-pattern>
  </servlet-mapping>
  
  <!-- post乱码过滤器 -->
  <filter>
  <filter-name>CharacterEncodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
  <param-name>encoding</param-name>
  <param-value>utf-8</param-value>
  </init-param>
  </filter>
  <filter-mapping>
  <filter-name>CharacterEncodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
  </filter-mapping>
  
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  
</web-app>

login.jsp--------------------------------------------------------------------------------------------------------

<head>
    <title>login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" href="../css/table.css" rel="stylesheet"/>
<script src="../js/table.js"></script>
</head>


<body>
    <div>
        <form method="post" action="../login">
            <table>
                <tr>
                <td></td>
                    <td><label>${msg}</label></td>
                <tr>
                    <td>Username:</td>
                    <td><input type="text" name="username"></td>
                </tr>
                <tr>
                    <td>Password:</td>
                    <td><input type="password" name="password"></td>
                </tr>
                <tr>
                    <td>Login:</td>
                    <td><input type="submit" value="Login"/></td>
                </tr>
            </table>
        </form>
    </div>
</body>

index.jsp------------------------------------------------------------------------------------------------------------

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Table</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" href="../css/table.css" rel="stylesheet"/>
    <script type="text/javascript" src="../js/table.js"></script>
</head>


<body>
    <table>
        <th>
            <tr><h3>OBS_Simple_Demo</h3></tr>
        </th>
        <tr>
            <td>
                <form method="post" enctype="multipart/form-data" action="../obs/upload">
                    <input type="file" name="file"/>
                    <input type="submit" value="上传"/>
                </form>
            </td>
        <td>
            <form method="get" action="../obs/search">
               <input type="text" name="fileName" />
               <input type="submit" value="查询"/>
            </form>
            </td>
        </tr>
        <tr></tr><tr></tr><tr></tr>
        <tr>
            <table class="altrowstable" id="alternatecolor">
                <tr align="left">
                    <th width="300">名称</th>
                    <th width="150">存储类型</th>
                    <th width="150">大小</th>
                    <th width="250">修改时间</th>
                    <th width="150">区域</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${list }" var="file">
<tr>
<TD>${file.fileName }</TD>
<TD>${file.property }</TD>
<TD>${file.fileSize }</TD>
<TD>${file.updatetime }</TD>
<TD>${file.category }</TD>
<TD>
<a href="../obs/download/${file.fileName }">下载</a>
</TD>
</tr>
</c:forEach>
            </table>
    </table>


</body>

</html>


table.css------------------------------------------------------------------------------------------------------------------

table.altrowstable {
    font-family: verdana,arial,sans-serif;
    font-size:11px;
    color:#333333;
    border-width: 1px;
    border-color: #a9c6c9;
    border-collapse: collapse;
}
table.altrowstable th {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #a9c6c9;
    background-color: #E1E4E5;
}
table.altrowstable td {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #a9c6c9;
}
td {
    height: 30px;
    white-space: nowrap;
}
.evenrowcolor {
    background-color:#F7F8F8;
}
div {
    border-radius: 20px;
    width: 300px;
    height: 350px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);

}


table.js------------------------------------------------------------------------------------------------------------

function altRows(id) {
    if (document.getElementsByTagName) {
        var table = document.getElementById(id);
        var rows = table.getElementsByTagName("tr");
        for (var i = 0; i < rows.length; i++) {
            if (i % 2 == 0) {
                rows[i].className = "evenrowcolor";
            }
        }
    }
}

window.onload = function () {
    altRows('alternatecolor');
}

LoginController---------------------------------------------------------------------------------------------------------

@Controller
public class LoginController {

@Autowired
private ObsService obsService;

@RequestMapping("/")
public String login() {
return "login";
}

@RequestMapping(value="/login", method=RequestMethod.POST)
public String index(String username, String password, Model model) {
if (!username.equals("zhangsan")) {
model.addAttribute("msg", "username error");
return null;
}
if (!password.equals("123")) {
model.addAttribute("msg", "password error");
return null;
}
model.addAttribute("list", obsService.getFileList());
return "index";
}

}


ObsController--------------------------------------------------------------------------------------------------------------

@Controller
@RequestMapping("/obs")
public class ObsController {

@Autowired
private ObsService obsService;


@RequestMapping(value="/upload", method=RequestMethod.POST)
public String uploadUserPic(@RequestParam("file") MultipartFile file, Model model) {

//获取原始名称
String originalFilename = file.getOriginalFilename();
if (file != null && originalFilename != null && originalFilename.length()>0) {
System.out.println("file name is null-------------");
model.addAttribute("msg", "文件格式错误");
return "index";
}
System.out.println("file name is : " + originalFilename);
//生成新的名称
String newFilename = "new file" + originalFilename.substring(originalFilename.lastIndexOf("."));
//创建新的图片文件
File newFile = new File("D:/temp/" + newFilename);
//将内存中的图片数据写入磁盘(即上传到服务器端)
try {
file.transferTo(newFile);
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
System.out.println("upload success ----------------");
return "index";
}

@RequestMapping(value="/search", method=RequestMethod.GET)
public String search(@RequestParam String fileName, Model model) {
if (fileName == null || fileName.length() == 0) {
model.addAttribute("list", obsService.getFileList());
return "index";
}
if (fileName.equals("testName1")) {
model.addAttribute("list", obsService.getFile());
return "index";
}
return "index";
}
}

TestFile-------------------------------------------------------------------------------------------------------------

private String fileName;
private String fileSize;
private String updatetime;
private String category;

private String property;

ObsService---------------------------------------------------------------------------------------------------------

@Service
public class ObsService {


public List<TestFile> getFileList() {
List<TestFile> list = new ArrayList<>();
for (int i = 0; i < 10; i++) {
TestFile file = new TestFile();
file.setFileName("testName" + i);
file.setFileSize("2" + i);
file.setUpdatetime("2012-12-12");
file.setCategory("cn-earth-2");
file.setProperty("可读写");
list.add(file);
}
return list;
}

public List<TestFile> getFile() {
List<TestFile> list = new ArrayList<>();
TestFile file = new TestFile();
file.setFileName("testName1");
file.setFileSize("222");
file.setProperty("haha");
file.setUpdatetime("2012-12-12");
file.setCategory("789789");
list.add(file);
return list;
}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
东南亚位于我国倡导推进的“一带一路”海陆交汇地带,作为当今全球发展最为迅速的地区之一,近年来区域内生产总值实现了显著且稳定的增长。根据东盟主要经济体公布的最新数据,印度尼西亚2023年国内生产总值(GDP)增长5.05%;越南2023年经济增长5.05%;马来西亚2023年经济增速为3.7%;泰国2023年经济增长1.9%;新加坡2023年经济增长1.1%;柬埔寨2023年经济增速预计为5.6%。 东盟国家在“一带一路”沿线国家中的总体GDP经济规模、贸易总额与国外直接投资均为最大,因此有着举足轻重的地位和作用。当前,东盟与中国已互相成为双方最大的交易伙伴。中国-东盟贸易总额已从2013年的443亿元增长至 2023年合计超逾6.4万亿元,占中国外贸总值的15.4%。在过去20余年中,东盟国家不断在全球多变的格局里面临挑战并寻求机遇。2023东盟国家主要经济体受到国内消费、国外投资、货币政策、旅游业复苏、和大宗商品出口价企稳等方面的提振,经济显现出稳步增长态势和强韧性的潜能。 本调研报告旨在深度挖掘东南亚市场的增长潜力与发展机会,分析东南亚市场竞争态势、销售模式、客户偏好、整体市场营商环境,为国内企业出海开展业务提供客观参考意见。 本文核心内容: 市场空间:全球行业市场空间、东南亚市场发展空间。 竞争态势:全球份额,东南亚市场企业份额。 销售模式:东南亚市场销售模式、本地代理商 客户情况:东南亚本地客户及偏好分析 营商环境:东南亚营商环境分析 本文纳入的企业包括国外及印尼本土企业,以及相关上下游企业等,部分名单 QYResearch是全球知名的大型咨询公司,行业涵盖各高科技行业产业链细分市场,横跨如半导体产业链(半导体设备及零部件、半导体材料、集成电路、制造、封测、分立器件、传感器、光电器件)、光伏产业链(设备、硅料/硅片、电池片、组件、辅料支架、逆变器、电站终端)、新能源汽车产业链(动力电池及材料、电驱电控、汽车半导体/电子、整车、充电桩)、通信产业链(通信系统设备、终端设备、电子元器件、射频前端、光模块、4G/5G/6G、宽带、IoT、数字经济、AI)、先进材料产业链(金属材料、高分子材料、陶瓷材料、纳米材料等)、机械制造产业链(数控机床、工程机械、电气机械、3C自动化、工业机器人、激光、工控、无人机)、食品药品、医疗器械、农业等。邮箱:market@qyresearch.com

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值