How to process any request of the type example.com/request?
Suppose I own say add-one.com and if I receive add-one.com/23 I want to capture开发者_运维问答 '23' and then display 24 to the user (for example http://dictionary.reference.com/browse/overflow or any other word) instead of throwing a 404 error. How could I do this? I do not want to do anything like add-one.com/process.php?number=23.
Looks like you want the request path. Take a look at the following examples on THIS page. It should help you get started.
For more complex projects, you should also get familiar with the basics of REST. You can then start using Jersey, a framework for building RESTful web services in Java.
精彩评论