
Java
Coding_Beginner
这个作者很懒,什么都没留下…
展开
-
No enclosing instance of type Test_02_1 is accessible. Must qualify the allocation with an enclosing
main是Test_02_1类的static方法,按照常理它只能访问Test类中static资源,而class A是非static所以报错了。解决方法很简单,给class A添加static属性就可以了。staticclass A{}原创 2017-12-17 13:15:04 · 414 阅读 · 0 评论 -
#{...} is not allowed in template text
问题:jsp页面引用 onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-#{%d+1}',maxDate:'%y-%M-#{%d+180}'})"特殊符号 # 识别不了,运行就报错下面错误:#{...} is not allowed in template text<td><input type=...原创 2019-06-10 16:29:27 · 995 阅读 · 0 评论 -
如何从字符串jsonString获得JSONObject对象和JSONArray对象
/*json字符串最外层是大括号时:*/JSONObject jsonObject = new JSONObject(jsonStr);/*json字符串最外层是方括号时:*/JSONArray jsonArray = new JSONArray(jsonStr);参考文章:Android-json解析(三):原生JSONObject+JSONArray的解析、遍历及生成等...原创 2019-06-03 21:40:38 · 1326 阅读 · 0 评论 -
不同的*.java文件共用一个常量或者变量
问题:就好比A.java中Class A中有一个public static final int RECORDNUM= 100;那么在B.java中Class B 中要怎么用RECORDNUM这个常量?解决方法:方法1:int a = A.RECORDNUM;方法2:在B类中import static A.RECORDNUM;调用时直接 int a = RECORDNUM;...原创 2019-05-25 17:55:17 · 1841 阅读 · 0 评论 -
两个servlet之间传递数据
response.sendRedirect(“servlet的地址?参数名=参数值&参数名=参数值...”);参数类型是String,参数名应当使用字母组合在接受数据的Servlet中:String参数=request.getParameter(“参数名”);参考文章:servlet之间传递数据的方式...原创 2019-04-13 18:46:48 · 2550 阅读 · 0 评论 -
java代码中,url地址传参中文乱码处理
xxxx为中文字符传参前:使用java.net.URLEncoder.encode("xxxx",“utf-8"),将中文转为16进制字符。取参时:使用java.net.URLDncoder.decode("xxxx",“utf-8")将16进制字符转为中文。eg:传参(Servlet1中):response.sendRedirect("Servlet2?TeacherNam...原创 2019-04-13 18:35:56 · 1309 阅读 · 0 评论 -
Parcelable接口的使用——要将实体类封装到消息中,必须实现该接口
参考文章:Parcelable接口的使用原创 2019-03-01 11:33:07 · 379 阅读 · 0 评论 -
The origin server did not find a current representation for the target resource or is not willing to
Eclipse搭建的web项目本来是正常的,在重新开机后出现 错误404 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.的解决方法解决办法:!首先确保文件配置正确、代码没错、访问的 ur...原创 2019-02-15 21:43:45 · 857 阅读 · 0 评论 -
My97DatePicker日历插件的使用
<scripttype="text/javascript"src="My97DatePicker/WdatePicker.js"></script>My97DatePicker文件夹在webroot下面 (webroot,即tomcat服务器文件夹下-----该项目的根目录)<inputtype="text"name="day"onclick="Wda...原创 2019-03-12 13:43:52 · 249 阅读 · 0 评论