shaonan zhang

Greenhorn
+ Follow
since Dec 12, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shaonan zhang

hi

I want to observe the amount of the session use. because An excellent performance in less session data is obtained.

I can do it by C#



But I dont know how do it by Java, (The Same Java class doesn't exist. ?)

please help me if any body know this.
i need it urgently.

thanks ina dvance,

ZSN
13 years ago
hello friends!
I use javascript to product some html'element Dynamicly. e.g
(
var aRows=oTable.rows;
var aCells=oRow1.cells;
var oCell1_1=aRows (oRow1.rowIndex).insertCell(aCells.length);
oCells.innerHTML="<p align=center><input type=text size=5 name="txtCard"></p>";
)
Client can freely produce these elements which name or id is the same . but how to do ,in action formbean ,get these Dynamic value that is post.
and that,reture these value to jsp when validate
is failure.
All help will be highly appreciated.
Regards,
19 years ago
how to do ,update jbuilder8.0 struts1.02 to struts1.1,thanks
19 years ago
I read and write a xml file by jdom in servlet.In client ,Client access xml data binding the element of html in xml file.but when I delete and add the data to xml file by servlet.Client cannot right now see the data that I delete and add in servlet. and only after client refresh the IE , could see instant data .I suspect the reason is IE'cache,
therefore, I add those code in my jsp
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
%>
<html>
<head>
<title>&#</title>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Expires" content="Tue, 01 Jan 2000 12:12:12 GMT">
<meta http-equiv="Pragma" content="no-cache">
</head>
But I have still failed. How to do? please help me.
[ January 24, 2003: Message edited by: shaonan zhang ]
[ January 24, 2003: Message edited by: shaonan zhang ]
19 years ago
JSP
I use xml to be small database in my webapplation.By servlet I manipulate the xml file that is local. When I use servlet I need notice Security(read and write the local file) and threads(At one time many user read and write the xml file).But I dont know how to do to avoid these question in servlet. what is a good solution. please help me.
[ January 19, 2003: Message edited by: shaonan zhang ]
.I also have the same question.I want somebody who has experience of xml'programme on servlet has a good talk for us.
Think for all!
[ January 16, 2003: Message edited by: shaonan zhang ]

why ? I use the Jbuilder7.0 , Jdk1.4 and Jdom8.0
my file selectdata.xml is at D:\wepapp\defaultroot\selectdata.xml.
In servlet.I use this
Document doc = sb.build(new FileInputStream("/selectdata.xml")); but I cannt get it .
Error message:
java.io.FileNotFoundException: \selectdata.xml at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:103)
at java.io.FileInputStream.(FileInputStream.java:66)
at webapp.XmlSelectSet.doPost(XmlSelectSet.java:32)
****************************
my servlet code is:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import org.jdom.input.*;
import org.jdom.output.*;
import org.jdom.*;
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
String nodeName=request.getParameter("nodeName");
String addItem=request.getParameter("addItem");
String delItem=request.getParameter("delItem");
String itemText=request.getParameter("Description");
int item;
try{
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(new FileInputStream("/selectdata.xml"));//here if I use absolute path, can get this xml file. but, of course xml data cannt access.
Element root = doc.getRootElement();
if(addItem==null||addItem.length()==0){
item=Integer.parseInt(delItem);
Element selectTitle = root.getChild(nodeName);
java.util.List selectItem=selectTitle.getChildren();
selectItem.remove(item);
}else{
item=Integer.parseInt(addItem);
Element selectTitle = root.getChild(nodeName);
java.util.List selectItem=selectTitle.getChildren();
int l=selectItem.size();
Element select=new Element("select"+l);
select.setText(itemText);
selectItem.add(l,select);
}
XMLOutputter outp = new XMLOutputter("\t", false,"Shift_JIS");
outp.output(doc, new FileOutputStream("/selectdata.xml"));
}catch(JDOMException e){out.print(e.toString());}
****************************
my selectdata.xml code:
<?xml version="1.0" encoding="Shift_JIS"?>
<!-- save web all select element concent -->
<selectcon>
<collectmoney>
<position>\siyikyu\SikyuMessage.html</position>
<select1>--NO Select--</select1>
<select2>China</select2>
<select3>New York Mets</select3>
<select4>Japan</select4>
</collectmoney>
<useDiffer>
<position>\siyikyu\SikyuMessage.html</position>
<select1>--NO Select--</select1>
<select2>use1</select2>
<select3>use2</select3>
<select4>use3</select4>
</useDiffer>
<askDiffer>
<position>\siyikyu\SikyuMessage.html</position>
<select1>--NO Select--</select1>
<select2>ask1</select2>
<select3>ask2</select3>
<select4>ask3</select4>
</askDiffer>
</selectcon>
please help me. the servlet code is correct? How can I do ? Thanks
[ January 15, 2003: Message edited by: shaonan zhang ]
[ January 15, 2003: Message edited by: shaonan zhang ]
[ January 15, 2003: Message edited by: shaonan zhang ]
[ January 16, 2003: Message edited by: shaonan zhang ]