Jean-Sebastien Delfino wrote:
Jean-Sebastien Delfino wrote:
Luciano Resende wrote:
Binding REST was originally created as a copy of Binding HTTP and it
has been enhanced to a great extent without really removing any of the
native Binding HTTP functionality.

I was wondering what are people thoughts on deprecating the current
Binding.HTTP, and make the runtime to "proxy" all binding.http to
binding.rest.

Thoughts ?


Would that work with implementation.widget too? I'm asking because it looks like Widget components are using binding.http to serve their resources.


BTW, that doesn't work so well when Tuscany is running in as Webapp, as the HTTPBindingListenerServlet doesn't get the right resource paths.

I think that the problem is in HTTPBindingListenerServlet.java:78
String path = URLDecoder.decode(request.getRequestURI().substring(request.getServletPath().length()), "UTF-8"); which, I guess, is trying to get the part of the request URI after the http binding servlet path??

That code seems to work OK in J2SE with an embedded Web container, where there's no Web context root before the servlet path, but gets the wrong part of the URI in a hosted Webapp, where there is a Web context before the servlet path.

I've tried to replace that line by:
String path = URLDecoder.decode(request.getPathInfo(), "UTF-8");
which returned the expected resource path, but I'm not sure what else that change could break.

Does anybody know for sure the intent of the original code? and why it used getRequestURI() instead of just request.getPathInfo()?

Thanks

That change doesn't cause any build break, and nobody has come up with any more insight, so if there's no objections I'll push it from sandbox/sebastien/java/dynamic [1] to trunk.

[1] http://svn.apache.org/repos/asf/tuscany/sandbox/sebastien/java/dynamic/
--
Jean-Sebastien

Reply via email to