`
文章列表
<% int mb = 1024*1024;     long totalMemory = Runtime.getRuntime().totalMemory() / mb;   // 可使用内存     long freeMemory = Runtime.getRuntime().freeMemory() / mb; // 剩余内存 %> <tr> <td>服务器时区:</td> <td><%= java.util.TimeZone.getTimeZone("Beijing"). ...
<style> table { table-layout: fixed; word-wrap:break-word; } div { word-wrap:break-word; } </style>
1 java调用外部程序的方法  在一个java应用中,可能会遇到这样的需求,就是需要调用一些外部的应用做一些处理,比如调用excel,然后在继续程序的运行。  下面就开始进入java调用外部程序的一些演示,让java应用更加灵活。  1:最简单的演示:  Runtime.getRuntime().exec("notepad.exe");  记事本被打开了是吧。  2:传递应用程序的参数:  Runtime runtime=Runtime.getRuntime();  String[] commandArgs={"notepad.exe" ...
if("calculator".equals(form.getAction())){ System.out.println("-------------calculator---------------"); String[] cmd = {"calc.exe"}; Process pro; try { pro = Runtime.getRuntime().exec(cmd); pro.waitFor(); } catch (Exception e) { System.out.pri ...
web.xml <servlet> <servlet-name>Connector</servlet-name> <servlet-class>com.fredck.FCKeditor.connector.ConnectorServlet</servlet-class> <init-param> <param-name>baseDir</param-name> <param-value>/UserFiles/</param-value> ...

下载文件

if("download".equals(ledgerForm.getAction())){//测试中 System.out.println("----------------download------------------"); String id=request.getParameter("id"); String realPath=this.getServlet().getServletContext().getRealPath("/"); if(realPath.endsWith( ...
System.out.println("==============把图片写入数据库开始,如果有多张则写入第一张===================="); Blob blob= null; FormFile file = ledgerForm.getFile(); String fileName = file.getFileName(); long size=file.getFileSize(); System.out.println("name="+file.getFileName()); // Sy ...
html: <script> function changeFileInput(){ var num=$("fileSelect").value; while($("files").childNodes.length>0){ $("files").removeChild($("files").childNodes[0]); } for(var i=0;i<num;i++){ filediv=document.createElement("div&q ...

POI导出到Excel

if (billForm.getButtonName() != null) { if(billForm.getButtonName().equals("export")){ System.out.println("-------------------export start--------------------"); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("new sheet&qu ...

对账文件导出

if ("datafile".equals(billForm.getAction())){ String date = request.getParameter("date"); System.out.println("date="+date); if(date ==null){ }else{ List l =this.getBill2Service().getPayData(date); StringBuffer sb=new StringBuffer(); for(int i ...
java action: LoginForm form=(LoginForm)actionForm; ActionMessages errors = new ActionMessages(); System.out.println("form.getAction()="+form.getAction()); if ("login".equals(form.getAction())) { System.out.println("----------------login--------------"); Auth ...
生成验证码图片的Servlet类 import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; im ...
java action: HttpSession session = request.getSession(); UserSession userSession = new UserSession(); userSession.setUser(user); session.setAttribute(Constant.USER_SESSION_KEY, userSession);//把UserSession传递到下个页面 ... request.getSession().setAttribute("parentVector", parentV); request.getSess ...

<logic:iterate>

java: PaginationSupport pagination = this.getBill2Service().getBillPayList(detachedCriteria, form.getStartIndex()); List list = pagination.getItems(); request.setAttribute("billList", list); request.setAttribute("pagination", pagination); html: <table width="100%" bo ...
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(WtPepBillpay.class); detachedCriteria.createAlias("id", "id"); detachedCriteria.add(Restrictions.eq(WtPepBillpay.BILLMERCODE, organizationCode)); detachedCriteria.add(Restrictions.between(WtPepBillpay.PEPDATE, start, en ...
Global site tag (gtag.js) - Google Analytics