List<Foo> results = null;
results = this.getResults();
if (results == null || results.size() == 0)
{
LOGGER.warn("results empty");
}
else
{
LOGGER.warn("results:" + results.toString());
}
Run Code Online (Sandbox Code Playgroud)
getResults返回空List 时,上面的代码总是产生以下输出.
results:[null]
Run Code Online (Sandbox Code Playgroud)
我需要响应这个空方案,但不知道如何捕获它.
我的插入方法有什么问题?我的表有两列,名称,艺术家和时间戳,实际上,我如何将时间戳参数传递给insert语句?
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
/*FileWriter dir = new FileWriter(nameOfSong.getText()
+ ".txt");
BufferedWriter buffer = new BufferedWriter(dir);
buffer.write(nameOfSong.getText());
buffer.newLine();
buffer.write(artist.getText());
buffer.newLine();
buffer.newLine();
buffer.write(lyrics.getText());
buffer.close();
*/
Statement statement = connection.createStatement();
statement.executeUpdate("INSERT INTO lyrics1_lyrics1 VALUES(" +
nameOfSong.getText() + ", " + artist.getText() + "");
} catch (Exception z) {
System.err.println("Error: " + z.getMessage());
}
internalFrame.dispose();
}
});
)
Run Code Online (Sandbox Code Playgroud) 我有一个单选按钮,如果用户单击其内部的 div,我希望可以选择该按钮。我有一个 div 的点击事件,但我似乎无法检查单选按钮。
继承人我的代码:
var new_div = document.createElement('div');
new_div.setAttribute('id', 'controlDiv');
new_div.setAttribute('class', 'ansClass');
var newAnswer = document.createElement('input');
newAnswer.setAttribute('type', 'radio');
newAnswer.setAttribute('name', 'choice');
newAnswer.setAttribute('class', 'radioButton');
$(newAnswer).attr("id", "button"+j);
var newLabel = $("<label>", {id: "label"+j, class: "ansLabel", text: "answer"+j});
$(new_div).append(newAnswer);
$(new_div).append(newLabel);
$( "#controlDiv" ).click(function() {
var radButton = $(this).find('input[type=radio]');
radButton.click();
// $(radButton).attr("checked", "checked");
});
Run Code Online (Sandbox Code Playgroud) $(document).ready(function () {
$.ajax({
type: 'POST',
url: 'http:abc/public/aditya/eJewelry/get_store_details.php?store_id=udb1001',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert(data);
}
});
});
Run Code Online (Sandbox Code Playgroud)
我正在向该网址发送请求并获得回复: -
[{
"id": "22",
"storename": "Unique Diamond Boutique",
"email": "croberts@uniquediamondboutique.com",
"storeimage_ipad": "",
"website": "www.uniquediamondboutique.com",
"store_code": "udb1001",
"street_address": "157 E New England Avenue\nSuite 202\n",
"country": "US",
"zipcode": "32789",
"state": "FL",
"city": "Winter Park",
"email_sales": "croberts@parkavegold.com",
"personal_phone": "407-312-6768",
"company_phone": "407-218-5958",
"image": "store_22.png",
"status": "1",
"paypal_email": "croberts@uniquediamondboutique.com",
"moreAddress": [{
"street_address": "123 main st",
"city": "MIAMI",
"state": "FL",
"zipcode": "33106",
"country": "", …Run Code Online (Sandbox Code Playgroud) 我当前接受整数的验证器是
$( "#UserForm" ).validate({
rules: {
contact: {
required: true,
number: true,
minlength: 6,
}
}
});
Run Code Online (Sandbox Code Playgroud)
它工作正常
但现在我想改变它以便也接受空间.
我的代码应该是什么?请帮助我在jquery中初学者
我们都知道IE在打开html和渲染css文件方面有很多问题.
我希望IE在打开页面时不显示任何内容.
我怎样才能做到这一点?