How to use a servlet filter in Java to change an incoming servlet request url?

后端 未结 3 1229
春和景丽
春和景丽 2020-11-22 07:24

How can I use a servlet filter to change an incoming servlet request url from

http://nm-java.appspot.com/Check_License/Dir_My_App/Dir_ABC/My_Obj_123

3条回答
  •  攒了一身酷
    2020-11-22 07:52

    You could use the ready to use Url Rewrite Filter with a rule like this one:

    
      ^/Check_License/Dir_My_App/Dir_ABC/My_Obj_([0-9]+)$
      /Check_License?Contact_Id=My_Obj_$1
    
    

    Check the Examples for more... examples.

提交回复
热议问题