Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » Run a JSP from within a help plugin
Run a JSP from within a help plugin [message #492315] Mon, 19 October 2009 22:16 Go to next message
Douglas Dirks is currently offline Douglas DirksFriend
Messages: 26
Registered: July 2009
Junior Member
Hi all,

I'm searching for a way to incorporate a JSP in a help plugin.

I assume that there is some extension point that will allow me to instruct the jetty JSP server to compile .jsp files within my plugin, but so far I've been unsuccessful finding this information in the docs. Any pointers at all would be much appreciated.

Thanks,
Doug
Re: Run a JSP from within a help plugin [message #492324 is a reply to message #492315] Mon, 19 October 2009 23:26 Go to previous messageGo to next message
Douglas Dirks is currently offline Douglas DirksFriend
Messages: 26
Registered: July 2009
Junior Member
For what it's worth, I found a bug report (opened by me, go figure) referring to this behavior. The resolution suggests it is possible to compile and run a .jsp from a help plugin. The bug is

https://bugs.eclipse.org/bugs/show_bug.cgi?id=214946

I cannot, however, seem to make this work as described in the resolution description.

I'm using Eclipse 3.4.2, which is the only difference I can spot between the plugin description in the bug report and my own plugin.
Re: Run a JSP from within a help plugin [message #492587 is a reply to message #492324] Tue, 20 October 2009 22:10 Go to previous messageGo to next message
Douglas Dirks is currently offline Douglas DirksFriend
Messages: 26
Registered: July 2009
Junior Member
Continuing to explore this, I'm going to post the contents of some of my plugin files in hopes someone will see what is wrong.

My plugin.xml file looks like this:

<plugin name="IDL Help" id="com.rsi.idl.doc.base"
  version="8.0.0.M0" provider-name="ITT">

   <extension point="org.eclipse.equinox.http.registry.servlets">
      <servlet
         alias="/jsp/*.jsp"
         class="org.eclipse.equinox.jsp.jasper.registry.JSPFactory:">
      </servlet>
      <serviceSelector
         filter="(other.info=org.eclipse.help)">
      </serviceSelector>
   </extension>

   <extension point="org.eclipse.equinox.http.registry.resources">
      <resource
         alias="/doc"
         base-name="/">
      </resource>
      <serviceSelector
         filter="(other.info=org.eclipse.help)">
      </serviceSelector>
    </extension>
  
</plugin>


My MANIFEST.MF file looks like this:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: IDL Documentation base
Bundle-SymbolicName: com.rsi.idl.doc.base; singleton:=true
Bundle-Version: 8.0.0.M0
Bundle-Vendor: ITT Visual Information Solutions
Require-Bundle: org.eclipse.equinox.jsp.jasper.registry



I'm trying to call a file called test.jsp located in the root of the plugin directory. test.jsp contains the following:

<html>
   <body>
      Hello World - <%=new java.util.Date()%>
   </body>
</html>


When I start the help system and attempt to load

http://127.0.0.1:2635/help/jsp/test.jsp


I get the following error:

HTTP ERROR: 500

Plug-in com.rsi.idl.doc.base was unable to load class org.eclipse.equinox.jsp.jasper.registry.JSPFactory.

RequestURI=/help/jsp/test.jsp


Can this be some sort of class path issue? The org.eclipse.equinox.jsp.jasper.registry.*.jar file is in my plugins directory, and all of the other JSPs in the help system load properly.

Any ideas?
Re: Run a JSP from within a help plugin [message #493263 is a reply to message #492315] Sat, 24 October 2009 02:29 Go to previous messageGo to next message
Chris Goldthorpe is currently offline Chris GoldthorpeFriend
Messages: 815
Registered: July 2009
Senior Member
It sounds as though you are close - does your plugin have dependencies to org.eclipse.equinox.jasper and org.eclipse.equinox.jasper.registry?
Re: Run a JSP from within a help plugin [message #493976 is a reply to message #493263] Wed, 28 October 2009 16:02 Go to previous message
Douglas Dirks is currently offline Douglas DirksFriend
Messages: 26
Registered: July 2009
Junior Member
Got it.

The necessary change was to add a slash to the end of the servlet class attribute. The plugin.xml now contains the following:

   <extension point="org.eclipse.equinox.http.registry.servlets">
      <servlet
         alias="/jsp/*.jsp"
         class="org.eclipse.equinox.jsp.jasper.registry.JSPFactory:/">
      </servlet>
      <serviceSelector
         filter="(other.info=org.eclipse.help)">
      </serviceSelector>
   </extension>


Note the slash at the end of
org.eclipse.equinox.jasper.registry.JSPFactory:/


I don't quite understand why this is necessary, but adding it seemed to do the trick.

Now, on to my next challenge: getting access to Java functions defined in other plugins. Most notably org.eclipse.help.webapp.


Re: Run a JSP from within a help plugin [message #623761 is a reply to message #492324] Tue, 20 October 2009 22:10 Go to previous message
Douglas Dirks is currently offline Douglas DirksFriend
Messages: 26
Registered: July 2009
Junior Member
Continuing to explore this, I'm going to post the contents of some of my plugin files in hopes someone will see what is wrong.

My plugin.xml file looks like this:

<plugin name="IDL Help" id="com.rsi.idl.doc.base"
version="8.0.0.M0" provider-name="ITT">

<extension point="org.eclipse.equinox.http.registry.servlets">
<servlet
alias="/jsp/*.jsp"
class="org.eclipse.equinox.jsp.jasper.registry.JSPFactory:" >
</servlet>
<serviceSelector
filter="(other.info=org.eclipse.help)">
</serviceSelector>
</extension>

<extension point="org.eclipse.equinox.http.registry.resources">
<resource
alias="/doc"
base-name="/">
</resource>
<serviceSelector
filter="(other.info=org.eclipse.help)">
</serviceSelector>
</extension>

</plugin>

My MANIFEST.MF file looks like this:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: IDL Documentation base
Bundle-SymbolicName: com.rsi.idl.doc.base; singleton:=true
Bundle-Version: 8.0.0.M0
Bundle-Vendor: ITT Visual Information Solutions
Require-Bundle: org.eclipse.equinox.jsp.jasper.registry


I'm trying to call a file called test.jsp located in the root of the plugin directory. test.jsp contains the following:

<html>
<body>
Hello World - <%=new java.util.Date()%>
</body>
</html>

When I start the help system and attempt to load

http://127.0.0.1:2635/help/jsp/test.jsp

I get the following error:

HTTP ERROR: 500

Plug-in com.rsi.idl.doc.base was unable to load class org.eclipse.equinox.jsp.jasper.registry.JSPFactory.

RequestURI=/help/jsp/test.jsp

Can this be some sort of class path issue? The org.eclipse.equinox.jsp.jasper.registry.*.jar file is in my plugins directory, and all of the other JSPs in the help system load properly.

Any ideas?
Previous Topic:standalone html help and resource ids (contextIds)
Next Topic:Eclipse help very slow to start on Suse 11.0
Goto Forum:
  


Current Time: Fri Apr 26 11:53:07 GMT 2024

Powered by FUDForum. Page generated in 0.03209 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top