使用步驟:
1.在專案上按右鍵->Export
2.General->Ant Buildfiles
3. 選擇要匯出build.xml的專案

4.由於這個檔案是工具產生的,請依自已的需求做修改。
//because quota text box position is out of form $("#quota_input").change(function(){ //do validation by changing value in the text box $("#filesizeForm").validate().element("#quotaType"); });
Process processOnLinux = Runtime.getRuntime().exec("tail -500 " + USR_LOG); reader = new BufferedInputStream(processOnLinux.getInputStream()); reader = new InputStreamReader(processOnLinux.getInputStream(), "UTF-8");
@GET @Path("/{uid}") @Produces(MediaType.APPLICATION_JSON) public Response getUser( @PathParam(value="uid") String uid){ //do sth ResponseBuilder rb = Response.ok(respJSON.toString()); CacheControl cc = new CacheControl(); cc.setNoCache(true); return rb.cacheControl(cc).build(); }
@Override public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { //HttpServletRequest hsresq = (HttpServletRequest) request; HttpServletResponse hsresp = (HttpServletResponse)response; //current request server url(Don't include host and sitename) //String currentURL = hsresq.getServletPath(); hsresp.setHeader("Pragma","no-cache"); hsresp.setHeader("Cache-Control","no-cache,no-store,must-revalidate"); //prevents caching at the proxy server hsresp.setDateHeader("Expires", 0); chain.doFilter(request, response); }在web.xml設定只對jsp的頁面進行filter,
<filter> <filter-name>JSPNoCacheFilter</filter-name> <filter-class>filter.JSPNoCacheFilter</filter-class> </filter> <filter-mapping> <filter-name>JSPNoCacheFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping>Reference:
PreparedStatement stmt = conn.prepareStatement( "select id, name from users where id in (?)"); stmt.setString("1,2,3");However, this will not work. JDBC only allows you to substitute a single literal value in the "?". You can't substitute things that are meant to become part of the SQL statement. This is necessary because if the SQL itself can change, the driver can't precompile the statement. It also has the nice side effect of preventing SQL injection attacks. Instead, you have four options for the implementation:
StringBuilder inClause = new StringBuilder(); boolean firstValue = true; for (int i=0; i < batchSize; i++) { inClause.append('?'); if ( firstValue ) { firstValue = false; } else { inClause.append(','); } } PreparedStatement stmt = conn.prepareStatement( "select id, name from users where id in (" + inClause.toString() + ')'); for (int i=0; i < batchSize; i++) { stmt.setInt(i); // or whatever values you are trying to query by }