SSH配置檔案

2021-09-24 13:27:01 字數 1473 閱讀 2900

首先我們應該確定架包版本  開發軟體的版本  由我的經驗我給出的介意為 eclipse mars + tomcat7 +jdk1.8

原因在於tomcat8有乙個小bug  eclipse neon 只能使用jdk1.8以上版本

接下來我們應該最先配置web.xml檔案的東西 第乙個為解決中文亂碼問題  該配置能解決大部分亂碼問題

例如:在url後加上name=張三&sex=男就不能解決 此亂碼用過濾器解決

characterencoding

org.springframework.web.filter.characterencodingfilter

encoding

utf-8

/*

第二部分設定hibernate的延遲載入問題

opensession

org.springframework.orm.hibernate3.support.opensessioninviewfilter

/*

第三部分當然是我們的spring的配置檔案了contextconfiglocation為固定命名  在它的原始碼包裡能看見這個屬性

classpath:applicationcontext.xml為了防止路徑找不到問題

contextconfiglocation

org.springframework.web.context.contextloaderlistener

第四部分前端控制器

struts2

org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter

/*request

forward

接下來我們該去配置applicationcontext.xml檔案 它和struts.xml檔案部分先後順序  但要規範命名 避免不必要的錯誤

思路:首先我們要引入連線資料庫的配置檔案資訊也可以直接加上,看個人習慣,這樣便於修改,只需修改db.properties裡的內容 適用性強資料來源採用c3p0,spring整合hibernate我就不過多解釋了 這些都是基礎性問題,

專案寫多了你會發現你的很多配置檔案資訊都是可以重複利用的,spring中比較重點和精華的就是它的控制反轉和切面程式設計,事物管理的話 可以是註解也可以配置 各有各的好處 不過外面專案開發更多是註解開發

org.hibernate.dialect.mysql5dialect

true

true

update

struts.xml你通過看他的原始碼你會發現很多預設的資訊 

你只需要按照此型別 配置 再將前端頁面放於/web-inf下至於為什麼放於/web-inf下自己可以去問問外面開發人員

/web-inf/pages//.jsp

ssh配置檔案詳解

配置 etc ssh sshd config 檔案 this is ssh server systemwide configuration file.port 22 listenaddress 192.168.1.1 hostkey etc ssh ssh host key serverkeybit...

SSH的各種配置檔案

對映檔案user.hbm.xml例子 net.hncu.po.user id username password age type int birth type date email xmlns xsi xsi schemalocation spring beans 2.5.xsd datasour...

SSH框架搭建及配置檔案

2,通過web.xml來載入spring的環境。也就是說在web.xml的檔案中加入如下 說明 listener優先啟動 注意 一些配置檔案必須放在src的目錄下,否則會拋錯誤,說找不到檔案。3,struts2按照以前的用法,配置好。struts2的配置檔案包括兩個 乙個是struts.xml,乙個...