spring - How to create a servlet on the fly -


for below url's receive 404 error, fine since url's not exist. possible create these servlets while server running before error page returned ?

http://127.0.0.1:8888/test1 http://127.0.0.1:8888/test1/test2 

i'm thinking perhaps create generic controller intercepts urls if current servlet not exist, create ?

assuming spring mean spring mvc, this:

@controller public class yourcontroller {     @requestmapping("/mappinga")     public void methoda() {         // (...)     }      @requestmapping("/mappingb")     public void methodb() {         // (...)     }      // catches non-matched requests.     @requestmapping("/*")     public void fake404(httpservletrequest request) {         var uri = request.getrequesturi();         // (...)     } } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -