java - Struts2 String[] parameter instead of Long -


i developing struts2 application (struts 2.3.14, java 1.7, on tomee plus 1.5.1 server).

i have bunch of "detail" actions, , of them contain following code:

private long modelid;  public long getmodelid() {     return modelid; }  public void setmodelid(long modelid) throws exception {     this.modelid = modelid;     (...some other stuff...) } 

in every action have "persist" action use save data, one:

@action(value = "persistentity", results = {     @result(name = "success",        location = "entitydetail",              type = "redirectaction", params   = {"modelid", "%{modelid}"}) }) public string persist() throws exception {     this.modelid = [save method invocation]      return "success"; } 

after saving try redirect user detail page, following error:

unexpected exception caught setting 'modelid' on 'class classpath.detailaction':  error setting expression 'modelid' value '[ljava.lang.string;@43b5d2fe' 

so, seesm struts handling masterid string array... had @ this question, no me.

what strange me, after error same error every time try enter existing entity, if restart application can enter existing entities without error.

thank you!

well, turns out misleaded struts2 error message... framework correctly trying set parameter in action, had exception thrown

(...some other stuff...)  

section. went through whole log file, , found real issue.

thank anyway.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -