show table deleted message in webpage when it is deleted from database

后端 未结 1 1598
慢半拍i
慢半拍i 2021-01-28 00:39

I\'ve to show errors in backend database or server in frontend. (like table deletion,mismatch password,server connection etc.) I am not getting idea to do this.

I\'ve do

1条回答
  •  深忆病人
    2021-01-28 01:07

    I don't see any code for username/password checking through ajax and neither in the JSP, so can't give an answer for that.

    Now for showing alert when there is no table, have you refreshed the page after you deleted the database table from backend (because I don't see an ajax call that fires of to check for the table other than the catch block)?

    Also I don't think this: JOptionPane.showMessageDialog(null,"Error = " + e.getMessage()); would work in a JSP, instead you can try the following to show the message:

    // your code ...
    <%
            connection.close();
        }
        catch(Exception e)
        {
    %>
    
    Error = <%= e.getMessage() %>
    <% }//end of catch %> // your code continues ...

    You can also put some javascript code which picks up the

    contents and shows an alert after the page has loaded completely.

    If you can paste some code that shows the flow and also some more elaboration as to what you are doing, it would be helpful.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题