Jasper Question

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

Jasper Question

Tony Thompson
I have an application that builds a WebApplicationContext
programatically.  I am adding 3 servlets to the context, in this order:

org.apache.jasper.servlet.JspServlet
org.mortbay.jetty.servlet.Invoker
org.mortbay.jetty.servlet.Default

One of the things I am trying to do is pass an init parameter to
Jasper.  I can run JSPs out of my web application so, I know the servlet
in configured but, my init parameters do not seem to be taking.  Here is
the servlet initialization code:

sHold = webApp.addServlet(
"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
"org.apache.jasper.servlet.JspServlet" );
sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
sHold.setInitParameter( "fork", "false" );

Can anyone tell me why the init parameters might not be taking?

Thanks
Tony


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
OK, I have some additional information.  It is not an issue with the way
I am assembling the WebApplicationContext.  The issue is with the
serlvet mappings in my web.xml.  If I put a servlet mapping in for my
JSP, it doesn't work properly (i.e. it tries to fork the external
compiler which is what I am trying to prevent).  Here is my mapping:

<servlet>
    <servlet-name>factsReport</servlet-name>
    <display-name>factsReport</display-name>
    <jsp-file>/test/factsReport.jsp</jsp-file>
</servlet>
<servlet-mapping>
    <servlet-name>factsReport</servlet-name>
    <url-pattern>/factsReport.jsp</url-pattern>
</servlet-mapping>

With that in my web.xml, if I go to http://server/factsReport.jsp, I
get a compile error because it tries to fork the external compiler.  If
I go to http://server/test/factsReport.jsp, it compiles with the
internal compiler and runs just fine.

I can also modify my web.xml and get it to work correctly with the
mapping:

<servlet>
    <servlet-name>factsReport</servlet-name>
    <display-name>factsReport</display-name>
    <jsp-file>/test/factsReport.jsp</jsp-file>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
</servlet>

If I pass the Jasper "fork" as an initialization parameter to my JSP,
that works.

Is this working as designed?  It seems like Jetty should always send
the right parameters to Jasper no matter how it is being invoked.

Thanks
Tony

>>> [hidden email] 05/11/05 02:45PM >>>
I have an application that builds a WebApplicationContext
programatically.  I am adding 3 servlets to the context, in this
order:

org.apache.jasper.servlet.JspServlet
org.mortbay.jetty.servlet.Invoker
org.mortbay.jetty.servlet.Default

One of the things I am trying to do is pass an init parameter to
Jasper.  I can run JSPs out of my web application so, I know the
servlet
in configured but, my init parameters do not seem to be taking.  Here
is
the servlet initialization code:

sHold = webApp.addServlet(
"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
"org.apache.jasper.servlet.JspServlet" );
sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
sHold.setInitParameter( "fork", "false" );

Can anyone tell me why the init parameters might not be taking?

Thanks
Tony


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Hi Tony,

Have you taken a look at the webdefault.xml file? There is a copy in
$JETTY_HOME/etc. It sets up all the Jasper mappings and init params on
behalf of all webapps. Here's a link to the FAQ entry for it:
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault


regards
Jan


Tony Thompson wrote:

> OK, I have some additional information.  It is not an issue with the way
> I am assembling the WebApplicationContext.  The issue is with the
> serlvet mappings in my web.xml.  If I put a servlet mapping in for my
> JSP, it doesn't work properly (i.e. it tries to fork the external
> compiler which is what I am trying to prevent).  Here is my mapping:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
> </servlet>
> <servlet-mapping>
>     <servlet-name>factsReport</servlet-name>
>     <url-pattern>/factsReport.jsp</url-pattern>
> </servlet-mapping>
>
> With that in my web.xml, if I go to http://server/factsReport.jsp, I
> get a compile error because it tries to fork the external compiler.  If
> I go to http://server/test/factsReport.jsp, it compiles with the
> internal compiler and runs just fine.
>
> I can also modify my web.xml and get it to work correctly with the
> mapping:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
>     <init-param>
>         <param-name>fork</param-name>
>         <param-value>false</param-value>
>     </init-param>
> </servlet>
>
> If I pass the Jasper "fork" as an initialization parameter to my JSP,
> that works.
>
> Is this working as designed?  It seems like Jetty should always send
> the right parameters to Jasper no matter how it is being invoked.
>
> Thanks
> Tony
>
>
>>>>[hidden email] 05/11/05 02:45PM >>>
>
> I have an application that builds a WebApplicationContext
> programatically.  I am adding 3 servlets to the context, in this
> order:
>
> org.apache.jasper.servlet.JspServlet
> org.mortbay.jetty.servlet.Invoker
> org.mortbay.jetty.servlet.Default
>
> One of the things I am trying to do is pass an init parameter to
> Jasper.  I can run JSPs out of my web application so, I know the
> servlet
> in configured but, my init parameters do not seem to be taking.  Here
> is
> the servlet initialization code:
>
> sHold = webApp.addServlet(
> "*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
> "org.apache.jasper.servlet.JspServlet" );
> sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
> sHold.setInitParameter( "fork", "false" );
>
> Can anyone tell me why the init parameters might not be taking?
>
> Thanks
> Tony
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
In reply to this post by Tony Thompson
I will give it a shot but, I don't see how that is any different than me
adding the Jasper servlet to the context programmatically.  Would you
expect it to behave differently?  If so, that seems like a bug to me.
It should work the same no matter how Jasper is added to the context.

>>> [hidden email] 05/14/05 04:46PM >>>
Hi Tony,

Have you taken a look at the webdefault.xml file? There is a copy in
$JETTY_HOME/etc. It sets up all the Jasper mappings and init params on

behalf of all webapps. Here's a link to the FAQ entry for it:
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault



regards
Jan


Tony Thompson wrote:
> OK, I have some additional information.  It is not an issue with the
way
> I am assembling the WebApplicationContext.  The issue is with the
> serlvet mappings in my web.xml.  If I put a servlet mapping in for
my

> JSP, it doesn't work properly (i.e. it tries to fork the external
> compiler which is what I am trying to prevent).  Here is my mapping:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
> </servlet>
> <servlet-mapping>
>     <servlet-name>factsReport</servlet-name>
>     <url-pattern>/factsReport.jsp</url-pattern>
> </servlet-mapping>
>
> With that in my web.xml, if I go to http://server/factsReport.jsp, I
> get a compile error because it tries to fork the external compiler.
If

> I go to http://server/test/factsReport.jsp, it compiles with the
> internal compiler and runs just fine.
>
> I can also modify my web.xml and get it to work correctly with the
> mapping:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
>     <init-param>
>         <param-name>fork</param-name>
>         <param-value>false</param-value>
>     </init-param>
> </servlet>
>
> If I pass the Jasper "fork" as an initialization parameter to my
JSP,

> that works.
>
> Is this working as designed?  It seems like Jetty should always send
> the right parameters to Jasper no matter how it is being invoked.
>
> Thanks
> Tony
>
>
>>>>[hidden email] 05/11/05 02:45PM >>>
>
> I have an application that builds a WebApplicationContext
> programatically.  I am adding 3 servlets to the context, in this
> order:
>
> org.apache.jasper.servlet.JspServlet
> org.mortbay.jetty.servlet.Invoker
> org.mortbay.jetty.servlet.Default
>
> One of the things I am trying to do is pass an init parameter to
> Jasper.  I can run JSPs out of my web application so, I know the
> servlet
> in configured but, my init parameters do not seem to be taking.
Here

> is
> the servlet initialization code:
>
> sHold = webApp.addServlet(
> "*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
> "org.apache.jasper.servlet.JspServlet" );
> sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
> sHold.setInitParameter( "fork", "false" );
>
> Can anyone tell me why the init parameters might not be taking?
>
> Thanks
> Tony
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Hi Tony,

What I meant is that the webdefault.xml file is ALWAYS used by the
WebApplicationContext (unless you specify a custom one). So the Jasper
stuff will always be automatically set up for you, including all the
mappings of *.jsp There is no reason for you to put in indiviual servlet
mappings in your web.xml.

If you want to change the default setup, then the natural place to do it
is in the webdefault.xml. However, the default behaviour seems to be
what you want.

cheers
Jan

Tony Thompson wrote:

> I will give it a shot but, I don't see how that is any different than me
> adding the Jasper servlet to the context programmatically.  Would you
> expect it to behave differently?  If so, that seems like a bug to me.
> It should work the same no matter how Jasper is added to the context.
>
>
>>>>[hidden email] 05/14/05 04:46PM >>>
>
> Hi Tony,
>
> Have you taken a look at the webdefault.xml file? There is a copy in
> $JETTY_HOME/etc. It sets up all the Jasper mappings and init params on
>
> behalf of all webapps. Here's a link to the FAQ entry for it:
> http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault
>
>
>
> regards
> Jan
>
>
> Tony Thompson wrote:
>
>>OK, I have some additional information.  It is not an issue with the
>
> way
>
>>I am assembling the WebApplicationContext.  The issue is with the
>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>
> my
>
>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>compiler which is what I am trying to prevent).  Here is my mapping:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>></servlet>
>><servlet-mapping>
>>    <servlet-name>factsReport</servlet-name>
>>    <url-pattern>/factsReport.jsp</url-pattern>
>></servlet-mapping>
>>
>>With that in my web.xml, if I go to http://server/factsReport.jsp, I
>>get a compile error because it tries to fork the external compiler.
>
> If
>
>>I go to http://server/test/factsReport.jsp, it compiles with the
>>internal compiler and runs just fine.
>>
>>I can also modify my web.xml and get it to work correctly with the
>>mapping:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>>    <init-param>
>>        <param-name>fork</param-name>
>>        <param-value>false</param-value>
>>    </init-param>
>></servlet>
>>
>>If I pass the Jasper "fork" as an initialization parameter to my
>
> JSP,
>
>>that works.
>>
>>Is this working as designed?  It seems like Jetty should always send
>>the right parameters to Jasper no matter how it is being invoked.
>>
>>Thanks
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/11/05 02:45PM >>>
>>
>>I have an application that builds a WebApplicationContext
>>programatically.  I am adding 3 servlets to the context, in this
>>order:
>>
>>org.apache.jasper.servlet.JspServlet
>>org.mortbay.jetty.servlet.Invoker
>>org.mortbay.jetty.servlet.Default
>>
>>One of the things I am trying to do is pass an init parameter to
>>Jasper.  I can run JSPs out of my web application so, I know the
>>servlet
>>in configured but, my init parameters do not seem to be taking.
>
> Here
>
>>is
>>the servlet initialization code:
>>
>>sHold = webApp.addServlet(
>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
>>"org.apache.jasper.servlet.JspServlet" );
>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>sHold.setInitParameter( "fork", "false" );
>>
>>Can anyone tell me why the init parameters might not be taking?
>>
>>Thanks
>>Tony
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
In reply to this post by Tony Thompson
My example may have been a bit misleading.  Say my servlet mapping looks
like this:

<servlet>
    <servlet-name>factsReport</servlet-name>
    <display-name>factsReport</display-name>
    <jsp-file>/test/factsReport.jsp</jsp-file>
</servlet>
<servlet-mapping>
    <servlet-name>factsReport</servlet-name>
    <url-pattern>/ShowFactsReport</url-pattern>
</servlet-mapping>

This is something that is done frequently.  I tested with the
webdefaults.xml and it doesn't work either way (configuring the context
with webdefaults.xml or programmatically).  If I have a servlet mapping
for my JSP, the init parameters for the JspServlet are ignored.  The
only way I can get it to work is by passing Jasper init parameters to my
servlet.  It seems like Jetty should automatically add Jasper init
parameters when it starts my mapped servlet.  No?

Tony

>>> [hidden email] 05/17/05 10:26AM >>>
Hi Tony,

What I meant is that the webdefault.xml file is ALWAYS used by the
WebApplicationContext (unless you specify a custom one). So the Jasper

stuff will always be automatically set up for you, including all the
mappings of *.jsp There is no reason for you to put in indiviual
servlet
mappings in your web.xml.

If you want to change the default setup, then the natural place to do
it
is in the webdefault.xml. However, the default behaviour seems to be
what you want.

cheers
Jan

Tony Thompson wrote:
> I will give it a shot but, I don't see how that is any different than
me
> adding the Jasper servlet to the context programmatically.  Would
you
> expect it to behave differently?  If so, that seems like a bug to me.

> It should work the same no matter how Jasper is added to the
context.
>
>
>>>>[hidden email] 05/14/05 04:46PM >>>
>
> Hi Tony,
>
> Have you taken a look at the webdefault.xml file? There is a copy in

> $JETTY_HOME/etc. It sets up all the Jasper mappings and init params
on
>
> behalf of all webapps. Here's a link to the FAQ entry for it:
>
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault

>
>
>
> regards
> Jan
>
>
> Tony Thompson wrote:
>
>>OK, I have some additional information.  It is not an issue with the
>
> way
>
>>I am assembling the WebApplicationContext.  The issue is with the
>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>
> my
>
>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>compiler which is what I am trying to prevent).  Here is my mapping:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>></servlet>
>><servlet-mapping>
>>    <servlet-name>factsReport</servlet-name>
>>    <url-pattern>/factsReport.jsp</url-pattern>
>></servlet-mapping>
>>
>>With that in my web.xml, if I go to http://server/factsReport.jsp, I
>>get a compile error because it tries to fork the external compiler.
>
> If
>
>>I go to http://server/test/factsReport.jsp, it compiles with the
>>internal compiler and runs just fine.
>>
>>I can also modify my web.xml and get it to work correctly with the
>>mapping:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>>    <init-param>
>>        <param-name>fork</param-name>
>>        <param-value>false</param-value>
>>    </init-param>
>></servlet>
>>
>>If I pass the Jasper "fork" as an initialization parameter to my
>
> JSP,
>
>>that works.
>>
>>Is this working as designed?  It seems like Jetty should always send
>>the right parameters to Jasper no matter how it is being invoked.
>>
>>Thanks
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/11/05 02:45PM >>>
>>
>>I have an application that builds a WebApplicationContext
>>programatically.  I am adding 3 servlets to the context, in this
>>order:
>>
>>org.apache.jasper.servlet.JspServlet
>>org.mortbay.jetty.servlet.Invoker
>>org.mortbay.jetty.servlet.Default
>>
>>One of the things I am trying to do is pass an init parameter to
>>Jasper.  I can run JSPs out of my web application so, I know the
>>servlet
>>in configured but, my init parameters do not seem to be taking.
>
> Here
>
>>is
>>the servlet initialization code:
>>
>>sHold = webApp.addServlet(
>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
>>"org.apache.jasper.servlet.JspServlet" );
>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>sHold.setInitParameter( "fork", "false" );
>>
>>Can anyone tell me why the init parameters might not be taking?
>>
>>Thanks
>>Tony
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>



-------------------------------------------------------
This SF.Net email is s /jsp-file>
>>    <init-parponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Tony,

By default, Jetty uses implicit jsp mapping as defined in the Servlet
Spec 11.2.1. That is, you do not have to put in individual mappings in
your web.xml file for each jsp file. You only specify the servlet
mappings if you want to change the url mapping.

The settings for the Jasper jsp container are controlled by the
init-params on the jsp servlet definition in webdefaults.xml. You change
the webdefaults.xml file to affect  the container configuration such as
forking the jsp compiler, log levels, type of jsp compiler etc etc.

Looking back at your posts, perhaps the root cause of your problems is
that your url-mapping is not as you think it is? You have mapped
/ShowFactsReport , which will only exactly match requests which end in
/ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
    http://www.my.host/myapp/ShowFactsReport/morestuffhere

Other than all that, you could have a look at the jetty demo that comes
with the source, as it uses some jsp servlet mappings for the snoop.jsp
and see what is different with your application.

cheers
Jan



Tony Thompson wrote:

> My example may have been a bit misleading.  Say my servlet mapping looks
> like this:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
> </servlet>
> <servlet-mapping>
>     <servlet-name>factsReport</servlet-name>
>     <url-pattern>/ShowFactsReport</url-pattern>
> </servlet-mapping>
>
> This is something that is done frequently.  I tested with the
> webdefaults.xml and it doesn't work either way (configuring the context
> with webdefaults.xml or programmatically).  If I have a servlet mapping
> for my JSP, the init parameters for the JspServlet are ignored.  The
> only way I can get it to work is by passing Jasper init parameters to my
> servlet.  It seems like Jetty should automatically add Jasper init
> parameters when it starts my mapped servlet.  No?
>
> Tony
>
>
>>>>[hidden email] 05/17/05 10:26AM >>>
>
> Hi Tony,
>
> What I meant is that the webdefault.xml file is ALWAYS used by the
> WebApplicationContext (unless you specify a custom one). So the Jasper
>
> stuff will always be automatically set up for you, including all the
> mappings of *.jsp There is no reason for you to put in indiviual
> servlet
> mappings in your web.xml.
>
> If you want to change the default setup, then the natural place to do
> it
> is in the webdefault.xml. However, the default behaviour seems to be
> what you want.
>
> cheers
> Jan
>
> Tony Thompson wrote:
>
>>I will give it a shot but, I don't see how that is any different than
>
> me
>
>>adding the Jasper servlet to the context programmatically.  Would
>
> you
>
>>expect it to behave differently?  If so, that seems like a bug to me.
>
>
>>It should work the same no matter how Jasper is added to the
>
> context.
>
>>
>>>>>[hidden email] 05/14/05 04:46PM >>>
>>
>>Hi Tony,
>>
>>Have you taken a look at the webdefault.xml file? There is a copy in
>
>
>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init params
>
> on
>
>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>
>
> http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault
>
>
>>
>>
>>regards
>>Jan
>>
>>
>>Tony Thompson wrote:
>>
>>
>>>OK, I have some additional information.  It is not an issue with the
>>
>>way
>>
>>
>>>I am assembling the WebApplicationContext.  The issue is with the
>>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>>
>>my
>>
>>
>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>compiler which is what I am trying to prevent).  Here is my mapping:
>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>></servlet>
>>><servlet-mapping>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <url-pattern>/factsReport.jsp</url-pattern>
>>></servlet-mapping>
>>>
>>>With that in my web.xml, if I go to http://server/factsReport.jsp, I
>>>get a compile error because it tries to fork the external compiler.
>>
>>If
>>
>>
>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>internal compiler and runs just fine.
>>>
>>>I can also modify my web.xml and get it to work correctly with the
>>>mapping:
>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>>   <init-param>
>>>       <param-name>fork</param-name>
>>>       <param-value>false</param-value>
>>>   </init-param>
>>></servlet>
>>>
>>>If I pass the Jasper "fork" as an initialization parameter to my
>>
>>JSP,
>>
>>
>>>that works.
>>>
>>>Is this working as designed?  It seems like Jetty should always send
>>>the right parameters to Jasper no matter how it is being invoked.
>>>
>>>Thanks
>>>Tony
>>>
>>>
>>>
>>>
>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>
>>>I have an application that builds a WebApplicationContext
>>>programatically.  I am adding 3 servlets to the context, in this
>>>order:
>>>
>>>org.apache.jasper.servlet.JspServlet
>>>org.mortbay.jetty.servlet.Invoker
>>>org.mortbay.jetty.servlet.Default
>>>
>>>One of the things I am trying to do is pass an init parameter to
>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>servlet
>>>in configured but, my init parameters do not seem to be taking.
>>
>>Here
>>
>>
>>>is
>>>the servlet initialization code:
>>>
>>>sHold = webApp.addServlet(
>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",
>>>"org.apache.jasper.servlet.JspServlet" );
>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>sHold.setInitParameter( "fork", "false" );
>>>
>>>Can anyone tell me why the init parameters might not be taking?
>>>
>>>Thanks
>>>Tony
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is s /jsp-file>
>
>>>   <init-parponsored by Oracle Space Sweepstakes
>
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
In reply to this post by Tony Thompson
My issue is not with the servlet mapping.  I am doing the servlet
mapping because I want to change the URL.  The issue is, I am doing the
servlet mapping and the JSPs will not compile correctly.  The easiest
way to demostrate the issue is to run the Jetty demo server but make
sure you are running it so that 'javac' is not in your path anywhere.
So, by default, Jasper is set to fork the external compiler.  If your
JSP compiles fail, you will see the error that says it can't find
'javac'.  Now, try to get a JSP to compile using the internal compiler
(in the tools.jar) by setting fork=true as a Jasper init parameter.
Once the JSPs compile, try running a JSP that is mapped (like snoop.jsp)
and it will not be able to compile because it can't find 'javac'.

That demonstrates the issue.  I can't get the JSP init parameters to
work with a mapped JSP.  If you access snoop.jsp without using its
mapped URL, it should compile.

Tony

>>> [hidden email] 05/18/05 11:40AM >>>
Tony,

By default, Jetty uses implicit jsp mapping as defined in the Servlet
Spec 11.2.1. That is, you do not have to put in individual mappings in

your web.xml file for each jsp file. You only specify the servlet
mappings if you want to change the url map ,mping.

The settings for the Jasper jsp container are controlled by the
init-params on the jsp servlet definition in webdefaults.xml. You
change
the webdefaults.xml file to affect  the container configuration such as

forking the jsp compiler, log levels, type of jsp compiler etc etc.

Looking back at your posts, perhaps the root cause of your problems is

that your url-mapping is not as you think it is? You have mapped
/ShowFactsReport , which will only exactly match requests which end in

/ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
    http://www.my.host/myapp/ShowFactsReport/morestuffhere 

Other than all that, you could have a look at the jetty demo that comes

with the source, as it uses some jsp servlet mappings for the snoop.jsp

and see what is different with your application.

cheers
Jan



Tony Thompson wrote:
> My example may have been a bit misleading.  Say my servlet mapping
looks

> like this:
>
> <servlet>
>     <servlet-name>factsReport</servlet-name>
>     <display-name>factsReport</display-name>
>     <jsp-file>/test/factsReport.jsp</jsp-file>
> </servlet>
> <servlet-mapping>
>     <servlet-name>factsReport</servlet-name>
>     <url-pattern>/ShowFactsReport</url-pattern>
> </servlet-mapping>
>
> This is something that is done frequently.  I tested with the
> webdefaults.xml and it doesn't work either way (configuring the
context
> with webdefaults.xml or programmatically).  If I have a servlet
mapping
> for my JSP, the init parameters for the JspServlet are ignored.  The
> only way I can get it to work is by passing Jasper init parameters to
my

> servlet.  It seems like Jetty should automatically add Jasper init
> parameters when it starts my mapped servlet.  No?
>
> Tony
>
>
>>>>[hidden email] 05/17/05 10:26AM >>>
>
> Hi Tony,
>
> What I meant is that the webdefault.xml file is ALWAYS used by the
> WebApplicationContext (unless you specify a custom one). So the
Jasper
>
> stuff will always be automatically set up for you, including all the

> mappings of *.jsp There is no reason for you to put in indiviual
> servlet
> mappings in your web.xml.
>
> If you want to change the default setup, then the natural place to
do
> it
> is in the webdefault.xml. However, the default behaviour seems to be

> what you want.
>
> cheers
> Jan
>
> Tony Thompson wrote:
>
>>I will give it a shot but, I don't see how that is any different
than
>
> me
>
>>adding the Jasper servlet to the context programmatically.  Would
>
> you
>
>>expect it to behave differently?  If so, that seems like a bug to
me.

>
>
>>It should work the same no matter how Jasper is added to the
>
> context.
>
>>
>>>>>[hidden email] 05/14/05 04:46PM >>>
>>
>>Hi Tony,
>>
>>Have you taken a look at the webdefault.xml file? There is a copy in
>
>
>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init params
>
> on
>
>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>
>
>
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault

>
>
>>
>>
>>regards
>>Jan
>>
>>
>>Tony Thompson wrote:
>>
>>
>>>OK, I have some additional information.  It is not an issue with
the

>>
>>way
>>
>>
>>>I am assembling the WebApplicationContext.  The issue is with the
>>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>>
>>my
>>
>>
>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>compiler which is what I am trying to prevent).  Here is my
mapping:

>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>></servlet>
>>><servlet-mapping>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <url-pattern>/factsReport.jsp</url-pattern>
>>></servlet-mapping>
>>>
>>>With that in my web.xml, if I go to http://server/factsReport.jsp,
I
>>>get a compile error because it tries to fork the external compiler.

>>
>>If
>>
>>
>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>internal compiler and runs just fine.
>>>
>>>I can also modify my web.xml and get it to work correctly with the
>>>mapping:
>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>>   <init-param>
>>>       <param-name>fork</param-name>
>>>       <param-value>false</param-value>
>>>   </init-param>
>>></servlet>
>>>
>>>If I pass the Jasper "fork" as an initialization parameter to my
>>
>>JSP,
>>
>>
>>>that works.
>>>
>>>Is this working as designed?  It seems like Jetty should always
send

>>>the right parameters to Jasper no matter how it is being invoked.
>>>
>>>Thanks
>>>Tony
>>>
>>>
>>>
>>>
>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>
>>>I have an application that builds a WebApplicationContext
>>>programatically.  I am adding 3 servlets to the context, in this
>>>order:
>>>
>>>org.apache.jasper.servlet.JspServlet
>>>org.mortbay.jetty.servlet.Invoker
>>>org.mortbay.jetty.servlet.Default
>>>
>>>One of the things I am trying to do is pass an init parameter to
>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>servlet
>>>in configured but, my init parameters do not seem to be taking.
>>
>>Here
>>
>>
>>>is
>>>the servlet initialization code:
>>>
>>>sHold = webApp.addServlet(
>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
> it
> is in the w
>>>"org.apache.jasper.servlet.JspServlet" );
>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>sHold.setInitParameter( "fork", "false" );
>>>
>>>Can anyone tell me why the init parameters might not be taking?
>>>
>>>Thanks
>>>Tony
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is s /jsp-file>
>
>>>   <init-parponsored by Oracle Space Sweepstakes
>
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Tony,

I've tried and failed to reproduce your problem.

My environment:

Java:     1.4.2_08-b03
Jetty:    5.1.4rc0
Platform: Linux

My method:

I commented tools.jar out of the
$JETTY_HOME/src/org/mortbay/start/start.config file. I changed the
$JETTY_HOME/src/org/mortbay/jetty/servlet/webdefault.xml file to specify
compiler=javac, fork=false and did a top-level clean build.

snoop.jsp compiled and ran OK with the following log output (stack trace
removed for legibility):
19:49:27.774 ERROR! [Listener-4]
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
 >25> Error compiling file:
/home/janb/src/Jetty/work/Jetty__8080__jetty//org/apache/jsp/snoop_jsp.java
     [javac] Since compiler setting isn't classic or modern,ignoring
fork setting.
[javac] Compiling 1 source file
19:49:27.774 WARN!! [Listener-4]
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
 >11> /jetty/snoop.jsp:
Compiler Adapter 'javac' can't be found.

If I instead specify only fork=false and don't set a compiler, snoop.jsp
compiles and runs fine with the following log output (stack trace
removed for legibility):
19:57:31.523 WARN!! [Listener-4]
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
 >11> /jetty/snoop.jsp:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Which version of Jetty are you using and how are you starting it?

cheers
Jan


Tony Thompson wrote:

> My issue is not with the servlet mapping.  I am doing the servlet
> mapping because I want to change the URL.  The issue is, I am doing the
> servlet mapping and the JSPs will not compile correctly.  The easiest
> way to demostrate the issue is to run the Jetty demo server but make
> sure you are running it so that 'javac' is not in your path anywhere.
> So, by default, Jasper is set to fork the external compiler.  If your
> JSP compiles fail, you will see the error that says it can't find
> 'javac'.  Now, try to get a JSP to compile using the internal compiler
> (in the tools.jar) by setting fork=true as a Jasper init parameter.
> Once the JSPs compile, try running a JSP that is mapped (like snoop.jsp)
> and it will not be able to compile because it can't find 'javac'.
>
> That demonstrates the issue.  I can't get the JSP init parameters to
> work with a mapped JSP.  If you access snoop.jsp without using its
> mapped URL, it should compile.
>
> Tony
>
>
>>>>[hidden email] 05/18/05 11:40AM >>>
>
> Tony,
>
> By default, Jetty uses implicit jsp mapping as defined in the Servlet
> Spec 11.2.1. That is, you do not have to put in individual mappings in
>
> your web.xml file for each jsp file. You only specify the servlet
> mappings if you want to change the url map ,mping.
>
> The settings for the Jasper jsp container are controlled by the
> init-params on the jsp servlet definition in webdefaults.xml. You
> change
> the webdefaults.xml file to affect  the container configuration such as
>
> forking the jsp compiler, log levels, type of jsp compiler etc etc.
>
> Looking back at your posts, perhaps the root cause of your problems is
>
> that your url-mapping is not as you think it is? You have mapped
> /ShowFactsReport , which will only exactly match requests which end in
>
> /ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
>     http://www.my.host/myapp/ShowFactsReport/morestuffhere 
>
> Other than all that, you could have a look at the jetty demo that comes
>
> with the source, as it uses some jsp servlet mappings for the snoop.jsp
>
> and see what is different with your application.
>
> cheers
> Jan
>
>
>
> Tony Thompson wrote:
>
>>My example may have been a bit misleading.  Say my servlet mapping
>
> looks
>
>>like this:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>></servlet>
>><servlet-mapping>
>>    <servlet-name>factsReport</servlet-name>
>>    <url-pattern>/ShowFactsReport</url-pattern>
>></servlet-mapping>
>>
>>This is something that is done frequently.  I tested with the
>>webdefaults.xml and it doesn't work either way (configuring the
>
> context
>
>>with webdefaults.xml or programmatically).  If I have a servlet
>
> mapping
>
>>for my JSP, the init parameters for the JspServlet are ignored.  The
>>only way I can get it to work is by passing Jasper init parameters to
>
> my
>
>>servlet.  It seems like Jetty should automatically add Jasper init
>>parameters when it starts my mapped servlet.  No?
>>
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/17/05 10:26AM >>>
>>
>>Hi Tony,
>>
>>What I meant is that the webdefault.xml file is ALWAYS used by the
>>WebApplicationContext (unless you specify a custom one). So the
>
> Jasper
>
>>stuff will always be automatically set up for you, including all the
>
>
>>mappings of *.jsp There is no reason for you to put in indiviual
>>servlet
>>mappings in your web.xml.
>>
>>If you want to change the default setup, then the natural place to
>
> do
>
>>it
>>is in the webdefault.xml. However, the default behaviour seems to be
>
>
>>what you want.
>>
>>cheers
>>Jan
>>
>>Tony Thompson wrote:
>>
>>
>>>I will give it a shot but, I don't see how that is any different
>
> than
>
>>me
>>
>>
>>>adding the Jasper servlet to the context programmatically.  Would
>>
>>you
>>
>>
>>>expect it to behave differently?  If so, that seems like a bug to
>
> me.
>
>>
>>>It should work the same no matter how Jasper is added to the
>>
>>context.
>>
>>
>>>>>>[hidden email] 05/14/05 04:46PM >>>
>>>
>>>Hi Tony,
>>>
>>>Have you taken a look at the webdefault.xml file? There is a copy in
>>
>>
>>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init params
>>
>>on
>>
>>
>>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>>
>>
>>
> http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault
>
>
>>
>>>
>>>regards
>>>Jan
>>>
>>>
>>>Tony Thompson wrote:
>>>
>>>
>>>
>>>>OK, I have some additional information.  It is not an issue with
>
> the
>
>>>way
>>>
>>>
>>>
>>>>I am assembling the WebApplicationContext.  The issue is with the
>>>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>>>
>>>my
>>>
>>>
>>>
>>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>>compiler which is what I am trying to prevent).  Here is my
>
> mapping:
>
>>>><servlet>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <display-name>factsReport</display-name>
>>>>  <jsp-file>/test/factsReport.jsp</jsp-file>
>>>></servlet>
>>>><servlet-mapping>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <url-pattern>/factsReport.jsp</url-pattern>
>>>></servlet-mapping>
>>>>
>>>>With that in my web.xml, if I go to http://server/factsReport.jsp,
>
> I
>
>>>>get a compile error because it tries to fork the external compiler.
>
>
>>>If
>>>
>>>
>>>
>>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>>internal compiler and runs just fine.
>>>>
>>>>I can also modify my web.xml and get it to work correctly with the
>>>>mapping:
>>>>
>>>><servlet>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <display-name>factsReport</display-name>
>>>>  <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>  <init-param>
>>>>      <param-name>fork</param-name>
>>>>      <param-value>false</param-value>
>>>>  </init-param>
>>>></servlet>
>>>>
>>>>If I pass the Jasper "fork" as an initialization parameter to my
>>>
>>>JSP,
>>>
>>>
>>>
>>>>that works.
>>>>
>>>>Is this working as designed?  It seems like Jetty should always
>
> send
>
>>>>the right parameters to Jasper no matter how it is being invoked.
>>>>
>>>>Thanks
>>>>Tony
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>>
>>>>I have an application that builds a WebApplicationContext
>>>>programatically.  I am adding 3 servlets to the context, in this
>>>>order:
>>>>
>>>>org.apache.jasper.servlet.JspServlet
>>>>org.mortbay.jetty.servlet.Invoker
>>>>org.mortbay.jetty.servlet.Default
>>>>
>>>>One of the things I am trying to do is pass an init parameter to
>>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>>servlet
>>>>in configured but, my init parameters do not seem to be taking.
>>>
>>>Here
>>>
>>>
>>>
>>>>is
>>>>the servlet initialization code:
>>>>
>>>>sHold = webApp.addServlet(
>>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
>>
>>it
>>is in the w
>>
>>>>"org.apache.jasper.servlet.JspServlet" );
>>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>>sHold.setInitParameter( "fork", "false" );
>>>>
>>>>Can anyone tell me why the init parameters might not be taking?
>>>>
>>>>Thanks
>>>>Tony
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is s /jsp-file>
>>
>>>>  <init-parponsored by Oracle Space Sweepstakes
>>
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
In reply to this post by Tony Thompson
I am using Jetty 4.2.23.  In my test I am running on Windows with a JDK
that has the javac.exe renamed so that it can't be found.  I left the
tools.jar in place because we need a compiler for the second set of
tests.  I am starting the server like this:

java -jar start.jar etc/demo.xml

If I am using the Jetty build as it is by default, the webdefault.xml
is set so Jasper will fork the compiler.  So, then I run the tests:

T1: http://server:8080/jetty/jspsnoop (fails)
T2: http://server:8080/jetty/snoop.jsp (fails)

Both of those cases fail (as expected) with the following error (lots
of junk removed for clarity):

java.io.IOException: CreateProcess: javac.exe -classpath
D:\jetty-4.2.23;D:\jetty-4.2.23\etc;D:\jetty-4.2.23\lib\org.mortbay.jetty.jar;........

So far, that is what should happen.  Next, I change the webdefault.xml
and rebuild Jetty.  Here is change I made:

  <servlet>
    <servlet-name>jsp</servlet-name>
   
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>

Then I run the tests:

T3: http://server:8080/jetty/jspsnoop (fails with the same error as
above)
T4: http://server:8080/jetty/snoop.jsp (compiles and runs correctly)

My contention is that both T3 and T4 should work since I have set
Jasper not to fork the compiler.

Tony

>>> [hidden email] 05/18/05 01:05PM >>>
Tony,

I've tried and failed to reproduce your problem.

My environment:

Java:     1.4.2_08-b03
Jetty:    5.1.4rc0
Platform: Linux

My method:

I commented tools.jar out of the
$JETTY_HOME/src/org/mortbay/start/start.config file. I changed the
$JETTY_HOME/src/org/mortbay/jetty/servlet/webdefault.xml file to
specify
compiler=javac, fork=false and did a top-level clean build.

snoop.jsp compiled and ran OK with the following log output (stack
trace
removed for legibility):
19:49:27.774 ERROR! [Listener-4]
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
 >25> Error compiling file:
/home/janb/src/Jetty/work/Jetty__8080__jetty//org/apache/jsp/snoop_jsp.java

     [javac] Since compiler setting isn't classic or modern,ignoring
fork setting.
[javac] Compiling 1 source file
19:49:27.774 WARN!! [Listener-4]
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)

 >11> /jetty/snoop.jsp:
Compiler Adapter 'javac' can't be found.

If I instead specify only fork=false and don't set a compiler,
snoop.jsp
compiles and runs fine with the following log output (stack trace
removed for legibility):
19:57:31.523 WARN!! [Listener-4]
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)

 >11> /jetty/snoop.jsp:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Which version of Jetty are you using and how are you starting it?

cheers
Jan


Tony Thompson wrote:
> My issue is not with the servlet mapping.  I am doing the servlet
> mapping because I want to change the URL.  The issue is, I am doing
the
> servlet mapping and the JSPs will not compile correctly.  The
easiest
> way to demostrate the issue is to run the Jetty demo server but make
> sure you are running it so that 'javac' is not in your path anywhere.

> So, by default, Jasper is set to fork the external compiler.  If
your
> JSP compiles fail, you will see the error that says it can't find
> 'javac'.  Now, try to get a JSP to compile using the internal
compiler
> (in the tools.jar) by setting fork=true as a Jasper init parameter.
> Once the JSPs compile, try running a JSP that is mapped (like
snoop.jsp)

> and it will not be able to compile because it can't find 'javac'.
>
> That demonstrates the issue.  I can't get the JSP init parameters to
> work with a mapped JSP.  If you access snoop.jsp without using its
> mapped URL, it should compile.
>
> Tony
>
>
>>>>[hidden email] 05/18/05 11:40AM >>>
>
> Tony,
>
> By default, Jetty uses implicit jsp mapping as defined in the Servlet

> Spec 11.2.1. That is, you do not have to put in individual mappings
in
>
> your web.xml file for each jsp file. You only specify the servlet
> mappings if you want to change the url map ,mping.
>
> The settings for the Jasper jsp container are controlled by the
> init-params on the jsp servlet definition in webdefaults.xml. You
> change
> the webdefaults.xml file to affect  the container configuration such
as
>
> forking the jsp compiler, log levels, type of jsp compiler etc etc.
>
> Looking back at your posts, perhaps the root cause of your problems
is
>
> that your url-mapping is not as you think it is? You have mapped
> /ShowFactsReport , which will only exactly match requests which end
in
>
> /ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
>     http://www.my.host/myapp/ShowFactsReport/morestuffhere 
>
> Other than all that, you could have a look at the jetty demo that
comes
>
> with the source, as it uses some jsp servlet mappings for the
snoop.jsp

>
> and see what is different with your application.
>
> cheers
> Jan
>
>
>
> Tony Thompson wrote:
>
>>My example may have been a bit misleading.  Say my servlet mapping
>
> looks
>
>>like this:
>>
>><servlet>
>>    <servlet-name>factsReport</servlet-name>
>>    <display-name>factsReport</display-name>
>>    <jsp-file>/test/factsReport.jsp</jsp-file>
>></servlet>
>><servlet-mapping>
>>    <servlet-name>factsReport</servlet-name>
>>    <url-pattern>/ShowFactsReport</url-pattern>
>></servlet-mapping>
>>
>>This is something that is done frequently.  I tested with the
>>webdefaults.xml and it doesn't work either way (configuring the
>
> context
>
>>with webdefaults.xml or programmatically).  If I have a servlet
>
> mapping
>
>>for my JSP, the init parameters for the JspServlet are ignored.  The
>>only way I can get it to work is by passing Jasper init parameters
to

>
> my
>
>>servlet.  It seems like Jetty should automatically add Jasper init
>>parameters when it starts my mapped servlet.  No?
>>
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/17/05 10:26AM >>>
>>
>>Hi Tony,
>>
>>What I meant is that the webdefault.xml file is ALWAYS used by the
>>WebApplicationContext (unless you specify a custom one). So the
>
> Jasper
>
>>stuff will always be automatically set up for you, including all the
>
>
>>mappings of *.jsp There is no reason for you to put in indiviual
>>servlet
>>mappings in your web.xml.
>>
>>If you want to change the default setup, then the natural place to
>
> do
>
>>it
>>is in the webdefault.xml. However, the default behaviour seems to be
>
>
>>what you want.
>>
>>cheers
>>Jan
>>
>>Tony Thompson wrote:
>>
>>
>>>I will give it a shot but, I don't see how that is any different
>
> than
>
>>me
>>
>>
>>>adding the Jasper servlet to the context programmatically.  Would
>>
>>you
>>
>>
>>>expect it to behave differently?  If so, that seems like a bug to
>
> me.
>
>>
>>>It should work the same no matter how Jasper is added to the
>>
>>context.
>>
>>
>>>>>>[hidden email] 05/14/05 04:46PM >>>
>>>
>>>Hi Tony,
>>>
>>>Have you taken a look at the webdefault.xml file? There is a copy
in

>>
>>
>>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init params
>>
>>on
>>
>>
>>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>>
>>
>>
>
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault

>
>
>>
>>>
>>>regards
>>>Jan
>>>
>>>
>>>Tony Thompson wrote:
>>>
>>>
>>>
>>>>OK, I have some additional information.  It is not an issue with
>
> the
>
>>>way
>>>
>>>
>>>
>>>>I am assembling the WebApplicationContext.  The issue is with the
>>>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>>>
>>>my
>>>
>>>
>>>
>>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>>compiler which is what I am trying to prevent).  Here is my
>
> mapping:
>
>>>><servlet>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <display-name>factsReport</display-name>
>>>>  <jsp-file>/test/factsReport.jsp</jsp-file>
>>>></servlet>
>>>><servlet-mapping>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <url-pattern>/factsReport.jsp</url-pattern>
>>>></servlet-mapping>
>>>>
>>>>With that in my web.xml, if I go to http://server/factsReport.jsp,
>
> I
>
>>>>get a compile error because it tries to fork the external
compiler.

>
>
>>>If
>>>
>>>
>>>
>>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>>internal compiler and runs just fine.
>>>>
>>>>I can also modify my web.xml and get it to work correctly with the
>>>>mapping:
>>>>
>>>><servlet>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <display-name>factsReport</display-name>
>>>>  <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>  <init-param>
>>>>      <param-name>fork</param-name>
>>>>      <param-value>false</param-value>
>>>>  </init-param>
>>>></servlet>
>>>>
>>>>If I pass the Jasper "fork" as an initialization parameter to my
>>>
>>>JSP,
>>>
>>>
>>>
>>>>that works.
>>>>
>>>>Is this working as designed?  It seems like Jetty should always
>
> send
>
>>>>the right parameters to Jasper no matter how it is being invoked.
>>>>
>>>>Thanks
>>>>Tony
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>>
>>>>I have an application that builds a WebApplicationContext
>>>>programatically.  I am adding 3 servlets to the context, in this
>>>>order:
>>>>
>>>>org.apache.jasper.servlet.JspServlet
>>>>org.mortbay.jetty.servlet.Invoker
>>>>org.mortbay.jetty.servlet.Default
>>>>
>>>>One of the things I am trying to do is pass an init parameter to
>>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>>servlet
>>>>in configured but, my init parameters do not seem to be taking.
>>>
>>>Here
>>>
>>>
>>>
>>>>is
>>>>the servlet initialization code:
>>>>
>>>>sHold = webApp.addServlet(
>>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
>>
>>it
>>is in the w
>>
>>>>"org.apache.jasper.servlet.JspServlet" );
>>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>>sHold.setInitParameter( "fork", "false" );
>>>>
>>>>Can anyone tell me why the init parameters might not be taking?
>>>>
>>>>Thanks
>>>>Tony
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is s /jsp-file>
>>
>>>>  <init-parponsored by Oracle Space Sweepstakes
>>
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Hi Tony,

I see what you mean with Jetty 4.x. This doesn't happen with Jetty 5.x,
but as both the Jetty implementation and Jasper implementation changed
in the 5.x series, I can't say where the problem lies. I suggest you try
using the Jetty 5.x series if possible.

cheers
Jan

Tony Thompson wrote:

> I am using Jetty 4.2.23.  In my test I am running on Windows with a JDK
> that has the javac.exe renamed so that it can't be found.  I left the
> tools.jar in place because we need a compiler for the second set of
> tests.  I am starting the server like this:
>
> java -jar start.jar etc/demo.xml
>
> If I am using the Jetty build as it is by default, the webdefault.xml
> is set so Jasper will fork the compiler.  So, then I run the tests:
>
> T1: http://server:8080/jetty/jspsnoop (fails)
> T2: http://server:8080/jetty/snoop.jsp (fails)
>
> Both of those cases fail (as expected) with the following error (lots
> of junk removed for clarity):
>
> java.io.IOException: CreateProcess: javac.exe -classpath
> D:\jetty-4.2.23;D:\jetty-4.2.23\etc;D:\jetty-4.2.23\lib\org.mortbay.jetty.jar;........
>
> So far, that is what should happen.  Next, I change the webdefault.xml
> and rebuild Jetty.  Here is change I made:
>
>   <servlet>
>     <servlet-name>jsp</servlet-name>
>    
> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>     <init-param>
>       <param-name>fork</param-name>
>       <param-value>false</param-value>
>     </init-param>
>     <load-on-startup>0</load-on-startup>
>   </servlet>
>
> Then I run the tests:
>
> T3: http://server:8080/jetty/jspsnoop (fails with the same error as
> above)
> T4: http://server:8080/jetty/snoop.jsp (compiles and runs correctly)
>
> My contention is that both T3 and T4 should work since I have set
> Jasper not to fork the compiler.
>
> Tony
>
>
>>>>[hidden email] 05/18/05 01:05PM >>>
>
> Tony,
>
> I've tried and failed to reproduce your problem.
>
> My environment:
>
> Java:     1.4.2_08-b03
> Jetty:    5.1.4rc0
> Platform: Linux
>
> My method:
>
> I commented tools.jar out of the
> $JETTY_HOME/src/org/mortbay/start/start.config file. I changed the
> $JETTY_HOME/src/org/mortbay/jetty/servlet/webdefault.xml file to
> specify
> compiler=javac, fork=false and did a top-level clean build.
>
> snoop.jsp compiled and ran OK with the following log output (stack
> trace
> removed for legibility):
> 19:49:27.774 ERROR! [Listener-4]
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
>  >25> Error compiling file:
> /home/janb/src/Jetty/work/Jetty__8080__jetty//org/apache/jsp/snoop_jsp.java
>
>      [javac] Since compiler setting isn't classic or modern,ignoring
> fork setting.
> [javac] Compiling 1 source file
> 19:49:27.774 WARN!! [Listener-4]
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
>
>  >11> /jetty/snoop.jsp:
> Compiler Adapter 'javac' can't be found.
>
> If I instead specify only fork=false and don't set a compiler,
> snoop.jsp
> compiles and runs fine with the following log output (stack trace
> removed for legibility):
> 19:57:31.523 WARN!! [Listener-4]
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
>
>  >11> /jetty/snoop.jsp:
> Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK
>
> Which version of Jetty are you using and how are you starting it?
>
> cheers
> Jan
>
>
> Tony Thompson wrote:
>
>>My issue is not with the servlet mapping.  I am doing the servlet
>>mapping because I want to change the URL.  The issue is, I am doing
>
> the
>
>>servlet mapping and the JSPs will not compile correctly.  The
>
> easiest
>
>>way to demostrate the issue is to run the Jetty demo server but make
>>sure you are running it so that 'javac' is not in your path anywhere.
>
>
>>So, by default, Jasper is set to fork the external compiler.  If
>
> your
>
>>JSP compiles fail, you will see the error that says it can't find
>>'javac'.  Now, try to get a JSP to compile using the internal
>
> compiler
>
>>(in the tools.jar) by setting fork=true as a Jasper init parameter.
>>Once the JSPs compile, try running a JSP that is mapped (like
>
> snoop.jsp)
>
>>and it will not be able to compile because it can't find 'javac'.
>>
>>That demonstrates the issue.  I can't get the JSP init parameters to
>>work with a mapped JSP.  If you access snoop.jsp without using its
>>mapped URL, it should compile.
>>
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/18/05 11:40AM >>>
>>
>>Tony,
>>
>>By default, Jetty uses implicit jsp mapping as defined in the Servlet
>
>
>>Spec 11.2.1. That is, you do not have to put in individual mappings
>
> in
>
>>your web.xml file for each jsp file. You only specify the servlet
>>mappings if you want to change the url map ,mping.
>>
>>The settings for the Jasper jsp container are controlled by the
>>init-params on the jsp servlet definition in webdefaults.xml. You
>>change
>>the webdefaults.xml file to affect  the container configuration such
>
> as
>
>>forking the jsp compiler, log levels, type of jsp compiler etc etc.
>>
>>Looking back at your posts, perhaps the root cause of your problems
>
> is
>
>>that your url-mapping is not as you think it is? You have mapped
>>/ShowFactsReport , which will only exactly match requests which end
>
> in
>
>>/ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
>>    http://www.my.host/myapp/ShowFactsReport/morestuffhere 
>>
>>Other than all that, you could have a look at the jetty demo that
>
> comes
>
>>with the source, as it uses some jsp servlet mappings for the
>
> snoop.jsp
>
>>and see what is different with your application.
>>
>>cheers
>>Jan
>>
>>
>>
>>Tony Thompson wrote:
>>
>>
>>>My example may have been a bit misleading.  Say my servlet mapping
>>
>>looks
>>
>>
>>>like this:
>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>></servlet>
>>><servlet-mapping>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <url-pattern>/ShowFactsReport</url-pattern>
>>></servlet-mapping>
>>>
>>>This is something that is done frequently.  I tested with the
>>>webdefaults.xml and it doesn't work either way (configuring the
>>
>>context
>>
>>
>>>with webdefaults.xml or programmatically).  If I have a servlet
>>
>>mapping
>>
>>
>>>for my JSP, the init parameters for the JspServlet are ignored.  The
>>>only way I can get it to work is by passing Jasper init parameters
>
> to
>
>>my
>>
>>
>>>servlet.  It seems like Jetty should automatically add Jasper init
>>>parameters when it starts my mapped servlet.  No?
>>>
>>>Tony
>>>
>>>
>>>
>>>
>>>>>>[hidden email] 05/17/05 10:26AM >>>
>>>
>>>Hi Tony,
>>>
>>>What I meant is that the webdefault.xml file is ALWAYS used by the
>>>WebApplicationContext (unless you specify a custom one). So the
>>
>>Jasper
>>
>>
>>>stuff will always be automatically set up for you, including all the
>>
>>
>>>mappings of *.jsp There is no reason for you to put in indiviual
>>>servlet
>>>mappings in your web.xml.
>>>
>>>If you want to change the default setup, then the natural place to
>>
>>do
>>
>>
>>>it
>>>is in the webdefault.xml. However, the default behaviour seems to be
>>
>>
>>>what you want.
>>>
>>>cheers
>>>Jan
>>>
>>>Tony Thompson wrote:
>>>
>>>
>>>
>>>>I will give it a shot but, I don't see how that is any different
>>
>>than
>>
>>
>>>me
>>>
>>>
>>>
>>>>adding the Jasper servlet to the context programmatically.  Would
>>>
>>>you
>>>
>>>
>>>
>>>>expect it to behave differently?  If so, that seems like a bug to
>>
>>me.
>>
>>
>>>>It should work the same no matter how Jasper is added to the
>>>
>>>context.
>>>
>>>
>>>
>>>>>>>[hidden email] 05/14/05 04:46PM >>>
>>>>
>>>>Hi Tony,
>>>>
>>>>Have you taken a look at the webdefault.xml file? There is a copy
>
> in
>
>>>
>>>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init params
>>>
>>>on
>>>
>>>
>>>
>>>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>>>
>>>
>>>
> http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault
>
>
>>
>>>>regards
>>>>Jan
>>>>
>>>>
>>>>Tony Thompson wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>OK, I have some additional information.  It is not an issue with
>>
>>the
>>
>>
>>>>way
>>>>
>>>>
>>>>
>>>>
>>>>>I am assembling the WebApplicationContext.  The issue is with the
>>>>>serlvet mappings in my web.xml.  If I put a servlet mapping in for
>>>>
>>>>my
>>>>
>>>>
>>>>
>>>>
>>>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>>>compiler which is what I am trying to prevent).  Here is my
>>
>>mapping:
>>
>>
>>>>><servlet>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <display-name>factsReport</display-name>
>>>>> <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>></servlet>
>>>>><servlet-mapping>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <url-pattern>/factsReport.jsp</url-pattern>
>>>>></servlet-mapping>
>>>>>
>>>>>With that in my web.xml, if I go to http://server/factsReport.jsp,
>>
>>I
>>
>>
>>>>>get a compile error because it tries to fork the external
>
> compiler.
>
>>
>>>>If
>>>>
>>>>
>>>>
>>>>
>>>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>>>internal compiler and runs just fine.
>>>>>
>>>>>I can also modify my web.xml and get it to work correctly with the
>>>>>mapping:
>>>>>
>>>>><servlet>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <display-name>factsReport</display-name>
>>>>> <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>> <init-param>
>>>>>     <param-name>fork</param-name>
>>>>>     <param-value>false</param-value>
>>>>> </init-param>
>>>>></servlet>
>>>>>
>>>>>If I pass the Jasper "fork" as an initialization parameter to my
>>>>
>>>>JSP,
>>>>
>>>>
>>>>
>>>>
>>>>>that works.
>>>>>
>>>>>Is this working as designed?  It seems like Jetty should always
>>
>>send
>>
>>
>>>>>the right parameters to Jasper no matter how it is being invoked.
>>>>>
>>>>>Thanks
>>>>>Tony
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>>>
>>>>>I have an application that builds a WebApplicationContext
>>>>>programatically.  I am adding 3 servlets to the context, in this
>>>>>order:
>>>>>
>>>>>org.apache.jasper.servlet.JspServlet
>>>>>org.mortbay.jetty.servlet.Invoker
>>>>>org.mortbay.jetty.servlet.Default
>>>>>
>>>>>One of the things I am trying to do is pass an init parameter to
>>>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>>>servlet
>>>>>in configured but, my init parameters do not seem to be taking.
>>>>
>>>>Here
>>>>
>>>>
>>>>
>>>>
>>>>>is
>>>>>the servlet initialization code:
>>>>>
>>>>>sHold = webApp.addServlet(
>>>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
>>>
>>>it
>>>is in the w
>>>
>>>
>>>>>"org.apache.jasper.servlet.JspServlet" );
>>>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>>>sHold.setInitParameter( "fork", "false" );
>>>>>
>>>>>Can anyone tell me why the init parameters might not be taking?
>>>>>
>>>>>Thanks
>>>>>Tony
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is s /jsp-file>
>>>
>>>>> <init-parponsored by Oracle Space Sweepstakes
>>>
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

Tony Thompson
In reply to this post by Tony Thompson
Hmmmm....I had on my list to try Jetty 5 but haven't gotten to it yet.
Unfortunately, we are stuck on Jetty 4 for a while (hopefully no more
than several months).  Any chance this is an easy thing to fix in Jetty
4?

Tony

>>> [hidden email] 05/18/05 04:24PM >>>
Hi Tony,

I see what you mean with Jetty 4.x. This doesn't happen with Jetty 5.x,

but as both the Jetty implementation and Jasper implementation changed

in the 5.x series, I can't say where the problem lies. I suggest you
try
using the Jetty 5.x series if possible.

cheers
Jan

Tony Thompson wrote:
> I am using Jetty 4.2.23.  In my test I am running on Windows with a
JDK
> that has the javac.exe renamed so that it can't be found.  I left
the
> tools.jar in place because we need a compiler for the second set of
> tests.  I am starting the server like this:
>
> java -jar start.jar etc/demo.xml
>
> If I am using the Jetty build as it is by default, the
webdefault.xml
> is set so Jasper will fork the compiler.  So, then I run the tests:
>
> T1: http://server:8080/jetty/jspsnoop (fails)
> T2: http://server:8080/jetty/snoop.jsp (fails)
>
> Both of those cases fail (as expected) with the following error
(lots
> of junk removed for clarity):
>
> java.io.IOException: CreateProcess: javac.exe -classpath
>
D:\jetty-4.2.23;D:\jetty-4.2.23\etc;D:\jetty-4.2.23\lib\org.mortbay.jetty.jar;........
>
> So far, that is what should happen.  Next, I change the
webdefault.xml

> and rebuild Jetty.  Here is change I made:
>
>   <servlet>
>     <servlet-name>jsp</servlet-name>
>    
> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>     <init-param>
>       <param-name>fork</param-name>
>       <param-value>false</param-value>
>     </init-param>
>     <load-on-startup>0</load-on-startup>
>   </servlet>
>
> Then I run the tests:
>
> T3: http://server:8080/jetty/jspsnoop (fails with the same error as
> above)
> T4: http://server:8080/jetty/snoop.jsp (compiles and runs correctly)
>
> My contention is that both T3 and T4 should work since I have set
> Jasper not to fork the compiler.
>
> Tony
>
>
>>>>[hidden email] 05/18/05 01:05PM >>>
>
> Tony,
>
> I've tried and failed to reproduce your problem.
>
> My environment:
>
> Java:     1.4.2_08-b03
> Jetty:    5.1.4rc0
> Platform: Linux
>
> My method:
>
> I commented tools.jar out of the
> $JETTY_HOME/src/org/mortbay/start/start.config file. I changed the
> $JETTY_HOME/src/org/mortbay/jetty/servlet/webdefault.xml file to
> specify
> compiler=javac, fork=false and did a top-level clean build.
>
> snoop.jsp compiled and ran OK with the following log output (stack
> trace
> removed for legibility):
> 19:49:27.774 ERROR! [Listener-4]
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)

>  >25> Error compiling file:
>
/home/janb/src/Jetty/work/Jetty__8080__jetty//org/apache/jsp/snoop_jsp.java
>
>      [javac] Since compiler setting isn't classic or modern,ignoring

> fork setting.
> [javac] Compiling 1 source file
> 19:49:27.774 WARN!! [Listener-4]
>
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)

>
>  >11> /jetty/snoop.jsp:
> Compiler Adapter 'javac' can't be found.
>
> If I instead specify only fork=false and don't set a compiler,
> snoop.jsp
> compiles and runs fine with the following log output (stack trace
> removed for legibility):
> 19:57:31.523 WARN!! [Listener-4]
>
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)

>
>  >11> /jetty/snoop.jsp:
> Unable to find a javac compiler;
> com.sun.tools.javac.Main is not on the classpath.
> Perhaps JAVA_HOME does not point to the JDK
>
> Which version of Jetty are you using and how are you starting it?
>
> cheers
> Jan
>
>
> Tony Thompson wrote:
>
>>My issue is not with the servlet mapping.  I am doing the servlet
>>mapping because I want to change the URL.  The issue is, I am doing
>
> the
>
>>servlet mapping and the JSPs will not compile correctly.  The
>
> easiest
>
>>way to demostrate the issue is to run the Jetty demo server but make
>>sure you are running it so that 'javac' is not in your path
anywhere.

>
>
>>So, by default, Jasper is set to fork the external compiler.  If
>
> your
>
>>JSP compiles fail, you will see the error that says it can't find
>>'javac'.  Now, try to get a JSP to compile using the internal
>
> compiler
>
>>(in the tools.jar) by setting fork=true as a Jasper init parameter.
>>Once the JSPs compile, try running a JSP that is mapped (like
>
> snoop.jsp)
>
>>and it will not be able to compile because it can't find 'javac'.
>>
>>That demonstrates the issue.  I can't get the JSP init parameters to
>>work with a mapped JSP.  If you access snoop.jsp without using its
>>mapped URL, it should compile.
>>
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/18/05 11:40AM >>>
>>
>>Tony,
>>
>>By default, Jetty uses implicit jsp mapping as defined in the
Servlet

>
>
>>Spec 11.2.1. That is, you do not have to put in individual mappings
>
> in
>
>>your web.xml file for each jsp file. You only specify the servlet
>>mappings if you want to change the url map ,mping.
>>
>>The settings for the Jasper jsp container are controlled by the
>>init-params on the jsp servlet definition in webdefaults.xml. You
>>change
>>the webdefaults.xml file to affect  the container configuration such
>
> as
>
>>forking the jsp compiler, log levels, type of jsp compiler etc etc.
>>
>>Looking back at your posts, perhaps the root cause of your problems
>
> is
>
>>that your url-mapping is not as you think it is? You have mapped
>>/ShowFactsReport , which will only exactly match requests which end
>
> in
>
>>/ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
>>    http://www.my.host/myapp/ShowFactsReport/morestuffhere 
>>
>>Other than all that, you could have a look at the jetty demo that
>
> comes
>
>>with the source, as it uses some jsp servlet mappings for the
>
> snoop.jsp
>
>>and see what is different with your application.
>>
>>cheers
>>Jan
>>
>>
>>
>>Tony Thompson wrote:
>>
>>
>>>My example may have been a bit misleading.  Say my servlet mapping
>>
>>looks
>>
>>
>>>like this:
>>>
>>><servlet>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <display-name>factsReport</display-name>
>>>   <jsp-file>/test/factsReport.jsp</jsp-file>
>>></servlet>
>>><servlet-mapping>
>>>   <servlet-name>factsReport</servlet-name>
>>>   <url-pattern>/ShowFactsReport</url-pattern>
>>></servlet-mapping>
>>>
>>>This is something that is done frequently.  I tested with the
>>>webdefaults.xml and it doesn't work either way (configuring the
>>
>>context
>>
>>
>>>with webdefaults.xml or programmatically).  If I have a servlet
>>
>>mapping
>>
>>
>>>for my JSP, the init parameters for the JspServlet are ignored.
The

>>>only way I can get it to work is by passing Jasper init parameters
>
> to
>
>>my
>>
>>
>>>servlet.  It seems like Jetty should automatically add Jasper init
>>>parameters when it starts my mapped servlet.  No?
>>>
>>>Tony
>>>
>>>
>>>
>>>
>>>>>>[hidden email] 05/17/05 10:26AM >>>
>>>
>>>Hi Tony,
>>>
>>>What I meant is that the webdefault.xml file is ALWAYS used by the
>>>WebApplicationContext (unless you specify a custom one). So the
>>
>>Jasper
>>
>>
>>>stuff will always be automatically set up for you, including all
the

>>
>>
>>>mappings of *.jsp There is no reason for you to put in indiviual
>>>servlet
>>>mappings in your web.xml.
>>>
>>>If you want to change the default setup, then the natural place to
>>
>>do
>>
>>
>>>it
>>>is in the webdefault.xml. However, the default behaviour seems to
be

>>
>>
>>>what you want.
>>>
>>>cheers
>>>Jan
>>>
>>>Tony Thompson wrote:
>>>
>>>
>>>
>>>>I will give it a shot but, I don't see how that is any different
>>
>>than
>>
>>
>>>me
>>>
>>>
>>>
>>>>adding the Jasper servlet to the context programmatically.  Would
>>>
>>>you
>>>
>>>
>>>
>>>>expect it to behave differently?  If so, that seems like a bug to
>>
>>me.
>>
>>
>>>>It should work the same no matter how Jasper is added to the
>>>
>>>context.
>>>
>>>
>>>
>>>>>>>[hidden email] 05/14/05 04:46PM >>>
>>>>
>>>>Hi Tony,
>>>>
>>>>Have you taken a look at the webdefault.xml file? There is a copy
>
> in
>
>>>
>>>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init
params

>>>
>>>on
>>>
>>>
>>>
>>>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>>>
>>>
>>>
>
http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault

>
>
>>
>>>>regards
>>>>Jan
>>>>
>>>>
>>>>Tony Thompson wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>OK, I have some additional information.  It is not an issue with
>>
>>the
>>
>>
>>>>way
>>>>
>>>>
>>>>
>>>>
>>>>>I am assembling the WebApplicationContext.  The issue is with the
>>>>>serlvet mappings in my web.xml.  If I put a servlet mapping in
for

>>>>
>>>>my
>>>>
>>>>
>>>>
>>>>
>>>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>>>compiler which is what I am trying to prevent).  Here is my
>>
>>mapping:
>>
>>
>>>>><servlet>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <display-name>factsReport</display-name>
>>>>> <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>></servlet>
>>>>><servlet-mapping>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <url-pattern>/factsReport.jsp</url-pattern>
>>>>></servlet-mapping>
>>>>>
>>>>>With that in my web.xml, if I go to
http://server/factsReport.jsp,

>>
>>I
>>
>>
>>>>>get a compile error because it tries to fork the external
>
> compiler.
>
>>
>>>>If
>>>>
>>>>
>>>>
>>>>
>>>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>>>internal compiler and runs just fine.
>>>>>
>>>>>I can also modify my web.xml and get it to work correctly with
the

>>>>>mapping:
>>>>>
>>>>><servlet>
>>>>> <servlet-name>factsReport</servlet-name>
>>>>> <display-name>factsReport</display-name>
>>>>> <jsp-file>/test/factsReport.jsp</jsp-file>
>>>>> <init-param>
>>>>>     <param-name>fork</param-name>
>>>>>     <param-value>false</param-value>
>>>>> </init-param>
>>>>></servlet>
>>>>>
>>>>>If I pass the Jasper "fork" as an initialization parameter to my
>>>>
>>>>JSP,
>>>>
>>>>
>>>>
>>>>
>>>>>that works.
>>>>>
>>>>>Is this working as designed?  It seems like Jetty should always
>>
>>send
>>
>>
>>>>>the right parameters to Jasper no matter how it is being invoked.
>>>>>
>>>>>Thanks
>>>>>Tony
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>>>
>>>>>I have an application that builds a WebApplicationContext
>>>>>programatically.  I am adding 3 servlets to the context, in this
>>>>>order:
>>>>>
>>>>>org.apache.jasper.servlet.JspServlet
>>>>>org.mortbay.jetty.servlet.Invoker
>>>>>org.mortbay.jetty.servlet.Default
>>>>>
>>>>>One of the things I am trying to do is pass an init parameter to
>>>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>>>servlet
>>>>>in configured but, my init parameters do not seem to be taking.
>>>>
>>>>Here
>>>>
>>>>
>>>>
>>>>
>>>>>is
>>>>>the servlet initialization code:
>>>>>
>>>>>sHold = webApp.addServlet(
>>>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
>>>
>>>it
>>>is in the w
>>>
>>>
>>>>>"org.apache.jasper.servlet.JspServlet" );
>>>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>>>sHold.setInitParameter( "fork", "false" );
>>>>>
>>>>>Can anyone tell me why the init parameters might not be taking?
>>>>>
>>>>>Thanks
>>>>>Tony
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is s /jsp-file>
>>>
>>>>> <init-parponsored by Oracle Space Sweepstakes
>>>
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support 
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: Jasper Question

jan_bartel
Tony,

I actually don't think this is a Jetty problem. Jetty just works out
which servlet to dispatch the request off to, and in both cases it will
be the JspServlet. The JspServlet then does all the compilation etc etc.
To verify this, you could try the same test with Tomcat 4.1.29 (which
supplies the version of Jasper for Jetty 4.2.23).

cheers
Jan



Tony Thompson wrote:

> Hmmmm....I had on my list to try Jetty 5 but haven't gotten to it yet.
> Unfortunately, we are stuck on Jetty 4 for a while (hopefully no more
> than several months).  Any chance this is an easy thing to fix in Jetty
> 4?
>
> Tony
>
>
>>>>[hidden email] 05/18/05 04:24PM >>>
>
> Hi Tony,
>
> I see what you mean with Jetty 4.x. This doesn't happen with Jetty 5.x,
>
> but as both the Jetty implementation and Jasper implementation changed
>
> in the 5.x series, I can't say where the problem lies. I suggest you
> try
> using the Jetty 5.x series if possible.
>
> cheers
> Jan
>
> Tony Thompson wrote:
>
>>I am using Jetty 4.2.23.  In my test I am running on Windows with a
>
> JDK
>
>>that has the javac.exe renamed so that it can't be found.  I left
>
> the
>
>>tools.jar in place because we need a compiler for the second set of
>>tests.  I am starting the server like this:
>>
>>java -jar start.jar etc/demo.xml
>>
>>If I am using the Jetty build as it is by default, the
>
> webdefault.xml
>
>>is set so Jasper will fork the compiler.  So, then I run the tests:
>>
>>T1: http://server:8080/jetty/jspsnoop (fails)
>>T2: http://server:8080/jetty/snoop.jsp (fails)
>>
>>Both of those cases fail (as expected) with the following error
>
> (lots
>
>>of junk removed for clarity):
>>
>>java.io.IOException: CreateProcess: javac.exe -classpath
>>
>
> D:\jetty-4.2.23;D:\jetty-4.2.23\etc;D:\jetty-4.2.23\lib\org.mortbay.jetty.jar;........
>
>>So far, that is what should happen.  Next, I change the
>
> webdefault.xml
>
>>and rebuild Jetty.  Here is change I made:
>>
>>  <servlet>
>>    <servlet-name>jsp</servlet-name>
>>  
>><servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>>    <init-param>
>>      <param-name>fork</param-name>
>>      <param-value>false</param-value>
>>    </init-param>
>>    <load-on-startup>0</load-on-startup>
>>  </servlet>
>>
>>Then I run the tests:
>>
>>T3: http://server:8080/jetty/jspsnoop (fails with the same error as
>>above)
>>T4: http://server:8080/jetty/snoop.jsp (compiles and runs correctly)
>>
>>My contention is that both T3 and T4 should work since I have set
>>Jasper not to fork the compiler.
>>
>>Tony
>>
>>
>>
>>>>>[hidden email] 05/18/05 01:05PM >>>
>>
>>Tony,
>>
>>I've tried and failed to reproduce your problem.
>>
>>My environment:
>>
>>Java:     1.4.2_08-b03
>>Jetty:    5.1.4rc0
>>Platform: Linux
>>
>>My method:
>>
>>I commented tools.jar out of the
>>$JETTY_HOME/src/org/mortbay/start/start.config file. I changed the
>>$JETTY_HOME/src/org/mortbay/jetty/servlet/webdefault.xml file to
>>specify
>>compiler=javac, fork=false and did a top-level clean build.
>>
>>snoop.jsp compiled and ran OK with the following log output (stack
>>trace
>>removed for legibility):
>>19:49:27.774 ERROR! [Listener-4]
>>org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
>
>
>> >25> Error compiling file:
>>
>
> /home/janb/src/Jetty/work/Jetty__8080__jetty//org/apache/jsp/snoop_jsp.java
>
>>     [javac] Since compiler setting isn't classic or modern,ignoring
>
>
>>fork setting.
>>[javac] Compiling 1 source file
>>19:49:27.774 WARN!! [Listener-4]
>>
>
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
>
>> >11> /jetty/snoop.jsp:
>>Compiler Adapter 'javac' can't be found.
>>
>>If I instead specify only fork=false and don't set a compiler,
>>snoop.jsp
>>compiles and runs fine with the following log output (stack trace
>>removed for legibility):
>>19:57:31.523 WARN!! [Listener-4]
>>
>
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:588)
>
>> >11> /jetty/snoop.jsp:
>>Unable to find a javac compiler;
>>com.sun.tools.javac.Main is not on the classpath.
>>Perhaps JAVA_HOME does not point to the JDK
>>
>>Which version of Jetty are you using and how are you starting it?
>>
>>cheers
>>Jan
>>
>>
>>Tony Thompson wrote:
>>
>>
>>>My issue is not with the servlet mapping.  I am doing the servlet
>>>mapping because I want to change the URL.  The issue is, I am doing
>>
>>the
>>
>>
>>>servlet mapping and the JSPs will not compile correctly.  The
>>
>>easiest
>>
>>
>>>way to demostrate the issue is to run the Jetty demo server but make
>>>sure you are running it so that 'javac' is not in your path
>
> anywhere.
>
>>
>>>So, by default, Jasper is set to fork the external compiler.  If
>>
>>your
>>
>>
>>>JSP compiles fail, you will see the error that says it can't find
>>>'javac'.  Now, try to get a JSP to compile using the internal
>>
>>compiler
>>
>>
>>>(in the tools.jar) by setting fork=true as a Jasper init parameter.
>>>Once the JSPs compile, try running a JSP that is mapped (like
>>
>>snoop.jsp)
>>
>>
>>>and it will not be able to compile because it can't find 'javac'.
>>>
>>>That demonstrates the issue.  I can't get the JSP init parameters to
>>>work with a mapped JSP.  If you access snoop.jsp without using its
>>>mapped URL, it should compile.
>>>
>>>Tony
>>>
>>>
>>>
>>>
>>>>>>[hidden email] 05/18/05 11:40AM >>>
>>>
>>>Tony,
>>>
>>>By default, Jetty uses implicit jsp mapping as defined in the
>
> Servlet
>
>>
>>>Spec 11.2.1. That is, you do not have to put in individual mappings
>>
>>in
>>
>>
>>>your web.xml file for each jsp file. You only specify the servlet
>>>mappings if you want to change the url map ,mping.
>>>
>>>The settings for the Jasper jsp container are controlled by the
>>>init-params on the jsp servlet definition in webdefaults.xml. You
>>>change
>>>the webdefaults.xml file to affect  the container configuration such
>>
>>as
>>
>>
>>>forking the jsp compiler, log levels, type of jsp compiler etc etc.
>>>
>>>Looking back at your posts, perhaps the root cause of your problems
>>
>>is
>>
>>
>>>that your url-mapping is not as you think it is? You have mapped
>>>/ShowFactsReport , which will only exactly match requests which end
>>
>>in
>>
>>
>>>/ShowFactsReport  You need to use /ShowFactsReport/* to match eg:
>>>   http://www.my.host/myapp/ShowFactsReport/morestuffhere 
>>>
>>>Other than all that, you could have a look at the jetty demo that
>>
>>comes
>>
>>
>>>with the source, as it uses some jsp servlet mappings for the
>>
>>snoop.jsp
>>
>>
>>>and see what is different with your application.
>>>
>>>cheers
>>>Jan
>>>
>>>
>>>
>>>Tony Thompson wrote:
>>>
>>>
>>>
>>>>My example may have been a bit misleading.  Say my servlet mapping
>>>
>>>looks
>>>
>>>
>>>
>>>>like this:
>>>>
>>>><servlet>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <display-name>factsReport</display-name>
>>>>  <jsp-file>/test/factsReport.jsp</jsp-file>
>>>></servlet>
>>>><servlet-mapping>
>>>>  <servlet-name>factsReport</servlet-name>
>>>>  <url-pattern>/ShowFactsReport</url-pattern>
>>>></servlet-mapping>
>>>>
>>>>This is something that is done frequently.  I tested with the
>>>>webdefaults.xml and it doesn't work either way (configuring the
>>>
>>>context
>>>
>>>
>>>
>>>>with webdefaults.xml or programmatically).  If I have a servlet
>>>
>>>mapping
>>>
>>>
>>>
>>>>for my JSP, the init parameters for the JspServlet are ignored.
>
> The
>
>>>>only way I can get it to work is by passing Jasper init parameters
>>
>>to
>>
>>
>>>my
>>>
>>>
>>>
>>>>servlet.  It seems like Jetty should automatically add Jasper init
>>>>parameters when it starts my mapped servlet.  No?
>>>>
>>>>Tony
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>>>[hidden email] 05/17/05 10:26AM >>>
>>>>
>>>>Hi Tony,
>>>>
>>>>What I meant is that the webdefault.xml file is ALWAYS used by the
>>>>WebApplicationContext (unless you specify a custom one). So the
>>>
>>>Jasper
>>>
>>>
>>>
>>>>stuff will always be automatically set up for you, including all
>
> the
>
>>>
>>>>mappings of *.jsp There is no reason for you to put in indiviual
>>>>servlet
>>>>mappings in your web.xml.
>>>>
>>>>If you want to change the default setup, then the natural place to
>>>
>>>do
>>>
>>>
>>>
>>>>it
>>>>is in the webdefault.xml. However, the default behaviour seems to
>
> be
>
>>>
>>>>what you want.
>>>>
>>>>cheers
>>>>Jan
>>>>
>>>>Tony Thompson wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>I will give it a shot but, I don't see how that is any different
>>>
>>>than
>>>
>>>
>>>
>>>>me
>>>>
>>>>
>>>>
>>>>
>>>>>adding the Jasper servlet to the context programmatically.  Would
>>>>
>>>>you
>>>>
>>>>
>>>>
>>>>
>>>>>expect it to behave differently?  If so, that seems like a bug to
>>>
>>>me.
>>>
>>>
>>>
>>>>>It should work the same no matter how Jasper is added to the
>>>>
>>>>context.
>>>>
>>>>
>>>>
>>>>
>>>>>>>>[hidden email] 05/14/05 04:46PM >>>
>>>>>
>>>>>Hi Tony,
>>>>>
>>>>>Have you taken a look at the webdefault.xml file? There is a copy
>>
>>in
>>
>>
>>>>>$JETTY_HOME/etc. It sets up all the Jasper mappings and init
>
> params
>
>>>>on
>>>>
>>>>
>>>>
>>>>
>>>>>behalf of all webapps. Here's a link to the FAQ entry for it:
>>>>>
>>>>
>>>>
> http://jetty.mortbay.org/jetty/faq?s=250-Configuration&t=140xmlwebdefault
>
>
>>
>>>>>regards
>>>>>Jan
>>>>>
>>>>>
>>>>>Tony Thompson wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>OK, I have some additional information.  It is not an issue with
>>>
>>>the
>>>
>>>
>>>
>>>>>way
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>I am assembling the WebApplicationContext.  The issue is with the
>>>>>>serlvet mappings in my web.xml.  If I put a servlet mapping in
>
> for
>
>>>>>my
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>JSP, it doesn't work properly (i.e. it tries to fork the external
>>>>>>compiler which is what I am trying to prevent).  Here is my
>>>
>>>mapping:
>>>
>>>
>>>
>>>>>><servlet>
>>>>>><servlet-name>factsReport</servlet-name>
>>>>>><display-name>factsReport</display-name>
>>>>>><jsp-file>/test/factsReport.jsp</jsp-file>
>>>>>></servlet>
>>>>>><servlet-mapping>
>>>>>><servlet-name>factsReport</servlet-name>
>>>>>><url-pattern>/factsReport.jsp</url-pattern>
>>>>>></servlet-mapping>
>>>>>>
>>>>>>With that in my web.xml, if I go to
>
> http://server/factsReport.jsp,
>
>>>I
>>>
>>>
>>>
>>>>>>get a compile error because it tries to fork the external
>>
>>compiler.
>>
>>
>>>>>If
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>I go to http://server/test/factsReport.jsp, it compiles with the
>>>>>>internal compiler and runs just fine.
>>>>>>
>>>>>>I can also modify my web.xml and get it to work correctly with
>
> the
>
>>>>>>mapping:
>>>>>>
>>>>>><servlet>
>>>>>><servlet-name>factsReport</servlet-name>
>>>>>><display-name>factsReport</display-name>
>>>>>><jsp-file>/test/factsReport.jsp</jsp-file>
>>>>>><init-param>
>>>>>>    <param-name>fork</param-name>
>>>>>>    <param-value>false</param-value>
>>>>>></init-param>
>>>>>></servlet>
>>>>>>
>>>>>>If I pass the Jasper "fork" as an initialization parameter to my
>>>>>
>>>>>JSP,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>that works.
>>>>>>
>>>>>>Is this working as designed?  It seems like Jetty should always
>>>
>>>send
>>>
>>>
>>>
>>>>>>the right parameters to Jasper no matter how it is being invoked.
>>>>>>
>>>>>>Thanks
>>>>>>Tony
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>>[hidden email] 05/11/05 02:45PM >>>
>>>>>>
>>>>>>I have an application that builds a WebApplicationContext
>>>>>>programatically.  I am adding 3 servlets to the context, in this
>>>>>>order:
>>>>>>
>>>>>>org.apache.jasper.servlet.JspServlet
>>>>>>org.mortbay.jetty.servlet.Invoker
>>>>>>org.mortbay.jetty.servlet.Default
>>>>>>
>>>>>>One of the things I am trying to do is pass an init parameter to
>>>>>>Jasper.  I can run JSPs out of my web application so, I know the
>>>>>>servlet
>>>>>>in configured but, my init parameters do not seem to be taking.
>>>>>
>>>>>Here
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>is
>>>>>>the servlet initialization code:
>>>>>>
>>>>>>sHold = webApp.addServlet(
>>>>>>"*.jsp:*.jsP:*.jSp:*.jSP:*.Jsp:*.JsP:*.JSp:*.JSP",wo
>>>>
>>>>it
>>>>is in the w
>>>>
>>>>
>>>>
>>>>>>"org.apache.jasper.servlet.JspServlet" );
>>>>>>sHold.setInitParameter( "logVerbosityLevel", "DEBUG" );
>>>>>>sHold.setInitParameter( "fork", "false" );
>>>>>>
>>>>>>Can anyone tell me why the init parameters might not be taking?
>>>>>>
>>>>>>Thanks
>>>>>>Tony
>>>>>>
>>>>>>
>>>>>>-------------------------------------------------------
>>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>>Want to be the first software developer in space?
>>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>>_______________________________________________
>>>>>>Jetty-support mailing list
>>>>>>[hidden email]
>>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>>
>>>>>>
>>>>>>-------------------------------------------------------
>>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>>Want to be the first software developer in space?
>>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>>_______________________________________________
>>>>>>Jetty-support mailing list
>>>>>>[hidden email]
>>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>>
>>>>>-------------------------------------------------------
>>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>>Want to be the first software developer in space?
>>>>>Enter now for the Oracle Space Sweepstakes!
>>>>>http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click 
>>>>>_______________________________________________
>>>>>Jetty-support mailing list
>>>>>[hidden email]
>>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is s /jsp-file>
>>>>
>>>>>><init-parponsored by Oracle Space Sweepstakes
>>>>
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>>
>>>>-------------------------------------------------------
>>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>>Want to be the first software developer in space?
>>>>Enter now for the Oracle Space Sweepstakes!
>>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>>_______________________________________________
>>>>Jetty-support mailing list
>>>>[hidden email]
>>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>>
>>>
>>>
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>>
>>>-------------------------------------------------------
>>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>>Want to be the first software developer in space?
>>>Enter now for the Oracle Space Sweepstakes!
>>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>>_______________________________________________
>>>Jetty-support mailing list
>>>[hidden email]
>>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>>
>>
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>>
>>-------------------------------------------------------
>>This SF.Net email is sponsored by Oracle Space Sweepstakes
>>Want to be the first software developer in space?
>>Enter now for the Oracle Space Sweepstakes!
>>http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
>>_______________________________________________
>>Jetty-support mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/jetty-support 
>>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click 
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
> _______________________________________________
> Jetty-support mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jetty-support
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support