See comment inline.

Raymond

On Thu, Dec 18, 2008 at 02:50, Simon Kitching <s...@ops.co.at> wrote:
> Mikolaj Rydzewski schrieb:
>> Simon Kitching wrote:
>>> I have noticed that the server.xml can be configured to point to a
>>> custom DirContext class, like this:
>>>   <Context ....>
>>>     <Resources className="my.custom.dircontext.impl"/>
>>>   </Context>
>>>
>> I don't know anything about above solution.
>> But for sure you can precompile all JSPs, pack resulting classes into
>> jarfile and provide appropiate servlet mappings in web.xml. I believe,
>> that there's ant task to perform all required steps.
>>
> Yes, that is possible. But it is rather a nuisance, and doesn't help
> with serving other resources like images and javascript.
>
> It also isn't portable across different servlet-containers, ie a project
> cannot provide a "precompiled" download which works across different
> containers.
>
> I'm really surprised that there isn't more interest in serving webapp
> resources directly from jarfiles. I'll go investigate whether Jetty
> offers this feature..

The reason is that it's a performance hit.  Classes are cached by the
jvm so it's not such an issue however there is no provision in the jee
spec for caching resources; so to pull them from the jar file requires
disk io for each resource.  Imagine you have a jsp page with the same
image used many times.  Accessing the jar for each will require both
disk IO as well as cpu (if the jar is at all compressed).

If you want your applications to scale this is not a recommended approach.

>
> Thanks to all who offered suggestions on this thread.
>
> Regards, Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>



-- 
---------------------------------------------------------
Raymond Kroeker

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to