Home > Back-end >  There is something wrong with the redirection SSM project
There is something wrong with the redirection SSM project

Time:12-04

To gain authorization are redirected to the query conditions, more check out the results in a certain conditions and then to modify the operating results, modify completed will come out all of the queries the database, add operation is the same, check out the results to add information or blank pages will also add information query out all, delete had made a confirmation box, it's no use point to cancel now???


[code=Java]
 
package com. Wh. Controller;

The import org. Springframework. Beans. Factory. The annotation. Autowired;
The import org. Springframework. Stereotype. The Controller;
The import org. Springframework. UI. Model;
The import org. Springframework. Web. Bind. The annotation. RequestMapping;

The import com. Wh. Po. The Book;
The import com. Wh. Service. BookService;

@ Controller
Public class BookController {
The @autowired
Private BookService BookService;

//by many conditions find books
@ RequestMapping ("/findBookByCondition ")
Public String findBookByCondition (Model Model, Book Book) {
Model. The addAttribute (" books, "bookService. FindBookByCondition (book));
Return ". The main JSP ";
}

//add books
@ RequestMapping ("/doAdd ")
Public String doAdd (Book Book) {
BookService. DoAdd (book);
The return of "redirect: findBookByCondition";
}

//by isbn delete books
@ RequestMapping ("/doDel ")
Public String doDel (Book Book) {
BookService. DoDel (book);
The return of "redirect: findBookByCondition";
}


@ RequestMapping ("/doUpdate ")
Public String doUpdate (Book Book) {
BookService. DoUpdate (book);
The return of "redirect: findBookByCondition";
}


}
[/code]

CodePudding user response:

Separation with ajax, or before and after the end, to be honest, redirect the back-end control front-end, poor user experience
  • Related