Just caught an idea from Saul on irc:
sfarber: One question/idea: Could we have a standard 'extension url' pattern? For example, if all extension modules (RESTConfig, etc) had a common url pattern like 'api-module' then we could add a catch-all rule to the web.xml file...
sfarber: like "<servlet-mapping><servlet-name>dispatcher</servlet-name><pattern>*-module</pattern</servlet-mapping>" You know?
sfarber: clearly all supported modules could add their own config into the web.xml file. I'm just thinking of extension/community modules that would benefit from something like that.
Thoughts? I believe the dispatcher / spring extension points don't require any special thing to be added to the web.xml? I could be wrong, Andrea or Justin? Like right now if you're doing an extended module you don't need to add a mapping.
I think the REST stuff is special because it's not through the dispatcher, one of the main components of RESTlet is a dispatcher, routing with the URLs. So it may be a special case, but I think it should take on all /geoserver/api/ calls. Is that right David? So perhaps we should add some minimal restlet router, jars, and web.xml to trunk? So that adding in the restlet community modules doesn't require a new line in web.xml?
Chris
This sounds like a good idea to me. The reason that the Restlet stuff
requires a special rule is that it is accessed through the /geoserver/api/
URLs and not any existing ones. It actually does use the normal
dispatcher.
Changing the current Restlet-based modules to use a catch-all like this
would require tweaking the routing rules. Having a single Router instance
configured by Spring would be a bit more complicated; I'd like to hear an
opinion on that from someone with more Spring experience than me. I was
thinking that we could continue to simply register WrappingController's
with the dispatcher as we've been doing and simply give them URL's below
some common prefix. So, the /geoserver/api/ URL's would be replaced with
/geoserver/ext/api/ . That way, we'd be able to use anything that was
compatible with the dispatcher rather than just Restlets.
-David
On Thu, November 29, 2007 4:19 pm, Chris Holmes wrote:
Just caught an idea from Saul on irc:
sfarber: One question/idea: Could we have a standard 'extension url'
pattern? For example, if all extension modules (RESTConfig, etc) had a
common url pattern like 'api-module' then we could add a catch-all rule to
the web.xml file... sfarber: like
"<servlet-mapping><servlet-name>dispatcher</servlet-name><pattern>*-module
</pattern</servlet-mapping>"
You know?
sfarber: clearly all supported modules could add their own config into
the web.xml file. I'm just thinking of extension/community modules that
would benefit from something like that.
Thoughts? I believe the dispatcher / spring extension points don't
require any special thing to be added to the web.xml? I could be wrong,
Andrea or Justin? Like right now if you're doing an extended module you
don't need to add a mapping.
I think the REST stuff is special because it's not through the
dispatcher, one of the main components of RESTlet is a dispatcher, routing
with the URLs. So it may be a special case, but I think it should take on
all /geoserver/api/ calls. Is that right David? So perhaps we should add
some minimal restlet router, jars, and web.xml to trunk? So that adding
in the restlet community modules doesn't require a new line in web.xml?
Chris
!DSPAM:4040,474f2cf8225886491211187!
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
!DSPAM:4040,474f2cf8225886491211187!
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
!DSPAM:4040,474f2cf8225886491211187!
One of the showstoppers for having a catch all is struts. Currently the
struts stuff uses a separate dispatcher. There are two ways to solve this:
1. Put all the ui stuff under a particular pattern, oh i dont know,
something like "/ui/*". Currently its just a single wildcard and is too
greedy to allow spring to use the same wildcard.
2. Have spring route to struts. This is theoretically possible but i
could never get it to work. Even though its one of the spring examples
of how to use the dispatcher.
1 is probably out of the question since it breaks all backwards
compatibility. But if we could get 2 to work then we could do all teh
pattern matching dynamically in spring application contexts and leave
the web.xml alone.
Perhaps it is time to take another kick at the can for having spring
route to struts. Also there are much more recent version of spring, even
1.x like we are using . Perhaps this will work with an upgrade.
-Justin
dwinslow@anonymised.com wrote:
This sounds like a good idea to me. The reason that the Restlet stuff
requires a special rule is that it is accessed through the /geoserver/api/
URLs and not any existing ones. It actually does use the normal
dispatcher.
Changing the current Restlet-based modules to use a catch-all like this
would require tweaking the routing rules. Having a single Router instance
configured by Spring would be a bit more complicated; I'd like to hear an
opinion on that from someone with more Spring experience than me. I was
thinking that we could continue to simply register WrappingController's
with the dispatcher as we've been doing and simply give them URL's below
some common prefix. So, the /geoserver/api/ URL's would be replaced with
/geoserver/ext/api/ . That way, we'd be able to use anything that was
compatible with the dispatcher rather than just Restlets.
-David
On Thu, November 29, 2007 4:19 pm, Chris Holmes wrote:
Just caught an idea from Saul on irc:
sfarber: One question/idea: Could we have a standard 'extension url'
pattern? For example, if all extension modules (RESTConfig, etc) had a
common url pattern like 'api-module' then we could add a catch-all rule to
the web.xml file... sfarber: like
"<servlet-mapping><servlet-name>dispatcher</servlet-name><pattern>*-module
</pattern</servlet-mapping>"
You know?
sfarber: clearly all supported modules could add their own config into
the web.xml file. I'm just thinking of extension/community modules that
would benefit from something like that.
Thoughts? I believe the dispatcher / spring extension points don't
require any special thing to be added to the web.xml? I could be wrong,
Andrea or Justin? Like right now if you're doing an extended module you
don't need to add a mapping.
I think the REST stuff is special because it's not through the
dispatcher, one of the main components of RESTlet is a dispatcher, routing
with the URLs. So it may be a special case, but I think it should take on
all /geoserver/api/ calls. Is that right David? So perhaps we should add
some minimal restlet router, jars, and web.xml to trunk? So that adding
in the restlet community modules doesn't require a new line in web.xml?
Chris
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
!DSPAM:4040,474f2cf8225886491211187!
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
!DSPAM:4040,474f2cf8225886491211187!
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
!DSPAM:4007,474f711163207180515871!
--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org