skip to Main Content

I have created student registration system in eclipse using spring boot in which there is a main page in which we can add new student(student id,student name,course,and fee).
And there is also edit and delete option through which we can edit or delete students. On clicking on add new option it will take us to another web page where there are text fields to enter student name course and fee and there is a save button on clicking on save button it saves the student in database. After saving student information if we open main page it start showing student information which we have added but problem is on clicking on add new button my browser is not taking me to the web page where I can add student information both the web pages main page and the page where we can add student information are opening seperately.

I have tried to resolve this issue using chatgpt but no success so far. I want that on clicking on add new option it takes us to the page where we can add new student.

2

Answers


  1. Im sorry. Some advice would be to make it a little bit more organized for steps to recreate problem.

    From my understanding

    1st Open main page
    2nd Add student
    3rd Go back to main page, see recently added student
    4th When trying to add a new student, it opens up a new tab to add another student?

    Login or Signup to reply.
  2. Handling links and redirections are handled in the frontend like adding functionalities to button on click and redirections to new webpages, no matter which ever backend tech you are using.
    But if you want your backend endpoint to redirect to the next webpage then you can simply use redirect::path.

    @RestController
    class StudentController {
        @RequestMapping("/add")
        public String redirect() {
            /** any additional code **/
            return "redirect::add-new";
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search