刘文涛
wentao365 · 共 363 篇文章
jquery tab切换
<div class="login_nav" id="login"> <div class="loginFunc"> <div class="loginFuncDynPw">小说城</div> <div class="loginFuncNormal">军婚小说</div> </div> <div class="loginForm"> <form method="post" action="#" onsubmit="return Dcheck();"> <div style="padding-top:50px;padding-left:25px;"> <a href="https://open…
2015-01-13 12:32 · 网站前台 · 评论(0)
jquery 与 css相关
1: 遍历css 相关dom的值 <script type="text/javascript" src="/js/jquery/jquery-1.8.1.min.js"></script> <a href="tiepian_add.jsp" title="创建贴片"> <button class="button orange1 medium">创建贴片</button> </a> <a href="tiepian_list.jsp" title="贴片列表"> <button class="button orange2 medium">贴片列表</button> </a> <a href="…
打印IP 来源
<% String userAgent = request.getHeader("User-Agent"); if (userAgent != null && userAgent.indexOf("http") == -1 && userAgent.toLowerCase().indexOf("spider") == -1) { String ip = request.getRemoteHost(); IpUtil ipUtil = new IpUtil(); String country = ipUtil.getCountry(ip); String area = ipUtil.getAr…
2014-10-16 22:07 · java基础 · 评论(0)
jstl利用fn截取字符串
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> ${fn:substring(book.summary, 0, 55)} 效果:
2014-10-16 14:47 · JSP · 评论(1)
Mysql异常com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:Communications li
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 6,388 milliseconds ago…
2014-10-06 17:26 · mysql · 评论(1)
js 5秒之内禁止重复提交代码
<script language="javascript"> var checkSubmitFlg = false; function checkSubmit() { if (checkSubmitFlg == true) { alert("正在查询中.."); return false; } checkSubmitFlg = true; setTimeout(function() { checkSubmitFlg = false; }, 5000); return true; } </script> <form method=post action="/search.jsp#m" targ…
2014-09-07 21:35 · 网站前台 · 评论(0)
一对多关系中,查没儿子的记录语句
SELECT B.* FROM tbl_mall_order B WHERE NOT EXISTS (SELECT 'X' FROM tbl_mall_shoping_log C WHERE C.order_no = B.order_no)
2014-09-04 12:05 · oracle · 评论(0)
JAVA抓取网页的图片,JAVA利用正则表达式抓取网站图片
利用java抓取网页上的所有图片: 用两个正则表达式: 1、匹配html中img标签的正则:<img. src=(. ?)*?> 2、匹配img标签中得src中http路径的正则:http:"?(.*?)("|>|\s+) 实现: view plaincopyprint? package org.swinglife.main; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; …
2014-08-27 17:04 · 正则表达式 · 评论(0)
java 写文本换行
import org.apache.commons.io.FileUtils; public static void main(String[] args) throws IOException { File file = new File("c:\\1\\2\\3\\4.txt"); FileUtils.writeStringToFile(file, "1:\r\n", false); FileUtils.writeStringToFile(file, "2:\r\n", true); FileUtils.writeStringToFile(file, "3:\r\n", true); }
2014-08-08 18:34 · java基础 · 评论(0)
linux 设置环境变量
三种配置环境变量的方法 1. 修改/etc/profile文件 如果你的计算机仅仅作为开发使用时推荐使用这种方法,因为所有用户的shell都有权使用这些环境变量,可能会给系统带来安全性问题。 ·用文本编辑器打开/etc/profile ·在profile文件末尾加入: export JAVA_HOME=/usr/share/jdk1.6.0_14 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar ·重新登录 ·注解 a. 你要将 /usr/sha…
2014-08-07 13:32 · linux · 评论(0)
tomcat mysql jndi 配置
<Resource name="jdbc/testDB" //指定的jndi名称,会用于spring数据源bean的配置和ResourceLink的配置 type="javax.sql.DataSource" //数据源床型,使用标准的javax.sql.DataSource driverClassName="com.mysql.jdbc.Driver" //JDBC驱动器 url="jdbc:mysql://localhost:3306/test" //数据库URL地址 username="test" //数据库用户名 password="test" //数据库密码 maxIdle="40…
2014-07-22 10:46 · tomcat · 评论(0)
mysql常用
替换: update book set SUMMARY=REPLACE(SUMMARY,'作者: 分享到: document.getElementById("bdshell_js").src = "http://www.xiaoshuocity.comstatic/js/shell_v2.js?t=" + new Date().getHours();','')
2014-07-10 14:53 · mysql · 评论(0)
DBCP连接池配置示例
<bean id="dataSourceOracle2" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>${jdbc.oralce.driverClassName}</value> </property> <property name="url"> <value>${jdbc.oralce.url}</value> </property> <property name="username"> <value>${jd…
2014-06-17 11:44 · java基础 · 评论(0)
android 权限示例
android 权限示例,考进项目"AndroidManifest.xml"就可用了。 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW">…
2014-05-28 11:01 · android · 评论(0)