Time of Update: 2018-07-20
如果想將struts2 action中的某個對象,鏈表或是字串傳到jsp頁面,只需在action中定義 這個對象,鏈表或字串,然後產生get,set方法。這樣頁面就可以擷取了。例如: public class LoginAction extends ActionSupport{private User user; // 對象private String username; // 字串public List list = new LinkedList();// 鏈表public
Time of Update: 2018-07-20
1.建立Image.jsp檔案,如下: <%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*"%> <%!Color getRandColor(int fc, int bc) {
Time of Update: 2018-07-20
象普通的java程式一樣,可以把異常引入到 jsp中。如果在執行 jsp的java代碼時發生異常,可以用下面的指令將http請求轉寄給另一個專門處理異常的網頁: <%@ page errorPage=" errorpage. jsp"%> 在處理異常的網頁中,應該通過如下語句將該網頁生命為異常處理網頁 <%@ page isErrorPage="true"%>
Time of Update: 2018-07-20
日曆: <%@page contentType="text/html;charset=GBK"%><%@page import="java.util.Calendar"%><%//@page errorPage="handleErrorPage.jsp"%> <div align=center style="position: absolute; top: 12%;
Time of Update: 2018-07-20
有兩種傳參方式 一、get方式: 這種方式將參數寫在url中,舉例來說,如果目標傳參頁面是target.jsp,那麼在url裡可以這麼寫: http://..../target.jsp? <Param1> = <value1> & <Param2> = <value2> &...
Time of Update: 2018-07-20
在JSP中使用 FCKeditor 1.1運行庫 commons-fileupload-1.1.jar FCKeditor-2.3.jar 1.2編輯器版本 FCKeditor 2.0 FCKeditor 是一套線上編輯器,它幾乎囊括了現在網上所有的線上編輯器的功能,功能的實現相當完善,同時可自由定製功能按鈕,支援多種語言環境下配置安裝 1.3使用步驟 1.3.1 Web 應用程式目錄結構
Time of Update: 2018-07-20
IT程式員開發必備-各類資源下載清單,史上最全IT資源,個人收藏總結。 Developer's Guide : http://docs.cksource.com/CKEditor_3.x/Developers_Guide ----Java Integration Guide : CKEditor for
Time of Update: 2018-07-20
js,jsp--前端開發過程中瀏覽器及其版本的判定 在網上尋找瀏覽器及版本判定方法有好多,此處小弟總結一二,以節省大家時間。 1.jquery的方法: 通過Regex可判定常用瀏覽器及其版本。 function allinfo(){ var ua = navigator.userAgent; ua = ua.toLowerCase(); var match = /(webkit)[ \/]([\w.]+)/.exec(ua) ||
Time of Update: 2018-07-20
學習J2EE至今,項目也只做了兩個,中途遇到一些問題,最多的可能要數中文顯示及插入資料庫的中文問題。現總結如下: (一)定義中文轉換方法: 建立JSP頁面,命名為toChinese.jsp 也可以是別的; 定義方法為: <%! String toChinese(String str) { String rs = null; byte[] temp; try {
Time of Update: 2018-07-20
如果我可以將jsp動態網頁轉換成靜態頁面,那麼訪問的時候就不需要頻繁的訪問資料庫了。 jsp 顯示內容緩衝技巧 前段時間做自己社區的論壇,在jive 的基礎上做一個頁面顯示所有論壇的文章,可以稱 之為總版,模仿forum 類的介面做個superforum 並且實現cachable,不過因為這個頁面 重新整理量比較大,雖然被cache 了,我還是想辦法進行頁面的緩衝,感覺用jsp 產生的html 靜態內容當緩衝,頁面訪問速度應該有所提高。
Time of Update: 2018-07-20
一、springmvc 配置預設路徑 1.預設tomcat容器的預設頁面。 /index.html 這種方式適合訪問靜態頁面(也包括JSP)或者說是沒有任何參數的頁面。 或者配置web.xml中的welcome-file-list <welcome-file-list><welcome-file>index.html</welcome-file>
Time of Update: 2018-07-20
tomcat+jsp不支援中文顯示原因:1 tomcat內部設定,不支援中文顯示html和html檔案 2 jsp頁面中沒有設定中文內碼 解決方案:1 所有html,htm檔案都改成jsp尾碼,並且在頭部加上<%@page contentType="text/html"%><%@page
Time of Update: 2018-07-21
MyEclipse設定JSP頁面預設編碼方式: windows(視窗)-Preferences(喜好設定)-MyEclipse-Files & Editors-JSP-右側encoding:設定為ISO10646/Unicode(UTF-8) MyEclipse在Java檔案中設定作者、日期等說明: windows(視窗)-Preferences(喜好設定)-Java-Code Style(代碼樣式)-Code
Time of Update: 2018-07-20
struts2中action如何擷取jsp頁面參數 1. ActionContext 在Struts2開發中,除了將請求參數自動化佈建到Action的欄位中,我們往往也需要在Action裡直接擷取請求(Request)或會話(Session)的一些資訊,甚至需要直接對JavaServlet
Time of Update: 2018-07-25
轉自: http://yafei.iteye.com/blog/1087502 例如: <a href= "upload\admin\51\姓名.txt " target= "_blank " > 姓名.txt </a>
Time of Update: 2018-07-26
<jsp:include page="callee.jsp" /> <jsp:param name="param2" value="value2" /> <jsp:param name="param3" value="value3" /> </jsp:include> include指令是靜態引入的;
Time of Update: 2018-07-26
jsp中下載Excel 此處使用JavaScript的open()函數,後台使用jxl動態產生Excel檔案流。 前台:window.opne("downExcelAction"); 後台: public void downExcelAction() throws RowsExceededException, WriteException{ System.out.println("【匯出EXCEL表格】");
Time of Update: 2018-07-27
1.從一個jsp頁面跳轉到另一個jsp頁面時的參數傳遞 (1)使用request對象擷取用戶端提交的資訊 login.jsp頁面代碼如下: [java] view plain copy
Time of Update: 2018-07-27
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/
Time of Update: 2018-07-27
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <fmt:formatDate value="<%=new Date() %>" pattern="yyyy年MM月dd日HH點mm分ss秒" /> 我的應用程式情境: springmvc