原创 html5裏使用ajax提交含有上傳文件的form表單

這裏會用到html5裏的formdata類。 需要添加的js.css: <link rel="stylesheet" type="text/css"href="${pageContext.request.contextPath}/js/j

原创 web項目java後臺將html表格導出爲word表格文件

web環境;spring+jQuery+hibernate  前端jsp文件核心代碼:  <div class="col-sm-10 col-xs-10 col-md-8 col-md-offset-2 text-right" style

原创 用戶上傳用戶頭像至服務器

web框架:spring+hibernate+jQuery HTML代碼: <!-- 上傳頭像開始 --><div class="col-sm-3 userpic"><img src="<c:url value="${user.imgur

原创 web項目啓動不了的最常見的問題之一

如再啓動項目時報如下錯誤: 一般最常見的,也是最容易忽略的問題: JDK的jar包有沒有加到當前這個項目裏,可以通過下面的方法查看該項目是否有指定JDK包: 點擊最上面的工具欄裏的Project選項--點擊clear 之後右鍵點擊這個項目

原创 從服務器下載word文件

web框架:spring+hibernate+jQuery 前端jsp部分代碼:  <div class="container-fluid" style="padding-left: 0px; padding-right: 0px;">

原创 上傳,解析Excel文件並保存數據到數據庫

web框架:spring+hibernate+jQuery HTML端代碼: <div class="file-up-content"> <table id="fileDiv" class="table"><tr><td colspan=

原创 從cookie裏獲取用戶名和密碼,保存密碼功能

web框架:spring+hibernate+jQuery HTML裏的js代碼: <script type="text/javascript"> $(document).ready(function(){ if($.cookie("r

原创 JVM_Bind8081錯誤

錯誤日誌: 三月 15, 2017 9:25:16 上午 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apac

原创 web下載數據成Excel文件時中文亂碼

下載文件的文件名出現亂碼現象。 錯誤寫法:response.addHeader("Content-Disposition","attachment;   filename=/""+ new String(("數據元素簡表").getByt

原创 字段太長,無法錄入數據庫

報錯: 2017-03-13 10:16:43,159 ERROR [org.hibernate.util.JDBCExceptionReporter] - Data truncation: Data too long for colum