V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kelos
V2EX  ›  程序员

jsp 里的 getjsonobject 报错

  •  
  •   kelos · 2016-07-22 16:10:53 +08:00 · 1871 次点击
    这是一个创建于 2846 天前的主题,其中的信息可能已经有所发展或是发生改变。
    2016-7-22 15:46:12 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet [jsp] in context with path [/IP_check] threw exception [An exception occurred processing JSP page /postjson_do.jsp at line 34

    31: System.out.println(getjsons);
    32:
    33: JSONObject getjson = new JSONObject();
    34: JSONObject newObj = getjson.getJSONObject(getjsons);
    35:
    36: System.out.print(newObj);
    37: JSONObject jsa = newObj.getJSONObject("data");


    以上代码一直报错, import 用的是:

    <%@ page language="java" import="java.util.*" import="org.json.JSONObject" import="java.sql.*" pageEncoding="utf-8"%>

    引用到的 json 包有 org.json.jar 和 json-lib-2.2.3-jdk15.jar

    求助啊
    1 条回复    2016-07-22 16:40:12 +08:00
    kelos
        1
    kelos  
    OP
       2016-07-22 16:40:12 +08:00
    解决了,直接 new JSONObject(String).
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   972 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:31 · PVG 05:31 · LAX 14:31 · JFK 17:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.