}
@Override
protected void save(HttpServletRequest request, HttpServletResponse response) {
I18n entity = new I18n();
entity.setLang(request.getParameter("lang"));
entity.setId(entity.getLang());
entity.setLbl(request.getParameter("lbl"));
request.setAttribute("entity", entity);
if(i18nService.getI18n(entity.getLang(), entity.getId())!=null){
throw new RuntimeException(I18N.getLbl(request, "i18n.error.duplicatelang", "已经存在相同的语言"));
}
//保存
i18nService.insert(entity);
//当前语言
I18n entity2 = new I18n();
entity2.setLang(I18N.getDefaultLang(request));
entity2.setId(entity.getLang());
entity2.setLbl(entity.getLbl());
if(i18nService.getI18n(entity2.getLang(), entity2.getId()) == null){
i18nService.insert(entity2);
}
}