I want to change my ugly url which looks like:
/search.action?category=1
to a nice readable URL which looks like
/my-first-category
I'm using Struts 2, Java EE on Tomcat.
I've tried URL configs in struts like this:
<action name="my-first-category">
<result type="redirect">search.action?category=1</result>
</action>
Which does a redirect, and once the user visits the page they see the ugly URL in the address bar, not the nice readable one.
The same thing happens with this mapping:
<action name="12345">
<result type="redirectAction">
<param name="actionName">search</param>
<param name="category">1</param>
</result>
</action>
Do you know how to achieve what I need to be able to do?