[英]Eclipse RCP error 404 in custom help tab
我想添加一些高級功能來幫助基於Eclipse 3.7的Eclipse RCP應用程序中的瀏覽器。 我創建了一個用於幫助功能的單獨插件,並擴展了org.eclipse.help.webapp.AbstractView:
import java.util.Locale;
import org.eclipse.help.webapp.AbstractView;
public class CustomView extends AbstractView {
@Override
public String getImageURL() {
return "";
}
@Override
public char getKey() {
return 0;
}
@Override
public String getName() {
return "Custom";
}
@Override
public String getTitle(Locale arg0) {
return "Test Title";
}
@Override
public String getURL() {
return "/";
}
@Override
public String getBasicURL() {
return getURL();
}
}
我添加了擴展org.eclipse.help.webapp.view
指向該類。
在同一個插件中,我有一個文件夾Plugin / help,帶有文件CustomView.jsp:
<html>
<head>
<title>View Test</title>
</head>
<body>
<h1>Hellp JSP!</h1>
</body>
</html>
此文件夾已添加到build.properties文件。
另一個標簽按預期出現在幫助內容瀏覽器窗口中,但我唯一得到的是此標簽框架內的404錯誤:
HTTP錯誤404訪問/help/CustomView.jsp時出現問題。 原因:
/CustomView.jsp
由Jetty://提供技術支持
我在做什么錯以及如何使此選項卡內容正確顯示?
我已經找到失敗的原因。 剖析幫助插件后,我發現已定義了其他擴展名,這些擴展名允許Equinox將插件項目中提供的幫助文件用作可訪問資源。 這是我在擴展部分的plugin.xml中輸入的內容:
<extension point="org.eclipse.help.webapp.view">
<view class="plugin.CustomView"></view>
</extension>
<extension point="org.eclipse.equinox.http.registry.httpcontexts">
<httpcontext id="help">
<resource-mapping path="/"> </resource-mapping>
</httpcontext>
</extension>
<extension point="org.eclipse.equinox.http.registry.resources">
<resource alias="/help" base-name="/help" httpcontextId="help"> </resource>
</extension>
第一類是實際的視圖定義類。 接下來是指向插件根目錄的幫助上下文,最后一個是包含JSP文件的實際文件夾,相對於插件根目錄和別名的位置對瀏覽器可用。 在我的應用程序中添加了這些信息中心之后,在新標簽中顯示我的測試HTML代碼。 幫助插件中的其他擴展點(在信息中心中添加基於JSP的新視圖)也是如此。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.