Time of Update: 2018-12-03
hibernate的學習參考手冊http://d.download.csdn.net/fd3/aHR0cDovL2RsMi5jc2RuLm5ldC9kb3duMS8yMDA3MTIxMS8xMTIzMTkxNzI2MS5jaG0=!305892 使用add(串連db了),自動產生SessionFactory切換到myeclipse hibernate透視圖,串連資料庫後,點擊表,建立表的bean和映射(*.hbm.xml)執行個體package my;import
Time of Update: 2018-12-03
再學習1的基礎上使用DB整合塊包括檔案DBOptions.properties(修改資料庫的串連)Option.javaConnectionManager.javaDBConnection.javaDBOperate.java(以後就只使用DBOperate就可以了)再次說明,這裡的hibernate.cfg.xml只是擺設,沒有用來串連資料庫,這裡是在ConnectionManager.javaDBConnection.java中使用資料庫連接池進行串連的. 使用執行個體<%@
Time of Update: 2018-12-03
在小視窗中開啟,並可以執行action<script> function addToBag() { window.open("#","successToBag","height=300,width=200,toolbar=no,menubar=no,scrollbars=yes"); document.getElementById("bookForm:addBookBag").click();
Time of Update: 2018-12-03
初學Struts的人一定遇到過中文的亂碼問題 ,目前解決的方法有很多。我這有兩種經典的方法和大家分享。1,重寫 RequestProcessor 這是最簡單的方法。 public class MyRequestProcessor extends RequestProcessor { @Override protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse
Time of Update: 2018-12-03
現在我們要做的是去下載JK2,由JK2負責IIS和Tomcat的通訊, 重新啟動IIS,此時開啟http://localhost/,比較一下,和開啟http://localhost:8080/吧???大功告成也!!! 別忙,開啟http://localhost/jsp-examples/看看,是不是打不開啊???此時還需要在IIS中建立虛擬目錄jsp-examples,本地路徑為:C:/Program Files/Apache Software Foundation/Tomcat
Time of Update: 2018-12-03
使用struts標籤 註冊頁面:reguser.jsp <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/Struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/Struts-html.tld"
Time of Update: 2018-12-03
JSF是一個新的基於MVC模型的web應用程式框架技術。在概念和特徵方面,尤其是組件方面,超過了著名的Struts架構。而Myfaces是Apache軟體基金的一個項目,它實現了JSF架構。同樣sun公司也有一個參考實現 JSF RI。但是myfaces比JSF RI提供了更多的組件和特徵。Myfaces組件是一套用於JSF的組件,裡面的tomahawk包(t標籤)包含了豐富的組件,只需要幾個簡單的標籤就可以實現一些很有用的功能。例如:樹,檔案的上傳下載,日曆
Time of Update: 2018-12-03
一 A:使用struts,在Action中能否向jsp頁的java變數傳值? 如: test.jsp <% String test = new String(); %> testAction: String aa = "123"; 如何將aa的值傳到test.jsp中,賦於test?? Q:在action中, String aa = "123";
Time of Update: 2018-12-03
非常重要,很好。。。。1.JSF 組件模型JSF 組件模型與 AWT GUI 組件模型類似。它有事件和屬性,就像 Swing 組件模型一樣。它也有包含組件的容器,容器也是組件,也可以由其他容器包含。從理論上說,JSF 組件模型分離自 HTML 和 JSP。JSF 內建的標準組件集裡面有 JSP 綁定,可以產生 HTML 渲染。JSF 組件的樣本包括日曆輸入組件和 HTML
Time of Update: 2018-12-03
Spring 和 struts 整合的三種方式。1,使用Spring 的 ActionSupport 2, 使用Spring 的 DelegatingRequestProcessor 類。3,全權委託。無論用那種方法來整合第一步就是要為struts來裝載spring的應用環境。 就是在 struts 中加入一個外掛程式。struts-config.xml中 <plug-in
Time of Update: 2018-12-03
<html><head><title></title></head><body> <table id="editTable" border="1"> <tr> <td>aaaaaaa</td> <td>bbbbbbb</td> <td>ccccccc&l
Time of Update: 2018-12-03
Tagjavax.faces.webappJSF組件庫JSF自訂群組件 RichFaces 是用於 Java Server Faces(JSF)的一種新的使用者介面組件套件現在的RichFaces庫是由Ajax4jsf和RichFaces兩部分組成新組件:<rich:editor> 和 a4j:queue 使用,實現和設計細節可以查看Richfaces開發指南(“Queue Principles”, “<a4j:queue>” and
Time of Update: 2018-12-03
Q: 怎麼理解Set集合中的HashSet中的元素是無序的? Set集合中對象是不按特定順序排序,並且對象沒有重複的.而Set的一個實作類別:HashSet是按照hash演算法來存取集合中的對象的.hash是: 對象值-->雜湊碼-->元素位置 .所以我有個疑問:"Set集合中對象是不按特定順序排序" 與 "HashSet的中的對象值和元素位置的對應" 是不是有點矛盾?或者說有點彆扭. 這應該是個理解問題,請指正我的敘述並幫忙回答我的疑問? 感激!
Time of Update: 2018-12-03
java.lang.IllegalStateException: No thread-bound request: use RequestContextFilter 是因為在Web.xml中配置沒有增加Spring的相應Listener, 將下面代碼貼如Web.xml中即可。 <listener> <listener-class> org.springframework.web.context.request.RequestContextListener
Time of Update: 2018-12-03
1.登陸頁面的全域錯誤提示<h:messages globalOnly="true"></h:messages>error_password對應你輸入的密碼有錯! //聲明一個沒有登入成功的訊息 FacesMessage msg=MessageFactory.getMessage (facesContext,"error_password","");
Time of Update: 2018-12-03
一、模型介紹 一個人(Person )對應多個地址(Address )。 二、實體(省略getter 、setter 方法) public class Person1ntab_sx { private int personid; private String name; private int age; private Set addresses=new HashSet(); public class
Time of Update: 2018-12-03
一、模型介紹 多個人(Person )對應多個地址(Address )。 一個人可對應多個地址,一個地址也可以對應多個人。 二、實體(省略getter 、setter 方法) public class Personnn_sx { private int personid; private String name; private int age; private Set addresses=new HashSet();
Time of Update: 2018-12-03
package com.pp;/*功能:返回一個網址的網頁原始碼*/import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class URLTest{ public
Time of Update: 2018-12-03
第二步 準備工作手動採集 正則匹配正則 和 爬蟲/** * 超簡單的 Web 爬蟲程式,用來採集一個網頁中的所有連結地址(並且這些連結地址的網頁原始碼中包含字串"searchString")! * */public class SearchCrawler implements Runnable{.. SearchCrawler crawler = new SearchCrawler("http://www.blogjava.net/Jack2007/",
Time of Update: 2018-12-03
第三步尋找html中對應條件字串Pattern pattern = Pattern.compile("href=/"(.+?)/"");Matcher matcher = pattern.matcher("<a href=/"index.html/">首頁</a>");if(matcher.find()) System.out.println(matcher.group(1));//group(1)對應 (.+?)}eg2 Pattern pattern =