Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

sridhar bvap

Greenhorn
+ Follow
since Mar 12, 2008
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 sridhar bvap

Thanks for response David.
Yes exactly. I need it for browser window.
Hi...

Here i am having one problem with jsp page. Is it possible to call a java script function when i drag the window from one position to another? Here i am clarifying that it is not resizing, only the dragging the window as it is, with out resize.

Actually i need to store the position of the window when i move the window from one place to another. For that i tried with window object to call the dragging listeners. But nothing is working with window object in java script.

So, can any buddy please help me on this regard.

I am thank full to every one for their helping hand.





regards,
Sridhar



<html>
<head>
<script>
function defaultFun(){
var tab='<table border=\'1\'>';
for(var i=0;i<4;i++){
tab = tab+'<tr>';
tab = tab+'<td><input type=\'text\' name=cust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'1234\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=lust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'3445\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=pust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'4566\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=must:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'5677\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=sust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'2445\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=yust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'4355\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=eust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'7473\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=wust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'16534\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=zust:'+i+' style=\'text-align:right;\' onclick=\'myfun()\' value=\'1244\' size=\'9

\'></td>';
tab = tab+'<td><input type=\'text\' name=aust:'+i+' style=\'text-align:right;\' onclick=\'myfun(this)\' value=\'13454\' size=\'9

\'></td>';
tab = tab+'</tr>';
}
tab=tab+'</table>';
document.getElementById("tab").innerHTML =tab;
}
function check(){
var tabrows = document.getElementsByTagName('input');
var c=0;
for(var i=0;i<tabrows.length;i++)
{
if(tabrows[i].type == 'text'){
if(tabrows[i].name.match('pust:') != null)
tabrows[i].style.background = '#BBFFFF'
c++;

}

}

alert(c);

}
function myfun(obj){
obj.style.textAlign = 'left';
obj.style.background = '#BBBBBF';

}
></script>
</head>
<body onload="defaultFun(),check()">
<form>
<div id="tab">Table data</div>
</form>
</body>
</html>
Hi to all.

i need to write a chart application in Java which makes use of netcharts.server.api.

Iam having netcharts.jar, chartworks.jar, commons-httpclient.jar, commons-logging.jar, ncstoolkit.jar in my hand.

I need to make use of above jars only to build line graph or charts or any thing.

That application has to work in html or jsp.

can any buddy please help me in this regard.

iam very much thank full for any reply.

please help me.


thanks in advance

iam using spring.jar of 1.2.9 version and commons-logging-1.1.1.jar of apache tomcat 4 for running above application....Does it require more....?
Hi to all,
Iam trying to run simple spring application manually. While running the helloclient program it is throwing the NoClassDefFoundError.
iam providing the code.
public interface hello
{
public String sayhello(String a);
}

...
public class helloimpl implements hello
{
private String greeting;public helloimpl(){}public helloimpl(String a){ greeting=a; }
public String sayhello(String s){ return greeting+s; }
public void setGreeting(String a){ greeting=a; }

}
...
import java.io.*;
import org.springframework.beans.factory.*;
import org.springframework.beans.factory.xml.*;
import org.springframework.core.io.*;
public class helloclient
{
public static void main(String args[]) throws Exception{
try{
System.out.println("Please wait...");
Resource rs = new ClassPathResource("hello.xml");
BeanFactory factory = new XmlBeanFactory(rs);
hello bean1 = (hello)factory.getBean("hello");
String s = bean1.sayhello(args[0]);
System.out.println("The value is "+s);
}catch(Exception e){
System.out.println("The Exception is ####"+e);
}
}
}
...
iam setting classpath to the spring.jar and commons-logging.jar of tomcat41\server\lib to the current working directory.

iam using spring 1.2.9.
iam getting the following error while running application

E:\Spring\springdemo>java helloclient "sridhar"
Please wait...
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory
at org.springframework.util.ClassUtils.<clinit>(ClassUtils.java:59)
at org.springframework.core.io.ClassPathResource.<init>(ClassPathResourc
e.java:82)
at org.springframework.core.io.ClassPathResource.<init>(ClassPathResourc
e.java:64)
at helloclient.main(helloclient.java:10)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFacto
ry
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more

iam running program in windowsXP.

if any buddy know please help me.


thank you one and all.

[ May 21, 2008: Message edited by: sridhar bvap ]

[ May 21, 2008: Message edited by: sridhar bvap ]
[ May 21, 2008: Message edited by: sridhar bvap ]
thank you Nitesh for giving reply. can you please tell me alternative to XpathFactory in 1.4. can you tell me how to overcome from the above problem?
hi to all,
Iam using javax.xml.xpath.XPath to parse and read the xml file. It is working fine in java 1.5 version. but i want the same requirement in java 1.4. When iam using same code in java 1.4 it is throwing exceptions. Iam giving the code....

First of all iam creating XPathReader class for xpath parsing and reading.

import java.io.IOException;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.parsers.*;
import javax.xml.xpath.*;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

public class XPathReader {

private DocumentBuilder documentBuilder=null;
private Document xmlDocument;
private XPath xPath;


public XPathReader() {

initObjects();
}

private void initObjects(){
try {
documentBuilder= DocumentBuilderFactory.
newInstance().newDocumentBuilder();
xPath = XPathFactory.newInstance().
newXPath();
}catch (Exception ex) {
ex.printStackTrace();
}
}
public void parse(String filename){

try {
xmlDocument=documentBuilder.parse(filename);


} catch (Exception e) {
e.printStackTrace();
}
}
public Object read(String expression,
QName returnType){
try {
XPathExpression xPathExpression =
xPath.compile(expression);
return xPathExpression.evaluate
(xmlDocument, returnType);
} catch (XPathExpressionException ex) {
ex.printStackTrace();
return null;
}
}
}

In another class iam just creating object of XPathReader
XPathReader reader= new XPathReader();
reader.parse(...xml file path as String that which you want to parse...);
String expression = "....";
NodeList rootNode = (NodeList)reader.read(expression,XPathConstants.NODESET);
here generally i will get NodeList object...

this code works fine in java 1.5

but it is showing exceptions in 1.4 as...

java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
at javax.xml.xpath.XPathFactory.newInstance(Unknown Source)


if any buddy knows please help me...

thanks to one and all...
thank you Paul Clapham for giving reply.
By applying same NameSpace to all child elements iam avoiding to occur the name space for childs also. My require ment is fullfilling. But for doing that i need to trace each element and setNameSpace for each. I have many more elements under each sub child of root child.
What i mean to ask is rather tracing each subchild and apply name space for that, is there any simplest way to do this.
why because iam not creating the direct childs here. Iam just adding already created childs to root element. so, we need to go to trace the each child and set name space for each element.
I have multiple levels under each direct childs of root element.
can you please tell me the solution for that.
Tahnk you.
Hi to all,
iam applying a name space to a org.jdom.Element root element of my xml structure. It is comming fine as attribute to root element as xmlns:"http://www.loc.gov/MARC21/slim". But the same name space property is aaplying to direct childs of root element by xmlns=" " with empty string.
I tried to remove the name space for direct childs as per my requirement.
But it is not deleting. It is still existing with empty string for sub childs.

Is there any posibility to remove the xmlns for direct childs and existing this for root element.

If any buddy knows please help me.
Thanks one and all.
Hi to all,

Iam building xml file.In that iam trying to create org.jdom.NameSpace in setAttribute() method of org.jdom.Element object. Iam getting runtime errors like illegal name.
What exactly i want is i want to set "xmlns" as attribute name and "http://www.loc.gov/MARC21/slim" as attribute value. When iam directly creating that it is throwing exception that no attribute name should be xmlns in org.jdom.Element. That is why i approched to org.jdom.NameSpace. But iam not getting the way, how to set org.jdom.NameSpace in setAttribute method of org.jdom.Element object. I tried several ways but it is not comming.
can any budy help me please.
thanks to one and all.
Hi,
I want to select the path or location where to the file has to save.
I tried using JFileChooser, but it is not comming. It allows only to select a file, but i don't want to select a file. I have already file, i want to aloow user to select the location where to save the file, by some promt window just like File Chooser.
If any budy knows Please help me.

thanks to one and all.
12 years ago
Hi,
Iam trying to get the JTree object from DefaultMutableTreeNode object but iam not getting.Is it possible first..?. i have DefaultMutableTreeNode object, JTree object, TreePath object, TreeModel object of current node. I want to get Parent JTree object of current node. Any one who knows, please help me.

Thanks one and all.
12 years ago
Hi to all,
iam using JTree.What i want is, when i select a perticular node in one level, the tree has to display only child nodes of selected node, the other nodes in that level automatically collapse if they already expanded. That is in a one level only one node has to expand, the other nodes has to collapse.
If any budy knows this please help me.

Thanks to one and all.
[ March 31, 2008: Message edited by: sridhar bvap ]
12 years ago