将对象添加到列表中时,我能够看到该对象正在替换列表中的所有值。
请检查下图,并注意for循环中的代码,其中包含列表中对象的重复项。
public static void main(String args[]) {
ArrayList<Modelclass> al = new ArrayList<Modelclass>();
Modelclass obj = new Modelclass();
for (int i = 0; i < 10; i++) {
obj.setName(2 + i);
obj.setRoolno(4 + i);
System.out.println(obj);
//if (!al.equals(obj)) {
al.add(obj);
System.out.println(obj.getName() + "" + obj.getRoolno());
//}
}
}
Run Code Online (Sandbox Code Playgroud)
我试图从 javascript 代码中获取这个 cookie,但它没有显示在控制台中。
document.cookie
Run Code Online (Sandbox Code Playgroud)
我检查了 chrome 设置 cookie,它显示了它的所有数据,cookie 过期显示Expires:当浏览会话结束时
它还说
发送对象:仅安全连接
有什么办法可以得到那个饼干,请告诉我
每当多选下拉列表中的文本发生变化时,我都需要获取该字符。
但 onKeyUp 没有触发。请找到以下代码以供参考...
const options = [
{ label: "option 1", value: 1 },
{ label: "option 2", value: 2 },
{ label: "option 3", value: 3 },
{ label: "option 4", value: 4 }
];
const onKeyUp= e => {
alert(e.target.getAttribute("value"));
};
const onKeyDown = e => {
//alert(e.target.getAttribute("value"));
};
const selectedOption =value=>{
alert(value);
}
return (
<div className="App">
<Select options={options} onKeyUp={onKeyUp} onKeyDown={onKeyDown} onChange={selectedOption} />
</div>
);
Run Code Online (Sandbox Code Playgroud) 我将节点项目部署到heroku,它说应用程序错误
以下是快递文件
var express = require('express'),
http = require('http');
var bodyParser = require('body-parser');
var app = express()
.use(bodyParser.urlencoded())
.use(express.static(__dirname + '/public'))
.use('/node_modules', express.static(__dirname + '/node_modules'));
Run Code Online (Sandbox Code Playgroud)
以下是heroku的日志
2016-03-20T09:21:02.381628+00:00 heroku[web.1]: State changed from crashed to starting
2016-03-20T09:21:03.470949+00:00 heroku[web.1]: Starting process with command `npm start`
2016-03-20T09:21:06.258287+00:00 app[web.1]:
2016-03-20T09:21:06.321039+00:00 app[web.1]: ^
2016-03-20T09:21:06.258314+00:00 app[web.1]: > node server.js
2016-03-20T09:21:06.258312+00:00 app[web.1]: > mean-app@1.0.0 start /app
2016-03-20T09:21:06.258314+00:00 app[web.1]:
2016-03-20T09:21:06.321038+00:00 app[web.1]: throw err;
2016-03-20T09:21:06.321061+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:339:15)
2016-03-20T09:21:06.321032+00:00 app[web.1]: module.js:341
2016-03-20T09:21:06.321061+00:00 app[web.1]: at Function.Module._load (module.js:290:25)
2016-03-20T09:21:06.321044+00:00 app[web.1]: …Run Code Online (Sandbox Code Playgroud) arraylist ×1
collections ×1
cookies ×1
core ×1
express ×1
heroku ×1
html ×1
java ×1
javascript ×1
node.js ×1
react-select ×1
reactjs ×1