Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners display error message for dupliacate record in properties file
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


swaminathan m
display error message for dupliacate record in properties file
0 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


This is my code. Here if the properties file contain duplicate records(i.e.)more than one entry e.x.001,002,003,001 i want to display the error message "Duplicate Record found" while compile the java file.Please give the correct solution soon.

import java.io.*; import java.util.*; public class Sample2 { String message; public Sample2() {

       }
       public void setMessage()
       {
        Properties props = new Properties();

try {

     props.load(new FileInputStream("message.properties"));


     message = props.getProperty("002");

         System.out.println(message);
        for (Enumeration e = props.propertyNames();
        e.hasMoreElements();) {

} }

  catch(IOException e)
         {

        e.printStackTrace();

        }
 }
public static void main(String[] args)

     {

    Sample2 gr = new Sample2();

    gr.setMessage();

 }

}


Advertisement
View Answers

Related Tutorials/Questions & Answers:
display error message for dupliacate record in properties file
display error message for dupliacate record in properties file  This is my code. Here if the properties file contain duplicate records(i.e.)more than one entry e.x.001,002,003,001 i want to display the error message "Duplicate
Display error message if data is already inserted in database
Display error message if data is already inserted in database   Display error message if data is already inserted in database Pls help me Thanks
Advertisements
How to read and display data from a .properties file from a jsp page
How to read and display data from a .properties file from a jsp page  I have a .properties file. I have to create a jsp page such that it reads the data from this .properties file and display it in table format. Ex:by using
error message
error message  Sir i make one form facility with insert,update,delete.i want to error msg if any type of the data is missing and display in error msg which of the data is misssing
javascript dom error-message
javascript dom error-message  javascript dom error-message
struts2 properties file
struts2 properties file  How to set properties file in struts 2 ?   Struts 2 Format Examples Struts 2 Tutorial
error message - Java Beginners
error message  sir, while i m trying to execute my first program(print my name)I get error message like" javac is not recognized as internal or external ...blah..blah..or batch file".even i hav tried setting the path variable
forward error message in struts
forward error message in struts  how to forward the error message got in struts from one jsp to other jsp?   Hello Friend, Use <%@ page.... The code errorPage="errorPage.jsp" forwards the exception message
Properties File IN Struts - Struts
Properties File IN Struts  Can we break a large property file into small pieces? Suppose we have property file whose size is 64 kb .can we break... the detail along with code and also entry about properties into configuration file
Error display
Error display  I want to give a message on the screen that an error has occured...but I dont want to use alert and give pop up box...any other solution for the problem
Properties file in Java
Properties file in Java       In this section, you will know about the properties file. The properties file is a simple text file. Properties file contains keys and values
how to display the email message in jsp
how to display the email message in jsp  hi every one .. i am new from this industry please help me to display the email message in jsp page please send me sample code
error message - JSP-Servlet
error message  hi, friends after complete my servlet programe i can type http://localhost:8080 on the browser. the servlet program is insert data... device, path, or file you may not have the appropriate permission to access". my
Error Message in Eclipse - Development process
Error Message in Eclipse  Hi Friend, My changes... option is not working in Eclipse. Am getting error message while saving. Now save button is invalid.I forgot that error message. Something like workbench error
Java Properties File Example
an object of Properties class. 3. After that load the properties file into the program. 4. Finally get the text using the key of the properties file. An example of using the properties file and changing the caption French language is given
Properties file in Java
Properties file in Java       Properties file in Java In this section, you will know about the properties file. The properties file is a simple text file. Properties
Replace JSF Standard Error Message
Replace JSF Standard Error Message  How can we replace the JSF Standard Error Message
error display
error display  I am creating a web page...I have two textboxes and an add button. If nothing has been entered in the textboxes and if I click the add button , I have to get pop up box indicating that "please fill in the fields
applicationcontext.xml properties file
applicationcontext.xml properties file In this tutorial I will explain how you can use the properties defined in .properties file in your spring application... changing the properties file. Suppose you are developing an email sending
To Display the 'Last Modified' message in JSP
To Display the 'Last Modified' message in JSP  I have to display the "Last Modified" auto save message in a portlet page at the right end corner... Modified' Message should be displayed
Java Read username, password and port from properties file
the properties file and display the data from the database. Now to load the data from the properties file, we have used Properties class. This class allowed us to save data...Java Read username, password and port from properties file In this section
XML error message: The reference to entity
XML error message: The reference to entity   XML error message: The reference to entity "ai" must end with the ';' delimiter. Im getting this error when i gotta edit my blogger template Please advice manjunath
Java read properties file
Java read properties file In this section, you will learn how to read properties file. Description of code: There are different tools to access different files. Now to load the data from the properties file, we have used Properties
Struts properties file location - Struts
Struts properties file location  Hi, Where struts properties file stored in web application. I mean which location. Thank u   Hi Friend, The struts.properties file can be locate anywhere on the classpath
Java Write to properties file
Java Write to properties file In this section, you will learn how to write data to properties file.  The properties file is basically used to store... has provide Properties class to store data into .properties file. It consists
Display Errors using Message Resources - Struts
Display Errors using Message Resources  Hello.. I've a login page where i used applicationresources.properties to display errors for null values... required.. I want to display errors using message resources using
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
passing .properties file as a parameter to another function
passing .properties file as a parameter to another function  passing .properties file as a parameter to another function in an jsp file
depending on the form name i have to display the message
on the form name i have to display the message. for example, i have 3 jsp pages... on contact us after entering all details page has to display message like"thank u for contacting us" if user clicks on suugest display message like"thank u
 

 

 

DMCA.com