showMessageDialog() method cause the program get stuck in Java Web Project

Litchy

I'm using eclipse to develop a Java Web Dynamic Project. While calling the function:

JOptionPane.showMessageDialog(null, "Invalid Username or Password");

Both in running or debugging, the program will get stuck, and no alert window appears. And the program could never forward.

I'm using Tomcat 8.0 Server in eclipse Java EE to test the project. And the following is a piece of my code:

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    JOptionPane.showMessageDialog(null, "Invalid Username or Password");
}

And the function of doPost is proved to be right. So what's the reason why the program get stuck and how to fix it?

rtaft

JOptionPane is a Swing component, not something you would typically use on a web project. showMessageDialog is a blocking function, which explains why it is stuck. The doPost is server side and will need to return an error to the client. You should not perform UI operations here. The client will have to display the error when the POST is returned with the error in the response.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

showMessageDialog() method cause the program get stuck in Java Web Project

From Dev

Free a pointer to struct cause the program to get "stuck"

From Dev

Project Euler #5 in Java: stuck in the end of program

From Dev

Threading, and why my program seems to get stuck in a single method

From Dev

(Java) Stuck on Method

From Dev

(Java) Stuck on a method

From Dev

Java program is stuck on a specific thread

From Dev

Java Web application thread getting stuck for DB operation at java.net.SocketInputStream.socketRead0(Native Method)

From Dev

program get stuck after psql delete statement

From Dev

Java program stuck in user input loop

From Dev

ArrayIndexOutOfBoundsException and NullPointerException cause problems to my JAVA program

From Dev

Stuck On A Method/Class Reference Issue (JAVA Basic)

From Dev

How to get the root path of a web project in java EE

From Dev

GET not showing the objects Posted which is implemented in java dynamic web project

From Java

Recursive method call cause StackOverFlowError in kotlin but not in java

From Dev

Recursive method call cause StackOverFlowError in kotlin but not in java

From Dev

Java jar execution stuck when launched in a process by another java program

From Dev

Method Global to Project (Java)

From Dev

Get program that is stuck under task bar in Windows 7

From Dev

Java WEB project warnings

From Dev

Java project(Web Application)

From Dev

Java Runtime exec() get stuck after a while

From Dev

Java Runtime exec() get stuck after a while

From Dev

Java Swing Program- Input from GUI to Main getting stuck

From Dev

Java program appears stuck once while loop is entered

From Dev

stuck at 92% "Launching: starting virtual machine" on eclipse java program

From Dev

Java program appears stuck once while loop is entered

From Dev

Java - Stuck on one final point - trying to replay the program

From Dev

VtkRenderWindowInteractor doesn't start and cause program freezes [java]

Related Related

  1. 1

    showMessageDialog() method cause the program get stuck in Java Web Project

  2. 2

    Free a pointer to struct cause the program to get "stuck"

  3. 3

    Project Euler #5 in Java: stuck in the end of program

  4. 4

    Threading, and why my program seems to get stuck in a single method

  5. 5

    (Java) Stuck on Method

  6. 6

    (Java) Stuck on a method

  7. 7

    Java program is stuck on a specific thread

  8. 8

    Java Web application thread getting stuck for DB operation at java.net.SocketInputStream.socketRead0(Native Method)

  9. 9

    program get stuck after psql delete statement

  10. 10

    Java program stuck in user input loop

  11. 11

    ArrayIndexOutOfBoundsException and NullPointerException cause problems to my JAVA program

  12. 12

    Stuck On A Method/Class Reference Issue (JAVA Basic)

  13. 13

    How to get the root path of a web project in java EE

  14. 14

    GET not showing the objects Posted which is implemented in java dynamic web project

  15. 15

    Recursive method call cause StackOverFlowError in kotlin but not in java

  16. 16

    Recursive method call cause StackOverFlowError in kotlin but not in java

  17. 17

    Java jar execution stuck when launched in a process by another java program

  18. 18

    Method Global to Project (Java)

  19. 19

    Get program that is stuck under task bar in Windows 7

  20. 20

    Java WEB project warnings

  21. 21

    Java project(Web Application)

  22. 22

    Java Runtime exec() get stuck after a while

  23. 23

    Java Runtime exec() get stuck after a while

  24. 24

    Java Swing Program- Input from GUI to Main getting stuck

  25. 25

    Java program appears stuck once while loop is entered

  26. 26

    stuck at 92% "Launching: starting virtual machine" on eclipse java program

  27. 27

    Java program appears stuck once while loop is entered

  28. 28

    Java - Stuck on one final point - trying to replay the program

  29. 29

    VtkRenderWindowInteractor doesn't start and cause program freezes [java]

HotTag

Archive