我有这样的事情:
POD-1
|
-------------------------
?|? ?|? ?|?
service-1 service-2 service-3
Run Code Online (Sandbox Code Playgroud)
如何从pod中的服务器与服务后面的pod中的其他服务器进行通信?
因此,在我的课堂上,我被下令将图像上传到数据库,并将其发布并显示在网站上,使用servlet或php时非常简单,但是我被要求仅使用JSP文件来完成。为此,我必须从用户那里获取图像并将其作为参数传递并获得参数的一部分,这不是问题。
当我尝试运行它并且服务器要求@multipartconfig注释时,问题就开始了。我找不到将其添加到jsp代码中的方法。
<%@page import="javax.servlet.annotation.MultipartConfig"%>
<%@page import="java.sql.*"%>
<%@page import="java.io.InputStream"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
Part p = request.getPart("image");
InputStream inputStream = null;
if (p != null) {
inputStream = p.getInputStream();
}
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/test42";
Class.forName(driver);
Connection con = DriverManager.getConnection(url, "root", "1234");
String sqlString = "INSERT INTO test42.images items(idimages) values(" + inputStream + ");";
String msg = p.toString();
%>
Run Code Online (Sandbox Code Playgroud)
<form method="post" action="mainPage.jsp" enctype="multipart/form-data">
choose file :
<input type="file" name="image" />
<input type="submit" value="submit">
</form>
Run Code Online (Sandbox Code Playgroud)
这是来自服务器的消息: …
我正在尝试添加pre-commit
脚本。
该脚本有效,但 git 忽略了对文件的更改,似乎 git 忽略了我.git
在.gitignore
.
例如:
# add a hook that runs hello world
echo "#\!/bin/sh \n echo 'hello world'" > .git/hooks/pre-commit
# make the hook runnable
chmod +x .git/hooks/pre-commit
# check changes
git status
# > Your branch is up to date with 'origin/master'.
# > nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)
因此,我如何将钩子提交到存储库?