You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Fernando Lichtschein <fe...@gmail.com> on 2006/01/10 22:02:12 UTC

Calling a servlet from jsp

Dear sirs,

I am new (three days) to Geronimo, I was asked to port a Web Application
that has already been running in a variety of platforms, mainly
Apache/Tomcat and Oracle Application Server 10g.

The installation went on with no problems, especially since Geronimo 1.0 had
just been released, using Sun JDK 1.5.0.

The problem is that the jsp s of the application call servlets that are not
in WEB-INF/classes, I get an error "The requested resource is not
available". The servlets are in a directory that is several levels below
WEB-INF, and are invoked using using
<form name="formx"  onSubmit="validate()" method="POST" action="
com.xx.yyy.Servlet">.

There are a number of classes in a couple of directories, so mapping them in
geronimo-web.xml would not be practical.

Regards and thanks,
--
Fernando Lichtschein
lich@fibertel.com.ar

Re: Calling a servlet from jsp

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
I also wonder whether you need some kind of special servlet handing
that needs to be configured in order to be able to invoke a servlet
directly by its class name instead of by calling a URL that it's
mapped to.

Aaron

On 1/10/06, Fernando Lichtschein <fe...@gmail.com> wrote:
> Dear sirs,
>
>  I am new (three days) to Geronimo, I was asked to port a Web Application
> that has already been running in a variety of platforms, mainly
> Apache/Tomcat and Oracle Application Server 10g.
>
>  The installation went on with no problems, especially since Geronimo 1.0
> had just been released, using Sun JDK 1.5.0.
>
>  The problem is that the jsp s of the application call servlets that are not
> in WEB-INF/classes, I get an error "The requested resource is not
> available". The servlets are in a directory that is several levels below
> WEB-INF, and are invoked using using
>  <form name="formx"  onSubmit="validate()" method="POST"
> action="com.xx.yyy.Servlet">.
>
>  There are a number of classes in a couple of directories, so mapping them
> in geronimo-web.xml would not be practical.
>
>  Regards and thanks,
> --
> Fernando Lichtschein
> lich@fibertel.com.ar

Re: Calling a servlet from jsp

Posted by Paul McMahan <pa...@gmail.com>.
Assuming that you are using tomcat as your web container I think you can
achieve the desired results by looking in var/catalina/conf/web.xml and
uncommenting the servlet declaration and servlet mapping elements that
enable the InvokerServlet.  Then restart your server and you should be able
to post to servlets from your JSPs without having to explicitly declare
those servlets in your application's web.xml.

However, before you enable the InvokerServlet please be advised that
enabling this feature is (for some) a security concern because it makes any
servlet in your applications' classpaths visible to HTTP requests.  It's
convenient for development purposes but probably not advisable for a
production or external system.

Best wishes,
Paul

On 1/10/06, Fernando Lichtschein <fe...@gmail.com> wrote:
>
> Dear sirs,
>
> I am new (three days) to Geronimo, I was asked to port a Web Application
> that has already been running in a variety of platforms, mainly
> Apache/Tomcat and Oracle Application Server 10g.
>
> The installation went on with no problems, especially since Geronimo 1.0had just been released, using Sun JDK
> 1.5.0.
>
> The problem is that the jsp s of the application call servlets that are
> not in WEB-INF/classes, I get an error "The requested resource is not
> available". The servlets are in a directory that is several levels below
> WEB-INF, and are invoked using using
> <form name="formx"  onSubmit="validate()" method="POST" action="
> com.xx.yyy.Servlet">.
>
> There are a number of classes in a couple of directories, so mapping them
> in geronimo-web.xml would not be practical.
>
> Regards and thanks,
> --
> Fernando Lichtschein
> lich@fibertel.com.ar