I have a problem when trying to make some simple navigation in spring mvc. I have a navigation controller:
@Controller
@RequestMapping("/secure")
public class NavigationController {
@RequestMapping("/operation")
public String processOperationPage() {
//Some logic goes here
return "corpus/operation";
}
@RequestMapping("/configuration")
public String processConfigurationPage() {
//Some logic goes here
return "corpus/configuration";
}
}
and there is my links to reach that controller:
<a href="secure/operation.htm">Operation</a>
<a href="secure/configuration.htm">Configuration</a>
When the first time the link is clicked everything is OK. In the browser I see the normal path as I am expecting. For e.g: http://localhost/obia/secure/configuration.htm. But if I am at this page, and from this page I want to reach operation.htm when I click the operation link the path becomes like this: http://localhost/obia/secure/secure/operation.htm.
The secure appears two times. How can I solve this problem?
Your links are relative. Adding a slash in front of them will fix it.