You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2010/01/26 00:30:42 UTC

Servlet to share Pivot (and maybe other) jars

Hi to all,
just a quick idea to minimize the overhead by pivot jars in a webapp:

I'm thinking on writing a simple servlet that (mapped on a dedicated
URI, like lib-shared) publish the required jars to clients, but having
them under WEB-INF/lib ... ok ok, many security problems could happen,
but doing all thing right (like publishing only some type of
resources, and only from some folders, requiring authentication, etc)
could help to move also pivot jars with all server-side jars already
under WEB-INF/lib , or shared lib (available in some application
servers).

In this way, webapp containing one or more Pivot webapps could be a
little lighter (less MB of WAR), and many times I've seen "simple"
Applets (from many commercial products) depending on many jars, like
Spring, Hibernate etc ...


Probably Pivot projects (and in this case, web-server) are not the
best place for this type of component, but what do you think ?
Could be useful, or is another my crazy idea ?

Bye,
Sandro

Re: Servlet to share Pivot (and maybe other) jars

Posted by Sandro Martini <sa...@gmail.com>.
Yes, I agree with you, it makes no sense only on Pivot jars.
I hope this little thread could help someone in situations like this
(and more complex :-) ).

Thanks,
Sandro

Re: Servlet to share Pivot (and maybe other) jars

Posted by Greg Brown <gk...@mac.com>.
Makes sense, but I personally don't think it would be worth the effort. The Pivot JARs you might typically want to use on the server include Core and Web, and these are pretty small (180k and 29k). Even WTK and Terra are pretty small, and they aren't likely to be used on the server often.

On Jan 25, 2010, at 6:54 PM, Sandro Martini wrote:

> Hi Greg,
> thanks for the info, but my idea was to share the same jars used in
> the server-side part (why not also Pivot itself ?), because I've seen
> in many projects that if possible the client-side part deployed with a
> webapp is done using the same jars of the server-side, duplicating
> them, so the trick, like a symbolic link in UNIX.
> 
> Just a little idea, maybe could be useful to someone ... and I'm
> interesting to see what users (and developers of course) say on this
> ... comments are always welcome.
> 
> Bye


Re: Servlet to share Pivot (and maybe other) jars

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,
thanks for the info, but my idea was to share the same jars used in
the server-side part (why not also Pivot itself ?), because I've seen
in many projects that if possible the client-side part deployed with a
webapp is done using the same jars of the server-side, duplicating
them, so the trick, like a symbolic link in UNIX.

Just a little idea, maybe could be useful to someone ... and I'm
interesting to see what users (and developers of course) say on this
... comments are always welcome.

Bye

Re: Servlet to share Pivot (and maybe other) jars

Posted by Greg Brown <gk...@mac.com>.
I'd suggest putting them in /lib rather than /WEB-INF/lib. That way, you can still share them across all the Pivot apps deployed in the web app but you don't need to write a custom servlet to serve them up.

On Jan 25, 2010, at 6:30 PM, Sandro Martini wrote:

> Hi to all,
> just a quick idea to minimize the overhead by pivot jars in a webapp:
> 
> I'm thinking on writing a simple servlet that (mapped on a dedicated
> URI, like lib-shared) publish the required jars to clients, but having
> them under WEB-INF/lib ... ok ok, many security problems could happen,
> but doing all thing right (like publishing only some type of
> resources, and only from some folders, requiring authentication, etc)
> could help to move also pivot jars with all server-side jars already
> under WEB-INF/lib , or shared lib (available in some application
> servers).
> 
> In this way, webapp containing one or more Pivot webapps could be a
> little lighter (less MB of WAR), and many times I've seen "simple"
> Applets (from many commercial products) depending on many jars, like
> Spring, Hibernate etc ...
> 
> 
> Probably Pivot projects (and in this case, web-server) are not the
> best place for this type of component, but what do you think ?
> Could be useful, or is another my crazy idea ?
> 
> Bye,
> Sandro