java - How to configure url maping in tuckey-urlrewrite-filter? -


i have page about.jsp, contact.jsp, user.jsp, index.jsp in folder projects under webapps root. use tuckey-urlrewrite-filter url mapping. used url writing as

    <rule>     <from>/contact_us</from>         <to>/contact.jsp</to>     </rule>     <rule>     <from>/about_us</from>         <to>/about.jsp</to>     </rule> 

when type in url about_us or contact_us these finely work open corresponding page. want url user.jsp thing except contact_us , about_us. because used user.jsp profile page. if in url type "abhiramgiri" user.jsp should open or type except contact_us , about_us should open user.jsp. not able write actual code these case. plz me...

try setting last="true" first 2 rules, adding third rule:

<rule>     <from>/contact_us</from>     <to last="true">/contact.jsp</to> </rule> <rule>     <from>/about_us</from>     <to last="true">/about.jsp</to> </rule> <rule>     <from>.*</from>     <to>/user.jsp</to> </rule> 

this means that, if there match on /contact_us filter stop looking matches, , same goes /about_us. doesn't match either of compared against third rule, should match anything.

in regular expressions, "." means match single character, , "*" means match 0 or more occurrences of preceding portion of pattern. ".*" means match 0 or more of character.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -