Check for empty keys + form does not lose values
This commit is contained in:
parent
ca29c9ae67
commit
1bd9397c0e
|
@ -79,6 +79,7 @@ public class RegisterServiceServlet extends HttpServlet {
|
|||
Gson gson = new GsonBuilder().registerTypeAdapter(Jwks.class, new JwksDeserializer()).create();
|
||||
jwks = gson.fromJson(jwksString, Jwks.class);
|
||||
if (jwks.getKeys()==null || jwks.getKeys().length==0) {
|
||||
System.out.println("Something wrong with the keys.");
|
||||
request.getSession().setAttribute("msg_key_value_error_display", "display:block");
|
||||
canProceed = false;
|
||||
}
|
||||
|
@ -125,7 +126,13 @@ public class RegisterServiceServlet extends HttpServlet {
|
|||
|
||||
} else {
|
||||
//something is wrong with the form and the error messages will appear
|
||||
response.sendRedirect("./registeredServices");
|
||||
request.getSession().setAttribute("first_name", name);
|
||||
request.getSession().setAttribute("description", description);
|
||||
request.getSession().setAttribute("key_radio", keyType);
|
||||
request.getSession().setAttribute("uri", jwksUri);
|
||||
request.getSession().setAttribute("value", jwksString);
|
||||
|
||||
response.sendRedirect("./registerService");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue