锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品久久久久,一区二区三区av,亚洲一区二区精品http://www.aygfsteel.com/lmsun/category/3301.htmlzh-cnWed, 28 Feb 2007 20:14:02 GMTWed, 28 Feb 2007 20:14:02 GMT60Java鐜鍙橀噺璁劇疆http://www.aygfsteel.com/lmsun/articles/17670.htmlmy javamy javaTue, 01 Nov 2005 06:04:00 GMThttp://www.aygfsteel.com/lmsun/articles/17670.htmlhttp://www.aygfsteel.com/lmsun/comments/17670.htmlhttp://www.aygfsteel.com/lmsun/articles/17670.html#Feedback0http://www.aygfsteel.com/lmsun/comments/commentRss/17670.htmlhttp://www.aygfsteel.com/lmsun/services/trackbacks/17670.htmlJAVA_HOME=D:\j2sdk1.4.2_03
Path=D:\j2sdk1.4.2_03;D:\j2sdk1.4.2_03\bin
CLASSPATH=.;D:\j2sdk1.4.2_03\lib\tools.jar;D:\j2sdk1.4.2_03\lib\dt.jar;D:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\servlet-api.jar;D:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\jsp-api.jar



my java 2005-11-01 14:04 鍙戣〃璇勮
]]>
struts in action 涓殑register-complete.war閮ㄧ講澶辮觸闂http://www.aygfsteel.com/lmsun/articles/12537.htmlmy javamy javaFri, 09 Sep 2005 05:53:00 GMThttp://www.aygfsteel.com/lmsun/articles/12537.htmlhttp://www.aygfsteel.com/lmsun/comments/12537.htmlhttp://www.aygfsteel.com/lmsun/articles/12537.html#Feedback0http://www.aygfsteel.com/lmsun/comments/commentRss/12537.htmlhttp://www.aygfsteel.com/lmsun/services/trackbacks/12537.htmlstruts in action 涓殑register-complete.war,鍦╰omcat涓儴緗插悗,褰撹緭鍏ョ敤鎴峰悕鍜屽瘑鐮佸悗鎬繪槸緇欏嚭failure欏甸潰鐨勮В鍐蟲柟娉?BR>
1銆侀鍏堝皢紼嬪簭鏀懼湪涓涓嬫病鏈夌┖鏍肩殑鐩綍涓紙涓嶈兘鏀懼湪濡侾rogram Files涓級
渚嬪鍦―鐩樼殑鏍圭洰褰曚笅鏂板緩鐩綍錛歮yregister.
鍦?server.xml涓姞鍏ワ細
<Context path="/myregister"
docBase="d:\myregister\"
crossContext="false"
debug="0"
reloadable="true" >

<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_dbtest_log." suffix=".txt"
timestamp="true"/>

</Context>


2銆佹壘鍒癠serDirectory.java涓笅闈唬鐮侊細
    public void setUser(String userId, String password) throws
            UserDirectoryException {

        // no nulls
        if ((null==userId) || (null==password)) {
         System.out.print("userid is null");
            throw new UserDirectoryException();
        }


        try {

            // conform userId to uppercase when stored
            p.put(fixId(userId), password);
            String o = this.getClass().getClassLoader().getResource(UserDirectoryFile).getFile();
            p.store(new FileOutputStream(o), UserDirectoryHeader);

           
        }

        catch (IOException e) {
            throw new UserDirectoryException();

       }
    }


淇敼涓猴細
    public void setUser(String userId, String password) throws
            UserDirectoryException {

        // no nulls
        if ((null==userId) || (null==password)) {
         System.out.print("userid is null");
            throw new UserDirectoryException();
        }


        try {

            // conform userId to uppercase when stored
            p.put(fixId(userId), password);
            String o = this.getClass().getClassLoader().getResource(UserDirectoryFile).getFile();
     System.out.println(o); //o is /D:/myregister/WEB-INF/classes/resources/users.properties
     String ostr=o.substring(1); // the  line must be add is to use to remove the "/" in  String o
     System.out.println(ostr); //ostr is D:/myregister/WEB-INF/classes/resources/users.properties
            p.store(new FileOutputStream(ostr), UserDirectoryHeader);//modify o as ostr

           
        }

        catch (IOException e) {
            throw new UserDirectoryException();

       }
    }

娉ㄦ剰鏈鍏抽敭鐨勬槸灝嗭細this.getClass().getClassLoader().getResource(UserDirectoryFile).getFile();鎵鑾峰緱鐨勫瓧絎︿覆榪涜澶勭悊鍥犱負瀹冨墠闈㈠浜嗕竴涓?/"銆傞渶瑕佸幓鎺夈?BR>


鑻辨枃錛?BR>
I found a solution to your problem

first step:
you must deploy the application build a folder  make sure you don't use
a directory which has any spaces in the path (such as the Program Files directory on Windows)as this may
cause the UserDirectoryException.
such as build a folder "myregister"  in Driver D and copy the program in it.

add the following codes to server.xml:

<Context path="/myregister"
docBase="d:\myregister\"
crossContext="false"
debug="0"
reloadable="true" >

<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_dbtest_log." suffix=".txt"
timestamp="true"/>

</Context>

    

second step:
just find the following code within the 'UserDirectory.java'
    public void setUser(String userId, String password) throws
            UserDirectoryException {

        // no nulls
        if ((null==userId) || (null==password)) {
         System.out.print("userid is null");
            throw new UserDirectoryException();
        }


        try {

            // conform userId to uppercase when stored
            p.put(fixId(userId), password);
            String o = this.getClass().getClassLoader().getResource(UserDirectoryFile).getFile();
            p.store(new FileOutputStream(o), UserDirectoryHeader);

           
        }

        catch (IOException e) {
            throw new UserDirectoryException();

       }
    }


modify as follow:
    public void setUser(String userId, String password) throws
            UserDirectoryException {

        // no nulls
        if ((null==userId) || (null==password)) {
         System.out.print("userid is null");
            throw new UserDirectoryException();
        }


        try {

            // conform userId to uppercase when stored
            p.put(fixId(userId), password);
            String o = this.getClass().getClassLoader().getResource(UserDirectoryFile).getFile();
     System.out.println(o); //o is /D:/myregister/WEB-INF/classes/resources/users.properties
     String ostr=o.substring(1); // the  line must be add is to use to remove the "/" in  String o
     System.out.println(ostr); //ostr is D:/myregister/WEB-INF/classes/resources/users.properties
            p.store(new FileOutputStream(ostr), UserDirectoryHeader);//modify o as ostr

           
        }

        catch (IOException e) {
            throw new UserDirectoryException();

       }
    }


by the way,the String o is /D:/myregister/WEB-INF/classes/resources/users.properties
the String ostr is D:/myregister/WEB-INF/classes/resources/users.properties



my java 2005-09-09 13:53 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 囊谦县| 绥滨县| 白银市| 芜湖市| 滨海县| 巴中市| 鄂伦春自治旗| 垣曲县| 江都市| 九江县| 桦南县| 九台市| 满洲里市| 永城市| 枝江市| 鸡西市| 博客| 越西县| 苏州市| 克什克腾旗| 澜沧| 桓台县| 南郑县| 周宁县| 井陉县| 彭泽县| 伽师县| 三河市| 汉寿县| 普兰县| 静乐县| 义乌市| 南昌县| 定南县| 云梦县| 民县| 德化县| 新乡市| 土默特左旗| 大石桥市| 黑山县|