Dave Siracusa [
http://community.jboss.org/people/davesiracusa] created the discussion
"httprouter issues with GET/POST WADL Services and Web Routing"
To view the discussion, visit:
http://community.jboss.org/message/543285#543285
--------------------------------------------------------------
I ran into two issues when using the httprouter (new):
1) Using this router one must specify the method (get,post,delete, etc) in the
configuration tree. If you route to an external server that supports both GET and POST
you are stuck because the method factory is created at init time forcing you to use only
one. I've run into this with a RESTful service I'm pointing to.
2) Say you point the router to a web server that serves up a page. This page contains
relative links to images. The text/html content comes back however the images/other
content does not. As a matter of fact you can't specify anything after the base url,
its ignored.
And my router as such:
<action name="httprouter">
<property name="endpointUrl" value="
http://localhost/
http://localhost">
<http-client-property name="max-total-connections" value="100"
/>
<http-client-property name="max-connections-per-host" value="50"
/>
</property>
<property name="method" value="GET" />
<property name="responseType" value="STRING" />
</action>
Urls like this succeed (partially):
-
http://localhost:8080/Quickstart_async/http/test
http://localhost:8080/Quickstart_async/http/test (returns text/html only).
Urls like this fail (even though they exist):
-
http://localhost:8080/Quickstart_async/http/test/index.htm
http://localhost:8080/Quickstart_async/http/test/index.htm
-
http://localhost:8080/Quickstart_async/http/test/welcome.png
http://localhost:8080/Quickstart_async/http/test/welcome.png
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I changed the httprouter source:
1) I added support for comma separated method value (GET,POST,DELETE). It creates
factories in the init() method, caching it as the original author intended.
2) I added a call to method.setPath in the process method to initialize the path and all
is good.
I've attached the source.
BTW - I'm having problems signing the CLA. I've opened discussions on this.
I'd like to create a JIRA and check in my changes.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/543285#543285]
Start a new discussion in JBoss ESB Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]