Here is my controller code:
@RequestMapping(value = RestURIConstants.GET_APP_MENU_LIST, method = RequestMethod.GET)
public @ResponseBody ComListMaster getCommonMasterByMasterId(@PathVariable("listid") Integer listId)
{
ComListMaster commonMaster = commonService.getCommonMasterList(listId);
logger.debug("Calling master list");
return commonMaster;
}
Above code give me the exception:
Caused by: java.lang.NumberFormatException: For input string: "{listid}"
Please tell me how to get GET response of above code.
Thanks in advance. here is ComListMaster
public class ComListMaster extends BaseModel implements java.io.Serializable
{ private static final long serialVersionUID = 5408136749548491686L;
@Id
@Column(name = "LIST_ID")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer listId;
@Column(name = "LIST_DESC")
private String description;
@Column(name = "LIST_VALUE")
private String value;
@OneToMany(fetch = FetchType.EAGER, mappedBy = "comListMaster")
private Set<ComListDetails> comListDetails = new HashSet<ComListDetails>();
public Integer getListId()
{
return listId;
}
public void setListId(Integer listId)
{
this.listId = listId;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public String getValue()
{
return value;
}
public void setValue(String value)
{
this.value = value;
}
public Set<ComListDetails> getComListDetails()
{
return comListDetails;
}
public void setComClientAddresses(Set<ComListDetails> comListDetails)
{
this.comListDetails = comListDetails;
}
@Override
public String toString()
{
return "ComListMaster [listId=" + listId + ", description=" + description + ", value=" + value
+ ", comListDetails=" + comListDetails + "]";
}
}
My exception is: java.lang.NumberFormatException: For input string: "{listid}"
API: public static final String GET_APP_MENU_LIST = "/api/app/common/master/{listid}";
listId
an integer (i-e a number) not a letter ? – akuma8