Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Help with JSP and JSTL examples
Help with JSP and JSTL examples [message #73523] Sun, 24 September 2006 11:27 Go to next message
Eclipse UserFriend
Originally posted by: ridcully560.yahoo.com

Hello,

following the comments on
https://bugs.eclipse.org/bugs/show_bug.cgi?id=140430
I was able to run the examples projects, and to build an own projekt
with some simple JSPs. After that, I tries to include some JSTL-tags,
but they didn't work. In the org.eclipse.equinox.jsp.jstl.examples_1.0.0
there are a lot of files that seem to me like precompiled JSPs (am I
right there?), but there's now build-script or similar to compile such
files from my own JSPs.

Or are those precompiled files just the basis to make JSTL work in the
project - like some kind of library?

Johannes
Re: Help with JSP and JSTL examples [message #73645 is a reply to message #73523] Mon, 25 September 2006 16:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: simon.kaegi.cognos.com

Hi Johannes,

I suspect the problem is that you haven't added TLDs to "your" JSP bundle.
Jasper (the underlying implementation) searches for TLDs in your
ServletContext. Here's a bit more info --
http://tomcat.apache.org/tomcat-5.5-doc/jasper/docs/api/org/ apache/jasper/compiler/TldLocationsCache.html

In the OSGi world, your bundle provides the ServletContext, so typically
this means your JSP bundle still must define its TLDs.
You still import the various JSTL classes that provide the implementation,
but also place your TLDs in a path where Jasper will look.
I'd take a look and imitate what the jsp-examples or jstl-examples bundles
do in /web/WEB-INF/tld/.

HTH
-Simon

"Johannes" <ridcully560@yahoo.com> wrote in message
news:ef5q3a$pr7$1@utils.eclipse.org...
> Hello,
>
> following the comments on
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=140430
> I was able to run the examples projects, and to build an own projekt with
> some simple JSPs. After that, I tries to include some JSTL-tags, but they
> didn't work. In the org.eclipse.equinox.jsp.jstl.examples_1.0.0 there are
> a lot of files that seem to me like precompiled JSPs (am I right there?),
> but there's now build-script or similar to compile such files from my own
> JSPs.
>
> Or are those precompiled files just the basis to make JSTL work in the
> project - like some kind of library?
>
> Johannes
Re: Help with JSP and JSTL examples [message #73830 is a reply to message #73645] Thu, 28 September 2006 16:03 Go to previous message
Eclipse UserFriend
Originally posted by: ridcully560.yahoo.com

Hi Simon,

it works in some way, but I still got problems with jetty and tomcat.

When I try and run everything under eclipse with jetty, it all seems to
work fine, but it also seems stuck somehow: When I change something on
the servlet or JSPs it just has no effect on the pages that are
displayed. I tried the clean-command in eclipse several time, restarted
eclipse, even restarted the whole computer, but nothing helps.

I tried to run it under tomcat, but that doesn't work, too. I
started with a new istallation of tomcat, deployed the bridge.war, and
then put my own bundles into the
webapps/bridge/WEB-INF/platform/plugins-directory. After redeploying it,
my own bundles appeared as INSTALLED. By trying to start them I figured
out which other bundles would be needed as a minimal configuration until
all bundles appeared as RESOLVED. I was then able to start everything
except my own bundles:

Nested Exception:
java.lang.LinkageError: load contraints violated when linking
javax/servlet/Servlet class

After that, I tried the following (from bug 140430)

> Alternate Http Service
>
> If you prefer to run in an appserver with the Servlet Bridge Launcher providing
> the Http Service implementation you'll need to modify
> " org.eclipse.equinox.servlet.bridge.launcher\templates\WEB-IN F\platform\plugins\org.eclipse.equinox.servlet.bridge.extens ionbundle_3.2.0\META-INF\MANIFEST.MF "
> to reflect the updated packages exposed in the servlet 2.4 incarnation of
> org.eclipse.equinox.servlet.api.
>
> After this modification and performing a build with the "webAppBuilder.xml"
> script org.eclipse.equinox.servlet.bridge.launcher the bundles needed are shown
> below.
> Http Service (external servlet container with servlet bridge launcher
> ------------
> 2) org.eclipse.osgi.services_3.1.100.v20060601 [3.2RC7]
> 3) org.eclipse.equinox.servlet.bridge.extensionbundle [created from running
> webAppBuilder.xml in org.eclipse.equinox.servlet.bridge.launcher from
> equinox-incubator HEAD]
> 4) org.eclipse.equinox.servlet.bridge.http_3.2.0.qualifier [from
> equinox-incubator HEAD]
> 5) org.eclipse.equinox.jakarta.commons.logging_1.0.4 [from equinox-incubator
> HEAD] (still needed for Jasper)
>
> Depending on where your webapp is located the context name will prefix the
> former example URLs.
> e.g http://localhost:8080/bridge/jsp-examples/index.html
>

After running the script, I replaced the
org.eclipse.equinox.servlet.bridge.extensionbundle (which is not
appearing in the status-output afterwards anymore),
the new created /lib/servletbridge.jar, exported the new
org.eclipse.equinox.servlet.bridge.http, and exported
org.eclipse.equinox.servlet.bridge.launcher (without this
the servlet.bridge.http was not able to start).

I'm then able to start every bundle, but get an 404-error when I'm
trying to load my servlets or JSPs. The ss-command gives the following
result:

id State Bundle
0 Active system.bundle
1 Active org.eclipse.equinox.common
2 Active org.eclipse.update-configurator
3 Active org.eclipse.equinox.servlet.bridge.http
4 Active org.eclipse.equinox.http.registry
5 Active MyPLugin1
6 Active MyPlugin2
7 Active MyMainApp
9 Active org.eclipse.equinox.http.jsp
11 Active org.eclipse.equinox.jakarta.commons.el
12 Active org.eclipse.equinox.jakarta.commons.logging
13 Active org.eclipse.equinox.jasper
14 Active org.eclipse.equinox.jsp.jstl
15 Active org.eclipse.equinox.registry
16 Active org.eclipse.equinox.servlet.api
18 Active org.eclipse.equinox.servlet.bridge.launcher
37
19 Active org.eclipse.osgi.services

The design of the MyMainApp is equal to the one of the
jsp.jstl.examples-project (wich I can start, but get an 404-error, too).
I'm registering the servlet this way (which seems correct, as it works
with jetty):

>ServiceReference sr = context.getServiceReference(HttpService.class.getName());
>if(sr != null) {
> HttpService http = (HttpService)context.getService(sr);
> if(http != null) {
> http.registerServlet("/mymainapp/MainServlet", new MainServlet(), null, null);
> }
>}

When I run "bundle 7" I get the message that no services from this
bundle are installed, but I think that's correct as I am only
registering servlets and recources.

When I run "diag 7" the message says "no unresolved contraints" - so I
think that's fine, too.

Maybe you can see where I made the mistake.
Johannes
Previous Topic:JMX Resource Manager with HTTP Adaptor
Next Topic:Corona logging vs log4j direct access
Goto Forum:
  


Current Time: Fri Apr 26 08:17:23 GMT 2024

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

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

Back to the top