Jetty with Servlets without JSP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Jetty with Servlets without JSP

Alan Gutierrez-6
    Googling didn't reveal how it was possible, but I think it is
    possible, isn't it?

--
Alan Gutierrez - [hidden email] - http://engrm.com/blogometer/


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jetty with Servlets without JSP

Eric Rizzo
On 10/14/05, Alan Gutierrez <[hidden email]> wrote:
>     Googling didn't reveal how it was possible, but I think it is
>     possible, isn't it?

Serving JSPs is just the function of a servlet. You'll need to remove
the JSP servlet from your configuration in order to disable serving of
JSPs.
Jetty includes the JSP servlet (among other things) in the
webdefault.xml file. I will leave it up to your research to determine
how to override or change that configuration.

HTH,
Eric


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jetty with Servlets without JSP

Alan Gutierrez-6
* Eric Rizzo <[hidden email]> [2005-10-19 09:57]:
> On 10/14/05, Alan Gutierrez <[hidden email]> wrote:
> >     Googling didn't reveal how it was possible, but I think it is
> >     possible, isn't it?

> Serving JSPs is just the function of a servlet. You'll need to remove
> the JSP servlet from your configuration in order to disable serving of
> JSPs.

> Jetty includes the JSP servlet (among other things) in the
> webdefault.xml file. I will leave it up to your research to determine
> how to override or change that configuration.

    I find it a bit puzzling since I'm launching jetty in Eclipse,
    without it's supporting scripts, like webdefault.xml, and
    specifying a minimal jetty.xml, that configures just one
    org.mortbay.jetty.Server.

<Configure class="org.mortbay.jetty.Server">
  <Call name="addListener">
    <Arg>
      <New class="org.mortbay.http.SocketListener">
        <Set name="port">8386</Set>
      </New>
    </Arg>
  </Call>
  <Call name="addWebApplication">
    <Arg>/dev/</Arg>
    <Arg>./artifacts/core/www/</Arg>
  </Call>
</Configure>

    There is no JETTY_HOME environment variable set.

--
Alan Gutierrez - [hidden email] - http://engrm.com/blogometer/


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jetty with Servlets without JSP

Eric Rizzo
On 10/20/05, Alan Gutierrez <[hidden email]> wrote:

> * Eric Rizzo <[hidden email]> [2005-10-19 09:57]:
> > On 10/14/05, Alan Gutierrez <[hidden email]> wrote:
> > >     Googling didn't reveal how it was possible, but I think it is
> > >     possible, isn't it?
>
> > Serving JSPs is just the function of a servlet. You'll need to remove
> > the JSP servlet from your configuration in order to disable serving of
> > JSPs.
>
> > Jetty includes the JSP servlet (among other things) in the
> > webdefault.xml file. I will leave it up to your research to determine
> > how to override or change that configuration.
>
>     I find it a bit puzzling since I'm launching jetty in Eclipse,
>     without it's supporting scripts, like webdefault.xml, and
>     specifying a minimal jetty.xml, that configures just one
>     org.mortbay.jetty.Server.

Yeah, that probably catches a lot of people. The issue is that
WebApplicationContext defines a default value for the
defaultsDescriptor property. The default defaultsDescriptor is
packaged in the Jetty JAR, so unless you override the
defaultsDescriptor property in your jetty.xml (or in code if you're
configuring Jetty programatically), you will get the one in the Jetty
JAR (which includes, among other things, the JSP servlet).
So, you need to specify a value for the defaultsDescriptor property in
your jetty.xml (I think you can specify an empty/null value, but if
not just write your own webdefault.xml and refer to that one). Here's
part of a jetty.xml that does this:


<Configure class="org.mortbay.jetty.Server">

  <Call name="addListener">
          <......etc....>
  </Call>

  <Set name="WebApplicationConfigurationClassNames">
          <......etc....>
  </Set>


  <Set name="rootWebApp">root</Set>

  <Call name="addWebApplication">
    <Arg>/</Arg>
    <Arg>./webapp</Arg>

    <Set name="extractWAR">false</Set>
    <Set name="defaultsDescriptor">config/webdefault.xml</Set>

    <Set name="virtualHosts">
      <Array type="java.lang.String">
        <Item>127.0.0.1</Item>
        <Item>localhost</Item>
      </Array>
    </Set>
  </Call>

</Configure>


HTH,
Eric


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jetty with Servlets without JSP

Alan Gutierrez-6
* Eric Rizzo <[hidden email]> [2005-10-21 18:14]:

> On 10/20/05, Alan Gutierrez <[hidden email]> wrote:
> > * Eric Rizzo <[hidden email]> [2005-10-19 09:57]:
> > > On 10/14/05, Alan Gutierrez <[hidden email]> wrote:
> > > >     Googling didn't reveal how it was possible, but I think it is
> > > >     possible, isn't it?
> >
> > > Serving JSPs is just the function of a servlet. You'll need to remove
> > > the JSP servlet from your configuration in order to disable serving of
> > > JSPs.
> >
> > > Jetty includes the JSP servlet (among other things) in the
> > > webdefault.xml file. I will leave it up to your research to determine
> > > how to override or change that configuration.
> >
> >     I find it a bit puzzling since I'm launching jetty in Eclipse,
> >     without it's supporting scripts, like webdefault.xml, and
> >     specifying a minimal jetty.xml, that configures just one
> >     org.mortbay.jetty.Server.
>
> Yeah, that probably catches a lot of people. The issue is that
> WebApplicationContext defines a default value for the
> defaultsDescriptor property. The default defaultsDescriptor is
> packaged in the Jetty JAR, so unless you override the
> defaultsDescriptor property in your jetty.xml (or in code if you're
> configuring Jetty programatically), you will get the one in the Jetty
> JAR (which includes, among other things, the JSP servlet).

Eric

I didn't notice your response earlier. It didn't occur to me to
check the Jetty JAR, but it should have. Thanks.

--
Alan Gutierrez - [hidden email] - http://engrm.com/blogometer/


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support