PDA

View Full Version : including jsp in lzx file


srinivas
07-22-2006, 12:54 AM
Hi 4nds,

I have written a jsp that takes some string and gets forwarded to the lzx file.

Till then its working fine.

But i want to pass that string to the lzx file which displays the menubar depending on the string it got from the request.

I think i should do 2 things
--> include that jsp file in the lzx file.
--> read the string from the jsp and display menubar according to the string.

I haven't added that code in these files.could anyone of you pls tell me the same....


Here is the code..


***************login.html***************


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Login Page </title>
<body bgcolor="gray">
<form method="POST" action="http://localhost:8080/lps-3.3.1/menu.lzx">
<image src="CapcoLogo.gif" width="90" height="90"/>

<table cellspacing="5" align="center" >
<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
<tr>
<th align="right">Enter the user role:</th>
<td align="left"><input type="text" name="j_userrole"></td>
</tr>
<tr></tr><tr></tr><tr></tr>
<tr>
<td align="right"><input type="submit" value="Log In"></td>
<td align="left"><input type="reset"></td>
</tr>
</table>
</form>
</body>
</html>



****************menu.lzx****************

<canvas>

<dataset name="menu" src="menu.xml"/>
<attribute name="mbar"/>

<class name="adminMenuBar" placement="menubar" datapath ="menu:/menubar/item" extends="menubar">
<menu name="File" datapath="@name" width="150">
<menuitem datapath="menu:/menubar/item[1]/subitem/@name" />
</menu>
<menu name="Document" datapath="@name" width="150">
<menuitem datapath="menu:/menubar/item[2]/subitem/@name" />
</menu>
</class>

<class name="userMenuBar" placement="menubar" datapath ="menu:/menubar/item" extends="menubar">
<menu name="Document" datapath="@name"
width="150">
<menuitem datapath="menu:/menubar/item[2]/subitem/@name" />
</menu>
</class>
<script>
var strg="admin";

if(strg == "admin"){
canvas.mbar = new adminMenuBar();
}
else{
canvas.mbar = new userMenuBar();
}
</script>
</canvas>