I want to rewrite my URL in Struts2. Please help me out to do this. How can i customize as i want, i don\'t want to show my parameter that i am passing and also show action
If you don't want to show the parameter passing you could use this solution.
To hide passed parameter actually you need to submit the form. You should prevent the default behavior of the click event and replace it with the form event.
If you also want to show action with different name, you can use the above filter or wildcard mapping.
Advanced Wildcards
From 2.1.9+ regular expressions can be defined defined in the action name. To use this form of wild card, the following constants must be set:
The regular expressions can be in two forms, the simplest one is
{FIELD_NAME}
, in which case the field with theFIELD_NAME
in the action will be populated with the matched text, for example:
/books/content.jsp