Null field, data passing

Hello,
I am new to java and servlets.
I have 2 questions regarding servlets. I hope somene will answer them.
1. When I am getting data html form to servlet how do I check for empty data filed.
For example in my html form, I have field name called "supply name". How do I check this field is null.
If (supplyname != null)
this does not work.
2. is it possible to pass array from one servelt to another servelet>
Thanks

In answer to (1), check for "".equals(supplyName.trim()).
In answer to (2), yeah, it's possible. I'm guessing that you have one servlet included in the other? Just put the array on the request like so:
request.setAttribute("myArray", myArray);
Then in the recipient servlet, do:
MyObject[] myArray = (MyObject[])request.getAttribute("myArray");

Similar Messages

  • Mapping failure in Null fields passing

    Hi
    We are facing some problem in null fields passing to RFC side.. some times the JDBC colums not having the data ,
    so that time our map is failing to call RFC.
    Please let me know any prevent methodologies for this?
    Target side field occurances are 0...1
    Regards
    rambarki

    Hi Rambarki,
    since your target field is optional, you can map your target only if the value is present in the source, do not map if it is null.
    Also are you getting any specific error ?
    Have a look at this thread aswell..
    JDBC Adapter: Mapping: result contains only null values
    Regards
    Anand

  • Nulls in Dates

    We are working with the beta release 3.0c of Forte and 2.0c of express. We
    have several DateTime domain fields for which we need to have nulls carried
    through and updated on the data base. Ideally when the user selects the
    insert button and the new record is initialized we would like to place
    nulls in those fields before the display and then have those nulls
    maintained through the data base update. If the user keys a valid date in
    one or more of those fields then the non-null date values would be carried.
    Conversely, if a date is present we would like to be able to have the user
    delete the date field resulting in nulls being carried forward.
    We have made several attempts to null these date fields
    (PlaceValueInDisplayField, SetValuesInNewRecord, overriding the
    InsertRecordIntoResultSet method, overriding the newobject method) with no
    success.
    Has anyone been successful in nulling date fields? Thanks.

    Donald R. Smith wrote:
    >
    We are working with the beta release 3.0c of Forte and 2.0c of
    express. We
    have several DateTime domain fields for which we need to have nulls
    carried
    through and updated on the data base. Ideally when the user selects
    the
    insert button and the new record is initialized we would like to place
    nulls in those fields before the display and then have those nulls
    maintained through the data base update. If the user keys a valid
    date in
    one or more of those fields then the non-null date values would be
    carried.
    Conversely, if a date is present we would like to be able to have the
    user
    delete the date field resulting in nulls being carried forward.
    We have made several attempts to null these date fields
    (PlaceValueInDisplayField, SetValuesInNewRecord, overriding the
    InsertRecordIntoResultSet method, overriding the newobject method)
    with no
    success.
    Has anyone been successful in nulling date fields? Thanks.gbkhor wrote:
    1. Create a new domain class say, NewDateTimeNullable which superclass
    is DateTimeNullable.
    2. At the NewDateTimeNullable Init() method, do Self.IsNull = TRUE this
    will set the initial value to null.
    Ideally when the user selects the insert button and the new record is initialized we would like to
    place nulls in those fields before the display and then have those nulls maintained through the data
    base update.3. At the Application modal(Express), for all the datetime class which
    would like to behave like you mention above, change the data type to
    NewDateTimeNullable.
    If the user keys a valid date in one or more of those fields then the non-null date values would be carried.
    Conversely, if a date is present we would like to be able to have the user delete the date field resulting
    in nulls being carried forward.4. Upon insertion or save do check
    - If Variable.IsNull then
    else If Variable.IsEqual('') then
    Variable.IsNull = TRUE;
    end if;
    end if;
    Hope this will help.
    My URL http://www.geocities.com/Hollywood/Lot/3985/
    BASS Consulting Sdn. Bhd.
    8th Floor, Menara SMI,
    6 Lorong P. Ramlee,
    50250 Kuala Lumpur,
    West Malaysia.
    Tel. (603) 2305588 ext. 995
    Fax. (603) 2019403

  • How to handle multiple fields data

    Hi All,
    My data is :
    FldName           FldTypeCode          Text
    Sandya            02                         nothing
    Raj                 01                         12/Oct/2008
    Lokesh            03                          12546
    Harish             04                          12565.35
    King                01                          12/Nov/2007
    Cobra              02                          texttype In the UI I have give with refcursor all three fields data. now from UI to DB he is passing all values to update at a time.
    Q) Now My question is How to update all the values.
    Eg: Create procedure procdname (ip_allvalues in typerecord)
    is
    begin
    --statements;
    end;
    the above procedure input parameter can handle all three fields data when they pass,
    1) If the parameter handles, which type i need to create ?
    2) How i need to update multiple records at a time?
    Please can any body...
    Thanks in advance..

    sanjuv wrote:
    In the UI I have give with refcursor all three fields data. now from UI to DB he is passing all values to update at a time.
    Q) Now My question is How to update all the values.With an update statement. Identify the row with a where condition and then set the new values. That's one of the first reasons why primary keys are used.
    1) If the parameter handles, which type i need to create ?
    2) How i need to update multiple records at a time? If you don't explain how you User Interface is designed to work nobody can tell you anything about it. Anyway for such things there is no need to define any type.
    Usually the application should submit an update command(like the following one) for each row to update.
    update <table_name>
         set field_1= <value1>,
              field_2= <value2>
              field_n= <valuen>
    where <primary key column> = <primary key value of the row to update>Bye Alessandro
    Edited by: Alessandro Rossi on 6-ott-2008 16.37

  • How to calcaulate the text field data

    hi frnds need help,
    how to find difference bet time if i taking  the data  from texts fields data i.e long text
    i called the FM & passed the parameters
    of text data but iam gettin answer as zero
    i hope ur gettin my point

    Hi
    You have to use READ_TEXT fun Module to fetch the Long text data by passing the correct paramters like OBJECT,ID,OBJECTNAME and LANGuage fields
    see the doc
    READ_TEXT
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Save pdf as custom filename using field data

    Hi folks, I'm not very knowledgable in JavaScript and I'm hoping to get pointed in the right direction. I will give a brief description of what I hope to accomplish.
    I have a pdf form that is to be filled out for equipment inspection.  Once all the fields have been completed I would like the user to click on a save button that will save the pdf into a subfolder with a file name such as
    equipmentTYPE-equipmentID-date-pass.pdf
    where equipmentTYPE and equipmentID are text fiels and pass/fail are radio buttons (I already have the form built, except for the save button).  I would also like for the saved pdf to have the user rights removed.
    Any help with this would be greatly appreciated! I don't know yet how big or challenging this task will be.  Is it something that can be accomplished soley in Acrobat with javaScript?

    First of all, you cannot automate the removal of usage rights, so that part is out. You can save a file to an existing directory and build the file name based on form field values, but the code that does the saving has to be included in a folder-level JavaScript file on each user's macine, as explained in the following tutorial: http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

  • Reflection errors in Field Data Edit Scripting context(Line Item class)

    Hello Experts,
    I have a script that does some validation in the Field Data Edit Scripting context of the "Line Item" class, and I  have "MATERIAL" as my target. when i try throwing an Application Exception in this context I get a reflection error message box instead of the message I have passed to the Application Exception constructor.
    your help will be greatly appreciated.
    kind regards,

    One thing to be aware of is that no matter how you choose to construct your exception in field, field data edit and collection scripts, the attribute is always set to the be the taget field/collection. Have you noticed that? The script designers made things that way. What's going on here is that the exception raised in the Interprer is caught by the Script Manager and rethrown with the script target as the attribute and your raised exception as the exception.
    One other thing I would point out is that scripts set to execute on the Collection Member Lifecycle event tend to be poor performers.  You can get a faster result if you edit whole collection and chain the errors onto one ChainException. I can only speculate as to why, but I have seen major improvements in complex scripts if I iterate the whole collection, versus implementing a collection memeber lifecycle validate event. This is counter-intuitive, but there it is.
    Finally, exceptions raised in Collection Lifecycle Events that interupt the overall save process in the prescence of parent document Lifecycle Validation events can result in partially saved data. I observed this issue a few years back and it may be resolved now. The only member lifecycle event I use is Created, to lock, default, etc.
    So, for your particular problem, you may want to rethink your strategy and see if you can get things to work for you bypassing that reflection issue. If you still can't raise the exception on MATERIAL, maybe you can raise it on another field, because another advantage of this approach is that you have full control to raise any error on any field on the Line Items.

  • How can L identify what are the not null fields of a table in a stored procedure ?

    How can L identify what are the not null fields of a table in a stored procedure ?

    You could query the data dictionary:
    SELECT column_name
    FROM all_tab_columns
    WHERE owner = '...'
    AND table_name = '...'
    AND nullable = 'N'

  • Retrieve data passed in session from another application in visual jsf

    hi,
    I'm using jboss 4.2.2, visual jsf, etbeans 6.0.1
    My application needs to read the data passed in session from the calling application.
    i try to get it using the below in init()
    HttpServletRequest request=(HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
    String value=(String) request.getAttribute("id");
    System.out.print(value);
    But it always prints null.
    any idea??
    Thanks.

    Hi,
    My value is still null.
    I created a simple web application. In the jsp page, ==>
    <form method="post" action="http://localhost:8080/MyApp/">
    <input type="hidden" name="username" value="ME"/>
    <input type="submit" value="Submit" name="Submit"/>
    </form>
    In MyApp, which is a Web application with Visual JSF, in the welcome file init() method, i get the values ==>
    String value = (String) FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("username");
    System.out.print("request value in welcome page init() = " + value);
    Fearing loss of data by request, i tried in session too. But no luck.

  • UIX/BC4J: messageTextInput nulls out data.

    I switched a page from the use of messageInput to messageTextInput. This was so I would be able to control the attributes of the field better. However, now when I select Update instead of saving the new data it deletes it from the database. messageInput works messageTextInput nulls the data in the database.
    I tried setting the id value according to the note "UIX XML-BC4J: Bug on messageTextInput" but this did not solve my problem.
    Here is an example of one of the fields I changed:
    <!-- <bc4j:messageInput attrName="NOTES_GEN" /> -->
    <bc4j:messageTextInput id="genNotes"
    attrName="NOTES_GEN"
    prompt="Notes"
    columns="75"
    rows="4"
    maximumLength="1000"
    wrap="hard"/>
    Any ideas?

    We aren't properly defaulting the "name" attribute
    of <bc4j:messageTextInput> in the same way that we
    default it for <bc4j:messageInput>.
    So, set the "name" to match "attrName":
    <bc4j:messageTextInput id="genNotes"
    attrName="NOTES_GEN"
    name="NOTES_GEN"
    etc...
    />
    This has been fixed since 9.0.3 (the "name" problem,
    but unfortunately not the "id" problem).

  • Invoice posting from SRM system -ECC mandatory fields data need to be fille

    Dear Experts,
    I am creating an invoice from external system(SAP SRM) and generates an IDOC in SRM and same is sent to ECC. In ECC for creating invoice we have two mandatory fields house bank(hbkid) and section code(secco). These fileds data is not coming from SRM IDOC so i need to pass these fileds data before posting the IDOC.
    I am using EXIT_SAPLMRMH_015 for passing these fields data. I tried to debug the exit but it is not stopping.
    I written the below code for this but still data is not filling . I request you to give me your suggestions on this.
    DATA: S_RBKPV TYPE MRM_RBKPV OCCURS 0 WITH HEADER LINE.
    DATA: W_SCACD LIKE LFA1-SCACD.
    S_RBKPV = E_RBKPV.
    IF E_RBKPV-LIFNR IS NOT INITIAL.
    SELECT SINGLE SCACD FROM LFA1 INTO E_RBKPV-SECCO WHERE LIFNR = E_RBKPV-LIFNR.
    SELECT SINGLE VBANK FROM ZMM_HOUSEBANK INTO E_RBKPV-HBKID WHERE BUKRS = E_RBKPV-BUKRS
    AND GSBER = E_RBKPV-GSBER.
    IF SY-SUBRC EQ 0.
    E_CHANGE = 'X'.
    ENDIF.
    ENDIF.
    Regards,
    Ravi

    Identified the EXIT and working on EXit.
    Thanks
    Ravi

  • Custom fields data in mm02/mm03 is not showing

    Hi,
      My requirement is to add custom fields to mm01 and update the database.but at the same time if i check the material in mm02/mm03 the custom field data also should show.
    iam able to update database.my custom fields data is not showing if iam checking in mm02/mm03.
    Please help me how can i do this.
    Thanks in advance,
    Neelima.N

    Hi folks,
      can u please help me out.
    By the following code i can able to display the data in mm02/mm03.but my problem is the last created customer field(model) data is showing for all the materials.
    for eg matnr-10 model -xx.
             matnr-20 model-yy.
      if iam checking in mm02/mm03 for matnr-10 model-yy it is displaying.in database it is updating correctly.
    can  u please tell me how can i write a code to select the zfield data for that particular material.
    Module get_data.
    if sy-tcode = 'MM02'.
        select single model into mara-model from mara
                  where matnr is not null.
    elseif sy-tcode = 'MM03'.
        select single model into mara-model from mara
                  where matnr is not null.
      loop at screen.
      if screen-name = 'MARA-MODEL'.
       screen-input = 0.
       modify screen.
       ENDIF.
      endloop.
    endmodule.
    Thanks,
    Neelu.
    Edited by: neelima natta on Feb 26, 2009 2:02 PM

  • Searching paricular field data using servlet programme

    **How can we search particular field data using servlet programming.**
    **Any one can give code**

    maneeshsahu wrote:
    **How can we search particular field data using servlet programming.**Field? In what?
    **Any one can give code**Sure:
    public class FieldSearcher extends HttpServlet
           public void doGet(HttpServletRequest req, HttpServletResponse resp)
                 String fieldName = req.getParameter("field");
                 if (field != null)
                     // put your "field search" code in here.
    }%

  • Include those records that have Null End Dates

    I have to pull a report that show those who are currently working so we are assuming those with no End Dates are still working. When I put '0' or '0/0/00' for the End Date I get an error stating I need to put in a date.
    How do I only include those records that have Null End Dates? Ultimately I need a count of those currently employed. So I'm assuming once my report only shows those records I can add a running total field.
    I have Crystal XI.
    Thanks

    Try entering some default value for null like enter a default date "1/1/1900" which means that the end date is null.
    Now in the record selection write the condition like this
    if {?EndDateParameter}=date(1900,1,1) then
    (isnull(datefield)=true or totext(datefield)="")
    else
    datefield={?EndDateParameter}
    Regards,
    Raghavendra

  • Key Fields, Data Fields, Key Figures and Characteristis, Dimesions & Key Fi

    Hi All,
    Can any one please describe more about the below terms and with the Example....
    Like when we identify which one is Key filelds and Data fileds, how to distingush creating new dimesions (Is it based on user reporting) Key figures in Dimestions...
    DSO/ODS:  Key fields, Data Fields
    InfoCube: Dimensions, Key Figures
    Infoobjects: Key figures, Characteritics
    Regards,
    Prem

    Hi,
    Search through SDN for more information on these concepts,
    Re: ods data fields or key fields?
    Re: Key Fields and Data Fields in ODS
    defining Key -field and data fields
    Regards,
    Mani

Maybe you are looking for