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
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 Zoe Peng

Mike,
Thanks.
I didn't notice that I need admin role to access it. By adding another role and user..I get it in.
Zoe
15 years ago
Hi,
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
Zoe
15 years ago
Hi,

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 192.168.1.1----------->tomcat server
http://192.168.1.2:8080/myservlet , and servlet return remoteAddr
192.168.1.1, works great.
2) Client 192.168.1.1-----------> apache server http://192.168.1.2/myservlet
(through Apache proxy support redirect to
http://192.168.1.2:8080/myservlet), servlet return remoteAddr is
192.168.1.2, 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
Hi,
I am looking for a SOAP training course for my company. Does anybody know who offer the course in Dallas?
Thanks.
--Zoe
15 years ago
Hi,
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.
--Zoe
--xsl:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0' >
<xsl utput doctype-
system='http://www.wapforum.org/DTD/wml_1.1.xml'/>
<!-- declare param -->
<xsl aram name="Page" select="0" />
<xsl aram name="PageSize" select="5" />
<!-- start from here -->
<xsl:template match="/">
<wml>
<card id="message">
<p>
<select name="MAILMSGCONTENT" title="MAILMSGCONTENT">
<xsl:for-each
select="email_client/email_session_config/user_email_msgs/email_msg">

<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"/>
</xsl:variable>
<option value="{$_usr_em_msg_subj}">
<xsl:value-of select="$_usr_em_msg_subj" />
</option>
</xsl:if>
</xsl:if>
</xsl:for-each>
<xsl:for-each
select="email_client/email_session_config/default_email_msgs/email_ms
g">
<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"/>
</xsl:variable>
<option value="{$_def_em_msg_subj}">
<xsl:value-of select="$_def_em_msg_subj" />
</option>
</xsl:if>
</xsl:if>

</xsl:for-each>
<option onpick="#card">More</option>
</select>
<a href="#reply">Select</a>
<anchor>Back<prev/></anchor>
</p>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>

--xml
<?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."
action="emailreply">
<email_session_config>
<user_email_msgs usr_id="user1">
<email_msg>
<em_msg_subj>Are you testing?</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>How are you doing?</em_msg_subj>
</email_msg>
</user_email_msgs>
<default_email_msgs>
<email_msg>
<em_msg_subj>Yes</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>No</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Please call</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Pick Up Groceries</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Call Home</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Contact School</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Check Post Box</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Call Office</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Appointment Due</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Appointment Cancelled</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Busy</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Will Call Later</em_msg_subj>
</email_msg>
<email_msg>
<em_msg_subj>Call you back</em_msg_subj>
</email_msg>
</default_email_msgs>
</email_session_config>
</email_client>
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.
xml:
<mailquery>
<pop3srv>param1</pop3srv>
<smtpsrv>param2</smtpsrv>
</mailquery>
stylesheet
<xsl:stylesheet..>
<a href="http://query2?pop3=param1&smpt=param2&action=read" >Read</a>
<a href="http://query2?pop3=param1&smpt=param2&action=send" >Send</a>
</xsl:stylesheet>
2. when I click Read, I will get another xml document and
another stylesheet on the fly
<Mail>
<Msg id="1">bbb</Msg>
<Msg id="2">ccc</Msg>
</Mail>
<xsl:stylesheet..>
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>
</xsl:stylesheet>
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.
--Zoe
Hi,
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"/>
</item>
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.
--Zoe
---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.*;
import java.io.*;
public class XTree extends JTree
{
private DefaultMutableTreeNode treeNode;

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

public XTree( String text ) throws ParserConfigurationException
{

super();
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.
--Zoe
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.
http://www.zvon.org/other/charSearch/PHP/search.php
--Zoe
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.
--Zoe
> 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.
--Zoe
> 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.
Xpointer:
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. http://www.w3c.org/ for more information.
--Zoe
Hi,
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
--Zoe
Hello,
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;

out.println(userInfo);
//encoder username and password
BASE64Encoder encoder = new BASE64Encoder();
16 years ago