Dear Sir, The File Checking program i have written in action class.... if i deploy it in weblogic in Linux server and if i get access to that action class it is checking That machine OS information but i am opening the application in Windows PC..... it is not checking in my PC.... What to do to get my PC information... pls solve that
-Rodricks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
it is not checking in my PC
What does that mean? Are you running the code Rahul posted and it is not giving the correct result?
Sorry Rodricks george , could not get much from you post. ;-)
Rodricks george
Ranch Hand
Joined: Sep 10, 2006
Posts: 97
posted
0
Dear Sir,
This is my code
String osname=System.getProperty("os.name"); System.out.println(osname); String userHome=System.getProperty("user.home"); System.out.println("User Home Direcory:->"+userHome);
boolean exists = (new File("C:/WINDOWS/jtwain.dll")).exists(); if (exists) { // File or directory exists System.out.println("Found jtwain.dll"); return mapping.findForward("success"); } else { // File or directory does not exist System.out.println("Not Found jtwain.dll"); request.getSession().setAttribute("winDir","C:/WINDOWS"); return mapping.findForward("fail"); }
i wrote this one in action class..... i deployed the struts program in weblogic in linux OS...... While executing the application from server i got only linux machine system properties.... I want client side system properties...... whoever open my website i should get their system properties...... so that if they dont have the corresponding dll file...i will ask them to install it in c:\windows directory.... Pleas help me how to check the file found or not in client side.
-Rodricks
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
posted
0
Action class is part of struts framework and will be executed in the server side. So its obvious that you will get the properties of the server machine , now the client machine.
Though I have not worked on applets , but I think applet would be the choice if you want to do something like this as the applet bytecodes will get executed on the client side , not on the server.
Rodricks george
Ranch Hand
Joined: Sep 10, 2006
Posts: 97
posted
0
Dear Rahul Sir,
As you said i created a J applet Program and got the client details and got the user.home information and checked the windows folder and i redirected to a jsp from applet and the program is successfully running... Thank you sir for really perfect information at rite time...