Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

How can i get MAC address of client in java jsp

How can i get MAC address of client in java jsp

 
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans
View previous topic :: View next topic  
Author Message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Sun Sep 14, 2008 3:43 am    Post subject: How can i get MAC address of client in java jsp Reply with quote

In my web application, i have to restrict access to limited computer system on the behave of MAC address. For this i need to get MAC address of client. I tried lot of thing like to run cmd and then get

Quote:
ipconfig -all

But this gives us whole bunch of IPs and mac addresses and other thing.
I want to get single MAC address through java.
Can anyone give me source code for getting MAC address of client in jsp.
Back to top
View user's profile Send private message
magicgenie



Joined: 20 Apr 2007
Posts: 4

PostPosted: Mon Dec 08, 2008 3:11 pm    Post subject: Reply with quote

run time classes can execute ipconfig command through java but finding mac in jsp, required permission.

If user is logged on windows system with minimum user permission than cannot find or run ipconfig command. Always will not get success in getting MAC address.

MAC OS X Operating system difficult to find

New version of java come with network class have method to get MAC address.

I think it is jdk 6


Last edited by magicgenie on Tue Dec 09, 2008 5:35 am; edited 1 time in total
Back to top
View user's profile Send private message
javatech



Joined: 19 Jan 2007
Posts: 39

PostPosted: Mon Dec 08, 2008 3:38 pm    Post subject: Reply with quote

Check this blog to find MAC address of ethernet card.

http://sourcezone.wordpress.com/2008/02/14/java-how-to-get-the-mac-addresses-of-network-cards/
Back to top
View user's profile Send private message
stonebreak



Joined: 22 Jan 2007
Posts: 4

PostPosted: Tue Dec 09, 2008 5:45 am    Post subject: Reply with quote

Java 6 have added getHardwareAddress() in java.net.NetworkInterface

http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress()

getHardwareAddress fetch MAC address of client machine
Back to top
View user's profile Send private message
juniormember



Joined: 28 Jun 2008
Posts: 154

PostPosted: Tue Dec 09, 2008 5:15 pm    Post subject: Reply with quote

Can this getHardwareAddress() method give client's MAC address??
Back to top
View user's profile Send private message
jeni



Joined: 11 Jun 2007
Posts: 2

PostPosted: Sun Dec 14, 2008 7:07 am    Post subject: Reply with quote

getHardwareAddress() can not give you client's MAC address in java.

Read java docs clearly

Quote:
This class represents a Network Interface made up of a name, and a list of IP addresses assigned to this interface. It is used to identify the local interface on which a multicast group is joined. Interfaces are normally known by names such as "le0".
Back to top
View user's profile Send private message
jyotirai



Joined: 24 Jun 2007
Posts: 1

PostPosted: Sun Dec 14, 2008 7:11 am    Post subject: Reply with quote

Final question,
Can we get client MAC address through JSP yes or not

Or we don't have any option to get MAC of remote machine which is used by client to access web based software
Back to top
View user's profile Send private message
seniormember
Site Admin


Joined: 20 Jul 2008
Posts: 77

PostPosted: Sun Dec 06, 2009 4:46 am    Post subject: Reply with quote

Hi jyotirai, you can get clients mac address using jsp pages also.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Java,Struts framework, Velocity, JSF, Hibernate, Servlet, JSP, javaBeans All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack