当前位置:网站首页>Project Notes - Random 2
Project Notes - Random 2
2022-08-11 06:56:00 【kerodaisuki】
1. Upload the image to the tomcat server
Deploy the project to webapps
Adapt the deployment method to war mode and deploy the project under the webapps of tomcat
Two ways to deploy projects in Idea
war mode: upload the project to the webapps directory in the form of a wai package;
war exploaded mode: just the mapping of the directory, it is equivalent to tomcat starting in the project source folder
Create upload directory in webapps
The upload directory is specially used to save uploaded pictures
Upload image to server
Modify the output path of the image
1. Get the running directory information of the project
2. Intercept the directory path to webapps
3. Splice the output path and save the image to upload
Page Loading Image
When using tomcat as an image server, after storing the uploaded image, if you want the image to be accessible, you need to configure it in the idea:
1. Select extend source

Select the upload folder in the webapps directory
2. Upload a picture to the server
3. Load pictures on the internal page of the project

4. It can also be accessed through HTTP
http://localhost:8080/upload/xxxxxxxxx.jpgBeanUtils Tools
BeanUtils is one of the members of Apache commons components, mainly used to simplify the operation of JavaBean package data.All data submitted by a form can be encapsulated into JavaBeans.
. BeanUtils Object Common Methods
populate(Object bean, Map properties) : Encapsulate the Map data into the specified javabean, generally used to encapsulate all the data of the form into the javabean
setProperty(Object obj , String name ,Object value) : set property value
getProperty(Object obj , String name): get the property value
边栏推荐
猜你喜欢
随机推荐
BaseActvity的抽取
SSL证书为什么要选付费?
Lua 快速入门(一)——基础语法
Error in render: “TypeError: Cannot read properties of undefined (reading ‘commentsContent‘)“
无胁科技-TVD每日漏洞情报-2022-7-25
IP证书申请
Redis学习笔记【四】完结
【LeetCode-205】同构字符串
无胁科技-TVD每日漏洞情报-2022-8-4
本地服务配置内网穿透实现微信公众号整合
无胁科技-TVD每日漏洞情报-2022-7-31
将UI的点击事件渗透下去
无胁科技-TVD每日漏洞情报-2022-7-30
Apache APISIX 默认密钥漏洞复现
【LeetCode-455】方法饼干
无胁科技-TVD每日漏洞情报-2022-8-2
C-8月1日-递归与动态内存管理
CLR via C# 第一章 CLR的执行模型
无胁科技-TVD每日漏洞情报-2022-8-8
分布式事物学习









