午夜精品免费视频,91在线九色porny,av电影在线观看一区二区三区http://www.aygfsteel.com/senlin-blog/category/10112.htmlweb報(bào)表設(shè)計(jì)器....zh-cnSat, 06 Feb 2010 01:55:43 GMTSat, 06 Feb 2010 01:55:43 GMT60load runner8.1不能錄制腳本的問(wèn)題解決http://www.aygfsteel.com/senlin-blog/archive/2010/02/05/312113.htmlJJCEAJJCEAFri, 05 Feb 2010 07:15:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2010/02/05/312113.htmlhttp://www.aygfsteel.com/senlin-blog/comments/312113.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2010/02/05/312113.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/312113.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/312113.html2.打開(kāi)IE-->Internet選項(xiàng)-->高級(jí),把“禁用腳本調(diào)試(Internet Explorer)”和“禁用腳本調(diào)試(其它)”前面的勾去掉.
? 建議使用使用IE6.

JJCEA 2010-02-05 15:15 發(fā)表評(píng)論
]]>
控制你的網(wǎng)頁(yè)進(jìn)行翻頁(yè)打印http://www.aygfsteel.com/senlin-blog/archive/2008/04/10/191921.htmlJJCEAJJCEAThu, 10 Apr 2008 09:00:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2008/04/10/191921.html閱讀全文

JJCEA 2008-04-10 17:00 發(fā)表評(píng)論
]]>
讀取網(wǎng)卡的mac地址http://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106160.htmlJJCEAJJCEASat, 24 Mar 2007 16:47:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106160.htmlhttp://www.aygfsteel.com/senlin-blog/comments/106160.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106160.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/106160.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/106160.htmlpackage com.paiao.ReadMac;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class ReadMac {
??? public ReadMac() {
??? }

??? public static String getMACAddress() {

??????? String address = "";
??????? String os = System.getProperty("os.name");
??????? if (os != null && os.startsWith("Windows")) {
??????????? try {
??????????????? String command = "cmd.exe /c ipconfig /all";
??????????????? Process p = Runtime.getRuntime().exec(command);
??????????????? BufferedReader br =
??????????????????????? new BufferedReader(
??????????????????????????????? new InputStreamReader(p.getInputStream()));
??????????????? String line;
??????????????? while ((line = br.readLine()) != null) {
??????????????????? if (line.indexOf("Physical Address") > 0) {
??????????????????????? int index = line.indexOf(":");
??????????????????????? index += 2;
??????????????????????? address = line.substring(index);
??????????????????????? break;
??????????????????? }
??????????????? }
??????????????? br.close();
??????????????? return address.trim();
??????????? } catch (IOException e) {}
??????? }
??????? return address;
??? }

public static void main(String[] args) {
??? System.out.println("Mac:"+ReadMac.getMACAddress());
}
}



JJCEA 2007-03-25 00:47 發(fā)表評(píng)論
]]>
判斷sever 2000數(shù)據(jù)庫(kù)是否開(kāi)啟http://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106159.htmlJJCEAJJCEASat, 24 Mar 2007 16:46:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106159.htmlhttp://www.aygfsteel.com/senlin-blog/comments/106159.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106159.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/106159.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/106159.html????????????? boolean m_boo = true;
????????????? String url =? "jdbc:jtds:sqlserver:"+"http://"+fwqIP+":1433;DatabaseName=master;lastupdatecount=true;SelectMethod=cursor";
????????????? com.paiao.app.db.DbBase dbbase? =? com.paiao.app.db.DbBase.getInstance();
????????????? Connection con = this.con(url,user,password);
????????????? PreparedStatement pstm = null;
????????????? String sqls1 = "create database shebei_paiao ";
????????????? //String sqls1 = "select * from syscolumns ";
????????????? try {
??????????????? pstm = con.prepareStatement(sqls1);
??????????????? pstm.execute();
??????????????? m_boo = true;
????????????? }
????????????? catch (Exception e) {
??????????????? m_boo = false;
??????????????? System.out.println("您的mssqlserver數(shù)據(jù)庫(kù)沒(méi)有啟動(dòng)!");
????????????? }
????????????? finally {
??????????????? dbbase.Release(pstm, con);
????????????? }
????????????? return m_boo;
??????????? }

JJCEA 2007-03-25 00:46 發(fā)表評(píng)論
]]>
用setup Factory 7.0 制做安裝文件時(shí)修改注冊(cè)表的方法http://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106158.htmlJJCEAJJCEASat, 24 Mar 2007 16:41:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106158.htmlhttp://www.aygfsteel.com/senlin-blog/comments/106158.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106158.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/106158.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/106158.html--打包一個(gè)由jdk1.5,tomcat5.5下開(kāi)發(fā)的項(xiàng)目,以前tomcat 4.1下很好處理jdk路徑問(wèn)題,只需要在startup.bat和shutdown.bat文件中加入如下兩句就可以了:

set CATALINA_HOME=..//在這句下面加入
//設(shè)定jdk的路徑
set JAVA_HOME=..\..\%CATALINA_HOME%\jdk1.4
:gotHome? //=..//在這句上面加入

但是用了tomcat5.5卻沒(méi)有了這兩個(gè)文件,它將自已的安裝路徑和jdk的路徑都寫(xiě)到注冊(cè)表中了.

這就需要在打包時(shí)動(dòng)態(tài)的修改注冊(cè)表,否則將不能正常使用.

-- 安裝路徑:your_variable
--Dialog.Message(your_variable, your_variable, MB_OK, MB_ICONEXCLAMATION);

-- 創(chuàng)建一個(gè)全局變量,并賦予一個(gè)字符串
your_variable1 = "";

--Dialog.Message(your_variable, your_variable, MB_OK, MB_ICONEXCLAMATION);
-- 從注冊(cè)表中導(dǎo)入的值:
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Tomcat");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Tomcat\\5.5");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters");
your_variable1=String.Replace("D:\\Software\\Tomcat 5.5","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Tomcat\\5.5", "InstallPath", your_variable1, 7);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Tomcat\\5.5", "Version", "5.5.12", 7);
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Java");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Log");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Start");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Stop");
your_variable1=String.Replace("D:\\Software\\jdk1.5\\bin\\client\\jvm.dll","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Java", "Jvm",your_variable1, 1);
your_variable1=String.Replace("D:\\Software\\Tomcat 5.5\\bin\\bootstrap.jar","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Java", "Classpath",your_variable1, 1);

your_variable1=String.Replace("-Dcatalina.home=D:\\Software\\Tomcat 5.5|-Dcatalina.base=D:\\Software\\Tomcat 5.5|-Djava.endorsed.dirs=D:\\Software\\Tomcat 5.5\\common\\endorsed|-Djava.io.tmpdir=D:\\Software\\Tomcat 5.5\\temp|-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager|-Djava.util.logging.config.file=D:\\Software\\Tomcat 5.5\\conf\\logging.properties","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Java", "Options", your_variable1, 7);

your_variable1=String.Replace("D:\\Software\\Tomcat 5.5\\logs","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Log", "Path",your_variable1 , 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Log", "StdError", "auto", 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Log", "StdOutput", "auto", 1);

your_variable1=String.Replace("D:\\Software\\Tomcat 5.5","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Start", "WorkingPath", your_variable1, 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Start", "Class", "org.apache.catalina.startup.Bootstrap", 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Start", "Params", "start", 7);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Start", "Mode", "jvm", 1);

your_variable1=String.Replace("D:\\Software\\Tomcat 5.5","D:\\Software",your_variable,true);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Stop", "WorkingPath", your_variable1, 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Stop", "Class", "org.apache.catalina.startup.Bootstrap", 1);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Stop", "Params", "stop", 7);
Registry.SetValue(3, "Software\\Apache Software Foundation\\Procrun 2.0\\Tomcat5\\Parameters\\Stop", "Mode", "jvm", 1);


-- 從注冊(cè)表中導(dǎo)入的值:
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "Type", "16", 4);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "Start", "3", 4);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "ErrorControl", "1", 4);
your_variable1=String.Replace("\"D:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\bin\\Tomcat5.exe\" //RS//Tomcat5","D:\\Program Files\\Apache Software Foundation",your_variable,true);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "ImagePath", your_variable1, 2);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "DisplayName", "Apache Tomcat", 7);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "ObjectName", "LocalSystem", 7);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5", "Description", "Apache Tomcat 5.5.12 Server - Registry.CreateKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Enum");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Parameters");
Registry.CreateKey(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Security");
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Enum", "0", "Root\\LEGACY_Tomcat5\\0000", 7);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Enum", "Count", "1", 4);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Enum", "NextInstance", "1", 4);
Registry.SetValue(3, "SYSTEM\\CurrentControlSet\\Services\\Tomcat5\\Security", "Security", "01 00 14 80 90 00 00 00 9C 00 00 00 14 00 00 00 30 00 00 00 02 00 1C 00 01 00 00 00 02 80 14 00 FF 01 0F 00 01 01 00 00 00 00 00 01 00 00 00 00 02 00 60 00 04 00 00 00 00 00 14 00 FD 01 02 00 01 01 00 00 00 00 00 05 12 00 00 00 00 00 18 00 FF 01 0F 00 01 02 00 00 00 00 00 05 20 00 00 00 20 02 00 00 00 00 14 00 8D 01 02 00 01 01 00 00 00 00 00 05 0B 00 00 00 00 00 18 00 FD 01 02 00 01 02 00 00 00 00 00 05 20 00 00 00 23 02 00 00 01 01 00 00 00 00 00 05 12 00 00 00 01 01 00 00 00 00 00 05 12 00 00 00", 3);



JJCEA 2007-03-25 00:41 發(fā)表評(píng)論
]]>
利用java的ZipOutputStream類(lèi)壓縮文件或文件夾中的文件http://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106157.htmlJJCEAJJCEASat, 24 Mar 2007 16:36:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106157.htmlhttp://www.aygfsteel.com/senlin-blog/comments/106157.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106157.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/106157.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/106157.htmlpackage codemaking.util;

import java.io.File;
import org.apache.tools.zip.ZipOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipEntry;


public class CompressBook {
? public CompressBook() {
? }

? /*
?? * inputFileName 輸入一個(gè)文件夾
?? * zipFileName 輸出一個(gè)壓縮文件夾
?? */
? public void zip(String inputFileName) throws Exception {
??? String zipFileName = "c:\\test.zip"; //打包后文件名字
??? System.out.println(zipFileName);
??? zip(zipFileName, new File(inputFileName));
? }

? private void zip(String zipFileName, File inputFile) throws Exception {
??? ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
??? zip(out, inputFile, "");
??? System.out.println("zip done");
??? out.close();
? }

? private void zip(ZipOutputStream out, File f, String base) throws Exception {
??? if (f.isDirectory()) {
????? File[] fl = f.listFiles();
????? out.putNextEntry(new org.apache.tools.zip.ZipEntry(base + "/"));
????? base = base.length() == 0 ? "" : base + "/";
????? for (int i = 0; i < fl.length; i++) {
??????? zip(out, fl[i], base + fl[i].getName());
????? }
??? }
??? else {
????? out.putNextEntry(new org.apache.tools.zip.ZipEntry(base));
????? FileInputStream in = new FileInputStream(f);
????? int b;
????? System.out.println(base);
????? while ( (b = in.read()) != -1) {
??????? out.write(b);
????? }
????? in.close();
??? }
? }

? public static void main(String [] temp){
??? CompressBook book = new CompressBook();
??? try {
????? book.zip("c:\\test",new File("c:\\test"));
??? }
??? catch (Exception ex) {
??? }
? }
}



JJCEA 2007-03-25 00:36 發(fā)表評(píng)論
]]>
利用java的ZipOutputStream類(lèi)解壓文件或文件夾中的文件http://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106156.htmlJJCEAJJCEASat, 24 Mar 2007 16:35:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106156.htmlhttp://www.aygfsteel.com/senlin-blog/comments/106156.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2007/03/25/106156.html#Feedback2http://www.aygfsteel.com/senlin-blog/comments/commentRss/106156.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/106156.htmlpackage codemaking.util;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
import java.util.zip.GZIPInputStream;
import java.io.DataInputStream;

?

/**
?* Description: 此類(lèi)用于...
?*
?* @author??? wunaigang(2005-6-21)
?* @version?? 1.0.0
?*/
public class ZipManager {

?

??????? /**
???????? * zip壓縮功能測(cè)試. 將d:\\temp\\zipout目錄下的所有文件連同子目錄壓縮到d:\\temp\\out.zip.
???????? *
???????? * @param baseDir 所要壓縮的目錄名(包含絕對(duì)路徑)
???????? * @param objFileName 壓縮后的文件名
???????? * @throws Exception
???????? */
??????? public void createZip(String baseDir, String objFileName) throws Exception {
??????????????? File folderObject = new File(baseDir);

?

??????????????? if (folderObject.exists()){
??????????????????????? List fileList = getSubFiles(new File(baseDir));

?

??????????????????????? //壓縮文件名
??????????????????????? ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(objFileName));

?

??????????????????????? ZipEntry ze = null;
??????????????????????? byte[] buf = new byte[1024];
??????????????????????? int readLen = 0;
??????????????????????? for (int i = 0; i < fileList.size(); i++) {
??????????????????????????????? File f = (File) fileList.get(i);
??????????????????????????????? System.out.println("Adding: " + f.getPath() + f.getName());

?

??????????????????????????????? //創(chuàng)建一個(gè)ZipEntry,并設(shè)置Name和其它的一些屬性
??????????????????????????????? ze = new ZipEntry(getAbsFileName(baseDir, f));
??????????????????????????????? ze.setSize(f.length());
??????????????????????????????? ze.setTime(f.lastModified());

?

??????????????????????????????? //將ZipEntry加到zos中,再寫(xiě)入實(shí)際的文件內(nèi)容
??????????????????????????????? zos.putNextEntry(ze);
??????????????????????????????? InputStream is = new BufferedInputStream(new FileInputStream(f));
??????????????????????????????? while ((readLen = is.read(buf, 0, 1024)) != -1) {
??????????????????????????????????????? zos.write(buf, 0, readLen);
??????????????????????????????? }
??????????????????????????????? is.close();
??????????????????????????????? System.out.println("done...");
??????????????????????? }
??????????????????????? zos.close();
??????????????? }else{
??????????????????????? throw new Exception("this folder isnot exist!");
??????????????? }
??????? }
??????? /**
???????? * zip壓縮功能測(cè)試. 將指定文件壓縮后存到一壓縮文件中
???????? *
???????? * @param baseDir 所要壓縮的文件名
???????? * @param objFileName 壓縮后的文件名
???????? * @return 壓縮后文件的大小
???????? * @throws Exception
???????? */
??????? public long createFileToZip(String zipFilename,String sourceFileName) throws Exception {

?

??????????????? File? sourceFile = new File(sourceFileName);

?

??????????????? byte[] buf = new byte[1024];

?

??????????????? //壓縮文件名
??????????????? File objFile = new File(zipFilename);

?

??????????????? ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(objFile));

?

??????????????? ZipEntry ze = null;
??????????????? //創(chuàng)建一個(gè)ZipEntry,并設(shè)置Name和其它的一些屬性
??????????????? ze = new ZipEntry(sourceFile.getName());
??????????????? ze.setSize(sourceFile.length());
??????????????? ze.setTime(sourceFile.lastModified());

?

??????????????? //將ZipEntry加到zos中,再寫(xiě)入實(shí)際的文件內(nèi)容
??????????????? zos.putNextEntry(ze);

?

??????????????? InputStream is = new BufferedInputStream(new FileInputStream(sourceFile));

?

??????????????? int readLen = -1;
??????????????? while ((readLen = is.read(buf, 0, 1024)) != -1) {
??????????????????????? zos.write(buf, 0, readLen);
??????????????? }
??????????????? is.close();
??????????????? zos.close();

?


??????????????? return objFile.length();
??????? }
??????? /**
???????? * zip壓縮功能測(cè)試. 將指定文件壓縮后存到一壓縮文件中
???????? *
???????? * @param baseDir 所要壓縮的文件名
???????? * @param objFileName 壓縮后的文件名
???????? * @return 壓縮后文件的大小
???????? * @throws Exception
???????? */
??????? public long createFileToZip(File sourceFile,File zipFile)throws IOException {

?


??????????????? byte[] buf = new byte[1024];

?

??????????????? //壓縮文件名
??????????????? File objFile = zipFile;

?

??????????????? ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(objFile));

?

??????????????? ZipEntry ze = null;
??????????????? //創(chuàng)建一個(gè)ZipEntry,并設(shè)置Name和其它的一些屬性
??????????????? ze = new ZipEntry(sourceFile.getName());
??????????????? ze.setSize(sourceFile.length());
??????????????? ze.setTime(sourceFile.lastModified());

?

??????????????? //將ZipEntry加到zos中,再寫(xiě)入實(shí)際的文件內(nèi)容
??????????????? zos.putNextEntry(ze);

?

??????????????? InputStream is = new BufferedInputStream(new FileInputStream(sourceFile));

?

??????????????? int readLen = -1;
??????????????? while ((readLen = is.read(buf, 0, 1024)) != -1) {
??????????????????????? zos.write(buf, 0, readLen);
??????????????? }
??????????????? is.close();
??????????????? zos.close();

?

??????????????? return objFile.length();
??????? }

?

??????? /**
???????? * 測(cè)試解壓縮功能. 將d:\\download\\test.zip連同子目錄解壓到d:\\temp\\zipout目錄下.
???????? *
???????? * @throws Exception
???????? */
??????? public void releaseZipToFile(String sourceZip, String outFileName)
??????????????????????? throws IOException{
????????????????????? ZipFile zfile=new ZipFile(sourceZip);
????????????????????? System.out.println(zfile.getName());
????????????????????? Enumeration zList=zfile.entries();
????????????????????? ZipEntry ze=null;
????????????????????? byte[] buf=new byte[1024];
????????????????????? while(zList.hasMoreElements()){
????????????????????? //從ZipFile中得到一個(gè)ZipEntry
????????????????????? ze=(ZipEntry)zList.nextElement();
????????????????????? if(ze.isDirectory()){
????????????????????? continue;
????????????????????? }
????????????????????? //以ZipEntry為參數(shù)得到一個(gè)InputStream,并寫(xiě)到OutputStream中
????????????????????? OutputStream os=new BufferedOutputStream(new FileOutputStream(getRealFileName(outFileName, ze.getName())));
????????????????????? InputStream is=new BufferedInputStream(zfile.getInputStream(ze));
????????????????????? int readLen=0;
????????????????????? while ((readLen=is.read(buf, 0, 1024))!=-1) {
????????????????????? os.write(buf, 0, readLen);
????????????????????? }
????????????????????? is.close();
????????????????????? os.close();
????????????????????? System.out.println("Extracted: "+ze.getName());
????????????????????? }
????????????????????? zfile.close();

??????? }

?

??????? /**
???????? * 取得指定目錄下的所有文件列表,包括子目錄.
???????? *
???????? * @param baseDir
???????? *??????????? File 指定的目錄
???????? * @return 包含java.io.File的List
???????? */
??????? private List getSubFiles(File baseDir) {
??????????????? List ret = new ArrayList();
??????????????? //File base=new File(baseDir);
??????????????? File[] tmp = baseDir.listFiles();
??????????????? for (int i = 0; i < tmp.length; i++) {
??????????????????????? if (tmp[i].isFile()) {
??????????????????????????????? ret.add(tmp[i]);
??????????????????????? }
??????????????????????? if (tmp[i].isDirectory()) {
??????????????????????????????? ret.addAll(getSubFiles(tmp[i]));
??????????????????????? }
??????????????? }
??????????????? return ret;
??????? }

?

??????? /**
???????? * 給定根目錄,返回一個(gè)相對(duì)路徑所對(duì)應(yīng)的實(shí)際文件名.
???????? *
???????? * @param baseDir
???????? *??????????? 指定根目錄
???????? * @param absFileName
???????? *??????????? 相對(duì)路徑名,來(lái)自于ZipEntry中的name
???????? * @return java.io.File 實(shí)際的文件
???????? */
??????? private File getRealFileName(String baseDir, String absFileName) {
??????????????? String[] dirs = absFileName.split("/");
??????????????? //System.out.println(dirs.length);
??????????????? File ret = new File(baseDir);
??????????????? //System.out.println(ret);
??????????????? if (dirs.length > 1) {
??????????????????????? for (int i = 0; i < dirs.length - 1; i++) {
??????????????????????????????? ret = new File(ret, dirs[i]);
??????????????????????? }
??????????????? }
??????????????? if (!ret.exists()) {
??????????????????????? ret.mkdirs();
??????????????? }
??????????????? ret = new File(ret, dirs[dirs.length - 1]);
??????????????? return ret;
??????? }

?

??????? /**
???????? * 給定根目錄,返回另一個(gè)文件名的相對(duì)路徑,用于zip文件中的路徑.
???????? *
???????? * @param baseDir
???????? *??????????? java.lang.String 根目錄
???????? * @param realFileName
???????? *??????????? java.io.File 實(shí)際的文件名
???????? * @return 相對(duì)文件名
???????? */
??????? private String getAbsFileName(String baseDir, File realFileName) {
??????????????? File real = realFileName;
??????????????? File base = new File(baseDir);
??????????????? String ret = real.getName();
??????????????? while (true) {
??????????????????????? real = real.getParentFile();
??????????????????????? if (real == null)
??????????????????????????????? break;
??????????????????????? if (real.equals(base))
??????????????????????????????? break;
??????????????????????? else {
??????????????????????????????? ret = real.getName() + "/" + ret;
??????????????????????? }
??????????????? }
??????????????? System.out.println("TTTTT" + ret);
??????????????? return ret;
??????? }


??????? public void testReadZip() throws Exception{
??????? String baseDir="d:\\temp\\zipout";
??????? ZipFile zfile=new ZipFile("d:\\download\\src.zip");
??????? System.out.println(zfile.getName());
??????? Enumeration zList=zfile.entries();
??????? ZipEntry ze=null;
??????? byte[] buf=new byte[1024];
??????? while(zList.hasMoreElements()){
??????? //從ZipFile中得到一個(gè)ZipEntry
??????? ze=(ZipEntry)zList.nextElement();
??????? if(ze.isDirectory()){
??????? continue;
??????? }
??????? //以ZipEntry為參數(shù)得到一個(gè)InputStream,并寫(xiě)到OutputStream中
??????? OutputStream os=new BufferedOutputStream(new FileOutputStream(getRealFileName(baseDir, ze.getName())));
??????? InputStream is=new BufferedInputStream(zfile.getInputStream(ze));
??????? int readLen=0;
??????? while ((readLen=is.read(buf, 0, 1024))!=-1) {
??????? os.write(buf, 0, readLen);
??????? }
??????? is.close();
??????? os.close();
??????? System.out.println("Extracted: "+ze.getName());
??????? }
??????? zfile.close();
??????? }


?? public static void main(String args[]){
???? ZipManager manager = new ZipManager();
???? try {
?????? //manager.releaseZipToFile("c:\\test.zip","c:\\test");
?????? manager.testReadZip();
???? }
???? catch (Exception e) {}
???? System.out.println("over");
?? }
?


}



JJCEA 2007-03-25 00:35 發(fā)表評(píng)論
]]>
如何在jboss 4.0中調(diào)用EJB組件http://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64014.htmlJJCEAJJCEAWed, 16 Aug 2006 15:02:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64014.htmlhttp://www.aygfsteel.com/senlin-blog/comments/64014.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64014.html#Feedback1http://www.aygfsteel.com/senlin-blog/comments/commentRss/64014.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/64014.html
  Tomcat 5.0 被集成在 jboss的下面這個(gè)目錄中:

  JBOSS_HOME\server\default\deploy\jbossweb-tomcat50.sar

  里面提供了一個(gè)server.xml和web.xml文件,可以對(duì)Tomcat進(jìn)行一些基本設(shè)置。但JBOSS的設(shè)計(jì)者建議用戶(hù)甚至不要接觸這個(gè)目錄,更不用說(shuō)修改和添加什么文件了,因?yàn)門(mén)omcat與Jboss是如此緊密相連,以致于所有的設(shè)置工作都可以在Jboss自己的配置文件中完成。但是我還是發(fā)現(xiàn)了一個(gè)地方值得修改:修改server.xml中的端口號(hào),比如由缺省的8080端口改為4000端口,因?yàn)槲野l(fā)現(xiàn)我的“百度下吧”軟件常常占用了8080端口,而且我本來(lái)已經(jīng)有了一個(gè)Tomcat 5.0。

  這樣鍵入:

http://localhost:4000/

  可以訪問(wèn)到Jboss的歡迎頁(yè)面

  本文演示了JSP頁(yè)面如何在jboss 4.0中調(diào)用EJB組件。

  總結(jié)構(gòu):

J2EE應(yīng)用/
|__EJB組件/(haiejb.jar)
| |__META-INF/
| | |__ejb-jar.xml
| | |__jboss.xml
| |__ejbs/
| |__HaiHome.class
| |__HaiClient.class
| |__HaiBean.class
|__WEB應(yīng)用/(haiejb.war)
| |__haiejb.jsp
| |__WEB-INF/
| |__web.xml
| |__jboss-web.xml
|__META-INF/
|__application.xml

  一、編譯java文件為EJB類(lèi)文件

  java文件編譯:

  [假定在系統(tǒng)環(huán)境變量的CLASSPATH中包含了javax.ejb.*包,該包可以在以下地方找:

  JBOSS_HOME\server\default\lib\jboss-j2ee.jar

  JBOSS_HOME\client\jboss-j2ee.jar]


  [java源文件目錄]>:javac -classpath %classpath% -d [輸出目錄:EJB組件目錄](méi) *.java

HaiHome.java:
package ejbs;

import java.io.Serializable;
import java.rmi.*;
import javax.ejb.*;

public interface HaiHome extends EJBHome {
HaiClient create() throws RemoteException, CreateException;
}

  HaiClient.java:

package ejbs;

import javax.ejb.*;
import java.rmi.RemoteException;
public interface HaiClient extends EJBObject {
 public String sayHai() throws RemoteException;
}
haiBean.java:
package ejbs;

import javax.ejb.*;
import javax.naming.*;

public class HaiBean implements SessionBean {

 public String sayHai() {
  return "Hai, EJB technology!";
 }
 
 public void ejbCreate() throws EJBException {}
 public void ejbRemove() throws EJBException {}
 public void ejbPassivate() {}
 public void ejbActivate() {}
 public void setSessionContext(SessionContext sc) {}
}

  二、創(chuàng)建EJB組件:

  haiejb.jar:(EJB組件)

  打包命令:[EJB組件目錄](méi)>:jar cvf haiejb.jar META-INF/ ejbs/


|__META-INF/

| |__ejb-jar.xml

| |__jboss.xml

|__ejbs/

|__HaiHome.class

|__HaiClient.class

|__HaiBean.class

  ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC ’-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN’ ’http://java.sun.com/dtd/ejb-jar_2_0.dtd’>
<ejb-jar>
<description>Hai EJB instance.</description>
<display-name>Hai EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>HaiEJB</ejb-name>
<home>ejbs.HaiHome</home>
<remote>ejbs.HaiClient</remote>
<ejb-class>ejbs.HaiBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>

  jboss.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>HaiEJB</ejb-name>
<jndi-name>HaiEJB</jndi-name>
</session>
</enterprise-beans>
</jboss>

  三、創(chuàng)建WEB應(yīng)用

  haiejb.war:(WEB應(yīng)用)

  打包命令:[WEB應(yīng)用目錄](méi)>:jar cvf haiejb.war haiejb.jsp WEB-INF/

|__haiejb.jsp

|__WEB-INF/

|__web.xml

|__jboss-web.xml

  haiejb.jsp:

<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="ejbs.*,javax.ejb.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.rmi.RemoteException" %>
<html>
<body>
<% String message = "nothing!";
try {
 InitialContext ic = new InitialContext();
 Object objRef = ic.lookup("HaiEJB");
 HaiHome home = (HaiHome) PortableRemoteObject.narrow(objRef,ejbs.HaiHome.class);
 HaiClient haiRemote = home.create();
 message = haiRemote.sayHai();
} catch (RemoteException re) {
 re.printStackTrace();
} catch (CreateException ce) {
 ce.printStackTrace();
} catch (NamingException ne) {
 ne.printStackTrace();
}
%>
<h1><%=message%></h1>
</body>
</html>

  web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC ’-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN’ ’http://java.sun.com/dtd/web-app_2_3.dtd’>
<web-app>
<ejb-ref>
<ejb-ref-name>HaiEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>ejbs.HaiHome</home>
<remote>ejbs.HaiClient</remote>
</ejb-ref>
</web-app>

  jboss-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<ejb-ref>
<ejb-ref-name>HaiEJB</ejb-ref-name>
<jndi-name>HaiEJB</jndi-name>
</ejb-ref>
</jboss-web>

  四、創(chuàng)建J2EE應(yīng)用程序

  haiejb.ear: (J2EE應(yīng)用程序)

  把上面創(chuàng)建的haiejb.jar和haiejb.war包拷貝到你創(chuàng)建的J2EE應(yīng)用主目錄,新建一個(gè)META-INF目錄并在里面創(chuàng)建application.xml文件:

  打包命令:[J2EE應(yīng)用目錄](méi)>:jar cvf haiejb.ear haiejb.jar haiejb.war META-INF/

|__haiejb.jar

|__haiejb.war

|__META-INF/

|__application.xml

  application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<application>
<display-name>HaiEJB J2EE Application</display-name>
<module>
<web>
<web-uri>haiejb.war</web-uri>
<context-root>/haiejb</context-root>
</web>
</module>
<module>
<ejb>haiejb.jar</ejb>
</module>
</application>

  五、部署J2EE應(yīng)用:

  把haiejb.ear拷貝到JBOSS_HOME\server\default\deploy\

  啟動(dòng)jboss 4.0,注意命令行窗口中有無(wú)異常,如果有異常情況,請(qǐng)查看log文件:

JBOSS_HOME\server\default\log\server.log

  從中查找分析問(wèn)題所在,然后改正之,直到無(wú)異常顯示

  最后在瀏覽器地址欄中鍵入:

http://localhost:8080/haiejb/haiejb.jsp

  結(jié)果:

  Hai, EJB technology!

  祝好運(yùn)!

JJCEA 2006-08-16 23:02 發(fā)表評(píng)論
]]>
weblogic8.1下EJB的部署與調(diào)用 http://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64003.htmlJJCEAJJCEAWed, 16 Aug 2006 13:42:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64003.htmlhttp://www.aygfsteel.com/senlin-blog/comments/64003.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/08/16/64003.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/64003.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/64003.html< ?xml version="1.0" encoding="UTF-8"? >
< !DOCTYPE ejb-jar PUBLIC ''-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'' ''" target=_blank >http://java.sun.com/dtd/ejb-jar_2_0.dtd'' >


< !-- Generated XML! -- >

< ejb-jar >
< display-name >hello< /display-name >
< enterprise-beans >
< session >
< display-name >HelloBean< /display-name >
< ejb-name >Hello< /ejb-name >
< home >org.bromon.ejb.session.HelloHome< /home >
< remote >org.bromon.ejb.session.Hello< /remote >
< local-home >org.bromon.ejb.session.HelloLocalHome< /local-home >
< local >org.bromon.ejb.session.HelloLocal< /local >
< ejb-class >org.bromon.ejb.session.HelloBean< /ejb-class >
< session-type >Stateless< /session-type >
< transaction-type >Bean< /transaction-type >
< security-identity >
< use-caller-identity/ >
< /security-identity >

< /session >
< /enterprise-beans >

< /ejb-jar >

2、weblogic-ejb-jar.xml(weblogic專(zhuān)署配置文件)
< !DOCTYPE weblogic-ejb-jar PUBLIC ''-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'' ''" target=_blank >http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'' >


< !-- Generated XML! -- >

< weblogic-ejb-jar >
< weblogic-enterprise-bean >
< ejb-name >Hello< /ejb-name >
< stateless-session-descriptor >
< pool >
< /pool >

< stateless-clustering >
< /stateless-clustering >

< /stateless-session-descriptor >

< transaction-descriptor >
< /transaction-descriptor >

< jndi-name >Hello< /jndi-name >
< local-jndi-name >HelloLocal< /local-jndi-name >
< /weblogic-enterprise-bean >
< /weblogic-ejb-jar >

3、HelloClient.java(客戶(hù)端代碼,最好和四個(gè)接口一起打包)
/*
* Created on 2004-5-11
*/
package org.bromon.ejb.session;
import javax.naming.*;
import javax.rmi.*;
import java.util.*;
/**
* @author Bromon
*/
public class HelloClient
{
public static void main(String args[])
{
try
{
Properties prop=new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");//加載weblogic上下文環(huán)境
prop.put(Context.PROVIDER_URL,"t3://localhost:7001");//weblogic專(zhuān)用協(xié)議

Context ctx=new InitialContext(prop);
Object obj=ctx.lookup("Hello");
HelloHome home=(HelloHome)PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello=home.create();
System.out.println(hello.say());
hello.remove();
}catch(Exception e)
{
System.out.println(e);
}
}
}

JJCEA 2006-08-16 21:42 發(fā)表評(píng)論
]]>
Eclipse使用技巧http://www.aygfsteel.com/senlin-blog/archive/2006/07/23/59620.htmlJJCEAJJCEASun, 23 Jul 2006 02:29:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/07/23/59620.htmlhttp://www.aygfsteel.com/senlin-blog/comments/59620.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/07/23/59620.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/59620.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/59620.html閱讀全文

JJCEA 2006-07-23 10:29 發(fā)表評(píng)論
]]>
影像與工作流技術(shù)在銀行業(yè)的應(yīng)用http://www.aygfsteel.com/senlin-blog/archive/2006/07/22/59525.htmlJJCEAJJCEASat, 22 Jul 2006 03:40:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/07/22/59525.htmlhttp://www.aygfsteel.com/senlin-blog/comments/59525.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/07/22/59525.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/59525.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/59525.html

?


業(yè)務(wù)需求

金融電子化的發(fā)展,令銀行業(yè)務(wù)從純粹的手工操作逐步實(shí)現(xiàn)了業(yè)務(wù)處理的電子化。銀行原始單據(jù)上的部分信息被輸入到計(jì)算機(jī)中,成為數(shù)字化的信息進(jìn)行傳遞和處理,業(yè)務(wù)處理的效率和能力大為提高,一些在手工階段無(wú)法實(shí)現(xiàn)的業(yè)務(wù),如通存通兌成為了基本的金融業(yè)務(wù)。然而,大量的金融應(yīng)用系統(tǒng)的處理都是基于手工輸入數(shù)據(jù)信息的處理,由于手工輸入、數(shù)據(jù)傳遞過(guò)程中可能出現(xiàn)的差錯(cuò)以及信息的不完整性(如數(shù)字化的憑證丟失了原始紙張憑證上的筆跡等信息),使得目前的金融電子化系統(tǒng)并不能減少紙張憑證的運(yùn)用,不得不繼續(xù)進(jìn)行大量紙張憑證的歸檔、存儲(chǔ)以及運(yùn)輸,以便進(jìn)行事后監(jiān)督、審計(jì)。大量的紙張不僅占用人力、物力,而且非常不便于進(jìn)行查詢(xún)。于是人們開(kāi)始運(yùn)用影像技術(shù)對(duì)紙張進(jìn)行處理。

在我國(guó)目前金融行業(yè)的應(yīng)用中,影像技術(shù)常常被用于進(jìn)行原始憑證的影像化存儲(chǔ),也就是在業(yè)務(wù)處理結(jié)束后,將大量的紙張文檔進(jìn)行掃描等處理后變?yōu)橛跋襁M(jìn)行存儲(chǔ),以便日后的查詢(xún)。但是,影像技術(shù)僅僅用于對(duì)憑證的存儲(chǔ)和查詢(xún),影像處理與業(yè)務(wù)處理兩個(gè)過(guò)程是獨(dú)立的,并不能解決數(shù)字化信息在采集和傳遞中的問(wèn)題;而且對(duì)于一些專(zhuān)業(yè)技術(shù)要求較高的業(yè)務(wù)如貸款、國(guó)際結(jié)算、保險(xiǎn)等,常常仍舊需要大量的紙張傳遞,業(yè)務(wù)處理效率難以提高,業(yè)務(wù)風(fēng)險(xiǎn)也不易控制。

以目前發(fā)展很快的個(gè)人貸款業(yè)務(wù)為例。個(gè)人貸款的特點(diǎn)是金額小、筆數(shù)多、客戶(hù)數(shù)量多而重復(fù)貸款的少。對(duì)銀行而言,這種貸款的貸前資信了解、貸后日常管理比企業(yè)貸款更為復(fù)雜。這就意味著個(gè)人貸款的文檔量大,相應(yīng)的紙上作業(yè)過(guò)程,如貸款文件的準(zhǔn)備、各種證明的收集等就形成繁重的負(fù)擔(dān)。隨之而來(lái)就是新員工(或新從事貸款業(yè)務(wù)的員工)的增加、員工的工作量增加、審批過(guò)程加長(zhǎng)和風(fēng)險(xiǎn)增大。

如果在個(gè)人貸款系統(tǒng)中運(yùn)用影像和工作流技術(shù),在各種業(yè)務(wù)系統(tǒng)處理過(guò)程從開(kāi)始階段都將原始憑證轉(zhuǎn)化為影像文件,通過(guò)影像與數(shù)字化信息同時(shí)在各工作崗位間的傳遞來(lái)實(shí)現(xiàn)業(yè)務(wù)的處理流程,不僅可以使每個(gè)業(yè)務(wù)處理人員都能看到影像化的原始憑證,進(jìn)行準(zhǔn)確的業(yè)務(wù)處理,避免手工輸入的錯(cuò)誤,而且可以很好地實(shí)現(xiàn)業(yè)務(wù)的集中處理,可以提高業(yè)務(wù)處理的效率,將業(yè)務(wù)風(fēng)險(xiǎn)降到最低限度。可以說(shuō),將影像處理技術(shù)與工作流管理技術(shù)充分地結(jié)合起來(lái),會(huì)形成新的有效的業(yè)務(wù)處理與業(yè)務(wù)監(jiān)管的模式。這種方案在國(guó)外銀行已經(jīng)有不少成功的先例。

技術(shù)實(shí)現(xiàn)

影像和工作流技術(shù)本身就包含了豐富的內(nèi)容,一個(gè)包含影像和工作流技術(shù)的應(yīng)用系統(tǒng)必須考慮到信息的采集、存儲(chǔ)、檢索、處理、發(fā)布等各個(gè)環(huán)節(jié)的技術(shù)問(wèn)題,處理過(guò)程見(jiàn)下圖。

1.文檔輸入系統(tǒng)
文檔輸入系統(tǒng)是影像和工作流解決方案實(shí)施中的關(guān)鍵所在。文檔輸入可通過(guò)掃描儀、傳真機(jī)或電子郵件系統(tǒng)將文件轉(zhuǎn)為電子化文檔存儲(chǔ)。文檔以壓縮的數(shù)字影像方式或數(shù)字影像結(jié)合文本方式或數(shù)字影像結(jié)合縮微影像方式輸入系統(tǒng),其中,數(shù)字影像結(jié)合文本方式需要在掃描儀上安裝字符識(shí)別(OCR)軟件,或在文檔輸入軟件中嵌入OCR軟件。對(duì)于嵌入對(duì)象,如電子表格和字處理文件等的輸入,可通過(guò)對(duì)象連接和嵌入(OLE)技術(shù)直接存儲(chǔ)于影像系統(tǒng)。

2.影像的壓縮及存儲(chǔ)
組成影像的基本單位為像素,衡量影像質(zhì)量的一個(gè)重要指標(biāo)是分辨率,例如,分辨率為200dpi即是指每平方英寸有40000個(gè)像素。分辨率越高,影像越清晰,但對(duì)數(shù)據(jù)的存儲(chǔ)、傳輸和硬件配置的要求也會(huì)越高。壓縮后的文件大小由多方面因素決定,如文檔的大小、色彩、灰度、底色、對(duì)比度、分辨率。通常,文本文件要求的分辨率為200dpi。

圖像的壓縮和解壓縮技術(shù)能夠最大限度地減少影像文件對(duì)存儲(chǔ)空間的消耗,又確保了影像解壓后無(wú)損失地再顯示。影像系統(tǒng)的影像壓縮通常采用CCITTIV壓縮協(xié)議。

影像可以存儲(chǔ)在硬盤(pán)、光盤(pán)、磁帶等多種存儲(chǔ)介質(zhì)上。存儲(chǔ)系統(tǒng)可以利用目錄查找和定位文檔,實(shí)現(xiàn)工作流作業(yè)文檔和非工作流相關(guān)文檔的集中存放,通過(guò)創(chuàng)建和配置文檔分類(lèi),可根據(jù)文檔的不同屬性、類(lèi)別和狀態(tài)進(jìn)行自動(dòng)分類(lèi)歸檔,不同類(lèi)型的文件分別存儲(chǔ)在各自的子目錄下,也可存儲(chǔ)于不同的文件系統(tǒng),以實(shí)現(xiàn)不同的存儲(chǔ)備份周期和策略。也可以實(shí)現(xiàn)從文件系統(tǒng)到其他廉價(jià)介質(zhì)(光盤(pán),磁帶)的遷移,提供多種靈活的備份方式。

對(duì)于存儲(chǔ)和訪問(wèn)光盤(pán)上的影像作業(yè),可以通過(guò)圖形化用戶(hù)接口對(duì)光盤(pán)塔或獨(dú)立光盤(pán)驅(qū)動(dòng)器中的光盤(pán)進(jìn)行標(biāo)記、插入、裝載、卸出等操作,通過(guò)在數(shù)據(jù)庫(kù)中跟蹤并記錄所有歸檔和未歸檔的影像作業(yè)的物理地址,選擇光盤(pán)塔中合適的光盤(pán),并響應(yīng)來(lái)自用戶(hù)的讀寫(xiě)請(qǐng)求。

3.建立索引及影像文檔管理
影像索引即輸入能惟一識(shí)別和提取該影像的數(shù)據(jù)項(xiàng)。每種類(lèi)型的文檔都有相對(duì)應(yīng)的索引表,索引表存放于相應(yīng)的數(shù)據(jù)庫(kù),文檔的類(lèi)型和索引表在系統(tǒng)維護(hù)和管理工具中定義。索引信息可通過(guò)手工方式錄入,或利用條碼識(shí)別技術(shù)(BCR)與字符識(shí)別技術(shù)(OCR,ICR),通過(guò)掃描條型碼或識(shí)別影像字符自動(dòng)錄入。

4.工作流和自動(dòng)控制
工作流系統(tǒng)為自動(dòng)處理業(yè)務(wù)流程而設(shè)計(jì),通過(guò)對(duì)業(yè)務(wù)處理路徑的定義,來(lái)自動(dòng)有序地管理文檔在企業(yè)內(nèi)各部門(mén)的處理。

工作流系統(tǒng)軟件可實(shí)現(xiàn)如下的功能:

  • 自動(dòng)把作業(yè)遞交給相關(guān)人員;
  • 確認(rèn)業(yè)務(wù)處理每一步必需的信息、應(yīng)用、服務(wù);
  • 實(shí)現(xiàn)作業(yè)的并行處理;
  • 把影像技術(shù)與業(yè)務(wù)處理流程集成;
  • 監(jiān)控處理流程,找出瓶頸,并優(yōu)化業(yè)務(wù)分布和流程;
  • 與原有的主機(jī)系統(tǒng)集成。

影像文檔處理系統(tǒng)的工作流軟件把文檔和文件夾傳送至企業(yè)內(nèi)部合適的人員處理,工作流軟件提供操作簡(jiǎn)單的工作界面,使用戶(hù)可以圖形化地定義文檔的路徑和操作流程,用戶(hù)通過(guò)使用標(biāo)準(zhǔn)的剪切、復(fù)制和粘貼操作或?qū)丶耐侠瓉?lái)定義流程中每一個(gè)工作步驟,通過(guò)對(duì)系統(tǒng)或用戶(hù)定義變量值的簡(jiǎn)單判別,自動(dòng)地安排影像文檔在銀行內(nèi)的作業(yè)流程處理。

5.信息展現(xiàn)
影像文檔處理系統(tǒng)用無(wú)紙化的影像工作流程取代了有紙化的文檔處理,所以,必須有友好的用戶(hù)界面的仿真工作終端、圖標(biāo)和控制鍵等,使具有傳統(tǒng)有紙化工作流程經(jīng)驗(yàn)的操作員能迅速地適應(yīng)和掌握無(wú)紙化工作流程。工作流終端管理工具可以針對(duì)用戶(hù)的特殊業(yè)務(wù)需求設(shè)計(jì)終端界面,以簡(jiǎn)化多步驟的操作過(guò)程。

隨著互聯(lián)網(wǎng)技術(shù)的發(fā)展,影像文檔處理系統(tǒng)也為用戶(hù)提供了基于標(biāo)準(zhǔn)的互聯(lián)網(wǎng)技術(shù)的系統(tǒng)文檔存取和管理。用戶(hù)可以通過(guò)因特網(wǎng)或內(nèi)部網(wǎng)以友好、易用的Web瀏覽器從任意網(wǎng)絡(luò)平臺(tái)或位置與服務(wù)器通信,訪問(wèn)影像和工作流系統(tǒng),進(jìn)行例如業(yè)務(wù)處理、系統(tǒng)維護(hù)等工作,管理人員應(yīng)用Web能夠在任何站點(diǎn),通過(guò)任何Web瀏覽器,提供比傳統(tǒng)的命令驅(qū)動(dòng)的遠(yuǎn)程登錄界面更直接、更易用的圖形界面。

應(yīng)用前景

影像和工作流技術(shù)的運(yùn)用是一個(gè)復(fù)雜的應(yīng)用集成工作,必須考慮到:

  • 工作流程的重組與改進(jìn)既要實(shí)現(xiàn)業(yè)務(wù)發(fā)展目標(biāo),又要保持和擴(kuò)展客戶(hù)群;
  • 員工崗位的重大變化,由于影像和工作流技術(shù)的運(yùn)用,可以實(shí)現(xiàn)業(yè)務(wù)處理一定程度的集中化,解決業(yè)務(wù)受理分散與業(yè)務(wù)處理集中的矛盾;
  • 充分考慮各種技術(shù)的運(yùn)用,如:分布式的存儲(chǔ)可以減少影像文件的傳輸要求,降低對(duì)網(wǎng)絡(luò)的壓力,影像和工作流技術(shù)可以與瀏覽器技術(shù)結(jié)合,更方便地實(shí)現(xiàn)業(yè)務(wù)處理,但必須充分考慮安全技術(shù)的運(yùn)用。

影像和工作流技術(shù)已經(jīng)被國(guó)外金融以及其他行業(yè)廣泛應(yīng)用。在國(guó)外一項(xiàng)對(duì)130家銀行的300名高級(jí)管理人員的調(diào)查中,56%的人認(rèn)為“最重要的投資是技術(shù)投資,特別是網(wǎng)絡(luò)與影像”。在我國(guó),影像和工作流技術(shù)的應(yīng)用與國(guó)外還有較大的差距,但隨著金融電子化進(jìn)程的深入,將會(huì)有更多的系統(tǒng)運(yùn)用影像和工作流及其相關(guān)技術(shù)。

影像和工作流技術(shù)的應(yīng)用范圍非常廣泛,可以影像化的文檔種類(lèi)也十分豐富,例如:憑證、票據(jù)、各種申請(qǐng)或信用狀況資料、圖像、各種文件等。也就是說(shuō),影像與工作流技術(shù)可以被用于所有基于大量紙張文件處理的金融行業(yè)應(yīng)用系統(tǒng)中,如國(guó)際結(jié)算、信貸、個(gè)人貸款、保險(xiǎn)、人事管理、辦公自動(dòng)化等。我們相信隨著IT技術(shù)的發(fā)展,影像和工作流技術(shù)可以被更加廣泛地運(yùn)用在金融以及其他行業(yè)。



JJCEA 2006-07-22 11:40 發(fā)表評(píng)論
]]>
把cvs管理的工程文件移植到另外一臺(tái)機(jī)子上http://www.aygfsteel.com/senlin-blog/archive/2006/06/15/52990.htmlJJCEAJJCEAThu, 15 Jun 2006 06:25:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/06/15/52990.htmlhttp://www.aygfsteel.com/senlin-blog/comments/52990.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/06/15/52990.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/52990.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/52990.html 1.在要移植的機(jī)子上裝的cvs服務(wù)器
2.將工程文件夾拷到要移植的機(jī)子上
3.在Repositories選項(xiàng)中,選擇工程目錄,然后,選擇add,輸入cvsdb
4.在Advanced選項(xiàng)中,前三項(xiàng)打了勾,下面兩個(gè)分別選擇
?? Request Authentication
?? Request Compression
5.客戶(hù)端訪問(wèn)時(shí),修改一下IP地址.
這樣就OK了



JJCEA 2006-06-15 14:25 發(fā)表評(píng)論
]]>
JAVA進(jìn)階:VO(DTO)與PO(DAO)之間的轉(zhuǎn)換http://www.aygfsteel.com/senlin-blog/archive/2006/06/08/51376.htmlJJCEAJJCEAThu, 08 Jun 2006 07:49:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/06/08/51376.htmlhttp://www.aygfsteel.com/senlin-blog/comments/51376.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/06/08/51376.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/51376.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/51376.htmlPO即 Persistence Object
  VO即 Value Object

 VO和PO的主要區(qū)別在于:
  VO是獨(dú)立的Java Object。
  PO是由Hibernate納入其實(shí)體容器(Entity Map)的對(duì)象,它代表了與數(shù)據(jù)庫(kù)中某條記錄對(duì)應(yīng)的Hibernate實(shí)體,PO的變化在事務(wù)提交時(shí)將反應(yīng)到實(shí)際數(shù)據(jù)庫(kù)中。

 實(shí)際上,這個(gè)VO被用作Data Transfer Object,即所謂的DTO。想必,VO就是Data Access Object ---DAO了啦。為什么要有這二者之分呢?如在傳統(tǒng)的MVC架構(gòu)中,位于Model層的PO,是否允許被傳遞到其他層面。由于PO的更新最終將被映射到實(shí)際數(shù)據(jù)庫(kù)中,如果PO在其他層面(如View層)發(fā)生了變動(dòng),那么可能會(huì)對(duì)Model層造成意想不到的破壞。

 主要想說(shuō)的還是如何進(jìn)行二者之間的轉(zhuǎn)換:
  屬性復(fù)制可以通過(guò)Apache Jakarta Commons Beanutils(http://jakarta.apache.org/commons/beanutils/)組件提供的屬性批量復(fù)制功能,避免繁復(fù)的get/set操作。down下來(lái)之后,里面的API DOC一應(yīng)俱全。

 對(duì)于一些無(wú)需處理其它處理(如過(guò)濾)直接用BeanUtilsBean.copyProperties方法,其參考如下:

public static void copyProperties(java.lang.Object dest,
????????????????????????????????? java.lang.Object orig)
?????????????????????????? throws java.lang.IllegalAccessException,
????????????????????????????????? java.lang.reflect.InvocationTargetExceptioCopy property values from the origin bean to the destination bean for all cases where the property names are the same.
 范例1:


?TUser user? =?? new? TUser();
TUser anotherUser? =?? new? TUser();
user.setName( " Emma " );
user.setUserType( 1 );
?try??? {
BeanUtils.copyProperties(anotherUser,user);
System.out.println( " UserName =>? "
?+ anotherUser.getName()
);
System.out.println( " UserType =>? "
?+? anotherUser.getUserType()
);
}?? catch? (IllegalAccessException e)?? {
e.printStackTrace();
}?? catch? (InvocationTargetException e)?? {
e.printStackTrace();
}  
?


 也可以利用其中的一些方法在copy屬性的時(shí)候達(dá)到自己的要求,如:

 范例2

? /** */ /** //*
?* Created on 2006-4-26
? */
?package? com.util;

?import? java.beans.PropertyDescriptor;
?import? java.util.Collection;

?import? org.apache.commons.beanutils.PropertyUtils;


?/** */ /**?? */ /** */ /**
?* CopyUtil
?*? @author? Jkallen
? */
? public?? class? CopyUtil?? {
???
???? /** */ /**?? */ /** */ /**
???? * Copy properties of orig to dest
???? * Exception the Entity and Collection Type
???? *? @param? dest
???? *? @param? orig
???? *? @return? the dest bean
????? */
????? public?? static? Object copyProperties(Object dest, Object orig)?? {
???????? if? (dest? ==?? null?? ||? orig? ==?? null )?? {
???????????? return? dest;
??????? }
???????
??????? PropertyDescriptor[] destDesc? =? PropertyUtils.getPropertyDescriptors(dest);
???????? try??? {
???????????? for? ( int? i? =?? 0 ; i? <? destDesc.length; i ++ )?? {
??????????????? Class destType? =? destDesc[i].getPropertyType();
??????????????? Class origType? =? PropertyUtils.getPropertyType(orig, destDesc[i].getName());
???????????????? if (destType? !=?? null?? &&? destType.equals(origType)
???????????????????????? &&?? ! destType.equals(Class. class ))?? {
???????????????????? if ( ! Collection. class .isAssignableFrom(origType))? {???????????????????
???????????????????????? try? {
??????????????????????????? Object value? =? PropertyUtils.getProperty(orig, destDesc[i].getName());
??????????????????????????? PropertyUtils.setProperty(dest, destDesc[i].getName(), value);
??????????????????????? } catch (Exception ex)? {???????????????????????????
??????????????????????? }
??????????????????? }
??????????????? }
??????????? }
???????????
???????????? return? dest;
??????? } catch (Exception ex)?? {
???????????? throw?? new? CopyException(ex);
?//???????????? return dest;
???????? }
??? }????
???
???? /** */ /**?? */ /** */ /**
???? * Copy properties of orig to dest
???? * Exception the Entity and Collection Type
???? *? @param? dest
???? *? @param? orig
???? *? @param? ignores
???? *? @return? the dest bean
????? */
????? public?? static? Object copyProperties(Object dest, Object orig, String[] ignores)?? {
???????? if? (dest? ==?? null?? ||? orig? ==?? null )?? {
???????????? return? dest;
??????? }
???????
??????? PropertyDescriptor[] destDesc? =? PropertyUtils.getPropertyDescriptors(dest);
???????? try??? {
???????????? for? ( int? i? =?? 0 ; i? <? destDesc.length; i ++ )?? {
???????????????? if? (contains(ignores, destDesc[i].getName()))?? {
???????????????????? continue ;
??????????????? }
???????????????
??????????????? Class destType? =? destDesc[i].getPropertyType();
??????????????? Class origType? =? PropertyUtils.getPropertyType(orig, destDesc[i].getName());
???????????????? if (destType? !=?? null?? &&? destType.equals(origType)
???????????????????????? &&?? ! destType.equals(Class. class ))?? {
???????????????????? if ( ! Collection. class .isAssignableFrom(origType))? {
??????????????????????? Object value? =? PropertyUtils.getProperty(orig, destDesc[i].getName());
??????????????????????? PropertyUtils.setProperty(dest, destDesc[i].getName(), value);
??????????????????? }
??????????????? }
??????????? }
???????????
???????????? return? dest;
??????? } catch (Exception ex)?? {
???????????? throw?? new? CopyException(ex);
??????? }
??? }
???
???? static?? boolean? contains(String[] ignores, String name)?? {
???????? boolean? ignored? =?? false ;
???????? for? ( int? j? =?? 0 ; ignores? !=?? null?? &&? j? <? ignores.length; j ++ )?? {
???????????? if? (ignores[j].equals(name))?? {
??????????????? ignored? =?? true ;
???????????????? break ;
??????????? }
??????? }
???????
???????? return? ignored;
??? }
}
?
?
  

  可以看到,在范例1中通過(guò)方法copyProperties的時(shí)候,二者之間在的屬性名必須相同(Copy property values from the origin bean to the destination bean for all cases where the property names are the same)。而在范例2中通過(guò)
?  Object value = PropertyUtils.getProperty(orig, destDesc[i].getName());
?   PropertyUtils.setProperty(dest, destDesc[i].getName(), value);
  也是將源與目的之間copy相同的屬性名。而VO是在前臺(tái)顯示,所以難免會(huì)用到PO中所不存在的屬性值。比如PO中可能是一個(gè)對(duì)象,而VO中則可能是此對(duì)象的全部屬性。其中的一些轉(zhuǎn)換則需要依據(jù)前臺(tái)需要針對(duì)性地處理啦!

Reference:? Apache DOC and <>



JJCEA 2006-06-08 15:49 發(fā)表評(píng)論
]]>
表現(xiàn)層框架Struts/Tapestry/JSF架構(gòu)比較 http://www.aygfsteel.com/senlin-blog/archive/2006/04/25/43040.htmlJJCEAJJCEATue, 25 Apr 2006 07:49:00 GMThttp://www.aygfsteel.com/senlin-blog/archive/2006/04/25/43040.htmlhttp://www.aygfsteel.com/senlin-blog/comments/43040.htmlhttp://www.aygfsteel.com/senlin-blog/archive/2006/04/25/43040.html#Feedback0http://www.aygfsteel.com/senlin-blog/comments/commentRss/43040.htmlhttp://www.aygfsteel.com/senlin-blog/services/trackbacks/43040.html表現(xiàn)層框架Struts/Tapestry/JSF架構(gòu)比較

板橋里人 http://www.jdon.com 2005/09/12

  Struts/Tapestry/JSF是目前J2EE表現(xiàn)層新老組合的框架技術(shù)。從誕生時(shí)間上看,Struts應(yīng)該比較早,使用得非常廣泛,Tapestry 3.0逐漸引起廣泛的重視,正當(dāng)Tapestry即將大顯身手時(shí)期,SUN推出JSF標(biāo)準(zhǔn)技術(shù),雖然JSF一開(kāi)始推出尚不成熟,留出了一段空白期,但是隨著JSF1.1標(biāo)準(zhǔn)推出,JSF開(kāi)始正面出擊,粉面隆重登場(chǎng)了。

  其實(shí),JSF和Tapestry也并不是那種頭碰頭的相同競(jìng)爭(zhēng)性技術(shù),兩者還是各有側(cè)重點(diǎn)的,不過(guò)比較細(xì)微,但是這種細(xì)微點(diǎn)在實(shí)現(xiàn)一個(gè)大工程時(shí)可能帶來(lái)不同的感受和變化。

  首先,我們從一個(gè)高度來(lái)抽象一下表現(xiàn)層框架應(yīng)有的技術(shù)架構(gòu),下圖可以說(shuō)所有表現(xiàn)層框架技術(shù)都必須實(shí)現(xiàn)的功能架構(gòu)圖:

  當(dāng)然,我們不必廢話(huà)羅嗦MVC模式,MVC模式是基準(zhǔn)模式,現(xiàn)在框架技術(shù)已經(jīng)不必再拼是否是MVC模式了。 在上圖MVC模式基礎(chǔ)上,一個(gè)表現(xiàn)層框架無(wú)外乎要實(shí)現(xiàn)圖中的三個(gè)功能:

1.在當(dāng)前頁(yè)面能夠顯示一個(gè)組件對(duì)象的內(nèi)容;而不是象純JSP那樣,需要在Jsp頁(yè)面寫(xiě)入“調(diào)用對(duì)象方法”的Java代碼。

2.當(dāng)用戶(hù)按下頁(yè)面的提交按扭或鏈接后,事件發(fā)生,這時(shí)應(yīng)該觸發(fā)服務(wù)器端并將當(dāng)前頁(yè)面的參數(shù)提交給服務(wù)器。這種機(jī)制表現(xiàn)在Form表單提交和有參數(shù)的鏈接<a href=""></a>

3.從一個(gè)頁(yè)面視圖直接跳轉(zhuǎn)到另外一個(gè)頁(yè)面視圖,單純的導(dǎo)航作用。

我們通過(guò)下表來(lái)比較這 三種框架在實(shí)現(xiàn)上圖各個(gè)功能時(shí)技術(shù)細(xì)節(jié),從而得出他們的異同點(diǎn)和偏重點(diǎn)。

? Struts Tapestry3.0 JSF
在View顯示的組件要求

組件必須繼承ActionForm

分顯式調(diào)用和隱式調(diào)用
組件必須繼承BaseComponent
普通POJO
無(wú)需繼承
Managed Bean
組件在View顯示粒度 View頁(yè)面只能顯示與表單對(duì)應(yīng)的ActionForm,配置中Action ActionForm 頁(yè)面一般只能1:1:1關(guān)系。 可將組件嵌入頁(yè)面任何一行,對(duì)使用組件數(shù)量無(wú)限制。 同Tapestry
頁(yè)面分區(qū)tiles 使用Tiles標(biāo)簽庫(kù)實(shí)現(xiàn),需要另外tiles-def.xml配置文件 組件有自己的視圖頁(yè)面,通過(guò)調(diào)用組件即直接實(shí)現(xiàn)多個(gè)頁(yè)面組合。強(qiáng)大自然的頁(yè)面組合是其特點(diǎn)。 通過(guò)組件+標(biāo)簽庫(kù)實(shí)現(xiàn)Subview,但如需重用Layout,還要結(jié)合Tiles.
頁(yè)面跳轉(zhuǎn) 使用標(biāo)簽庫(kù)html:link中寫(xiě)明目標(biāo)URL,URL名稱(chēng)需要對(duì)照配置文件的path命名,與組件Action耦合。 URL名稱(chēng)是目標(biāo)的組件名稱(chēng),不涉及URL和路徑等操作,方便穩(wěn)固。 類(lèi)似Struts,也需要在配置文件中查找,與組件分離。
參數(shù)傳遞 使用html:link時(shí)傳遞參數(shù)超過(guò)一個(gè)以上處理麻煩。 直接調(diào)用組件,直接賦予參數(shù),沒(méi)有參數(shù)個(gè)數(shù)限制 參數(shù)分離傳遞給組件
事件觸發(fā) 通過(guò)表單提交submit激活,不能細(xì)化到表單里字段。 能夠給于表單每個(gè)字段貼一個(gè)事件,事件組件必須實(shí)現(xiàn)PageListener接口 同Tapestry,事件組件必須實(shí)習(xí)ActionListener 接口

Struts組件編程模型

  Struts實(shí)現(xiàn)組件編程時(shí)有一些復(fù)雜:經(jīng)常為一個(gè)頁(yè)面中需要引入多個(gè)組件而頭疼,因?yàn)镾truts中無(wú)法直接引入多個(gè)組件,必須繞一些圈子:

  一般分兩種情況:如果同一個(gè)Action就可以對(duì)付這些組件,那么在這種情況下有兩個(gè)辦法:

1.將這多個(gè)組件裝入一個(gè)ActionForm中,如使用MapForm等機(jī)制;

2.手工將多個(gè)組件裝入request/session等scope中,然后根據(jù)其名稱(chēng)在jsp中獲得。

  這兩個(gè)方法都有缺點(diǎn): 第一種辦法經(jīng)常一個(gè)ActionForm弄得面目全非,變成一個(gè)大雜燴,違反了OO分派封裝的原則;第2種辦法其實(shí)又回到j(luò)sp編程;

  第二種情況,如果這些組件必須有預(yù)先由不同的Action來(lái)處理,每個(gè)組件必須經(jīng)過(guò)Action -->ActionForm流程,在這種情況下有兩種辦法:

1.使用Tiles, 不同流程輸出到同一個(gè)頁(yè)面的不同區(qū)域。是一種并行處理方式。

2. 對(duì)多個(gè)流程首尾相連,第一Action forward結(jié)果是第二個(gè)Action,最后輸出一個(gè)Jsp,在這個(gè)jsp中就可以使用前面多個(gè)流程的多個(gè)ActionForm了,這屬于串行方式。

Struts組件模型缺點(diǎn)

  Struts組件編程必須限定在Action/ActionForm/JSP這三個(gè)框框中做文章,難度相對(duì)比較大,而Tapestry/JSF則沒(méi)有太多這些技術(shù)框框限制,兩者在組件編程方面更讓編程者自由一些,方便一些,這也是組件型框架的優(yōu)勢(shì)吧。

Struts標(biāo)簽庫(kù)

  在Struts中,經(jīng)常需要使用標(biāo)簽庫(kù)來(lái)顯示組件ActionForm中內(nèi)容,這就涉及到一個(gè)結(jié)合的問(wèn)題,標(biāo)簽庫(kù)是別人寫(xiě)的,參考Struts的標(biāo)簽庫(kù)用法,而組件是自己的,難度和麻煩就體現(xiàn)在這個(gè)結(jié)合點(diǎn)上。

  JSF基本思路和Struts差不多,只不過(guò)換了不同標(biāo)簽庫(kù),也需要標(biāo)簽庫(kù)+組件的結(jié)合思考,不過(guò)因?yàn)榻M件這里是通用組件,沒(méi)有什么限制,所以這樣比Struts要輕松一些。

  Tapestry使用了組件庫(kù)概念替代了標(biāo)簽庫(kù),沒(méi)有標(biāo)簽庫(kù)概念,這樣就沒(méi)有標(biāo)簽庫(kù)和自己的組件需要結(jié)合的問(wèn)題,都是組件的使用,組件中分Tapestry標(biāo)準(zhǔn)組件和自己定義的組件,這也是接觸了Jsp體系的人學(xué)習(xí)Tapestry面臨的一個(gè)思路轉(zhuǎn)換。

  具體以頁(yè)面跳轉(zhuǎn)為例子,頁(yè)面跳轉(zhuǎn)是靠鏈接<a href="目標(biāo)"></a> 實(shí)現(xiàn),鏈接是頁(yè)面經(jīng)常使用的元素。

  Struts提供的html:link在頻繁使用就特別不方便,尤其在傳遞多個(gè)參數(shù)時(shí):其中html:link的page值,是跳轉(zhuǎn)對(duì)方頁(yè)面或Action的path,這個(gè)path一般需要到struts-config.xml查找Action的相應(yīng)path,一旦配置文件path值修改,涉及到這個(gè)所有相關(guān)頁(yè)面都要修改。

  JSF將鏈接概念劃分兩個(gè)方面:導(dǎo)航性質(zhì)和事件激活,在導(dǎo)航方面還是需要到配置faces-config查詢(xún)Navigation的from-outcome的值。

  由于Tapestry沒(méi)有標(biāo)簽庫(kù)概念,只有組件或頁(yè)面兩個(gè)概念,因此,鏈接跳轉(zhuǎn)目標(biāo)要么是組件,要么是頁(yè)面,簡(jiǎn)潔簡(jiǎn)單,它沒(méi)有多余的path概念,就是組件名,也就是對(duì)象名稱(chēng),組件名稱(chēng)和path名稱(chēng)合二為一。

總結(jié)

  JSF在很大程度上類(lèi)似Struts,而不是類(lèi)似Tapestry,可以說(shuō)是一種Struts 2.0,都是采取標(biāo)簽庫(kù)+組件的形式,只是JSF的組件概念沒(méi)有象Struts那樣必須繼承ActionForm的限制;JSF在事件粒度上要細(xì)膩,不象Struts那樣,一個(gè)表單一個(gè)事件,JSF可以細(xì)化到表單中的每個(gè)字段上。

  JSF只有在組件和事件機(jī)制這個(gè)概念上類(lèi)似Tapestry,但是不似Tapestry那樣是一個(gè)完全組件的框架,所以,如果你做一個(gè)對(duì)頁(yè)面要求靈活度相當(dāng)高的系統(tǒng),選用Tapestry是第一考慮。

  Struts/JSF則適合在一般的數(shù)據(jù)頁(yè)面錄入的系統(tǒng)中,對(duì)于Struts和JSF的選用,我目前個(gè)人觀點(diǎn)是:如果你是一個(gè)新的系統(tǒng),可以直接從JSF開(kāi)始;如果你已經(jīng)使用Struts,不必轉(zhuǎn)換,如果需要切換,可以將JSF和Tapestry一起考慮。

  另外,JSF/Tapestry不只是支持Html,也支持多種客戶(hù)端語(yǔ)言如WML或XUI等。

  這三者之間關(guān)系:如果說(shuō)Struts是左派;那Tapestry則是右派;而JSF則是中間派,中庸主義是SUN聯(lián)盟的一貫策略。



JJCEA 2006-04-25 15:49 發(fā)表評(píng)論
]]>
主站蜘蛛池模板: 南投县| 凯里市| 亚东县| 高台县| 淳化县| 唐山市| 余庆县| 东安县| 玉屏| 河南省| 沙洋县| 江北区| 临夏市| 平安县| 会泽县| 平武县| 赤水市| 潮州市| 井研县| 汝阳县| 成安县| 古蔺县| 安溪县| 瑞丽市| 吴忠市| 遂平县| 昆山市| 云龙县| 云霄县| 晋宁县| 依兰县| 孝昌县| 托里县| 静海县| 江阴市| 玉山县| 黎平县| 康定县| 乐山市| 宜章县| 象州县|