JSP解析xml的空指针异常 - Java / Java EE
这是XML的内容
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<title Number = "25">再谈网页标题设计的意义及问题</title>
<link>http://www.baidu.com</link>
<a>相关介绍</a>
<author>刘英慧</author>
<category>网络讲座</category>
<pubDate>2010.5.24</pubDate>
<Remark Cycle = "4"/>
</item>
<item>
<title Number = "25">人工智能</title>
<link>http://www.goolge.com</link>
<a>相关介绍</a>
<author>刘英慧</author>
<category>网络讲座</category>
<pubDate>2010.5.25</pubDate>
<Remark Cycle = "4"/>
</item>
</items>
这是JSP的内容
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" import = "javax.xml.parsers.*,org.w3c.dom.*,java.io.*"%>
<%
String fname = "C:/Documents and Settings/Administrator/workspace/Test/WebRoot/test.xml";
try{
DocumentBuilderFactory fac = DocumentBuilderFactory.newInstance();
DocumentBuilder bui = fac.newDocumentBuilder();
Document doc = bui.parse(new File(fname));
doc.normalize();
NodeList links = doc.getElementsByTagName("item");
for(
相关问答:
当知道一个日期,如何把这个日期所在旬的前后两个日期取出
比如输入20090905,就输入20090901 20090910
输出20090901 20090910
取得天数后作一下判断再把这个方法用下void set(int field, int value)
......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
java swing 程序如何打包成jar,然后可以通过批处理文件bat直接运行,有没有什么工具直接可以完成这两个工作?
用jar打包,把运行需要的jar拷贝到一个目录,批处理用 start javaw -cp .;其他包路径 运行
用zip ......
功能说明:Java servlet 把XML数据压缩后发送到PB用户端,PB收到数据后解压出来.
传输要经过Base64编码.
问题是:能收到数据但是解压不出来.想请教大家或者有什么好的办法?
PB可以用"zlibwapi.DLL" 解压
......
现在不想用<a> </a> 标签 ,因为点击后会出现页面重定位,给文字加上css样式就可以看起来 是href怎么实现这样的css
text-decoration:underline; cursor:hand;
引用
text-decoration:underline; cur ......