Servlet.service() for servlet [search] in context with path [/ajaxtest] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: net.sf.json.JSONArray
把json的第三方包放在web-inf/lib下面,然后把以前的包移除
我的代码报这个错,我在web.xml里面配置过了
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name></display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>search</servlet-name>
<servlet-class>com.imooc.SearchServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>search</servlet-name>
<url-pattern>/search</url-pattern>
</servlet-mapping>
</web-app>
老师 我导入包后出现JSONArray cannot be resolved这个 怎么解决
我和你的代码一样但是前台输入东西后台没有显示浏览器有下面这个问题
SCRIPT5007: Unable to get property 'open' of undefined or null reference
程序里报了空指针问题
请问一下,运行后出现空指针怎么办?
严重: Servlet.service() for servlet search threw exception
java.lang.NullPointerException
at java.lang.String.contains(String.java:2104)
at com.imooc.SearchServlet.getData(SearchServlet.java:38)
at com.imooc.SearchServlet.doGet(SearchServlet.java:29)
我也出现了这个情况,能把你的项目目录贴个图出来吗
严重: Servlet.service() for servlet [search] in context with path [/aaatest] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: net.sf.json.JSONArray
这是我的
代码都一样为什么没拿到listData,[]是什么鬼?