I am working on a project where I want to provide unique URL for each user.
For example:
www.SocialNetwork.com/jhon
www.SocialNetwork.com/jasmine
So far I'm able to achieve this:
www.SocialNetwork.com/profiles/jasmine
here profiles
is my action where I can get the user name by
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.patternMatcher" value="namedVariable"/>
<action name="profiles/{username}" class="com.example.actions.ViewProfileAction">
<result name="input">/WEB-INF/jsp/profile.jsp</result>
</action>
but I want to achieve something like this:
www.SocialNetwork.com/jasmine
Just use domain name and username.
Like Twitter does:
www.twitter.com/username
How to achieve this?
profiles/
in front of the action name if you don't want it to be there? – Tiffa