protected void processTemplate(TemplateContext templateContext, ServletRequest request) throws RedirectException {
super.processTemplate(templateContext, request);
if (request.getMethod() == Method.POST) {
- String name = request.getServletRequest().getParameter("name");
+ String name = request.getServletRequest().getParameter("name").trim();
+ if (name.length() == 0) {
+ templateContext.set("error", "no-name-given");
+ return;
+ }
try {
Artist artist = getCore().getDataManager().createArtist(name);
- throw new RedirectException("admin.edit-artist?artist=" + artist.getId());
+ throw new RedirectException("admin.edit-artist?id=" + artist.getId());
} catch (DatabaseException de1) {
throw new RuntimeException("Could not create artist.", de1);
}