When you create an article, you need to create the SEO-friendly URL also and persist it, along with the article. Now you need to have a repository method that allows you to retrieve articles by permalink, and a Spring MVC endpoint that calls that repository method.
Using the title may not be a good idea, as the title is usually not URL-friendly, and may eventually be non-unique. But it is a good idea to use the title as the input for the permalink.
Here's a sample permalink algorithm:
This is how the read path could look like:
@Autowired
private ArticleRepository ar;
@RequestMapping(value="/article/{id}/{ignored}") @ResponseBody
public Article getByIdAndIgnorePermalink(@PathVariable String id, @PathVariable String ignored){
return ar.getById(id);
}
@RequestMapping(value="/article/{title}.html") @ResponseBody
public Article getByPermalink(@PathVariable String permalink){
return ar.getByPermalink(permalink);
}