You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2000/02/11 22:55:31 UTC

[PROPOSAL] Re: tag

> No, <servlet> tags are not supported in Tomcat. You may have some luck with
> JSSI, but I have a feeling it needs tweaking since it's not possible to
> implement <servlet> tag support without subclassing HttpServletRequestImpl
> (to set parameters).

What is the reason that the SERVLET tag is not implemented in Tomcat?  I would also
like to be able to use it.  If it would be okay for me to add this functionality to
Tomcat, can someone suggest a starting place for me to start perusing the code?
What is the consensus about adding a SERVLET tag to Tomcat?  It seems to me that
since Tomcat supports both Servlets *and* JSP that it should also support the
SERVLET tag.  What are your thoughts?

Re: [PROPOSAL] Re: tag

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
"Daniel L. Rall" wrote:
> 
> > JSP has another mechanism for this (<jsp:include>, as others have pointed out),
> > but if you really want this I suggest you use JSSI as the starting point and
> > adapt it for Tomcat as a separate page processor than a JSP add-on.
> >
> > Adding <servlet> as a JSP custom action doesn't make much sense to me, since you
> > would  have to use a prefix, e.g. <foo:servlet>, and XML syntax so it would still
> > not help people migrating from other SSI implementations.
> 
> I did not realize that.  That rather negates the benefits of adding the
> SERVLET tag as an intrinsic feature.  Why must the <BAR:SERVLET> prefix
> and XML notation be used?  A single tag (with no prefix) seems like a
> rather trival thing to implement (no disrespect intended, I'm just
> trying to understand the reason behind this).

The prefix is how you associate a custom action with a tag library in JSP 1.1,
through the <%@ taglib uri="aTagLibrary" prefix="foo" %>. So all custom actions
must be used with a prefix. And all JSP actions, standard as well as custom,
use XML syntax, so your pages would need to look like:

  <foo:servlet name="myServlet">
    <foo:param name="aParam" value="aValue" />
  </foo:servlet>

See the JSP 1.1 spec for details.

Also, since JSP already provides the <jsp:include> action, adding another one
with the exact same functionality doesn't seem like such a good idea. But to
help people deploy existing servlet SSI apps in Tomcat, porting JSSI may be
worth it. An alternative is of course to make a program that converts SSI
pages to JSP pages, e.g. converts

  <servlet name=myServlet>
    <param name=aParam value=aValue>
  </servlet>

into

  <jsp:include page="/servlet/myServlet?aParam=aValue" flush="true" />

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: [PROPOSAL] Re: tag

Posted by co...@eng.sun.com.
> I did not realize that.  That rather negates the benefits of adding the
> SERVLET tag as an intrinsic feature.  Why must the <BAR:SERVLET> prefix
> and XML notation be used?  A single tag (with no prefix) seems like a
> rather trival thing to implement (no disrespect intended, I'm just
> trying to understand the reason behind this).

I think it's very simple:
A "JSP" page ( ends with .jsp ) is a file that follows the "Java Server
Pages" specification. If you read the specification, you'll find out that
it doesn't have a <servlet> tag. 

It doesn't matter if <servlet> is good or bad, or how easy it is to add
it. If you add it you'll no longer have a JSP page - i.e. if you try to
run it on another server that supports JSP it will not work. 

You can create a new template mechanism and use <servlet> and any other
tags, but just don't call it JSP.
If your system will use Servlet API you can plug it into tomcat, and it
will be treated the same as JSP pages.

Or you can send feedback to JSP spec authors - and if the next spec will
have <servlet>, we'll have to implement it. 

Costin


Re: [PROPOSAL] Re: tag

Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
> JSP has another mechanism for this (<jsp:include>, as others have pointed out),
> but if you really want this I suggest you use JSSI as the starting point and
> adapt it for Tomcat as a separate page processor than a JSP add-on.
> 
> Adding <servlet> as a JSP custom action doesn't make much sense to me, since you
> would  have to use a prefix, e.g. <foo:servlet>, and XML syntax so it would still
> not help people migrating from other SSI implementations.

I did not realize that.  That rather negates the benefits of adding the
SERVLET tag as an intrinsic feature.  Why must the <BAR:SERVLET> prefix
and XML notation be used?  A single tag (with no prefix) seems like a
rather trival thing to implement (no disrespect intended, I'm just
trying to understand the reason behind this).
-- 

Daniel Rall (dlr@finemaltcoding.com)

Re: [PROPOSAL] Re: tag

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Daniel Rall wrote:
> 
> > No, <servlet> tags are not supported in Tomcat. You may have some luck with
> > JSSI, but I have a feeling it needs tweaking since it's not possible to
> > implement <servlet> tag support without subclassing HttpServletRequestImpl
> > (to set parameters).
> 
> What is the reason that the SERVLET tag is not implemented in Tomcat?  I would also
> like to be able to use it.  If it would be okay for me to add this functionality to
> Tomcat, can someone suggest a starting place for me to start perusing the code?
> What is the consensus about adding a SERVLET tag to Tomcat?  It seems to me that
> since Tomcat supports both Servlets *and* JSP that it should also support the
> SERVLET tag.  What are your thoughts?

JSP has another mechanism for this (<jsp:include>, as others have pointed out), 
but if you really want this I suggest you use JSSI as the starting point and 
adapt it for Tomcat as a separate page processor than a JSP add-on. 

Adding <servlet> as a JSP custom action doesn't make much sense to me, since you 
would  have to use a prefix, e.g. <foo:servlet>, and XML syntax so it would still 
not help people migrating from other SSI implementations.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: [PROPOSAL] Re: tag

Posted by Danno Ferrin <sh...@earthlink.net>.
what functionality does the old <servlet> tag offer that 
<jsp:include ...><jsp:param .../></jsp:include> dose not provide?  I
have seen other people looking for way to do the <servlet> tag and
<jsp:include ... /> seems to work.

--Danno

Shachor Gal wrote:
> 
>  I suggest you to write a JSP tag extension, this should be rather
> simple...
> 
>         Gal Shachor
> 
> On Fri, 11 Feb 2000, Daniel Rall wrote:
> 
> > > No, <servlet> tags are not supported in Tomcat. You may have some luck with
> > > JSSI, but I have a feeling it needs tweaking since it's not possible to
> > > implement <servlet> tag support without subclassing HttpServletRequestImpl
> > > (to set parameters).
> >
> > What is the reason that the SERVLET tag is not implemented in Tomcat?  I would also
> > like to be able to use it.  If it would be okay for me to add this functionality to
> > Tomcat, can someone suggest a starting place for me to start perusing the code?
> > What is the consensus about adding a SERVLET tag to Tomcat?  It seems to me that
> > since Tomcat supports both Servlets *and* JSP that it should also support the
> > SERVLET tag.  What are your thoughts?
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Re: [PROPOSAL] Re: tag

Posted by Daniel Rall <dl...@finemaltcoding.com>.
>  I suggest you to write a JSP tag extension, this should be rather
> simple...

Thanks Gal, I'll make time to look into JSP tag extenstions this weekend.  If there are
no objections, perhaps we could add whatever code I churn out to the Tomcat distribution
(after review and revision, of course).  I just feel strongly that Tomcat should support
the tag.

Re: [PROPOSAL] Re: tag

Posted by Shachor Gal <sh...@techunix.technion.ac.il>.
 I suggest you to write a JSP tag extension, this should be rather
simple...

	Gal Shachor

On Fri, 11 Feb 2000, Daniel Rall wrote:

> > No, <servlet> tags are not supported in Tomcat. You may have some luck with
> > JSSI, but I have a feeling it needs tweaking since it's not possible to
> > implement <servlet> tag support without subclassing HttpServletRequestImpl
> > (to set parameters).
> 
> What is the reason that the SERVLET tag is not implemented in Tomcat?  I would also
> like to be able to use it.  If it would be okay for me to add this functionality to
> Tomcat, can someone suggest a starting place for me to start perusing the code?
> What is the consensus about adding a SERVLET tag to Tomcat?  It seems to me that
> since Tomcat supports both Servlets *and* JSP that it should also support the
> SERVLET tag.  What are your thoughts?
> 
>