Where to validate user input from FPM_FORM_UIBB?

I am supporting an ESS OVP app using WDA and FPM. 
This question concerns validating/changing user input from an edit page entered through FPM_FORM_UIBB
In a form, on an edit page, we wanted to mask the initially loaded value of a field with asterisks.
I used the feeder class get_data() method to accomplish this.
The user may then overtype the asterisks with content data.  At times, the user leaves some of the asterisks there as well.
I want to check the contents of the inpu field, and, if needed, compress out the asterisks.
if not inputfield co '* ' .
translate inputfield using '* ' .
condense inputfield NO-GAPS .
endif .
Where can I put this code? Or, where, generally, do you code validations of form data?
Thanks…  
…Mike

Hi Mark,
You should be able to catch the event in PROCESS_EVENT and GET_DATA. I would put the break-point in both of these methods and check for the field values and based on that decide course of action. So steps would be.
1) Put in the break-points in the obove methods.
2) Check the event and the field values you are intrested in.
3) Code accordingly.
Hope it helps.
Laeeq Siddique

Similar Messages

  • Where to validate user input

    hi all,
    I have following problem:
    When user submits form, all the data in request are Strings. Now suppose I need to put this data in database using TransferObject and DAO. My question is how to do it properly? I think about two ways of doing that:
    1)
    Create TransferObject with all properties being Strings or arrays of Strings, and then let DAO classes take care about validation of data format and type conversion. In this case all I need to do in my servlet is to create TransferObject, fill it with form data without any validation and then pass this object to DAO. Then DAO makes all conversions, and either adds new record or raises format exception.
    2)
    Create TransferObject with different types of properties according to database fields types. Then DAO get's valid data and all it needs to do is to put it in database. But then I have to take care about validation in my servlet to pass valid data to DAO.
    This way has at least one disadvantage for me: I think I can't use any utilities copying all properties from form to TransferObject.
    So tell me which way should be used to have right aplication design.
    Thanks for all replies.

    IMO, the database should concern itself with data integrity and referential integrity. It will validate the data type, precision and scale you are attempting to insert or update. It will also enforce referential constraints (e.g., primary keys, foreign keys, unique constraints, etc.) that may exist on the table(s). Finally, the database is responsible for ensuring a transaction is atomic, either the whole logical unit of work will be committed or the changes rolled-back successfully.
    More complex validations (e.g., account balance cannot be negative unless savings account balance is greater than $1,000) should generally be done in the middle-tier, though an argument can be made that even these validations can also be put in the database.
    Generally, for complicated transactions, the middle-tier will be responsible for transaction management. This is not a minor responsibility in a complicated set of data updates. The middle-tier will also enforce workflow and/or data sufficiency (e.g., even though a column may be nullable in the database, a business rule may require the value be specified).
    Finally, some validation can occur on the client. Though, you should always look at these validations in terms of application response time, not actual data validation. You may want to place some validations on the client so that a server trip is not required for validation. However, all validations must occur in the middle-ware and/or database. You cannot trust client code. Someone might modify the page and resubmit it.
    - Saish

  • Validate user input String

    I dunno why I cant get this to work,
    Im getting user input from JOptionPanes, and need to create an error message each time that nothing is entered, I tried creating a method to validate this, but couldnt get it too work, do I need to use the OnClick event handler???
    This is my code, thanks
    billsName = JOptionPane.showInputDialog("Please enter the Bill Name:");
    tomName = JOptionPane.showInputDialog("Please enter the Tom:");
    sandyNameLoc = JOptionPane.showInputDialog("Please enter the Sandy:");

    this is the way that I had the validation, but nothing happens, when I tyoe nothing in, it just goes to teh next input box
    fName = JOptionPane.showInputDialog("Please enter your First Name:");
    if(fName ==null)
    JOptionPane.showMessageDialog(null, "Eror", "Eror", JOptionPane.ERROR_MESSAGE);
    }

  • Where clause requiring user input

    I am a complete beginner at using SQL for Oracle.
    I am using a program called Toad for Oracle to try and help;
    See I am used to using the very simple Microsoft Query to build queries.
    I am using Excel to use these queries for a bunch of reports, graphs and charts.
    However, when I try and use Microsoft Query to build these queries I get a bunch of errors. Biggest one I can't get past is ORA-00972: identifier is too long.
    Anyway, so I start trying to build my query in Toad for Oracle.
    Is there a way like there is in Microsoft Query to write the Where Clause for user input.
    Example:
    MICROSOFT QUERY sample: Where A_COMPL_SUMMARY.ENTRY_DATE>= ?)
    And (A_COMPL_SUMMARY.ENTRY_DATE<= ?)
    And (A_COMPL_SUMMARY.ENTRY_DATE>=[Date1] And A_COMPL_SUMMARY.ENTRY_DATE<=[Date2])
    Something like that.
    Basically I'm wanting at this point of the query for excel to pop up a window for user to input what dates they want
    So is there a way to do this in SQL. I can't seem to write it the "correct way". It doesn't like the ?'s or the "[ ]"'s
    Please help!!!
    Thank you,

    When I try and copy/paste the SQL that I generated in Toad into Excel's query tool, 1st it tells me it can't be represented graphically. I select OK and then it gives me the "Microsoft Query has encountered a problem and needs to close. We are sorry for the inconvenience." my only options at this point are to Debug, Send Error Report, or Don't Send.
    Maybe I'm going about this the wrong way. But I need to run this Sql in Excel so I can get the graphs and charts from the data it executes.

  • Validate user input in textfield?

    Am trying validate user input into my JTextfield but its not working right... Am using the classes from sun's hp :
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html
    The classes with changes made:
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    public class DecimalField extends JTextField
    private NumberFormat format;
    private NumberFormat percentFormat;
    public DecimalField()
    super(10);
    percentFormat = NumberFormat.getNumberInstance();
    percentFormat.setMinimumFractionDigits(2);
    // ((DecimalFormat)percentFormat).setPositiveSuffix(" ");
    setDocument(new FormattedDocument(percentFormat));
    format = percentFormat;
    public double getValue()
    double retVal = 0.0;
    try
    retVal = format.parse(getText()).doubleValue();
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    return retVal;
    public void setValue(double value)
    setText(format.format(value));
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    import java.util.Locale;
    public class FormattedDocument extends PlainDocument
    public FormattedDocument(Format f)
    format = f;
    public Format getFormat()
    return format;
    public void insertString(int offs, String str, AttributeSet a)
    throws BadLocationException
    String currentText = getText(0, getLength());
    String beforeOffset = currentText.substring(0, offs);
    String afterOffset = currentText.substring(offs, currentText.length());
    String proposedResult = beforeOffset + str + afterOffset;
    try
    format.parseObject(proposedResult);
    super.insertString(offs, str, a);
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    // System.err.println("insertString: could not parse: "
    // + proposedResult);
    public void remove(int offs, int len) throws BadLocationException
    String currentText = getText(0, getLength());
    String beforeOffset = currentText.substring(0, offs);
    String afterOffset = currentText.substring(len + offs,
    currentText.length());
    String proposedResult = beforeOffset + afterOffset;
    try
    if (proposedResult.length() != 0)
    format.parseObject(proposedResult);
    super.remove(offs, len);
    } catch (ParseException e)
    Toolkit.getDefaultToolkit().beep();
    // System.err.println("remove: could not parse: " + proposedResult);
    private Format format;
    what am I doing wrong?

    am sorry
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    import java.util.Locale;
    public class FormattedDocument extends PlainDocument
        public FormattedDocument(Format f)
            format = f;
        public Format getFormat()
            return format;
        public void insertString(int offs, String str, AttributeSet a)
        throws BadLocationException
            String currentText = getText(0, getLength());
            String beforeOffset = currentText.substring(0, offs);
            String afterOffset = currentText.substring(offs, currentText.length());
            String proposedResult = beforeOffset + str + afterOffset;
            try
                format.parseObject(proposedResult);
                super.insertString(offs, str, a);
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
    //            System.err.println("insertString: could not parse: "
    //            + proposedResult);
        public void remove(int offs, int len) throws BadLocationException
            String currentText = getText(0, getLength());
            String beforeOffset = currentText.substring(0, offs);
            String afterOffset = currentText.substring(len + offs,
            currentText.length());
            String proposedResult = beforeOffset + afterOffset;
            try
                if (proposedResult.length() != 0)
                    format.parseObject(proposedResult);
                super.remove(offs, len);
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
    //            System.err.println("remove: could not parse: " + proposedResult);
        private Format format;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.Toolkit;
    import java.text.*;
    public class DecimalField extends JTextField
        private NumberFormat format;
        private NumberFormat percentFormat;
        public DecimalField()
            super(10);
            percentFormat = NumberFormat.getNumberInstance();
            percentFormat.setMinimumFractionDigits(2);
    //        ((DecimalFormat)percentFormat).setPositiveSuffix(" ");       
            setDocument(new FormattedDocument(percentFormat));
            format = percentFormat;
        public double getValue()
            double retVal = 0.0;
            try
                retVal = format.parse(getText()).doubleValue();
            } catch (ParseException e)
                Toolkit.getDefaultToolkit().beep();
            return retVal;
        public void setValue(double value)
            setText(format.format(value));
    }Well when I create this overriden TextField ( DecimalField ) its working as it should with the first character. Its only accepting digits and . but after the first character its accepting everything. Its like the validation disappear?

  • How to accept user inputs from  sql script

    I want to create Tablespace useing sql script , but the location of the data file I need accept from user . (to get the location of the data file ) .
    How can I accept user input from pl/sql .
    Example :
      CREATE TABLESPACE  TSPACE_INDIA LOGGING
         DATAFILE 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL;here I need to accept location of the datafile from user ie : 'H:\ORACLE_DATA\FRSDB\TSPACE_INDI_D1_01.dbf'

    Hi,
    Whenenever you write dynamic SQL, put the SQL text into a variable. During development, display the variable instead of executing it. If it looks okay, then you can try executing it in addition to displaying it. When you're finished testing, then you can comment out or delete the display.
    For example:
    SET     SERVEROUTPUT     ON
    DECLARE
        flocation     VARCHAR2 (300);
        sql_txt     VARCHAR2 (1000);
    BEGIN
        SELECT  '&Enter_The_Path'
        INTO    flocation
        FROM    dual;
        sql_txt :=  'CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
         DATAFILE' || flocation || ' "\SRC_TSPACE_INDI_D1_01.dbf" ' || '
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
         EXTENT MANAGEMENT LOCAL ';
        dbms_output.put_line (sql_txt || ' = sql_txt');
    --  EXECUTE IMMEDIATE sql_txt;
    END;
    /When you run it, you'll see something like this:
    Enter value for enter_the_path: c:\d\fubar
    old   5:     SELECT  '&Enter_The_Path'
    new   5:     SELECT  'c:\d\fubar'
    CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
         DATAFILEc:\d\fubar
    "\SRC_TSPACE_INDI_D1_01.dbf"
         SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE
    UNLIMITED
         EXTENT MANAGEMENT LOCAL  = sql_txt
    PL/SQL procedure successfully completed.This makes it easy to see that you're missing a space after the keyword DATAFILE. There are other errrors, too. For example, the path name has to be inside the quotes with the file name, without a line-feed between them, and the quotes should be single-quotes, not double-quotes.
    Is there some reason why you're using PL/SQL? In SQL, you can just say:
    CREATE TABLESPACE SRC_TSPACE_INDIA LOGGING
    DATAFILE  '&Enter_The_Path\SRC_TSPACE_INDI_D1_01.dbf'
    SIZE 500M  AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL;though I would use an ACCEPT command to given a better prompt.
    Given that you want to use PL/SQL, you could assign the value above to sql_txt. If you need a separate PL/SQL variable for flocation, then you can assign it without using dual, for example:
    DECLARE
        flocation     VARCHAR2 (300)     := '&Enter_The_Path';The dual table isn't needed very much in PL/SQL.
    Edited by: Frank Kulash on Jan 10, 2013 6:56 AM

  • User input from pl/sql

    How could I get user input from a pl/sql block?
    Hope that somebody can help me.
    thanx
    Amelio.

    There is a package DBMS_LOCK that has a SLEEP routine, which suspends the session for a given period of time (in seconds).
    However, you can only pause the procedure and not accept user input into the procedure during the pause.
    syntax: DBMS_LOCK.SLEEP(1) ;
    I need only to run an 'pause' or something like that within a pl/sql block. Do you know if it's possible? Thanks.

  • How to validate user input field?

    I need to validate a user input field against a table. This field is not part of an EO but is used to update an attribute on an existing EO.
    My question is, where would I place the sql that would validate the user input value against the table?
    Is there an easy way to do this?
    I'm at a roadblock and really need some help. Thank you.

    You can execute a sql query or a function from <your>AMImpl.java, using normal jdbc.
    but I would recommend this, it is easier and cleaner approach
    1. Create a VO (<your>VO) with the sql statement
    Select client
    from client_table
    where resp_id = :1
    and client= :2
    2. Add this vo to the am
    3. In AMImpl, get handle to the VO (this.get<your>VO1)
    4. Bind params
    this.get<your>VO1().setWhereClauseParams(0,current_resp );
    this.get<your>VO1().setWhereClauseParams(1,user_input_value);
    5. Execute the query
    this.get<your>VO1().executeQuery();
    6. Get the row after the query is executed
    oracle.jbo.Row <your>Row = this.get<your>VO1().first();
    7. Get the value of the attribute from the row
    l_client = <your>Row.getAttribute("Client") ;
    8. So now you have what you wanted to do with the sql.
    Thanks
    Tapash

  • Captivate 6 How to validate user input without using keyboard shortcuts

    I've been using Adobe Captivate 6 for about 4 months now.  Completely new to the program.  The number one function of Captivate for me will to create many software simulations for verifiable training.  This means that I will be utilizing the training and assessment modes A LOT.  I have run into many hurdles throughout the process, but one of my biggies right now is this:
    In the training and assessment modes, I have times where the user must input data such as an address or number.  In the actual software they will be utilizing it is not always required to use TAB or ENTER in order to move to the next field.  In some instances, it will be necessary to actually click into a field after entering data.  My problem is that it seems as if Captivate will not allow this,  as a keyboard shortcut is automatically entered even if a TAB or ENTER is not required after input.  I assume this is so that the inputted information can be verified.  If you decide you do not want to use a keyboard shortcut to validate the inputted information, you must have a submit button.  Is there any way to change this??  All I want is for the user to enter information and then click into another field WITHOUT having to press ENTER, TAB, or hit a submit button.  Is this even possible if you need user input to be validated??  Any ideas or suggestions would be much appreciated!!

    Hello,
    A while ago I explained the work flow I’m using often in that case, only for the last field you need to have either a shortcut or a submit button AND the sequence has to be imposed. The idea is that you make the Submit button for the first field transparent, delete the  ‘Submit’ text and put it over the second field. So if the user clicks on the second field, he also submits the value of the first field.
    Here is the blog post I’m referring to:
    http://lilybiri.posterous.com/one-submit-button-for-multiple-text-entry-box
    Although it was written for previous versions, the idea will still be functional.
    Lilybiri

  • User Input from Text File

    Hello
    I would like to incorporate code into this to allow the script I found on the internet to pull input from a txt file and then wait for the script to end before using the next entry in the text file and run until all entries in the text file have been used.
    Any help would be great thx.
    Jason
    ' Get Options from user
    GetOptions
    If (bInvalidArgument) Then
        WScript.Echo "Invalid Arguments" & VbCrLf
        bDisplayHelp = True
    End If
    If (bDisplayHelp) Then
        DisplayHelp
    Else
        If (bCheckVersion) Then
            CheckVersion
        End If
        If (strComputer = "") Then
            strComputer = InputBox("What Computer do you want to document (default=localhost)","Select Target",".")
        End If
        If (strComputer <> "") Then
            ' Run the GatherWMIInformation() function and return the status
            ' to errGatherInformation, if the function fails then the
            ' rest is skipped. The same applies to GatherRegInformation
            ' if it is successful we place the information in a
            ' new word document
            errGatherWMIInformation = GatherWMIInformation()
            If (errGatherWMIInformation) Then
                If (bDoRegistryCheck) Then
                    errGatherRegInformation = GatherRegInformation
                End If
                GetWMIProviderList
            Else
                WScript.Quit(999)
            End If
            If (bHasMicrosoftIISv2) Then ' Does the system have the WMI IIS Provider
                GatherIISInformation
            End If
            SystemRolesSet
            If (errGatherWMIInformation) Then
                Select Case strExportFormat
                    Case "word"
                        PopulateWordfile
                    Case "xml"
                        PopulateXMLFile
                End Select
            End If
        End If
    End If

    Unfortunately the script is too long to be posted but can be found at
    http://sydiproject.com/download/and is called Server v.2.3. I have also contacted the author and made the suggestion I
    asked about.
    Jason
    I do not know which script you had in mind but the one I looked at had 1,600 lines of code. As you say, posting it here would be inappropriate. At the same time it is unrealistic to ask for help for such a large script. Asking the author is one option. The
    other option would be to identify the module you wish to modify, analyse it until you fully understand it, modify it so that you can run it in a stand-alone manner, then post your question here. You will probably find that you can answer the question yourself
    after analysing the code!

  • Reading user input from a form within a workflow and perform actions in workflow based on the input

    Sharepoint 2013
    Need to get input from a user based on some condition within a workflow and based on the input received continue with the workflow. It can be a form with a text box and button to which i can redirect and when user enters a value and clicks on the button
    ,I should come back to the workflow and perform other processing. I should also be able to manually start this workflow from VS.
    Tried different approaches like initiation forms ,user input action of SP2010 etc all of these approaches either add some tasks to task list or force me to click on the workflow link to get input from a user.
    Any suggestions on this?

    Hello
    Thanks for the code, but I don't need an array of beans. By the way this code make a bean and an arraylist everytime it's called?
    I was looking for something like this:
    <form action="myjsp.jsp" method="post">
    ...so after submitting the result will go to the myjsp.jsp file and in the myjsp.jsp file
    <jsp:useBean id="value" class"myBean">
    <jsp:setpropertiy name"value" ....>so everytime I click the add button the values will go the mysjp.jsp file and that will set them in the javabean file. this method uses two files but I was looking for doing this in the same jsp file and not sending it to another file.
    chers
    Ehsan

  • How to validate user input

    Hi,
    I am new to Form design
    I am designing an offline form I just want to validate the user input
    whether user has entered Character or Numric.
    if user enters characters in phone no I have to give an error message.
    can you please give the pice of the script to validate the user input.
    Regards
    Bikas

    Instead of finding what is the type of input, you can restrict the user not to type characters in Phone No field.
    Place the below code in Change event of the Phone No field with Java Script as language. 
    // restrict entry to digits
    if (xfa.event.change.match(/[0-9]/) == null)
         xfa.event.change = "";
    Note: You have placed the question in the wrong forum.. You might need the Designer ES forum.
    Thanks
    Srini

  • Selecting user input from Select option into smart form

    Hi,
    when i use parameter then i wil show company code in smart-form output
    but when i use  select option then its throwing error parameter specified here is different
    what should i do in this case i want to design a big select option screen for taking user input
    REPORT  ZMM.
    TABLES BSEG.
    DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
           V_FMNAME TYPE RS38L_FNAM.
    *PARAMETERS SO_BUKRS TYPE BUKRS.
    SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
    DATA : Z_CONTROL TYPE SSFCTRLOP,      "Smart Forms: Control structure
            Z_OPTIONS TYPE SSFCOMPOP.      "SAP Smart Forms: Smart Composer (transfer) options.
    MOVE 'X' TO : Z_control-no_dialog,        "SAP Smart Forms: General Indicator
                   Z_options-tdnewid,          "New Spool Request (Print Parameters)
                   z_control-PREVIEW.         "Print preview
    MOVE 'LP01' TO Z_options-tddest.         "Spool: Output device
    MOVE space  TO Z_options-tdimmed.        "Print Immediately (Print Parameters).
    MOVE 'PRINTER' TO Z_control-device.      "Output device
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME = V_FORMNAME
      IMPORTING
        FM_NAME  = V_FMNAME.
    CALL FUNCTION V_FMNAME
      EXPORTING
        CONTROL_PARAMETERS = Z_CONTROL
        OUTPUT_OPTIONS     = Z_OPTIONS
        USER_SETTINGS      = ''
        BUKRS              = SO_BUKRS.
    pls help me in this regards.
    ketan..

    hi
    thnx for your reply
    can u pls elaborate in my code
    now i changed code   BUKRS    = SO_BUKRS-low.
    either i can give low or high but how to select from range
    REPORT  ZMM.
    TABLES BSEG.
    DATA : V_FORMNAME TYPE TDSFNAME VALUE 'ZPUR_REG',
           V_FMNAME TYPE RS38L_FNAM.
    *PARAMETERS SO_BUKRS TYPE BUKRS.
    SELECT-OPTIONS : SO_BUKRS FOR BSEG-BUKRS.
    DATA : Z_CONTROL TYPE SSFCTRLOP,      "Smart Forms: Control structure
            Z_OPTIONS TYPE SSFCOMPOP.      "SAP Smart Forms: Smart Composer (transfer) options.
    MOVE 'X' TO : Z_control-no_dialog,        "SAP Smart Forms: General Indicator
                   Z_options-tdnewid,          "New Spool Request (Print Parameters)
                   z_control-PREVIEW.         "Print preview
    MOVE 'LP01' TO Z_options-tddest.         "Spool: Output device
    MOVE space  TO Z_options-tdimmed.        "Print Immediately (Print Parameters).
    MOVE 'PRINTER' TO Z_control-device.      "Output device
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME = V_FORMNAME
      IMPORTING
        FM_NAME  = V_FMNAME.
    CALL FUNCTION V_FMNAME
      EXPORTING
        CONTROL_PARAMETERS = Z_CONTROL
        OUTPUT_OPTIONS     = Z_OPTIONS
        USER_SETTINGS      = ''
        BUKRS              = SO_BUKRS-low.
    ketan..

  • Validate user input

    How do I validate the data that the user inputs through the prompts? Example: End date is not earlier than start date, or End Date - Start Date <= 12 months?
    Any direction is appreciated

    Denzil,
    One way to "validate" the data would be to populate a back-end table that has the combinations of data you want users to invoke as they run a report.  Another way would be to set up an alerter in the report and when the undesired condition is met than a cell would show up stating the problem, but this solution appears after the report runs and is handled within the reporting tool.  Not very easy answers, just some choices for you to think about.
    Thanks,
    John

  • Requesting user input from UNIX command window

    New to this forum, and relatively new to Java......question for you......
    Currently, I am able to request a .txt file from a user in my unix command window by having them type in the following command:
    java Game (nameOfTextFile).txt
    with the following code:
    public class Game {
    public static void main(String[ ] args) {
    try{
    reader = args[0];
    catch(Exception g){
    System.out.println(g);
    where 'reader' holds the .txt file.
    What I would like to do is as soon as the user types in the command:
    java Game
    it gives them the line:
    "Please type the file to be input"
    and at this point they type in:
    (nameOfTextFile).txt
    and then I can start working with the text file.
    Any ideas?
    Thanks

    public class Game {
    public static void main(String[ ] args) {
    try{
    reader = args[0];
    catch(Exception g){
    System.out.println(g);
    }This class will not compile. The variable 'reader' is not declared anywhere.
    You could create a shell program. When the user enters the name of the shell program at the command prompt, it gives them the prompt to enter the file to be input. And then from within the shell program you call the java program with the name of the file.

Maybe you are looking for