我想在html中的同一行显示3个按钮.我尝试了两种选择:这一种:
<div style="width:500px;">
<div style="float: left; width: 130px"><button type="submit" class="msgBtn" onClick="return false;" >Save</button></div>
<div style ="float: none; width: 130px"><button type="submit" class="msgBtn2" onClick="return false;">Publish</button></div>
<div style ="float: right; width: 130px"><button class="msgBtnBack">Back</button></div>
</div>
Run Code Online (Sandbox Code Playgroud)
还有这个:
<p style="float: left; width: 130px"><button type="submit" class="msgBtn" onClick="return false;" >Save</button></p>
<p style ="float: none; width: 130px"><button type="submit" class="msgBtn2" onClick="return false;">Publish</button></p>
<p style ="float: right; width: 130px"><button class="msgBtnBack">Back</button></p>
Run Code Online (Sandbox Code Playgroud)
对于第二个选项,我使用了段落的样式:
<style>
p {display:inline}
</style>
Run Code Online (Sandbox Code Playgroud)
可悲的是,没有一个是好的,我似乎无法找到任何其他选择.第一个和第二个按钮显示在同一行,但第三个按钮显示在较低的位置......你能帮助我吗?
我试图使用扩展HttpServlet的servlet从jsp页面上传一个csv文件.在jsp页面中,我使用的是一个应该调用servlet的ajax.
这是ajax部分:
$(function() {
$(".upldBtn").click(function() {
alert("Upload button pushed");
$.ajax({
type: "POST",
url: contextPath + servletPath,
data: "action=get&custIdList=" + $('#custIdList').val(),
async: false,
dataType: "text/csv; charset=utf-8",
success: function(data){
alert("success");
}
});
});
Run Code Online (Sandbox Code Playgroud)
contextPath和servletPath也被声明,我没有在这里指定它们.
在jsp页面中,我在表格中有这个表格:
<form method="post" action="CSRUploadListServlet" enctype="multipart/form-data">
<input type="file" name="custIdList" id="custIdList" />
<input type="submit" value="Upload" class="upldBtn" />
</form>
Run Code Online (Sandbox Code Playgroud)
在servlet中,我想使用这个doPost方法:
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String methodName = "doPost";
logger.debug("[{}] call", methodName);
// checks if the request actually contains upload file
if (!ServletFileUpload.isMultipartContent(request)) {
PrintWriter writer …Run Code Online (Sandbox Code Playgroud) 我有一些内容存储在变量中,我想在html div中追加内容String.
这是脚本代码:
if ( $( "#eroare" ).val()!="") {
alert("Error 2" + $( "#eroare" ).val());
var aux = $( "#eroare" ).val();
alert("aux="+aux);
$( "#errorSuccess" ).html( "<b>" + aux + "</b>"); //this is not working
}
Run Code Online (Sandbox Code Playgroud)
这是html:
<div id="errorSuccess" >ceva</div>
<div><input type="hidden" id="eroare" value="${sessionScope.errmsg}" /></div>
Run Code Online (Sandbox Code Playgroud) 我有java instanceof的问题.我有一个名为Employee的类和其他几个扩展此类的类,例如 - Manager.我还创建了另一个类EmployeeStockPlan,我想测试instanceof是否正在查找我正在使用的对象.但是当我从新类调用一个方法时,我有这个错误:该方法grantStock(Manager)未定义类型Loader.对不起,我对java中的某些东西不知何故,我希望我不是在问愚蠢的问题.
Employee类:
package com.example.domain;
public class Employee {
private int empId;
private String name;
private String ssn;
private double salary;
public Employee(int empId, String name, String ssn, double salary) { // constructor
// method;
this.empId = empId;
this.name = name;
this.ssn = ssn;
this.salary = salary;
}
public void setName(String newName) {
if (newName != null) {
this.name = newName;
}
}
public void raiseSalary(double increase) {
this.salary += increase;
}
public String …Run Code Online (Sandbox Code Playgroud) html ×2
jquery ×2
ajax ×1
css ×1
instanceof ×1
java ×1
javascript ×1
jsp ×1
servlets ×1
stylesheet ×1