当前位置:网站首页>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.jpg
BeanUtils 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
边栏推荐
猜你喜欢
随机推荐
C语言-内存操作函数
电脑录屏的简单方法
UML 类图之间的关系
2022年全国职业技能大赛网络安全竞赛试题B模块自己解析思路(5)
无胁科技-TVD每日漏洞情报-2022-7-30
Lua 字符串
Lua 快速入门(二)——函数(Function)
(二)软件测试理论(*重点用例方法编写)
【LeetCode-278】第一个错误的版本
BaseActvity的抽取
星盟-pwn-fog
网络安全学习小结--kali基本工具、webshell、代码审计
Vulnhub靶机--DC7
【LeetCode-205】同构字符串
Unity3D中所有特殊的文件夹
Unity 使用双缓冲实现一个好用的计时器
无胁科技-TVD每日漏洞情报-2022-7-29
企业怎样申请SSL证书?
C语言-7月21日-指针的深入
轻松理解进程与线程