Monday, 15 April 2013

java - Error setting expression X with value [Ljava.lang.String;@......] -



java - Error setting expression X with value [Ljava.lang.String;@......] -

i getting , not weird error:

error setting look x value [ljava.lang.string;@......]

it occurs , not. quiet annoying. error comes class:

package com.corerestaurant.menuitem; import com.google.gson.gson; import com.opensymphony.xwork2.actionsupport; import com.opensymphony.xwork2.modeldriven; public class menuitemaction extends actionsupport implements modeldriven<menuitem>{ private menuitem menuitem = new menuitem(); private final string database_problems = "error code : database problems"; private string json; public string execute(){ menuitemservice itemservice = new menuitemservice(); if(itemservice.testdatabaseconnectionu()){ setjson(new gson().tojson(itemservice.getmenuitemsbymenuid(menuitem.getmenuid()) )); }else{ seterrortobesentbacktoclientside(database_problems); } homecoming success; } @override public menuitem getmodel() { homecoming menuitem; } public string getjson() { homecoming json; } public void setjson(string json) { this.json = json; } private void seterrortobesentbacktoclientside(string error){ string errorcode = error; setjson(new gson().tojson(errorcode)); } }

and menuitem class:

package com.corerestaurant.menuitem; public class menuitem { private string name; private double price; private int menuid; public string getname() { homecoming name; } public void setname(string name) { this.name = name; } public double getprice() { homecoming price; } public void setprice(double price) { this.price = price; } public int getmenuid() { homecoming menuid; } public void setmenuid(int menuid) { this.menuid = menuid; } public void setmenuid(menuitem fromjson) { setname(fromjson.getname()); setprice(fromjson.getprice()); } }

and calling things php file (the 2 lines that, sec 1 worrychild):

$specificmenujson = file_get_contents('http://localhost:8080/core/read?id=' . $menuid); $specificmenuitemsjson = file_get_contents('http://localhost:8080/core/readmenuitembyid?menuid=' . $menuid);

it has problem setting value of menuid, have getters , setters included. don't know why fails that. suggestions?

try alter name of method setmenuid

public void fromjsonmenuid(menuitem fromjson) { setname(fromjson.getname()); setprice(fromjson.getprice()); }

java jsp struts2 type-conversion ognl

No comments:

Post a Comment