Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] JSP using Java 1.7?

Nick,

By default, a webapp will use the webdefaults.xml file embedded in the
jetty-webapp.jar.

The one in $JETTY_HOME/etc/ is only provided as a convenience, so you
can modify it and point your webapps to it instead via calling
WebAppContext.setDefaultsDescriptor() (either programmatically, or via
xml in a context xml file).

cheers
Jan

On 19 July 2012 13:30, Nick Fenwick <neek@xxxxxxxxxxxxxxx> wrote:
> On 07/12/2012 01:21 AM, John English wrote:
>>
>>
>> Many thanks for this. Googling "compilerTargetVM" took me to your
>> "Configuring JSP" how-to, and this gave me a few more hints:
>>
>>   "There are several options for modifying the Jasper JSP servlet
>>    configuration... Another option is to add an entry for the Jasper
>>    JSP servlet to the web.xml file of your webapp."
>>
>> Accordingly I modified web.xml to include the following:
>
>
> Hi guys,
>
> I've had some trouble with this on jetty 7.6.4.  I run an embedded Jetty
> locally during development, and a standard "java -jar start.jar" setup in
> production.  My surprise is that in production, editing etc/webdefault.xml
> didn't help, it's as if it's ignoring the compilerTargetVM and
> compilerSourceVM config.  I do not override the defaultDescriptor value in
> my context .xml file, so AFAIK the web app is using the normal
> webdefault.xml file.  However, copying the <servlet> and <servlet-mapping>
> entry for the 'jsp' servlet from webdefault into my web.xml file _did_ fix
> the problem, suddenly my use of generics in my JSP compiles just fine.
>
> I don't understand why editing etc/webdefault.xml didn't seem to work,
> whereas moving the exact same config into my web.xml did work.  This sounds
> buggy, right?
>
> On a side note, in development, I made it accept 1.5 generics by using the
> setDefaultsDescriptor call:
>         WebAppContext webApp = new WebAppContext(warUrlString, CONTEXTPATH);
>         webApp.setParentLoaderPriority(true);
>         webApp.setDefaultsDescriptor(base + "etc/webdefault.xml");
>
> So I presume that using the defaultsDescriptor in my context.xml file in
> production would also work.. but this should be unnecessary, a web app uses
> etc/webdefault.xml and any config in there ought to apply by default, right?
>
> I'd like to take the 'jsp' servlet definition out of my web.xml if I can,
> because it's just cluttering the place up.  To my mind, it should live in
> etc/webdefault.xml.
>
> Nick
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com – Developer advice, services and support
from the Jetty & CometD experts.


Back to the top