The consumer can send parameters up to fieldn and valuen. Each field maps to the value.
With this type of requirement, I can't code a finite set of QueryParams on the server side method.
Is there any type of REST library that supports this? I checked RESTEasy and Jersey, and they both don't seem to support this [as far as I checked].
You can do that easily with a servlet in the which the Request object gives you a collection of parameters and attributes.
True REST would look like:
but would be quite difficult to implement knowing that you can have any number of fields(n)
then in method (Been a while, may need to check Syntax)
JAX-RS simply isn’t meant for the type of flexibility you’re describing… I’d probably stick with a servlet in the case you describe. Also, if you need the kind of flexibility you’re describing from an “interface” standpoint, then HTTP headers and query parameters seem much more friendly than path params
This is a simple JAX-RS RESTful webservice that does what you want. I encourage you to read through it and understand.
Pacakge names have been changed to protect the innocent, and I will not help you deploy it to your JEE container.
The framework is JAX-RS.
Now, once deployed correctly, entering this URL in browser: http://localhost:8080/jboss7webapp/rest/app/a=1&b=2&c=3&d=4
There you have it.. Good luck,
i am new to this whole web service, i am stuck with this JAXRS project where i have to integrate my EJB with the Service and i am not able to @Inject or @EJB, everytime i try to inject, i get a Null Pointer Exeption, i have been Searching in google to solve this issue,
i have tried all the possible solutions. like adding @Stateless, adding Beans.xml to my META-INF and also configuring RestEasy CDI Injector Factory in my Web.xml
But no use, i am using JBoss AS 7.0, i keep on getting null pointer, is it even possible to inject any object into my (JAX-RS) Web Services ?? Someone please help me, i have been stuck in this point for more than a week. Someone Please Explain me clearly about this.
Any Kind of help is welcome.
Thanks & Regards,