Home > Back-end >  After springboot form is submitted, the controller processing method throws an exception?
After springboot form is submitted, the controller processing method throws an exception?

Time:09-15

Springboot won't play, teach,

Try 1

This way, can get error pages, but behind the location. The href url specified need to spell a lot behind the parameter
Try 2
I tried another way, submit the form directly, this kind of situation, if wrong, page is printed a json string, containing the error information


For regular practice, thank you, how to submit the form, and can receive friendly submitted, but not print json


CodePudding user response:

Remember correctly, the returned json can not directly parsing, xmlHttpRequest [attribute name string]

CodePudding user response:

Springboot simplifies a lot of Ajax, can parse the returned json data directly, with the following the operation

CodePudding user response:

Don't want when you are using ajax behind successful jump page address bar when a large number of parameters, right?

When the form submission, if error to jump back to the form page, form page judgment when you return to the code and the corresponding error MSG silently; Successful forwarding you a list page;

CodePudding user response:

Want to jump, don't respond to json use responsebody or similar annotations, direct server jump not line?

CodePudding user response:

reference 4 floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page is best

CodePudding user response:

reference 5 floor weixin_49498858 reply:
Quote: refer to 4th floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page prompt best

Now that you are again want to AJAX, why want to jump, is I don't understand your needs...

CodePudding user response:

As it is for a while now


If submit error, form page will appear friendly prompt, if submitted successfully, jump to the list page, every time realAction is used to mark the request is successful, submit the form or submit twice to reach the effect
The action address visited twice, ajax, form. Submit a

CodePudding user response:

refer to 6th floor maradona1984 response:
Quote: refer to the 5 floor weixin_49498858 response:
Quote: refer to 4th floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page prompt best

Now that you are again want to AJAX, why want to jump, is I don't understand your needs...


refer to 6th floor maradona1984 response:
Quote: refer to the 5 floor weixin_49498858 response:
Quote: refer to 4th floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page prompt best

Now that you are again want to AJAX, why want to jump, is I don't understand your needs...

May not be clear, is the need to jump of the display list, with ajax this is in order to have a friendly reminder, this kind of writing I am reference an existing code, but it is the code after a successful jump is a static page, now do for a while first, submitted twice

CodePudding user response:

refer to the eighth floor weixin_49498858 response:
Quote: refer to the sixth floor maradona1984 response:
Quote: refer to the 5 floor weixin_49498858 response:
Quote: refer to 4th floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page prompt best

Now that you are again want to AJAX, why want to jump, is I don't understand your needs...


refer to 6th floor maradona1984 response:
Quote: refer to the 5 floor weixin_49498858 response:
Quote: refer to 4th floor maradona1984 response:
want to jump, don't use responsebody or similar response json annotations, direct server jump not line?

Jump straight, mainly with ajax is because there is a calibration must be done, of course you can jump page tip, but not so good, in the original page prompt best

Now that you are again want to AJAX, why want to jump, is I don't understand your needs...

May not be clear, is the need to jump of the display list, with ajax this is in order to have a friendly reminder, this kind of writing I am reference an existing code, but it is the code after a successful jump is a static page, now do for a while first, submitted two

You look like the title of a level framework, content of q is a business processing logic, it is no wonder that I didn't guess is the focus of your question
  • Related