java中获取图片路径的方法
//获取路径三中方法
//+ f.getOriginalFilename();
//String filedir = Thread.currentThread().getContextClassLoader().getResource("/").getPath()+"/uploads/"+upFileID+"/"+paperFileName;
//ServletActionContext.getServletContext().getRealPath("/uploads/"+upFileID+"/"+paperFileName)
FileInputStream fin = new FileInputStream(f);
String files = Thread.currentThread().getContextClassLoader().getResource("/").getPath()+"upload/";
/*String files = ServletActionContext.getServletContext().getRealPath("/")+"upload/";
System.out.println(ServletActionContext.getServletContext().getRealPath("/"));*/
οnsubmit="return excelIframeCallback(this);"
<form method="post" action="${ctx}/yhpersoninfor/save.action" enctype="multipart/form-data" class="pageForm required-validate" οnsubmit="return iframeCallback(this, dialogAjaxDone);" >
<input type="file" name="file">
/** 保存
* @param request
* @param yhpersoninfor
* @return
*/
@RequestMapping(value = "/save")
public void save(HttpServletResponse response, HttpServletRequest request, @ModelAttribute("yhpersoninfor") YhPersonInfor yhpersoninfor,
@RequestParam("file") MultipartFile file) {
try {
response.setContentType("text/html;charset=Utf-8");
PrintWriter out = response.getWriter();
ReturnInfo returnInfo = new ReturnInfo("200", "保存客户失败");
if (null != yhpersoninfor) {
String userImgName = Upload.uploadImg(request, file, file.getOriginalFilename(), 1, "portrait");//用户头像图片
yhpersoninfor.setZp(userImgName);
yhPersonInforService.saveYhPersonInfor(yhpersoninfor);
returnInfo = new ReturnInfo("200","保存YhPersonInfor成功!");
}
out.write(JSON.toJSONString(returnInfo));
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
<li><a class="icon" href="${ctx}/kfskgl/printAll.action" target="navTab_print" title="收 款 单 账 单" warn="请选择需要打印的账单!"><span>打印</span></a></li>
$("a[target=navTab_print]").each(function(){
$(this).click(function(event){
var $this = $(this);
var title = $this.attr("title") || $this.text();
var print_id = $("#skdzd_print").val();
var url = unescape($this.attr("href")+"?afwsf_id="+print_id).replaceTmById($(event.target).parents(".unitBox:first"));
DWZ.debug(url);
if (!url.isFinishedTm()) {
alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
return false;
}
UTILS.printTabUrl(title, url, 1,1900,1100, "A4", "70%");
event.preventDefault();
});
});
27:Excel格式导出
26:分页打印
24:皮肤颜色
23:居中百分比打印
22:分页打印
18:列表打印
http://localhost:8080/IFCB/order/business_orderLodop.action
http://localhost:8080/IFCB/order/business_orderLodop.action?rid=32');
private List<XmSalesList> xmsalesList;
//根据同行人数 航班/火车 计算出费用金额
$("#orderAddTable .unitBox").find("input.flld").live("change", function(){
//var menNum = $(this).val();
var tr = $(this).closest("tr");
var tds = $(tr).find("td");
var peopleNum = parseInt($(tds).eq(6).find("input").val());
var isFlag = $(tds).eq(7).find("option:selected").val();
//取出类型 通过类型取出最大值 和费用、
var obj = eval("("+$(tds).eq(7).find("option:selected").attr("rel")+")");
var totalAmount="";
if(parseInt(obj.CHARGETYPE)==1){
//1按照人数计算; 2按照次数计算;
if(peopleNum==""){
peopleNum=0;
}
totalAmount = parseFloat(peopleNum)*parseFloat(obj.PRICE);
}else if(parseInt(obj.CHARGETYPE)==2){
//同行人数不能超过最大核定人数
if(peopleNum> parseInt(obj.MAX_NO)){
alert("订单人数不能,超过额定人数"+obj.MAX_NO+" 人!");
$(tds).eq(6).find("input").val(obj.MAX_NO);
}
totalAmount = parseFloat(obj.PRICE);
}
$(tds).eq(8).find("input").val(totalAmount);
totalEnt();
});