Scanner Input Validation

Hi, I hope Im posting to the right place.
I want to check to see if the user input is an integer and keep asking for one if the input is not an integer. Should be very simple but I cant do it because I just dont know how. Im not willing to use a "try and catch" since I dont know how to use that either.
This is what I got...
     int num;
     System.out.print("Please enter a number? ");
     Scanner sc = new Scanner(System.in);
     while (!sc.hasNextInt())
          System.out.println("That is NOT an Integer!");
          System.out.print("Please enter a number? ");
     num = sc.nextInt();
     System.out.println(num + " is an Integer!");Thank you...

This is what I did in a recent project(I use BufferedReader, not Scanner). There are actually quite a few ways to do it. You can check the each char to see if they are between 0-9, but a try/catch right in main but I found this to be most effective to keep the program running. It's not the fastest running time from what I've tried(checking each char to be 0-9 was probably fastest) but if you want full proof do something like this.
public class Test{
     public static boolean isInteger(String string){
          try{
               Integer.parseInt(string);
               return true;
          catch(NumberFormatException nfe){
               return false;
           public static void main(String[] args){
                String input;
                int n;
                BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
          //gets the number of students to input
          System.out.println("How many students are there?");
          try{
               input = in.readLine();
          catch (IOException ioe){
               System.out.println("IO error trying to read input");
                   System.exit(1);
               while(!isInteger(input) || input.equals("")){
                  System.out.println("Not a number, please input a number");
               try{
                    input = in.readLine();
               catch (IOException ioe){
                    System.out.println("IO error trying to read input");
                        System.exit(1);
             n = Integer.parseInt(input);

Similar Messages

  • Input validation in an OO-friendly fashion

    Okay, so "input validation" may sound a bit like an issue for the security division of the forum, but I'm concerned with the most OO way to verify the inputs of users. The situation is that I have about five or six different blanks in a GUI (not that it matters) where a user can input something to change the GUI's model. The GUI's model is, itself, an interface and therefore supports pluggability.
    Now, each of the inputs has potentially different "policies" or business rules for what can be entered. For example, one may be a date, etc. You guys know what I mean. Anyway, I know that I could just have some validation method for every field, but this doesn't seem to be very OO-esque.
    I'd like to have some kind of an interface called "StringValidator" or something that would have a method "validate()," but I don't know how this would play out. Maybe I could have a map in my GUI model where the key is the field name and the associated value is an appropriate implementation of StringValidator? I don't know, though. Even though it would be easier to implement five specific methods, one for each field, I'd rather not.
    If I use some kind of StringValidator, maybe I could require a method that returns an array of Strings with all illegal forms, but then again, that's bad form...
    I really just don't know.
    So, in summary, my two questions are as follows:
    1. What is the best way to implement an OO, easily scalable way to validate Strings in my app?
    2. How do I protect against things like SQL statements, HTML scripts, etc.? I know I should (in many cases), but I don't know how to.
    Thanks for any help, and for wading through that description.
    theAmerican
    PS I just remembered something about some Scanner class or something. Maybe that would help?

    It depends quite what you're doing; if you're working with a db then using prepared statements would handle all the escaping for you, but if you allow the users to input raw SQL then you can't realistically stop them from screwing things up.
    Similarly if you're having the users create html somewhere, then the more flexibility there is the harder it is to control. You don't have to worry about scripting if you're just using JLabel to render the html as it doesn't support it; if you're creating a web UI then you may have to.
    Pete

  • Follow Up to Scanner Input from File

    Alright, I have another problem. My code is this:
    for (int j = 0; j < username.length; j++) {
         String line = input.nextLine();          // Create a temporary String that will store each line
         // Check if the temporary line isn't empty
         if (line.length() > 1) {
                 numAccounts++;
                 username[j] = line.substring(10);
                 password[j] = input.nextLine().substring(10);
                 System.out.println(username[j]);
         } else {     // If the temporary line is empty, go back on the loop to prevent empty array entries
                  j--; }
         }It runs through once, and then stops. Here are the declarations:
    static int numAccounts = 1;
    static String[] username = new String[numAccounts];
    static String[] password = new String[numAccounts];
    static  Scanner input = new Scanner(new BufferedReader(new FileReader("account.txt")));Which was done outside of the main method.
    Why does the loop iterate only once?

    Woah, don't need to get all heated up about something I'm doing wrong. I'm just trying to figure this out. Sorry if I'm getting on your nerves.
    So anyways, I did the ArrayList method with your suggestion of making it an ArrayList of Objects. This is what I have so far:
    // Declare the ArrayList that will store all the Account Objects retrieved from the database
    static ArrayList<Account> accounts = new ArrayList<Account>();
    while (input.hasNextLine()) {
        String line = input.nextLine();          // Create a temporary String that will store each line
        // Check if the temporary line isn't empty
        if (line.length() > 0) {
             //System.out.println(line);
             String currentName = line.substring(10);
             String currentPass = input.nextLine().substring(10);
             Account current = new Account(currentName, currentPass);
             accounts.add(current);
    }Yes, I stuck with using the line.length() > 0, because trying to use line != null doesn't work properly for me. Not entirely sure why. Just throws IndexOutOfBoundsException when it's called.
    And my Account Object class is as so:
    class Account {
         static String username, password;
         Account(String username, String password) {
              this.username = username;
              this.password = password; }
    }I tried to print out the username and passwords to the indexes of 0, 1, and 2, and they're all the same.
    System.out.println(accounts.get(0).username);
    System.out.println(accounts.get(0).password);
    System.out.println(accounts.get(1).username);
    System.out.println(accounts.get(1).password);
    System.out.println(accounts.get(2).username);
    System.out.println(accounts.get(2).password);What is also interesting, is that it only fetched (or copied) the last two lines in the text document. It ignores all the entries before that.
    Do you know what I did wrong? I think I did a logic error in there somewhere.

  • MM41/MM42/(MM43) - Sales view: How to add own input validation for CALP-END

    Hello.
    I am looking for an easy way, if any to create an own input validation for a certain field in the article master on the sales view tab. In addition to any standard input validation I would a like to add an own validation (for CALP-ENDPR) depending on the input.
    How can that be achieved in the easiest and proper manner - in general and for the specific case?
    There are no screen exits etc. here, if I am correct.
    Any ideas?
    Thanks.
    C.N.

    Hi,
    Please refer the below link.
    This is for MM01. I understand that you are into Retail system. Hope the same processing logic can be done in your scenario also.
    saptechnical(dot)com(slash)Tutorials(slash)ExitsBADIs(slash)MM(slash)MM01(dot)htm
    Replace the bracket words with the correct symbols.
    With Regards,
    Sumodh.P

  • Input validations using bsp code

    hai all,
       i want to check user input whether he/she entered correct values r not, i know how to do using javascript.
    but i need to do the same without using javascript.. is there any way
    leoiz

    No, this was not a joke, but it would be possible theoretically.
    Doing a quick search on Google got me this nice link:
    http://www.permadi.com/tutorial/flashjscommand/
    It shows an example of Flash interacting with JavaScript, hence proving the possibility.
    As for really using Flash/ActionScript for input validation ...
    If you are thinking about just including a little Flash-Validation for input fields - why do it with Flash if you can use JavaScript?
    And if your page is a Flash-Page anyway, well, you would not have to go back to HTML input fields, as you work within your Flash applet.
    Maybe you have a specific situation I didn't think of yet.
    Max

  • How do I return to the top of a form when input validation fails?

    I have a form that I am using spry input validation that I
    would like the user to be returned to the top of the page when
    validation fails. If that can't be done somewhat easily, can I have
    a message appear next to the submit button that says "Errors found.
    The field(s) marked in red need to be corrected" when there are any
    errors that prevent the form from submitting.

    The break statement in Java is similar to last in Perl.
    The continue statement in Java is similar to next in Perl.

  • [solved][C] input validation with strtod()

    I'm using strtod() in an RPN implementation, and I'm working on input validation. As per strtod(3), I've written the following conditional to catch input overflow.
    errno = 0;
    op1 = strtod(token, &endPtr);
    if ((errno == ERANGE && (op1 == HUGE_VALF || op1 == HUGE_VALL)) || (errno != 0 && op1 == 0)) {
    printf("Error: Input overflow.\n");
    clearstack();
    return 1;
    Except that when I enter something that would definitely overflow, this conditional is never entered. Furthermore, errno is never set. What am I missing?
    A link to the full code can be found here
    Last edited by falconindy (2010-04-13 17:49:15)

    tavianator wrote:
    Well the first wrong thing I see is that you should really test if fabs(op1) is HUGE_VAL{F,L}.
    The second thing is, why so complicated a test?  errno != 0 should be all you need.
    Fair enough. This is the first time I'm really dealing with floating point ops in C.
    tavianator wrote:The third thing is, if errno is really not being set, are you sure you're really overflowing?  doubles go up to about
    1.8e308 on most arches.
    Huh... wouldn't an unsigned double be, at most, 2^128 - 1 and more likely 2^64 - 1? I'm dealing with signed, so its then half that. Sure enough, sizeof(double) returns 8.
    Also, this is what made me think I'm hitting overflow.
    > 111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1 *
    = 111111111111111105547424803279259724863245197668615715838829352563602489955831513088.000
    >
    Hmm. If I go even further, I eventually do hit an overflow error. However, that still leaves me a little baffled as to the results above. Is this a result of the decimal precision inherent in a double?

  • Barcode scanner input

    Hi .
    I have an application that needs to receive bar code scanner input (the DS6707 from motorola). This application also discusses with 3 or 4 boards that run in parallel (using serial port com). So I have at least 5 threads that are running in parallel: one for each port com, one supervisor, and the main for the user interface.
    I created a control to get the data coming from the barcode scanner, but sometimes I lose some number on my barcode, or sometimes I receive ‘?’ instead of a number.
    If I create a thread that read the standard input, it works, I always receive all my numbers, but the problem is that I have the standard input that is visible and I don’t want.
    I tried to used keyboard methods from the windows library , but I don’t know how to proceed.
    Thanks for your help.

    I have a question about a keyboard wedge scanner input.
    I have a single panel with several text boxes placed in a grid.
    I post the output from 8 flash programmers in the boxes.
    I have a single wide text box below these to display general program status.
    My problem is when I scan the barcodes from the panel array, all data goes
    through the Upper Left text box. i want the data to go through the big box on the bottom.
    The reason I am using the text box in the upper left, is because that is where the data went
    when I scanned the bar codes. I was desperate to get the project moving forward.
    And the StdIO window caused too many problems.
    Question,  How do I move the cursor to the other text box ? I have tried many Set / Get
    Attribute parameters.  If there exists any "how-To" example code I would be grateful.
    void ReadSerialNumber1 (char* BigBuffer9)
     statspanelHandle  = TESTER_DialogGetSubPanelCVIHandle(&StatsHandle);
     statspanelHandle  = GetCtrlVal (StatsHandle, STATSPANEL_TEXTBOX_2, BigBuffer9);
     DisplayPanel(StatsHandle);
     fprintf(Stream1,"Serial Number..~%s~\n",BigBuffer9);
    code in main section
      sprintf(LittleBuffer1,"\n  -- SCAN Serial Number Nest 1-- ");
      WriteTextBox1(LittleBuffer1);
      PN_Size = strlen(LittleBuffer1);
      for(x=0;x<128;x++){ LittleBuffer1[x] = '\0';}
      PN_Size = strlen(LittleBuffer1);
      while(PN_Size != 10){
         int Stat_Val;
         Delay(0.5);  
      ReadSerialNumber1(LittleBuffer1);
         PN_Size = strlen(LittleBuffer1);
      if(TEST_CHECK_BREAK) break;
      if(PN_Size == 10)  Ready_Go = 1;
      strcpy(sSerialNum1,LittleBuffer1);
      strcpy(Scan_Buffer[0],LittleBuffer1);
      if(!strcmp(ModuleType2,"DSM")) strcpy(Scan_Buffer[1],LittleBuffer1);
      ResetTextBox2();
      if(TEST_CHECK_BREAK) break;
      sprintf(LittleBuffer1,"____%s____",Scan_Buffer[0]);  
      WriteTextBox1(LittleBuffer1); 
      Ready_Go = 0;

  • Element Input Validation - Table Values

    Hi All,
    Forum newbie.
    Can anyone tell me if its possible to do an Element Input Validation that is using table values?
    eg.
    This was my thinking -
    DEFAULT FOR TableLower IS 0
    DEFAULT FOR TableUpper IS 0
    INPUTS ARE entry_value (text)
    entry = TO_NUM(entry_value)
    Lower = TO_NUM(GET_TABLE_VALUE('Table Selected', 'Level', TableLower))
    Upper = TO_NUM(GET_TABLE_VALUE('Table Selected', 'Level', TableUpper))
    IF entry > Upper OR entry < Lower THEN
    formula_status = 'E'
    formula_message = 'Entry Value Must Be In The Table Range 1'
    ELSE
    formula_status = 's'
    RETURN formula_status, formula_message
    Any help would be very much appreciated.
    Dean

    Hello,
    It is possible to use GET_TABLE_VALUE function in element input validation.
    Thanks,
    Sudhakar

  • Scanner Input from File

    I'm trying to read from an external file using the Scanner class and to store the input in the applicable arrays, but I don't know how to skip lines.
    For example, if a text file has this in it:
    Name: Bob
    Age: 30
    Job: Engineer
    Name: Joe
    Age: 40
    Job: ManagerIt reads fine, and stores fine. But, if I have this instead:
    Name: Bob
    Age: 30
    Job: Engineer
    Name: Joe
    Age: 40
    Job: ManagerWith the empty line, the String class throws an index out of range exception. Same goes for if the very first line of the file is also blank.
    Here is my code:
    String[] name = new String[100];
    int[] age = new int[1000];
    String[] job= new String[1000];
         try {
                  Scanner input = new Scanner(new BufferedReader(new FileReader("test.txt")));
                  for (int i = 0; input.hasNext(); i++) {
                       name[i] = input.nextLine().substring(6);
                       age[i] = Integer.parseInt(input.nextLine().substring(5));
                       job[i] = input.nextLine().substring(5);
                       System.out.println("Name: " + name);
                   System.out.println("Age: " + age[i]);
                   System.out.println("Job: " + job[i]);
              input.close();
         } catch (FileNotFoundException error) {}Thank you all very much!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I already have something else that is handling non-existent files, so I don't need to do anything there.
    And thank you very much, I figured out how to do it! I just needed to temporarily store the line, see if it was longer than 1 in length, and perform based on that.
    Thank you very much!
    Edited by: ManiKatti on Dec 31, 2009 7:14 PM

  • Problem with Scanner input

    I want to take an int as first input and string with spaces as 2nd input via scanner input method... it takes int input and immediatly prints the output
    without taking string input.... where is the bug.... here is the code...
    import java.util.*;
    import java.io.*;
    public class Ud2
    public static void main(String[] args)
    Scanner in=new Scanner(System.in);
    int x=in.nextInt();
    String s=in.nextLine();
    System.out.print("the no is "+x+" and name is "+s);
    if the prob is due to new line charcter in the stream then how to remove or
    ignore it..?
    plzzz help.......................

    in.nextLine();Insert the above line after your nextInt call. Why? Because nextInt() does not consume the end of line(EOL) character. So when you call nextLine() you assign the EOL to s

  • How to do input validation in BDC's?

    hai,
       I am Rajesh, I want to know how and where to write input validation code in BDC's. Please help me on this.
    Thanking you

    Hi and welcome
    all key-fields (and fields with a check-table) are checked by SAP-standard in your called transaction in BDC too.
    if you want to validate additional:
    1)load you data from flat file into itab
    2)check fields:
    -against checktable
    -format (date,currency)
    -value
    A.
    pls reward usful answers
    Message was edited by: Andreas Mann

  • Scanner input being forgotten

    I am new to Java and playing around with Scanner input instead of BufferedReader. In the following code the Scanner input appears to be forgotten at the end. When asking if the user wants to repeat another person, if I omit the 2nd Scanner input, the nextLine is not executed or at least ignored. Is there a time limit or input limit for how long Scanner input will work?
    import java.util.Scanner;
    public class Java0504
         public static void main (String args[])                                    
              String repeat = "Y";
              while (repeat.equals("Y"))
                   System.out.println();
                   Scanner input = new Scanner(System.in);
                   System.out.print("Enter 1st Name ===>> ");
                   String firstName = input.nextLine();
                   System.out.print ("Enter last name ===>> ");
                   String lastName = input.nextLine();
                   System.out.print ("Enter your area code ===>> ");
                   String areaCode = input.nextLine ();
                   System.out.print ("Enter your prefix ===>> ");
                   String prefix = input.nextLine ();
                   System.out.print ("Enter the last four digits of your phone number ===>> ");
                   String lastFour = input.nextLine ();
                   System.out.print ("Enter your age ===>> ");
                   int age = input.nextInt ();     
                   System.out.println ();
                   System.out.print ("Do you have another person Y/N ===>> ");
                   Scanner input2 = new Scanner(System.in);
                   repeat = input2.nextLine ();     
              System.out.println ();                    
    }

    I think you probably need this:
    String dummy = input.nextLine();after the line:
    int age = input.nextInt();And then, add the following (and eliminate the input2, as suggested):
    repeat = input.nextLine(); after the "another person Y/N".
    Otherwise, I think the input.nextLine() after the "Y/N" will just consume the "return" that was pressed when the user entered the age.
    That is, the last few lines would be:
    int age = input.nextInt ();
    System.out.println ();
    String dummy = input.nextLine();
    System.out.print ("Do you have another person Y/N ===>> ");
    repeat = input.nextLine();

  • Number Input Validation

    I'm having a lot of trouble validating that only a number within the specified range can be taken as input in this program that calculates payments on a loan. The loops repeat and prompt for correct input IF the values inputted are numbers. I need the program to account for Strings and characters, so that if a string or char is entered in the loan amount, year amount, or interest rate amount, the user is prompted again until a number with no chars or strings present is input. I tried everything; I've changed all of my methods to strings and tried to parse the strings into integers, a waste of about 2 hours; I've tried using exception handling, I cannot get it to work right and there's too much overhead for that anyway. If there was just a static method such as NotANumber (NaN) for primitive types so that I could validate at the same time as I take the <variable>.nextDouble, I wouldn't have a problem. Any help please?
    public class Payment
        private double la;
        private double mir;
        private int yrs;
        private double monthlyPayment;
        Scanner inp = new Scanner(System.in);
        public Payment()     //no argument constructor
            la =  0;
            mir = 0;
            yrs = 0;
        public static double monthlyPayment(double loanAmount, double monthlyInterestRate, int years)
            int months = 12;// *= years;
            double temp = monthlyInterestRate;
            months *= years;
            monthlyInterestRate = monthlyInterestRate * .01;
            monthlyInterestRate /= 12;
            double monthlyPayment = loanAmount * monthlyInterestRate / (1 - 1/Math.pow(1 + monthlyInterestRate, months));
            System.out.println("Loan amount: " + loanAmount);
            System.out.println("Yearly interest rate: " + temp);
            System.out.println("Years: " + years);
            System.out.println("Monthly payment: " + monthlyPayment);
            return 1;
        public void input()
            char c = ' ';
            String s = "";
            double loan;
            double monthlyInterestRate;
            int years;
            Scanner in = new Scanner(System.in);
            do
                do
                    System.out.println("Enter loan amount: ");
                    loan = in.nextDouble();
                while(loanAmountFalse(loan));
                setLoanAmount(loan);
                do
                    System.out.print("Enter monthly interest rate: ");
                    monthlyInterestRate = in.nextDouble();
                while(monthlyInterestRateFalse(monthlyInterestRate));
                setMonthlyInterestRate(monthlyInterestRate);
                do
                    System.out.print("Enter years: ");
                    years = in.nextInt();
                while(yearsFalse(years));
                setYears(years);
                monthlyPayment(loan, monthlyInterestRate, years);
            while(continueOK());       
        private boolean continueOK()
            boolean cont = true;
            String s = "";
            char c = ' ';
            Scanner in = new Scanner(System.in);
            do                                   //allows prompt to repeat if 'y' or 'n' is not entered
                System.out.print("Enter 'y' to continue or 'n' to end program:");
                s = in.next();
                s = s.toLowerCase();            //input is not case sensitive
                c = s.charAt(0);
                if(c == 'n')
                    System.out.println("System exiting...");
                    System.exit(0);
            while(c != 'y');
            return true;
        private boolean loanAmountFalse(double loanAmount)
            if(loanAmount < 0)
                System.out.println("Loan amount UNDER 0... error...");
                return true;
            else if(loanAmount > 1000000)
                System.out.println("loan amount OVER 1000000...");
                return true;
            else
                System.out.println("loanAmOK method reached...");
                return false;
        private boolean monthlyInterestRateFalse(double monthlyInterestRate)
            if(monthlyInterestRate < 0)
                System.out.println("ERROR: Interest rate must be over 0...");
                return true;
            else if(monthlyInterestRate > 20)
                System.out.println("Error: Interest rate must be under 20...");
                return true;
            else
                System.out.println("good to go...");
                return false;
        private boolean yearsFalse(int years)
            if(years < 0)
                System.out.println("ERROR: years must be over 0...");
                return true;
            else if(years > 100)
                System.out.println("ERROR: years must be under 100...");
                return true;
            else
                System.out.println("Years ok");
                return false;
        public void setLoanAmount(double loanAmount)
            if(loanAmountFalse(loanAmount))
                System.out.print("Error: loan amount must be greater than 0 and less than $1,000,000.");
            else
                this.la = loanAmount;
        public void setMonthlyInterestRate(double monthlyInterestRate)
            if(monthlyInterestRateFalse(monthlyInterestRate))
                System.out.println("Error: interest rate must be greater than 0 and less than 20.");
            else
                this.mir = monthlyInterestRate;
        public void setYears(int years)
            if(yearsFalse(years))
                System.out.println("Error: years must be greater than 0 and less than 100.");
            else
                this.yrs = years;
    }

    flounder wrote:
    Or wrap a try statement around the call to nextDouble.Or use Scanner.hasNextDouble() to determine if the next token can successfully be parsed as a double.

  • Scanner input error

    I want to make a very simple program that allows the user to enter a key/character and have the corresponding unicode value returned. The problem is that I receive an error after the input of any character.
    Here is the code:
    import java.util.Scanner;
    public class KeyMap
    public static void main (String args[])
    int number; //the future unicode value.
              System.out.print ("Enter the key you want the unicode number of: ");
              Scanner scan = new Scanner (System.in);
              number = scan.nextInt();
              char key = (char)number;
              System.out.print ("The number for key " + key + " is " + number);
    And I get this error in the run log after the character is entered:
    Exception in thread "main" java.util.InputMismatchException
         at java.util.Scanner.throwFor(Scanner.java:819)
         at java.util.Scanner.next(Scanner.java:1431)
         at java.util.Scanner.nextInt(Scanner.java:2040)
         at java.util.Scanner.nextInt(Scanner.java:2000)
         at KeyMap.main(KeyMap.java:11)
    KeyMap has exited with status 1.
    Thanks for any help!

    Exception in thread "main"
    java.util.InputMismatchException
         at java.util.Scanner.throwFor(Scanner.java:819)
         at java.util.Scanner.next(Scanner.java:1431)
         at java.util.Scanner.nextInt(Scanner.java:2040)
         at java.util.Scanner.nextInt(Scanner.java:2000)
         at KeyMap.main(KeyMap.java:11)Well that's coz your listening for an Integer input.
    the error should happen if you input non-integer data type.
    Nywled

Maybe you are looking for

  • XML Publisher Enterprise 5.6.2 - World Sales report (DEMO)

    Hello All; Does anybody have problem displaying "World Sales" report as HTML output under Sales Manager folder? The demo is provided when downloading and installing XMLP server. "World Sales" report uses an XML feed from a URL which I configure per t

  • Exception in openDocument call - SDK for Java

    Hi, Getting exception in openDocument call to get object of type DocumentInstance. Snippet - IEnterpriseSession eSession=(IEnterpriseSession)session.getAttribute("EnterpriseSession");      if ( eSession != null)      ReportEngine webiRepEngine = (Rep

  • Relating to Creation of Number of Company Codes.

    Hi Experts, My Client is a Trader and he has 5 different Company Codes. Which are as follows. 1) This Company imports Goods and Sales Locally.-It"s a properitoship 2) This Company Exports Goods - Its a Properitoship. 3) This Company is a shop which s

  • Issue with Alerts using BPM : Trigerred for Successful messages also

    Hi Everybody, I am working on configuring Alerts using BPM. I have followed the below blog by Micheal. /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated In BPM after the receive step I have used cont

  • How to replace & with escape code?

    Hi, I want to replace all occurence of & in a string with escape code '%26' . Is the following lines of the code the right way to do this? Please help. Thanks. String test; test.replace('&', '%26');