锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲乱码精品,99国产精品久久久久久久成人热,国产精一区二区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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 万盛区| 沛县| 青川县| 柏乡县| 麟游县| 崇阳县| 虎林市| 安国市| 乌拉特后旗| 彭阳县| 西乌| 新安县| 沁阳市| 咸宁市| 济南市| 绩溪县| 沁水县| 云和县| 印江| 巫山县| 德惠市| 华阴市| 三亚市| 万载县| 都安| 巫山县| 汤原县| 吉隆县| 蓬安县| 南宫市| 巨野县| 禄丰县| 临汾市| 大冶市| 库尔勒市| 张家口市| 佛山市| 平塘县| 于田县| 东辽县| 武夷山市|