尝试从Java返回值并在JavaScript中读取它

时间:2014-12-23 22:53:15

标签: java javascript json

我在Java中有一个方法将返回一个JSON对象,我试图让它加载到一些JavaScript。这是我的代码,但它不起作用:

爪哇:

public JSONObject ticketListener(TicketMessage message) {
    JSONObject listener = new JSONObject();
    try {
        listener.put("Ticket Messenge", message.getText());
        listener.put("Ticket Number", message.getTicketNumber());
        listener.put("Operation", message.getOperation());
        listener.put("UserID", message.getUserID());
        listener.put("Operation Description", message.getOperationDescription());
    } catch (JSONException e) {
        e.printStackTrace();
    }
}

JavaScript的:

$scope.ticketListener = function() {
    var val = $entry(@com.cmcflex.flex.gui.programs.projectmanager.gui.messenger.ticketListener::getValue())();
};

请帮忙。

0 个答案:

没有答案