Monday, December 27, 2010
Setting character set for tomcat requests and responses
To set character set for your tomcat requests and responses, add param URIEncoding="UTF-8" (if you need your character set to be UTF-8) in the Connector tag of server.xml.
To start firebird in windows
Run command fbserver.exe -a from the firebird/bin directory (Note: firebird dir is the firebird installation dir - the name could differ with the version)
Saturday, December 19, 2009
Call a js function using a string variable having the function name
Hope the following coding snippet helps to know how :

<script>
testFCall();
function testFCall()
{
setTimeout('testCall(109)',0);
}
function testCall(val)
{
alert('val : '+val);
}
<script>
Labels:
function call using string,
java script,
javascript,
js,
setTimeout
Friday, October 2, 2009
Run os commands from java + print error messages
private void runProcess() throws Exception
{
try
{
Runtime rt = Runtime.getRuntime();
Process process = rt.exec("cmd /c cp C:\\work\\dev\\test.txt C:\\work\\dev\\test1.txt");
BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
while ((line = input.readLine()) != null)
{
System.out.println(line);
}
int exitVal = process.waitFor();
if (exitVal != 0)
{
input = new BufferedReader(new InputStreamReader(process.getErrorStream()));
line = null;
while ((line = input.readLine()) != null)
{
System.out.println(line);
}
}
}
catch (Exception e)
{
System.out.println(e.toString());
e.printStackTrace();
}
}
{
try
{
Runtime rt = Runtime.getRuntime();
Process process = rt.exec("cmd /c cp C:\\work\\dev\\test.txt C:\\work\\dev\\test1.txt");
BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
while ((line = input.readLine()) != null)
{
System.out.println(line);
}
int exitVal = process.waitFor();
if (exitVal != 0)
{
input = new BufferedReader(new InputStreamReader(process.getErrorStream()));
line = null;
while ((line = input.readLine()) != null)
{
System.out.println(line);
}
}
}
catch (Exception e)
{
System.out.println(e.toString());
e.printStackTrace();
}
}
Tuesday, June 23, 2009
cvs command to see the status in a single line
We can use the command - 'cvs status'. But it is too verbose. You may not need all those details all the time.
To see the status in a single line do - cvs -q -n update
To see the status in a single line do - cvs -q -n update
Courtesy : http://stackoverflow.com/questions/211819/is-there-a-way-to-get-a-short-cvs-status-from-command-line
Friday, June 19, 2009
Nebeans debugger msg : delete method not implemented
When I apply code changes using netbeans debugger, i get this message :
and I am not able to apply my code changes.
The problem was :
I had another file where i had added a method and had not compiled. so not able to apply code changes. (debugger does not allow adding new methods. If you add or remove a method [or any other type of class member] you have to compile the code before using debugger).
| The virtual machine does not support this operation: delete method not implemented |
The problem was :
I had another file where i had added a method and had not compiled. so not able to apply code changes. (debugger does not allow adding new methods. If you add or remove a method [or any other type of class member] you have to compile the code before using debugger).
Monday, June 15, 2009
Form submit in FireFox and IE
I am using FireFox 3 and IE 7 for my development.
For form submit, FF uses post as the default method. IE sends params as post only if specified in the <form> tag.
For form submit, FF uses post as the default method. IE sends params as post only if specified in the <form> tag.
Subscribe to:
Posts (Atom)