[英]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.