Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:52:44+00:00 2026-06-08T03:52:44+00:00

How to set a password in war file ??? Can i set the IP

  • 0

How to set a password in war file ??? Can i set the IP address,mac address in war file then before the deployment this war check the IP address ,mac address?If those address correct then war file deploy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:52:45+00:00Added an answer on June 8, 2026 at 3:52 am

    Do IP address check,mac address check etc inside war so even if war is deplyod it will not work if ip or mac address is incorrect. ie….Change the code in war like that

    A sample java program to get IP address and MAC address is given below

     import java.net.InetAddress;
        import java.net.NetworkInterface;
        import java.net.SocketException;
        import java.net.UnknownHostException;
    
        public class MACandIP{
    
           public static void main(String[] args){
    
            InetAddress ipAddress;
                byte[] macAddress;
            try {
    
                ipAddress = InetAddress.getLocalHost();
                System.out.println("IP address =" + ipAddress.getHostAddress());
                NetworkInterface networkInt = NetworkInterface.getByInetAddress(ipAddress);
                macAddress = networkInt.getHardwareAddress();
                StringBuilder strBld = new StringBuilder();
                        System.out.print("MAC address = ");
                for (int i = 0; i < macAddress.length; i++) {
                    strBld.append(String.format("%02X%s", macAddress[i], (i < macAddress.length - 1) ? "-" : ""));
                }
                System.out.println(strBld.toString());
    
     //in above code assume you got MAC address as  81-7B-39-C5-A6-D4 
    
                    if(strBld.toString().equalsIgnoreCase("81-7B-39-C5-A6-D4")){
                        // mac is correct 
                    }
    
            } catch (UnknownHostException excep) {
    
                excep.printStackTrace();
    
            } catch (SocketException exce){
                exce.printStackTrace();
            }
    
           }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I set the Basic Auth user id and password when using a
I'm trying to set this up where the user gives username and password in-app,
In grails I can set the password field to have a minimum size constraint
I was trying to deploy a WAR file using the Cargo Ant task version
I started HsqlDB in server mode and set password for administrator account SA. Then
Hi I need to know whether we can set password to our lock phone
I am creating the web project with username+password.In this project how to set password
I am trying to set minimum password requirements for my membership provider in Umbraco.
Is it possible to set printer password programmatically from C#? Or is it at
In a basic mysql insert you are able to set a password variable 'PASSWORD($password)'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.