Blueimp 論壇首頁
  首頁  | 討論區  | 最新話題  | 搜尋  | XML  |  登入

此話題中所有文章數: 26 [ 話題狀態: 一般 ]
文章(s): 26   頁(s): 4   [ 上一頁 | 1 2 3 4 | 下一頁 ]
上一話題 此文章已經觀看 18122 次 而且有 25 篇回應 下一話題
  男寶寶 totology 《一般生》
文章: 66
v3.8.8

Re: 轉址 (Context Path) on JBoss

小惡魔應該是要小弟放到mvnplugin內的mvnforum吧
小弟剛剛放了以後才想到
若是小惡魔放的話應該是要打 http://server-ip/play/PrintContextPath.jsp

小弟放到這個地方會開不出來
因為小弟原本就沒辦法打 http://server-ip/contextPath 進入網頁了阿
小弟是有試著在 最初的index.jsp 將contextPath印在jboss的console端
是空白的
或許我應該也可以試著在user內的index.jsp印印看
結果如附圖
果然還是沒有抓到context path


ps 今天小弟公司電腦系統重做 用NB上再處理
動作有點慢請見諒 biggrin
----------------------------------------
附加檔案 user-index.JPG (124887 bytes) (下載次數: 756)

[2007/11/21 下午 01:34:16]   [返迴此篇文章頂端 ]  回到頂端 
會員大頭照
男寶寶 jieh 《騎士團團長》
文章: 6857
v3.8.8

Re: 轉址 (Context Path) on JBoss

mvnplugin 內的 mvnforum?

我沒有在家裡 所以用公司的測試環境 copy 圖片給你看 是不是有哪個地方有不一致

不是放在 mvnplugin 內的 mvnforum 喔 而是放在 mvnplugin 的上層

你提到的 user 是在下面去了 而且那是要能正常經過 mvnfroumHome 才會正常運作
----------------------------------------
附加檔案 noname.gif (5495 bytes) (下載次數: 753)

----------------------------------------
支持小惡魔
BTC : 19tn3RnCuwZVukXAwyhDWZD4uBgUZoGJPx
LTC : LTFa17pSvvoe3aU5jbmfcmEpo1xuGa9XeA
知識跟八卦一樣,越多人知道越有價值;知識最好的備份方法,散播!
藍色小惡魔(林永傑): 臉書
----------------------------------------
[編輯文章 2 次, 最後修改: jieh 於 2007/11/21 下午 02:29:11]
[2007/11/21 下午 02:27:00]   [返迴此篇文章頂端 ]  回到頂端 
  男寶寶 totology 《一般生》
文章: 66
v3.8.8

Re: 轉址 (Context Path) on JBoss

那請問小惡魔網址要打啥進入?
以小惡魔為例是否為
http://server-ip/Forum/mvnforum/PrintContextPath.jsp

若是的話
小弟是無法讀到這個檔案的
因為小弟確定沒有抓到contextPath
小弟上篇文章附圖中為小弟進論壇的 /mvnplugin/user/index.jsp 的畫面

小弟已將小惡魔的程式合併在該檔內
會在jboss的console端印出訊息(小弟圈起來的地方)
----------------------------------------
[編輯文章 1 次, 最後修改: totology 於 2007/11/21 下午 02:42:11]
[2007/11/21 下午 02:41:30]   [返迴此篇文章頂端 ]  回到頂端 
會員大頭照
男寶寶 jieh 《騎士團團長》
文章: 6857
v3.8.8

Re: 轉址 (Context Path) on JBoss

smile 了解了... 你有 try 到就好

我實測過 放我說的地方 和 放在 mvnplugin/user 內

一樣打 http://host-ip/Forum/PrintContextPath.jsp 即可測試

mvnforum 有把 URL 轉好...

不過問題是一樣的 你的 mvnforum 確實是 deploy 到 ROOT 去了
----------------------------------------
支持小惡魔
BTC : 19tn3RnCuwZVukXAwyhDWZD4uBgUZoGJPx
LTC : LTFa17pSvvoe3aU5jbmfcmEpo1xuGa9XeA
知識跟八卦一樣,越多人知道越有價值;知識最好的備份方法,散播!
藍色小惡魔(林永傑): 臉書
[2007/11/21 下午 05:46:04]   [返迴此篇文章頂端 ]  回到頂端 
  男寶寶 totology 《一般生》
文章: 66
v3.8.8

Re: 轉址 (Context Path) on JBoss

給小惡魔看看我今天發現的錯誤
http://www.javaworld.com.tw/jute/post/view?bid=57&id=212015&sty=1&tpg=1&age=0

這是mvnForum的src內的一小段

/**
* This function is used to get the classpath of a reference of one class
* First, this method tries to get the path from system properties
* named "mvncore.context.path" (can be configed in web.xml). If it cannot
* find this parameter, then it will tries to load from the ClassLoader
* @todo FIXME: load from ClassLoader is not correct on Resin/Linux
*/
public static String getServletClassesPath() {
if (servletClassesPath == null) {
String strPath = System.getProperty("mvncore.context.path");
if (strPath != null && (strPath.length() > 0)) {
servletClassesPath = strPath;
} else {
ClassLoader classLoader = instance.getClass().getClassLoader();
URL url = classLoader.getResource("/");
if (url == null) {
// not run on the Servlet environment
servletClassesPath = ".";
} else {
servletClassesPath = url.getPath();
}
}
log.debug("servletClassesPath = " + servletClassesPath);
if (servletClassesPath.endsWith(File.separator) == false) {
servletClassesPath = servletClassesPath + File.separatorChar;
//log.warn("servletClassesPath does not end with /: " + servletClassesPath);
}
}
return servletClassesPath;
}


小弟判斷是
 

if (url == null ) {
// not run on the Servlet environment
servletClassesPath = ".";
} else {
servletClassesPath = url.getPath();
}


這小段出了問題,只是這個url是我們能去設定的嗎?
----------------------------------------
[編輯文章 1 次, 最後修改: totology 於 2007/11/21 下午 07:32:16]
[2007/11/21 下午 06:05:21]   [返迴此篇文章頂端 ]  回到頂端 
  男寶寶 totology 《一般生》
文章: 66
v3.8.8

Re: 轉址 (Context Path) on JBoss

修正上面錯誤
經過javaworld的高手提醒小弟找到一個錯誤
小弟在設定database_url時有地方打錯

目前deploy還是有小部分錯誤(附圖)
繼續偵錯... crying
----------------------------------------
附加檔案 deploy-error1.JPG (33724 bytes) (下載次數: 741)

[2007/11/22 上午 08:58:47]   [返迴此篇文章頂端 ]  回到頂端 
會員大頭照
男寶寶 jieh 《騎士團團長》
文章: 6857
v3.8.8

Re: 轉址 (Context Path) on JBoss

ClassLoader classLoader = instance.getClass().getClassLoader();
URL url = classLoader.getResource("/");

不能去設定... 但是能改變...
他是從 runtime 時該物件取出的屬性
依原理來說 就是你的 class 或 該物件所依附的 jar 被啟用當時的路徑

如果以 Tomcat mvnforum 來說 default : WEB-INF/lib/...
但是如果把 mvnforum.jar 剪到 Tomcat common/lib/... 之下時
mvnforum 的程式可以被讀取 但是... 此時取得的 URL 將截然不同

我沒有實作 主要是因為 這樣做意義不大
因為你把 classes 放去非程式預期普遍的作法
可能引起的副作用 或者你要調整的設定將更多 smile
----------------------------------------
支持小惡魔
BTC : 19tn3RnCuwZVukXAwyhDWZD4uBgUZoGJPx
LTC : LTFa17pSvvoe3aU5jbmfcmEpo1xuGa9XeA
知識跟八卦一樣,越多人知道越有價值;知識最好的備份方法,散播!
藍色小惡魔(林永傑): 臉書
[2007/11/22 上午 09:09:48]   [返迴此篇文章頂端 ]  回到頂端 
  男寶寶 totology 《一般生》
文章: 66
v3.8.8

Re: 轉址 (Context Path) on JBoss

這個地方小弟已經解了

現在進度讓小弟有點confuse
附圖為小弟console端畫面
紅框的地方是小弟不知道為啥會出現的東西 sad
----------------------------------------
附加檔案 deploy-error1.JPG (109562 bytes) (下載次數: 724)

[2007/11/22 上午 09:36:18]   [返迴此篇文章頂端 ]  回到頂端 
文章(s): 26   頁(s): 4   [ 上一頁 | 1 2 3 4 | 下一頁 ]