Fehlerkorrektur im CLI-Servlet
This commit is contained in:
parent
23bcbfb199
commit
a89989b1fd
@ -123,23 +123,23 @@ public class CLIClientConnectorServlet extends HttpServlet {
|
|||||||
String type = m[j].getParameterTypes()[0].getCanonicalName();
|
String type = m[j].getParameterTypes()[0].getCanonicalName();
|
||||||
try {
|
try {
|
||||||
if (type.equals("java.lang.String"))
|
if (type.equals("java.lang.String"))
|
||||||
m[j].invoke(o, value);
|
m[j].invoke(realO, value);
|
||||||
else if (type.equals("java.lang.Integer") || type.equals("int"))
|
else if (type.equals("java.lang.Integer") || type.equals("int"))
|
||||||
m[j].invoke(o, Integer.parseInt(value));
|
m[j].invoke(realO, Integer.parseInt(value));
|
||||||
else if (type.equals("java.lang.Long") || type.equals("long"))
|
else if (type.equals("java.lang.Long") || type.equals("long"))
|
||||||
m[j].invoke(o, Long.parseLong(value));
|
m[j].invoke(realO, Long.parseLong(value));
|
||||||
else if (type.equals("java.lang.Boolean") || type.equals("boolean"))
|
else if (type.equals("java.lang.Boolean") || type.equals("boolean"))
|
||||||
m[j].invoke(o, Boolean.valueOf(value));
|
m[j].invoke(realO, Boolean.valueOf(value));
|
||||||
else if (type.equals("java.util.Date")) {
|
else if (type.equals("java.util.Date")) {
|
||||||
DateFormat df = DateFormat.getInstance();
|
DateFormat df = DateFormat.getInstance();
|
||||||
m[j].invoke(o, df.parse(value));
|
m[j].invoke(realO, df.parse(value));
|
||||||
} else {
|
} else {
|
||||||
Method m2 = module.getClass().getMethod(
|
Method m2 = module.getClass().getMethod(
|
||||||
"findByString", Class.class, String.class);
|
"findByString", Class.class, String.class);
|
||||||
Object entity =
|
Object entity =
|
||||||
m2.invoke(module, m[j].getParameterTypes()[0], value);
|
m2.invoke(module, m[j].getParameterTypes()[0], value);
|
||||||
if (entity != null)
|
if (entity != null)
|
||||||
m[j].invoke(o, entity);
|
m[j].invoke(realO, entity);
|
||||||
else
|
else
|
||||||
throw new BusinessException(
|
throw new BusinessException(
|
||||||
"not object found for '" + value + "'");
|
"not object found for '" + value + "'");
|
||||||
|
Loading…
Reference in New Issue
Block a user