dev@glassfish.java.net

Re: taglib.tld configuration files with prelude

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 09 Oct 2008 21:00:24 +0200

On Oct 9, 2008, at 8:08 PM, Paul Sandoz wrote:

>
> On Oct 9, 2008, at 7:03 PM, Jakub Podlesak wrote:
>
>>
>> Hi Paul,
>>
>> Please see attached.
>>
>
> Thanks. Is there a link to online JavaDoc for the GF web API?
>

I found the source:

https://glassfish-svn.dev.java.net/source/browse/glassfish-svn/trunk/v3/common/glassfish-api/src/main/java/org/glassfish/api/web/TldProvider.java?view=markup

But given just the JavaDoc it is not possible determine exactly what
the map returned by getTldMap should consist of. Looking more closely
at the JSF code is:

   1) the key a URI to a jar file; and

   2) the list of values one or more entries in the jar file that is a
tld entry.

?

Paul.

> Can someone help me by telling what the following snippet of code
> from the GlassFishTldProvider does:
>
> Class jsfImplClass = null;
> try {
> jsfImplClass =
> getClass
> ().getClassLoader().loadClass("com.sun.faces.spi.InjectionProvider");
> } catch (ClassNotFoundException ignored) {
> }
>
> URI[] uris = null;
> Module m = null;
> if (jsfImplClass != null) {
> m = registry.find(jsfImplClass);
> }
> if (m!=null) {
> uris = m.getModuleDefinition().getLocations();
> } else {
>
>
> I am guessing i can probably ignore this approach and instead refer
> to the tld file directly.
>
> Paul.
>
>> ~Jakub
>>
>> On Thu, Oct 09, 2008 at 06:20:44PM +0200, Paul Sandoz wrote:
>>> On Oct 9, 2008, at 5:59 PM, Sahoo wrote:
>>>
>>>> I think you have to provide a service that implements
>>>> org.glassfish.api.web.TldProvider contract as part of Jersy bundle.
>>>> Then GlassFish web container can recognize the TLDs part of your
>>>> bundle. For an example, see GlassFishTldProvider.java in web/jsf-
>>>> integration module.
>>>>
>>>
>>> Can you send a link to source? or example code?
>>>
>>> Thanks,
>>> Paul.
>>>
>>>> Thanks,
>>>> Sahoo
>>>>
>>>> Paul Sandoz wrote:
>>>>> Hi,
>>>>>
>>>>> We are experimenting with Jersey installed as a GF v3 module.
>>>>>
>>>>> The jersey jar contains a taglib.tld configuration file in META-
>>>>> INF
>>>>> directly. That file references a class in jersey jar.
>>>>>
>>>>> When a JSP in the application refers to the taglib by the URI:
>>>>>
>>>>> <%_at_taglib prefix="rbt" uri="urn:com:sun:jersey:api:view" %>
>>>>>
>>>>> there an error results (see end of email).
>>>>>
>>>>> Things work fine in v2 or v3 if the jersey jars are included in
>>>>> the
>>>>> war. So i am guessing it is an OSGi class loading issue.
>>>>>
>>>>> Paul.
>>>>>
>>>>>
>>>>> Caused by: org.apache.jasper.JasperException: /com/sun/jersey/
>>>>> samples/bookstore/resources/Book/index.jsp(9,57) PWC6188: The
>>>>> absolute uri: urn:com:sun:jersey:api:view cannot be resolved in
>>>>> either web.xml or the jar files deployed with this application
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper
>>>>> .compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:
>>>>> 89)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:
>>>>> 375)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:
>>>>> 169)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper
>>>>> .compiler
>>>>> .TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:
>>>>> 429)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper
>>>>> .compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:
>>>>> 234)
>>>>> at
>>>>> org
>>>>> .apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:
>>>>> 498)
>>>>> at
>>>>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:578)
>>>>> at
>>>>> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642)
>>>>> at org.apache.jasper.compiler.Parser.parse(Parser.java:181)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.compiler.ParserController.doParse(ParserController.java:
>>>>> 239)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.compiler.ParserController.parse(ParserController.java:140)
>>>>> at
>>>>> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:
>>>>> 201)
>>>>> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:
>>>>> 428)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.JspCompilationContext.compile(JspCompilationContext.java:
>>>>> 608)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
>>>>> 374)
>>>>> at
>>>>> org
>>>>> .apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:
>>>>> 473)
>>>>> at
>>>>> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:
>>>>> 847)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core
>>>>> .ApplicationFilterChain
>>>>> .servletService(ApplicationFilterChain.java:
>>>>> 431)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:
>>>>> 885)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:732)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core
>>>>> .ApplicationDispatcher.processRequest(ApplicationDispatcher.java:
>>>>> 554)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:
>>>>> 485)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.ApplicationDispatcher.forward(ApplicationDispatcher.java:
>>>>> 377)
>>>>> at
>>>>> com
>>>>> .sun
>>>>> .jersey
>>>>> .impl
>>>>> .container
>>>>> .servlet
>>>>> .RequestDispatcherWrapper.forward(RequestDispatcherWrapper.java:
>>>>> 66)
>>>>> at
>>>>> com
>>>>> .sun
>>>>> .jersey
>>>>> .impl
>>>>> .container
>>>>> .servlet.JSPTemplateProcessor.writeTo(JSPTemplateProcessor.java:
>>>>> 103)
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> --
>> http://blogs.sun.com/japod
>> <
>> GlassFishTldProvider
>> .java
>> >
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>