Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext
在pom.xml里加入servlet依賴:
<!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
macos sierra 的問題
mysql5.7支持json
必須在類屬性中事先把這個對象創(chuàng)建出來,在構(gòu)造函數(shù)中設(shè)定這個屬性的值。
from flask_wtf import FlaskForm
class Auth(FlaskForm):
selects = SelectField('selects')
def __init__(self):
super(Auth, self).__init__()
self.selects.choices = [('value', 'text'), ('value', 'text')]
cpu 和 goroutine 默認(rèn)情況下并不是 1:1 的關(guān)系,對各個 goroutine 的調(diào)度是 go runtime 的調(diào)度器決定的
function async2() {
console.log( 'async2');
}
async function async1(resolve) {
await setTimeout(function () {
console.log("settimeout");
//當(dāng)我認(rèn)定async1完成后才開始async2
resolve()
},0);
}
new Promise(function (resolve) {
async1(resolve)
}).then(function () {
async2()
});
或者
new Promise(function (resolve) {
async1()
resolve()
}).then(function () {
async2()
});
其實就是創(chuàng)建數(shù)組,數(shù)組每一項就是一個函數(shù), a[n]() 執(zhí)行數(shù)組里的第N個函數(shù)
例如:
var a = []; //創(chuàng)建數(shù)組賦值
a[1] = function () {
console.log(1);
};
a[2] = function () {
console.log(2);
};
a[3] = function () {
console.log(3);
};
//a =[a[1],a[2],a[3]]
a[3]() // 3
感謝這位大神,寫的都很清楚了,http://blog.csdn.net/xu122723...。
問題的主要原因是,雖然tomcat已經(jīng)攔截了404,并指向了我的index頁面,但是這個404的標(biāo)記還是存在,只要遇見存在404錯誤頁處理的平臺,就gg了。就比如微信平臺,他檢測到你的404,就立馬跳向公益404頁面了。
解決方法一:后臺設(shè)置攔截器,在發(fā)送任何請求前,后臺都做攔截,并指向index頁面。
解決方法二:用nginx進行攔截,修改nginx.conf文件
http {
# 此處省略好多字
server {
# nginx才配使用80端口,其他服務(wù)速速離去
listen 80;
# 沒啥好解釋的
server_name localhost;
# 指定根目錄,由于我的前端項目是直接放在nginx下的html文件夾,所以我這樣配
root html;
# 這里其實是由if變過來的,意思是如果uri存在,那就訪問uri的資源,如果uri不存在,那就訪問該目錄下index.html文件。如果看不懂我的解釋,可以看這個https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#front-controller-pattern-web-apps
try_files $uri $uri/ /index.html;
# 這里是配你Tomcat里面的其他java項目,意思是當(dāng)你訪問http://ip/xxx的時候,會到這個代碼塊里面進行對應(yīng)操作
location /xxx {
# 這些照著加就好了,無非是獲取服務(wù)器host/ip相關(guān),一定要加,否則如果你的項目并不是前后端分離,而是SSH/SSM帶有jsp或者模板頁面的,那就會出現(xiàn)找不到css/js等找不到一切靜態(tài)資源文件的錯誤。為什么會報錯,因為你看network面板你就知道,他是去訪問http://127.0.0.1/xxx/css...而并不是訪問服務(wù)器的真實ip,所以還是乖乖加上吧!
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 去該地址去找項目資源
proxy_pass http://127.0.0.1:8080/xxx;
}
}
}
先去了解下socket的原理再說,socket客戶端和服務(wù)端是怎么交互的
對Struts 不熟悉
把button的默認(rèn)padding去掉 padding:0px
You can use iptables's filter table not nat table
exec 就可以
建一個任務(wù)數(shù)組,并監(jiān)聽這個數(shù)組對象,sts不存在時將需要執(zhí)行的回調(diào)存起來,ready完成和數(shù)組變化時都去檢查任務(wù)隊列長度 依次調(diào)用回調(diào) 回調(diào)然后在任務(wù)隊列數(shù)組刪除該回調(diào) 這樣你就不用去管他是否加載了,沒加載就會把任務(wù)依次掛起,加載完成了就會先把一個任務(wù)放進任務(wù)隊列,然后立即拿出來執(zhí)行
linux 和 windows 的文件系統(tǒng)是不同的。
我不是很懂這個 solr
技術(shù),但我覺得可能是文件系統(tǒng)的不同造成的錯誤。
在路由中使用重定向試試,匹配到有#!
的重定向到現(xiàn)有的項目路由上,并且把參數(shù)也帶上。 當(dāng)然,這是我的猜想,我也沒具體實現(xiàn)過這種情況。
目前找到一個添加用戶的方法,用guest登錄http://127.0.0.1:15672
在Admin欄目下有一個ADD a USER 可以添加一個新的用戶,并給他設(shè)置權(quán)限
pool.getConnection
跟connection.query
如果沒有promise/async寫法的話,你就手動實現(xiàn)各promise吧。
function search(searchtext) {
return new Promise((resolve, reject) => {
var resdata = {};
if (safetytest(searchtext)) {
pool.getConnection(function (err, connection) {
if (err) reject(err); // reject
connection.query(
function (err, result) {
if (err) reject(err); // reject
resdata = {
};
resolve(resdata); // resolve
}
);
});
}
})
}
有的話可能就是這樣了。
async function search(searchtext) {
var resdata = {};
// 安全檢查
if (safetytest(searchtext)) {
try {
const connection = await pool.getConnection()
const resdata = await connection.query()
return resdata
} catch (err) {
throw err
}
}
}
兩個 input 相同 v-model blur 引起的吧
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團,成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。