0

for a @webservlet annotated servlet, how can I do something similar to spring mvc:

@Path = my/custome/path/{id}  

and then use the id in the servlet code?
or do @requestParam (for post) ?

and use those params in the code.

Note: I want pure java-ee solution, not with some framework like spring, or struts etc.

Masood Ahmad
  • 731
  • 4
  • 15
  • 38
  • The pure JavaEE way of doing that is to use JAX-RS. – JB Nizet Jun 23 '14 at 07:46
  • @JBNizet 1) theres is NO other way? 2) if no, can you give an example of jax-rs controller? 3) can you give an example of a non-pure javaee way too? – Masood Ahmad Jun 23 '14 at 07:55
  • 1. Of course there is another way: implement it yourself, or use a framework sitting on top of servlets (like Spring MVC) which does it. 2. There are plenty of Jax-RS tutorials and example online. Use Google. 3. There are plenty of examples and tutorials using Spring-MVC (for example) online. Use Google. – JB Nizet Jun 23 '14 at 08:58
  • right. got you. thank. take a look at these. I share same thoughts . http://stackoverflow.com/questions/24360391/mvc-pattern-in-java-ee-and-migrating-from-spring-to-java-ee-7?noredirect=1#comment37671564_24360391 https://blogs.oracle.com/arungupta/entry/why_java_ee_6_is – Masood Ahmad Jun 23 '14 at 09:39

0 Answers0