Commit 3fcdfe35 authored by Matija Obreza's avatar Matija Obreza
Browse files

Better handling of /descriptor/{trait}/{method} URLs

and Fixed outdated /1/ links
parent 2782e985
......@@ -82,16 +82,14 @@ public class DescriptorController extends BaseController {
@RequestMapping("/{traitId}/{methodId}")
public String view(ModelMap model, @PathVariable("traitId") long traitId, @PathVariable("methodId") long methodId) {
final Parameter trait = traitService.getTrait(traitId);
if (trait == null) {
throw new ResourceNotFoundException();
}
final Method method = traitService.getMethod(methodId);
if (method == null) {
throw new ResourceNotFoundException();
}
if (!method.getParameter().getId().equals(trait.getId())) {
_logger.warn("Method does not belong to Param");
final Parameter trait = traitService.getTrait(traitId);
if (trait == null || !method.getParameter().getId().equals(trait.getId())) {
_logger.debug("Redirecting to valid URL");
return "redirect:/descriptors/" + method.getParameter().getId() + "/" + method.getId();
}
model.addAttribute("trait", trait);
......
......@@ -209,7 +209,7 @@
</ul>
<div class="header-search pull-left">
<form action="/1/acn/search2" class="form-inline">
<form action="/acn/search2" class="form-inline">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search Genesys..." />
<input type="submit" class="btn btn-primary" value="" />
......
......@@ -111,7 +111,7 @@
<!-- Block Help -->
<div class="col-md-4 col-sm-12 col-xs-12 no-space">
<div class="see-also-block" x-href="/1/content/help/how-to-use-genesys">
<div class="see-also-block" x-href="/content/help/how-to-use-genesys">
<div class="content">
<h2 class="short text-right pull-left">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment