Commit b98a6045 authored by michael.simon's avatar michael.simon
Browse files

Resource bundle not working in rest servlet, no facescontext and no bean

resolving possible
parent c1745d51
......@@ -33,6 +33,7 @@ public class DbMessageBundle extends ResourceBundle {
public DbMessageBundle() {
locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
ResourceBundle rb = ResourceBundle.getBundle(BASE_NAME, locale);
setParent(rb);
......
......@@ -15,7 +15,9 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import javax.inject.Inject;
import javax.servlet.ServletException;
......@@ -48,7 +50,6 @@ import edu.kit.scc.webreg.service.RegistryService;
import edu.kit.scc.webreg.service.ServiceService;
import edu.kit.scc.webreg.service.UserService;
import edu.kit.scc.webreg.service.UserUpdateService;
import edu.kit.scc.webreg.util.ResourceBundleHelper;
@Path("/attrq")
public class AttributeQueryController {
......@@ -71,9 +72,6 @@ public class AttributeQueryController {
@Inject
private KnowledgeSessionService knowledgeSessionService;
@Inject
private ResourceBundleHelper resourceHelper;
@GET
@Path("/eppn/{service}/{eppn}")
@Produces(MediaType.APPLICATION_JSON)
......@@ -166,7 +164,9 @@ public class AttributeQueryController {
response.setMessage("rules failed");
for (UnauthorizedUser uu : unauthorizedUserList) {
addXmlError(response, uu.getMessage(), resourceHelper.resolveMessage(uu.getMessage()));
ResourceBundle bundle = ResourceBundle.getBundle("msg.messages", Locale.ENGLISH);
String test = bundle.getString(uu.getMessage());
addXmlError(response, uu.getMessage(), test);
}
}
......
Markdown is supported
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