Wong Mary wrote:

> But the JSP 1.1 spec seems to indicate that the <jsp:include page="urlSpec".../>
> element requires "urlSpec" be a .html or a .jsp file.  A .class file for a
> servlet that is not page-compiled from a JSP would be invalid in the
> <jsp:include> tag.
>
> Is there an appropriate syntax for the <jsp:include...> to do the job
> that I'm missing?
>
> -Mary
>

The same syntax works for servlets, JSP pages, and HTML pages.  The secret is in how 
the URL
you specify is interpreted.

What you want to do is map your servlet to a particular URL pattern (see the Servlet 
API 2.2
specification for more details on the options).  In general, you can define a servlet 
to
match a particular URL (relative to the context path) like this:

    /catalog

or you can say that all URLs that have a particular filename extension match a specific
servlet.  That is actually how JSP pages get handled -- everything that ends with 
".jsp" is
handed to the JSP servlet for processing.

How you define the mapping from URLs to servlets is currently specific to each servlet
engine, but is standardized in the 2.2 servlet spec.  In the mean time, you can 
practice with
the JSWDK 1.0 servlet engine by using the WEB-INF/mapping.properties file to establish 
these
mappings.

Craig McClanahan


>
> On Wed, 29 Sep 1999 17:32:35 -0700, Craig R. McClanahan <[EMAIL PROTECTED]> 
>wrote:
>
> >Mary Wong wrote:
> >
> >> Is there support for invocation of the service() of a regular (ie.
> >> non-JSP-compiled) servlet inside a JSP page without explicitly calling that
> >> service() in the JSP?  I am thinking of a feature similiar to the <droplet
> >> bean=...> tag used in ATG Dynamo.
> >>
> >
> >I'm not familiar with Dynamo, but check out the <jsp:include> element -- it can be
> >used to include the output from a servlet (or a JSP page) in the output of the
> >page containing this element, without ever having to acquire a reference to the
> >servlet or call it's service() method yourself.
> >
> >>
> >> Thanks in advance,
> >> -Mary
> >>
> >
> >Craig McClanahan
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to