I want to display the message in jsp .

I display the data retrieve from the database.if the data base have no record,i want to display a message to user.I write only one jsp.
i used the JOptionPane,first time it takes more time to execute, after it execute normally,i am not satisfy for that.
Please give me some suggestions, but i don't want to refresh the page.
and is it possible to call the javascript function through jsp .

Hi,
Just declare a counter before fetching the resultset data and increment the counter by 1 whenever you get the data and if the counter returns 0 then display your alert message.
For example:
rs = stmt.executeQuery("........");
int iCounter = 0; //initialize the counter
while(rs.next())
iCounter++; //increment the counter
if(iCounter == 0)
out.println("No records to display"); //Display your alert message
Cheers,
Rkanth

Similar Messages

  • Display the message which is in  it_tab

    Hi Experts,
      i want to display the message which is in  it_tab .can you tell me which method is applicable for this.
    READ TABLE it_tab INTO ls_tab WITH KEY usertype = 'PRIV'.
      IF ls_tab-usertype = 'REG'.
      lo_api_controller ?= wd_This->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager.
      ENDIF.
    Thanks in Advance,

    HI,
    You can use REPORT_ERROR_MESSAGE to display the message.
    If you want to highlight the filed use REPORT_ATTRIBUTE_ERROR_MESSAGE.
    These methods are part of IF_WD_MESSAGE_MANAGER  and can be used like this.
    * get message manager
    DATA lo_api_controller     TYPE REF TO if_wd_controller.
    DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
    lo_api_controller ?= wd_this->wd_get_api( ).
    CALL METHOD lo_api_controller->get_message_manager
      RECEIVING
        message_manager = lo_message_manager
    * report message
    CALL METHOD lo_message_manager->report_error_message
      EXPORTING
        message_text             = 'MESSAGE TEXT'
    *    params                   =
    *    msg_user_data            =
    *    is_permanent             = ABAP_FALSE
    *    scope_permanent_msg      = CO_MSG_SCOPE_CONTROLLER
    *    view                     =
    *    show_as_popup            =
    *    controller_permanent_msg =
    *    msg_index                =
    *    cancel_navigation        =
    If tou have the message class name,message number use can use REPORT_T100_MESSAGE
    CALL METHOD lo_message_manager->report_t100_message
          EXPORTING
            msgid = '/MESSAGE CLASS NAME'
            msgno = 237
            msgty = 'E'.

  • Displaying the message in output of BDC program.

    Hi,
    I have developed the BDC program for running the MMPV and MMRV transaction code in that in output want to display the message that for which company code posting is done or some error is occurring. Below shown message is populate in when standard transaction code MP is execute.
    AL O G
    Mode: Check and close period
    Client: 140
    Period entered (month/year): 11 2007
    Incorrect period in control recd. of CoCd 1306; no conversion The current period (month/year) of the control record is 11 2007
    Period closing complete; log issued.
    E N D
    I want like this message to be display in output of the program, currently I am using the function module FORMAT_MESSAGE. It is displaying the message which is appearing on status bar only. I am not able to capture the message which is shown above.
    In this problem can any body can guide me

    I am using the Call transaction method.I use the internal table of 'bdcmsgcoll' in the program but  I am not able to get the message in internal table  other than the message which is appearing on the on the status bar, the message  which I  shown in mail it's an log message which is coming after running the standard MMPV transaction code.
    below shown is the code which I written.
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
             chetan
           W_MESSTAB LIKE BDCMSGCOLL .
          error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
          message texts
    DATA:   session LIKE apqi-groupid VALUE 'X',  " VALUE 'GAN'.
            GROUP TYPE APQI-GROUPID,
            USER TYPE APQI-USERID value 'SY-UNAME',
            KEEP TYPE APQI-QERASE,
            HOLDDATE TYPE APQI-STARTDATE,
            SMALLLOG(1) TYPE C VALUE ' ',
            CTUMODE LIKE CTU_PARAMS-DISMODE VALUE 'N',
            CUPDATE LIKE CTU_PARAMS-UPDMODE VALUE 'L', "'L'
            E_GROUP(12) TYPE C,
            E_USER TYPE SY-UNAME,
            E_KEEP(12) TYPE C,
            E_HDATE TYPE SY-DATUM.
    FORM BDC_TRANSACTION USING TCODE.
      DATA: L_MSTRING(480).
      DATA: L_SUBRC LIKE SY-SUBRC.
      DATA: L_Message(255) TYPE C .
      REFRESH MESSTAB.
      CALL TRANSACTION TCODE USING BDCDATA
                       MODE   CTUMODE
                       UPDATE CUPDATE
                       MESSAGES INTO MESSTAB.
      L_SUBRC = SY-SUBRC.
      IF SMALLLOG <> 'X'.
        LOOP AT MESSTAB.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              ID        = MESSTAB-MSGID
              LANG      = sy-langu
              NO        = MESSTAB-MSGNR
              V1        = MESSTAB-MSGV1
              V2        = MESSTAB-MSGV2
              V3        = MESSTAB-MSGV3
              V4        = MESSTAB-MSGV4
            IMPORTING
              MSG       = L_MESSAGE
            EXCEPTIONS
              NOT_FOUND = 1
              OTHERS    = 2.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.  "'-D'
          ENDIF.
          wa_tab-v_message = l_message.
        ENDLOOP.
      ENDIF.
      REFRESH BDCDATA.
    ENDFORM.                    "BDC_TRANSACTION
    FORM   mmpv_tcode .
      SELECT bukrs lfgja lfmon
      INTO table t_tab
      FROM marv
      WHERE bukrs IN s_bukrs AND
            lfgja IN s_lfgja AND
            lfmon IN s_lfmon.
      IF SY-SUBRC <> 0.
        MESSAGE 'NO TABLE  ENTRY FOUND FOR MMPV' TYPE 'I'.
        Leave list-processing.
        v_check = '1'.
      ENDIF.
    MMPV Program execution of all the company codes using loop.
      LOOP AT t_tab INTO wa_tab.
        perform bdc_dynpro      using 'RMMMPERI' '1000'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'I_LFGJA'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=ONLI'.
        perform bdc_field       using 'I_VBUKR'
                                      wa_tab-bukrs.
        perform bdc_field       using 'I_LFMON'
                                      wa_tab-lfmon.
        perform bdc_field       using 'I_LFGJA'
                                      wa_tab-lfgja.
        IF R_XCOMP = 'X'.
          perform bdc_field       using 'I_XCOMP'
                                        'X'.
        ENDIF.
        IF R_XINCO ='X'.
          perform bdc_field       using 'I_XINCO'
                                      'X'.
        ENDIF.
        IF R_XMOVE = 'X'.
          perform bdc_field       using 'I_XMOVE'
                                        'X'.
        ENDIF.
        IF R_XNEGQ = 'X'.
          perform bdc_field       using 'I_XNEGQ'
                                      'X'.
        ENDIF.
        IF R_XNEGV = 'X'.
          perform bdc_field       using 'I_XNEGV'
                                      'X'.
        ENDIF.
        perform bdc_dynpro      using 'SAPMSSY0' '0120'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=BABA'.
        perform bdc_dynpro      using 'RMMMPERI' '1000'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/EE'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'I_VBUKR'.
        perform bdc_transaction using 'MMPV'.
        wa_tab2-v_code = wa_tab-bukrs.
        wa_tab2-v_fyear = wa_tab-lfgja.
        wa_tab2-v_period = wa_tab-lfmon + 1.
        wa_tab2-v_message1 = wa_tab-v_message.
        APPEND wa_tab2 to t_tab2.
        clear wa_tab2.
      ENDLOOP.
    ENDFORM.                    " mmpv_tcode
    I want that log message is to be displayed in the output.
    Currently I am getting the output like this.
    Report for posting MM period
             Company Code        Financial year                Period open for posting       Message
    I want the message should e display under 'message' coloum.
             1306                2007                          12

  • I want to display the website which i have designed using jsp in telugu....

    Hi,
    I want to display the website which i have designed using jsp,mysql in telugu.I have searched a number of articles but couldn't get sufficient information.I read articles on internationalise jsp based websites but they were about converting in other languages rather than indic languages.
    Could anyone let me know the procedure to convert it into indic languages.What all are required.
    Thanks.

    (Please keep the subject line to a short descriptive sentence. Don't put your entire question there.)
    LabVIEW can communicate via serial port. If the microcontroller listens to serial data, there must be a certain command to light a LED connected to a certain port. All you need is to check the manual to find out what the serial data needs to be.
    LabVIEW Champion . Do more with less code and in less time .

  • Want to display the contents of a text file in a jsp

    hi
    i am new to jsp, i want to display the contents of a text file in a jsp file ,whenever jsp file is loaded from browser.
    -thanx

    i had come up with the code
    <!-- form.jsp -->
    <%@ page import="java.io.*, java.lang.*" %>
    <%@ page language="java" %>
    <html>
    <head>
    <title>Display</title>
    </head>
    <body>
    <%
    String sample[100];
    String line;
    %>
    <%! int i=0; %>
    <%!File f1 = new File("c:\\file.txt"); %>
    <% try { %>
    <%!FileReader fi = new FileReader(f1); %>
    <% } catch(FileNotFoundException io) { } %>
    <%!BufferedReader in = new BufferedReader(fi); %>
    <%
    while((line=in.readLine())!= null)
    sample= line;
    i++;
    in.close();
    %>
    i will display sample here
    </body>
    </html>
    but i am getting error
    display_jsp.java:16: unreported exception java.io.FileNotFoundException;
    must be caught or declared to be thrown
    FileReader fi = new FileReader(f1);
    ^
    plz help
    -thanx

  • Want to customise the message display by adding extra text in Logon Help forgot password link

    Dear All,
      I am implementing Forgot Password functioanlity or link in my Portal ( SAP EP7.0).I am getting "Logon Problem ? Get Support " link in my Portal welcome page.When I am clicking this link ,I am getting pop up asking me to enter user id and mail id.Everything is working fine.
    But my real concern is I want to customise the message display in case wrong user id or mail id or wrong question answer.
    The current message displaying as "User information incorrect. Cannot send e-mail with new password" and I want to display it as
    "User information incorrect. Cannot send e-mail with new password ,Please contact your Administrator"
    If I will tell in one sentence ,I want to customise the message display by adding extra text
    For example: "User information incorrect. Cannot send e-mail with new password"
    Requirements:"User information incorrect. Cannot send e-mail with new password ,Please contact your Administrator "
    Kindly help em out  how to do it ................
    Thanks,
    Sanjay Mohanty

    Hi,
    Until you have only played around with the layout of the logon page and not the actual code then you will be able to use this property. There are bits of code in the logon par which retreives these values.
    For eg you can see the below if statement in the logon page to determine if logon help has to be displayed. This is part of standard logo page so if you have not removed this in your custom one everything should work just fine.
    <% if ( logonBean.getLogonHelp() ) { %>
    Also check this link:
    http://help.sap.com/saphelp_nw70/helpdata/en/45/7e6313d8780dece10000000a11466f/frameset.htm
    Regards,
    Vijith

  • Display error message on jsp if there is an exception during pdf generation

    I am displaying pdf from my application and when the pdf document is found, it is displaying properly. Only problem is when the document is not found i want to display the jsp with an error message to the user. I am using IE and IE has a bug that it calls the servlet twice to display pdf. Please refer to this forum and IE bug info.
    http://forum.java.sun.com/thread.jsp?forum=33&thread=302647
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
    Now during the first call to the Servlet i have set the response ContentType
    response.setContentType("application/pdf");I want to change the content type back tp "text/html" before displaying the jsp with the error message. How should i do that. I tried to change the content type by doing response.setContentType("text/html"); in the servlet. But this is not working. I am still getting the same error. which is a diagol box in Acrobat saying "File does not begin with %PDF~"
    Thanks of your help in advance.

    hey u have retrieved pdf from
    blob object in database
    kindly send me that code ya
    thanks in advance

  • How to display the Message Pool Messages in CE 7.2

    Hi Experts,
    Please let me know how to display the Message Pool Messages in CE 7.2.
    I have tried with reportContextAttributeMessage, but it is deprecated in CE 7.2.
    Please do the needful.Its Urgent.
    Thanks & Regards,
    SatheshKumar R

    Hi Sathesh,
    Do the following steps:
    1.) After creating a component, under it you will see Message Pools. Double click and open it.
    2).Click "Add Message" and add a new message. (Give a message key, type of message (either warning, error etc ) and message text).
    3). Save the metadata.
    4). Raise this message where all you want by using following code(For example, on click of a button) :
          IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
          msgnr.reportMessage(IMessage<component name>.<message>,null,true);
    For example, I have a component name TestAppComp and under message pool I have message called message1, then use lik this:
            IWDMessageManager msgnr = wdThis.wdGetAPI().getComponent().getMessageManager();
            msgnr.reportMessage(IMessageTestAppComp.MESSAGE1,null,true);
    Reply me if you any doubt.
    Regards,
    Jithin

  • How sxmb_moni is displaying the messages

    Hi,
    I want to know how sxmb_moni is displaying the error information.
    when messages are listed and we select one error message.If we click error_information button it displays a pop up with detailed errors.
    Can some one please tell me from where it retrieves the messages. is it from any data base table.
    I have debugged standard  program with out any clue

    Hi samir,
    you are right as i am calling the cl_proxy_fault and passing the exception class name.
    But my requirement is can i know where this error messgae will get stored.
    I feel tht unless it stores in database table it will not display the message in sxmb_moni.
    ( Here i am talking about additional error information )
    Please correct if i am wrong
    Edited by: ch_ravi_sap on Feb 17, 2012 12:43 PM

  • Want to display the UDID

    Hi,
    This is my first post on Adobe DPS forum.
    On one page I want to print the UDID of my iPad. But this should be a variable as whenever I open my folio on another iPad it should show the UDID of that iPad. All in all, whenever I open my folio it should display the UDID of the iPad on which I'm opening the folio. Is it possible?
    Thanks in adavance and best regards.
    With regards,
    Anil Yadav

    i don't think you have access to this 'sensitive kind of information'.
    a Google search for "html UDID display" might get you the answer in seconds.
    —johannes
    (mobil gesendet)
    Am 07.10.2011 06:11 schrieb "Anil Yadav" <[email protected]>:
       Re: want to display the UDID  created by Anil Yadav<http://forums.adobe.com/people/Anil+Yadav>in
    Digital Publishing Suite - View the full discussion<http://forums.adobe.com/message/3959005#3959005>

  • Dont want to display Faces Message in JSF Page

    we are using seam framework. In our application user authentication is failed i create one FacesMessage like this
    FacesMessage.instance().add("Login Failed"); but this is displayed in top of the page but i want to display above the username and password field so what i did is i create text above that field .
    <h:outputText value="Login Failed" rendered="#{! empty facescontex.maximumServity}"/>
    Its working properly but the problem is in top of the page Login Failed comes from Faces Meassage is also displayed , i dont want to display that message.So i tried to create an message like
    FacesMessage.instance().add(""); then its not display the text...
    so please any giving suggestion regarding this..
    Thanks in Advance

    Sounds like that there is a <h:messages /> element in the top of the page which indeed shows any facesmessage in the queue. Remove that and use component specific <h:message /> elements only. The way that you're handling facesmessages is also bad, it's like a huge roundabout.

  • HT4061 iTunes will not open when my iPhone 4S is attached to my Mac Book Pro. iTunes will start up but as soon as my iPhone appears in the list of devices the program then quits and displays the message 'iTune Quit Unexpectedly'? Can anybody help?

    The Problem/s
    1. I am unable to sync my iPhone 4S with my Mac Book Pro, either by cable, wifi or bluetooth
    2. iTunes will initiall open and briefly identifies the iPhone in the Device section in iTunes.
    3. When iTunes starts to read the iPhone (displaying the spinning wheel), it immediately then quits and
    4. Opens a 'dialogue box' which displays the message "iTunes Quit Unexpectedly"
    5 The dialoge box offers the following button options to:-
    'Show Details'
    The 'Show Details' button will open and display a list of the 'Problem Details and System Configeration'. To the average user the information is useless, as one doesn't know what to look for to solve the problem. This is a long and detailed report (too long to include in this message), which includes information such as:-
    Crashed Thread:  20
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000006f0
    'OK'
    The 'Ok' button simply quits and closes the dialogue box
    'Reopen'
    The 'Reopen' button will again reopen iTunes, briefly showing that it is trying to read the iPhone in the Devices section, but then returns again to display the same dialogue box.
    Other Information
    1. iTunes will still start normally once the USB cable is removed from the Mac book Pro, but crashes again once the USB cable is reattached to the computer
    Any advice or help offered would be greatly appreciated.
    Sincerely
    Rob
    Message was edited by: Robmanrico

    Hi there anaqeed,
    I would recommend taking a look at the troubleshooting steps found in the article below.
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/ht1926
    -Griff W.

  • How can i display the message

    public class Userdefined extends Exception {
              Userdefined(String sparam){
              System.out.println(sparam);
              Userdefined(){
         private static int acno[]={100,105};
         private static double bal[]={100.00,200.00};
         public static void main(String args[]) {
              try{
              for(int i=0;i<2;i++)
                   System.out.println("ACCCCNO------>"+acno[i]+"BAl------>"+bal);
                   if(bal[i]<150.00)
              Userdefined udexp=new Userdefined("bal less");
              throw udexp;
              catch(Userdefined e){
                   System.out.println("--->"+e);
    How can i display the message "less amt" using my parmeterized constructor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    VinayTK wrote:
    How can i display the message "less amt" using my parmeterized constructor.Erm ... what? You can't --- at least not with the stuff you've got there.
    A properly formed question, with some idea of what you're trying to accomplish would be a huuuuge help.
    Winston
    BTW: Congratulations. At my age, 'first's in computing are rare; but it's definitely the first time I've seen an Exception class with a main() method.
    Edited by: YoungWinston on Sep 1, 2009 9:46 AM

  • Need to display the messages in a view which has the pop up on it

    Hello all,
    I have a view(View 1) in which if i click a button a pop up is being displayed.
    Now on the pop up(which has view 2 of window 2) i have a button(Ok) and if i click it then based on a condition i need to close the pop up and then display the message in the message area of View 1.
    Now if i click the button on the Pop up then it is being closed and the message is not being displayed on view 2.
    I think the message is being displayed on the pop up and is being closed after that.
    How can i display my message on View 1.
    Any ideas...Please help
    Thanks in advance,
    Shravan

    Hi Shravan,
    Create Message area in view1.
    and also give VIEW name wile displaying error message and try.
    *   report message
      CALL METHOD lo_message_manager->REPORT_ERROR_MESSAGE
        EXPORTING
          MESSAGE_TEXT              =
    *      PARAMS                    =
    *      MSG_USER_DATA             =
    *      IS_PERMANENT              = ABAP_FALSE
    *      SCOPE_PERMANENT_MSG       = CO_MSG_SCOPE_CONTROLLER
          VIEW                      =   VIEW1 .
    Cheers,
    Kris.

  • In using mail with my mackbook air with maverick, to open a message takes time as if the message is downloaded & its same every time I want to open the message from inbox.

    In using mail with my mackbook air with maverick, to open a message takes time as if the message is downloaded & its same every time I want to open the message from inbox.

    WoW! I'm surprised by the speed you reply and how serious you are with your answers! Thank you very much guys!!!
    Replying to Toad-Hall:
    I have a proper mailing list created as the manual says. It's a small group of contacts that exist in the address book. I do not type them as CC I just write "clients" and before I finish the word the name of the list appears.
    How can I stop Avast from scanning out going mail? It's the free version and I haven't found a real solution. I also tried to totally turn off the "mail shield" but I kept facing the same issues. However, I just turned it off and tried to send the mail, I didn't restart windows or thunderbird
    The idea with ipage server was fantastic! It would never come to my mind!!! As far as I see, the limit is 250 mails per hour. I doubt if I have ever reached the 50% of it. I also don't reach the bandwith limits... Besides that, if I had exceeded the limit I would get multi responses that "mail was not delivered".
    I want to thank you both for your excellent help so far. I'm sad to say that I still haven't solved the issue. When I made smaller lists, with the same addresses chosen from the address book I could send the messages, having a short delay. I would blame Avast but I tried the same on another laptop with my favourite NOD32 and had the same problem.
    What else should I check? Should I focus on Avast?

Maybe you are looking for

  • Why doesn't search work when I open a PDF in Safari?

    If I download the pdf and open it in Adobe reader, search works OK.  Using cmd-F in Safari opens a search window, but it does not find words that I am able to find in Adobe reader. Is there a way to force Safari to open the file in Reader (new window

  • AP div background image hiding

    I've created an AP div, then used a jpeg for the background image. I placed other AP divs above the background that hold other graphics (linked buttons) On my computer, both in Explorer and Firefox, the background image is visable. I have tested it a

  • Error 1406 when Installing VPN Client

    I am attempting to install a VPN client on a customers computer and getting "Error 1406" and that it doesn't have the ability to access certain registry keys. I am logged in as an administrator in Windows 7 64 bit.  What could be causing this problem

  • Can't Add To Access Control List Airport Express

    We have both Airport Extreme (2) and Express Base Stations (3) to create a wireless network. On the Extremes I can click the Add button in Access Control in the Airport Admin Utility to add people to the list. On all the Express Base Staions I can ed

  • Distributed Objects access control

    When vending a distributed object, I may want the object to be accessible: (1) on the internet (2) only on the local network (3) only on the same machine (4) only to the same user on the same machine (5) only to other threads in the same process Appl