dear sharma,
Here i've furnished the sample code to achieve your task.I've done by using wml,jsp and xtags.
In these examples the msg.jsp file would parse the xml file and get the record id of the corresponding subject link..msg1.jsp gets the record id from msg.jsp and display the message..
msg.xml
-------
<?xml version="1.0"?>
<record>
<row>
<user>ajith</user>
<recordid>1</recordid>
<subject>Hello</subject>
<message>Welcome to
java ranch</message>
</row>
<row>
<user>Maprapatu</user>
<recordid>2</recordid>
<subject>xml</subject>
<message>Welcome to xml discussion</message>
</row>
</record>
msg.jsp
-------
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<%@ page language="java" contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Products">
<xtags:parse url="http://localhost:8080/shop/msg.xml"/>
<p align="center" mode="nowrap">
Products Display
<table columns="2">
<tr>
<td>User</td>
<td>Subject</td>
</tr>
<xtags:forEach select="//row">
<xtags:variable id="rec_id" select="recordid"/>
<tr>
<td><xtags:valueOf select="user"/></td>
<td><a href="msg1.jsp?recordid=<%=rec_id%>"><xtags:valueOf select="subject"/></a></td>
</tr>
</xtags:forEach>
</table>
</p>
</card>
</wml>
msg1.jsp
--------
<%@ taglib uri="http://jakarta.apache.org/taglibs/xtags-1.0" prefix="xtags" %>
<%@ page language="java" contentType="text/vnd.wap.wml" %>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Message display">
<%
String recordid=request.getParameter("recordid");
%>
<xtags:parse url="http://localhost:8080/shop/msg.xml"/>
<p align="center" mode="nowrap">
Message Display<br/>
<xtags:forEach select="//row[recordid=$recordid]">
<xtags:valueOf select="message"/>
</xtags:forEach>
</p>
</card>
</wml>
Best Regards,
Parama guru.