This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Zoe Peng

Ranch Hand
+ Follow
since Nov 27, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zoe Peng

I didn't notice that I need admin role to access it. By adding another role and user..I get it in.
15 years ago
I forgot the user name and password for administration console in my local mechine.
Does it have a way to reset the login name and password except reinstall tomcat?? Thanks.
I use Tomcat4.1.12/WinXP
15 years ago

I am trying to get remote user information using request.getRemoteAddr(),
things working great on Tomcat alone, however, if I try to use Apache proxy
support have some problems. Here is the situation:

1) Client>tomcat server , and servlet return remoteAddr, works great.
2) Client> apache server
(through Apache proxy support redirect to, servlet return remoteAddr is, which is server's address

I guess 2) mistake request come from server itself instead of client machine
because request get forwarded.
Anyone knows if there is work around or other method that I can use to get
client information from tomcat servlet?
15 years ago
I am looking for a SOAP training course for my company. Does anybody know who offer the course in Dallas?
15 years ago
I have an email service(xml document) which I'll allow user to select
pre-defined messages as email subject when user doing the reply function
(in wml that transform from xslt).
The question for me is I have too much pre-defined message that I want
to pagnation them. The pre-defined messages will includes two parts
which are user pre-defined and default.
I got problem when I have want to click [[More]] to have next page if I
devide item into 5. Please help. Thanks in advance.
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl=''
version='1.0' >
<xsl utput doctype-
<!-- declare param -->
<xsl aram name="Page" select="0" />
<xsl aram name="PageSize" select="5" />
<!-- start from here -->
<xsl:template match="/">
<card id="message">

<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $PageSize + ($PageSize * $Page)">
<xsl:variable name="_usr_em_msg_subj">
<xsl:value-of select="./em_msg_subj"/>
<option value="{$_usr_em_msg_subj}">
<xsl:value-of select="$_usr_em_msg_subj" />
<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $PageSize + ($PageSize * $Page)">
<xsl:variable name="_def_em_msg_subj">
<xsl:value-of select="./em_msg_subj"/>
<option value="{$_def_em_msg_subj}">
<xsl:value-of select="$_def_em_msg_subj" />

<option onpick="#card">More</option>
<a href="#reply">Select</a>

<?xml version="1.0"?>
<!-- <!DOCTYPE tm_email_client
SYSTEM 'http://localhost/xml/dtd/tm_email_client.dtd'>-->
<email_client statuscode="0" statusdesc="Mail has been read."
<user_email_msgs usr_id="user1">
<em_msg_subj>Are you testing?</em_msg_subj>
<em_msg_subj>How are you doing?</em_msg_subj>
<em_msg_subj>Please call</em_msg_subj>
<em_msg_subj>Pick Up Groceries</em_msg_subj>
<em_msg_subj>Call Home</em_msg_subj>
<em_msg_subj>Contact School</em_msg_subj>
<em_msg_subj>Check Post Box</em_msg_subj>
<em_msg_subj>Call Office</em_msg_subj>
<em_msg_subj>Appointment Due</em_msg_subj>
<em_msg_subj>Appointment Cancelled</em_msg_subj>
<em_msg_subj>Will Call Later</em_msg_subj>
<em_msg_subj>Call you back</em_msg_subj>
Hi, please help.
The scenario is:
1. first query(http://query1/ )to get dynamic xml document and apply stylesheet to generate query2 on the fly; e-mail application for example.
<a href="http://query2?pop3=param1&smpt=param2&action=read" >Read</a>
<a href="http://query2?pop3=param1&smpt=param2&action=send" >Send</a>
2. when I click Read, I will get another xml document and
another stylesheet on the fly
<Msg id="1">bbb</Msg>
<Msg id="2">ccc</Msg>
You have <xsl:value-of select="count(Mail/Msg)" /> messages.
<a href="http://query3?PARAMS...msgid=1&action=getContents>Get Contents1</a>
<a href="http://query3?PARAMS...msgid=2&action=getContents>Get Contents2</a>
When I click Get Contents1, the params I want to use is from the stylesheet1 which is the same pop and smtp;
but, I don't have this information anymore when I get the second xml document. Is there a way to know and continue use the params?
Please help. Thanks.
I have a JTree structure based on dynamic xml document. This takes a DOM Node and recurses through the children until each one is added to a DefaultMutableTreeNode. The JTree then uses this object as a tree model.
The problem I am facing is how to extract the specific attribute value.
For example:
<item item_id="1" item_title="Favorites" item_dsc="My Favorites" >
<item_service item_service_usr_svc_nam="News"/>
The item element have three attributes.
When I go though the nodes, I just want to display the the value of item_desc.
The result I will get will be "Favorites". any ideas? Thanks.
---here is the short src codes; it displays all attributes.
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class XTree extends JTree
private DefaultMutableTreeNode treeNode;

private DocumentBuilderFactory dbf;
private DocumentBuilder db;
private Document doc;

public XTree( String text ) throws ParserConfigurationException

getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
setShowsRootHandles( true );
setEditable( false ); // A more advanced version of this tool would allow the Tree to be editable
// Begin by initializing the object's DOM parsing objects
dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating( false );
db = dbf.newDocumentBuilder();
// Take the DOM root node and convert it to a Tree model for the JTree
treeNode = createTreeNode( parseXml( text ) );
setModel( new DefaultTreeModel( treeNode ) );

* This takes a DOM Node and recurses through the children until each one is added
* to a DefaultMutableTreeNode. The JTree then uses this object as a tree model.
private DefaultMutableTreeNode createTreeNode( Node root )

DefaultMutableTreeNode treeNode = null;
String type, name, value;
NamedNodeMap attribs;
Node attribNode;

// Get data from root node
type = getNodeType( root );
name = root.getNodeName();
value = root.getNodeValue();

// Special case for TEXT_NODE
treeNode = new DefaultMutableTreeNode( root.getNodeType() == Node.TEXT_NODE ? value : name );
// Display the attributes if there are any
attribs = root.getAttributes();

if( attribs != null )

for( int i = 0; i < attribs.getLength(); i++ )
attribNode = attribs.item(i);
name = attribNode.getNodeName().trim();
value = attribNode.getNodeValue().trim();

if( value != null )

if( value.length() > 0 )
treeNode.add( new DefaultMutableTreeNode( "[Attribute] --> " + name + "=\"" + value + "\"" ) );
Did you encode or escape those when you store in your database?
I think you should do it first.
I found the solution. Thanks.
try this website to find out the characture that you want to display in the xml file.
hope it works for u.
Yes. We did use Xlink in our company.
as a good student, I would like to know everything that relative to XML.
It will be good if you can teach some basic concepts for XSLT, Xlink, XPath, XForm...
give some cases to your student.
tell them that if they are in the real world, they sould know the beautiful of xml.
But, please don't offer any exams for them.
> Does stylsheet(xsl) can take/pass session information?
Yes. It takes the session information.
It takes it as a parameter.
The reason why I ask is I'll need to take the jssessionid all the way in my application.
Since the original feed is in a xml document that generate by servlets, while I apply stylesheet to transform it and try to post and do something again, I'll need to check to see if the jsessionid is there or not. The browser I use didn't accept the cookies. It only accept the url rewritten. That's why..
Thank you guys.
> XML,XPath,XLink,XPointer concepts. What's the role and definition for them actually?Thanks
XML was designed to describe data, and to focus on what data is.
XPath is a set of syntax rules for defining parts of an XML document.
XLink allows elements to be inserted into XML documents in order to create and describe links between resources.
the language to be used as a fragment identifier for any URI-reference that locates a resource of Internet media type text/xml or application/xml.
based on the XPath.
hope it works for u.
also, don't forget to look at the official site. for more information.
I have a question here and don't know how to apply it. Please help.
Does stylsheet(xsl) can take/pass session information? any examples? Thanks
How can I do the base64 encoding?
I have username and password from usr input form.
I want to encode these data with base64.
How to approach this? I found out there is a BASE64Encoder in javax.commerce.util package. But, I really don't know how this works. Thakns.

//get usrname and password
String username = request.getParameter("username");
String password = request.getParameter("password");
String userInfo = username + password;

//encoder username and password
BASE64Encoder encoder = new BASE64Encoder();
16 years ago