I am building a web app using Spring MVC and I am having a problem.
Currently, if I login and go to the homepage of the webapp then it displays the user home page correctly (normal stuff profile image, details, etc) - thats all great.
However, I am trying to build in the functionality so that if anyone goes to the site with the url /user/username then it will redirect to a controller and attempt to find a user with the username "username" - if one is found then it loads the view of the selected users profile.
This is all working fine so far - but I wanted to check that if you are logged in and navigate to /user/mycurrentusername then dont load the normal profile page, just load the page you see when you first logon.. the problem is that when I return the same view I do for the homepage, being as I am now at url /user/* none of the page resources can be found (images/css) so i get the page but with no formatting/images..
What would be the best way around this? is there a better way to handle this?
(I also have problems that as it looks for images/css at /url/images.. it fires a request to my user Controller again :( )
Help much appreciated!