Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 自定义帮助选项卡中的Eclipse RCP错误404_Java_Jsp_Eclipse Rcp_Embedded Jetty - Fatal编程技术网

Java 自定义帮助选项卡中的Eclipse RCP错误404

Java 自定义帮助选项卡中的Eclipse RCP错误404,java,jsp,eclipse-rcp,embedded-jetty,Java,Jsp,Eclipse Rcp,Embedded Jetty,我想在基于Eclipse3.7的EclipseRCP应用程序中添加一些高级功能来帮助浏览器。我为帮助功能和扩展的org.eclipse.help.webapp.AbstractView创建了一个单独的插件: import java.util.Locale; import org.eclipse.help.webapp.AbstractView; public class CustomView extends AbstractView { @Override public S

我想在基于Eclipse3.7的EclipseRCP应用程序中添加一些高级功能来帮助浏览器。我为帮助功能和扩展的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

在同一个插件中,我有一个文件夹插件/帮助文件CustomView.jsp:

<html>
<head>
<title>View Test</title>
</head>

<body>
<h1>Hellp JSP!</h1>
</body>
</html>

由码头提供动力://


我做错了什么?如何正确显示此选项卡内容?

我找到了失败的原因。在剖析帮助插件之后,我发现了定义的其他扩展,允许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的视图

<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>