surya gollamudi

Greenhorn
+ Follow
since Oct 28, 2000
Merit badge: grant badges
For More
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 surya gollamudi

Hi Jayanthi
I did a simple program .
It worked properly on WINNT except for variables having "_" in between .If you modify the code , it will work for variables having underscore inbetween.
You just replace the string "Systemroot" with whatever variable you want .
I didn't dealt with pr.getErrorStream .It is better to include that one also in your code.

=================================================================
import java.util.*;
import java.io.*;
class testing
{
public static void main(String args[])
{
testing a= new testing();
String check = new String("Systemroot");
int varlen = check.length();
String os = System.getProperty("os.name");
System.out.println(os);
String sendcommand="";
if( os.equals( "Windows NT" ) )
{
sendcommand = "cmd.exe /c set";
}
else
if(os.equals( "Windows 95" ) )
{
sendcommand = "command.com /c set";
}
Runtime r=Runtime.getRuntime();
try
{
Process pr = r.exec(sendcommand);
InputStream stdinp = pr.getInputStream();
InputStreamReader isrinp = new InputStreamReader(stdinp);
BufferedReader brinp = new BufferedReader(isrinp);
String lineinp = null;
while ( (lineinp = brinp.readLine()) != null)
{
if((lineinp.substring(0,varlen)).equalsIgnoreCase(check))
{
System.out.println(lineinp.substring(varlen+1));
}
}
}
catch(Exception e)
{
System.out.println(e);
e.printStackTrace();
}
}
}
================================================================
If you are willing to supply the variable along with the "java"
command , see the reply that I gave for the posting http://www.javaranch.com/ubb/Forum34/HTML/000558.html

Even now if it won't solve your problem , just post your code.
23 years ago
Hi
See the following code .
I am able to print back whatever I pass from command panel.
import java.util.*;
class testing
{
public static void main(String args[])
{
String x = new String();
x = System.getProperty("hi");
System.out.println(x);
}
}
Now type
java -Dhi=d:\somefolder\onemorefolder testing
Hope this will help you
23 years ago
HI everyone
Count me in if you still have place for one.
23 years ago
HI
Firewall controlls network traffic on a machine for Security.These will not allow any connections from outside network to be established.As we all know , port 80 is open for web traffic.So in this case, this port can be used for client server communications.Sending a request an Http request on port 80 is know as Http Tunneling through firewalls.
This is different from servlet chaining.
In Serlet Chaining , the output from one servlet is sent to another servlet which takes place on the server side.
An example of Http Tunneling is an Applet downloaded on a client machine which is behind a firewall.
Then the applet can't directly communicate with the webserver in which case you have to use HttpTunneling
23 years ago
I am using JavaWebServer2.0 which is situated in the local machine and I started the webserver manually , going to JavaWebServer2.0\bin folder.
I tested this code in my friend's machine and found the same error.
[This message has been edited by surya gollamudi (edited November 13, 2000).]
23 years ago
Thanks Frank .But still I didn't understand one thing .
I am using jdk1.2.2 .Even then why I got this problem?
23 years ago
Hi
I wrote a small program in servlets as follows.
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
import java.util.*;
public class VectorTest extends HttpServlet
{
public void doPost(HttpServletRequest req,HttpServletResponse res)throws IOException
{
try
{
System.out.println("HI");
Vector vector1 = new Vector();
String addvector1 = new String("HIHIHI");
vector1.add(addvector1);
System.out.println(addvector1);
}//end try
catch(Exception e)
{System.out.println("In code " + e);}
finally{}
}//end public void doPost
}
When I tried to invoke this servlet , I got the following message
The servlet named invoker at the requested URL
http://localhost:8080/servlet/VectorTest
reported this exception: java.util.Vector: method add(Ljava/lang/Object Z not found. Please report this to the administrator of the web server.
.....
....
Can anyone throw some light on this?


[This message has been edited by surya gollamudi (edited November 13, 2000).]
23 years ago