How to invoke a controller using a html link in Spring-mvc?

Aki008

I have a jsp page called reports.jsp and I have displayed the links in the view for a user to click. How can I invoke Spring controller method by clicking on the link that will pass an argument.

George Ant

You have to use @PathVariable in order to do this. Example:

Jsp:

<a href="<c:url value="/test/${object.argument}" />" >hello</a>

Controller:

@RequestMapping(value = "/test/{argument}", method = RequestMethod.GET)
    public String Controller(@PathVariable("argument") String argument) {
       ...
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to invoke a controller using a html link in Spring-mvc?

From Dev

How to invoke async controller logic after returning response using Spring?

From Dev

How to invoke async controller logic after returning response using Spring?

From Dev

Link and invoke controller method

From Dev

Link and invoke controller method

From Dev

How to invoke a Spring Controller from Java Filter

From Dev

how to receive html check box value in spring mvc controller

From Dev

how to receive html check box value in spring mvc controller

From Dev

In spring mvc, how to link to another jsp using @RequestMapping?

From Dev

How to optimize my code in Spring MVC Controller using @RequestMapping?

From Dev

How to pass multiple values from the form to a controller using Spring MVC?

From Dev

how to link a page in spring mvc

From Dev

how to link a page in spring mvc

From Dev

How parametrize link value in spring controller and thymeleaf?

From Dev

Spring MVC ajax call a controller using

From Dev

using @Controller, @Service, and @Inject in Spring MVC

From Dev

Passing Array of Objects to Controller using Spring MVC

From Dev

Calling MVC Controller Action using Html button

From Dev

Calling MVC Controller Action using Html button

From Dev

Spring MVC, how to generate temporary link

From Dev

Generating link using urlhelper in MVC 6 controller (vNext)

From Dev

Generating link using urlhelper in MVC 6 controller (vNext)

From Dev

How to extend Spring MVC Controller Annotation?

From Dev

Spring MVC How to provide injectable for controller method

From Dev

How to call a Spring MVC controller in jsp

From Dev

Spring MVC: How to return an image from controller?

From Dev

how to get getServletContext() in spring mvc Controller

From Dev

How return error message in spring mvc @Controller

From Dev

How to create a master controller in Spring MVC

Related Related

  1. 1

    How to invoke a controller using a html link in Spring-mvc?

  2. 2

    How to invoke async controller logic after returning response using Spring?

  3. 3

    How to invoke async controller logic after returning response using Spring?

  4. 4

    Link and invoke controller method

  5. 5

    Link and invoke controller method

  6. 6

    How to invoke a Spring Controller from Java Filter

  7. 7

    how to receive html check box value in spring mvc controller

  8. 8

    how to receive html check box value in spring mvc controller

  9. 9

    In spring mvc, how to link to another jsp using @RequestMapping?

  10. 10

    How to optimize my code in Spring MVC Controller using @RequestMapping?

  11. 11

    How to pass multiple values from the form to a controller using Spring MVC?

  12. 12

    how to link a page in spring mvc

  13. 13

    how to link a page in spring mvc

  14. 14

    How parametrize link value in spring controller and thymeleaf?

  15. 15

    Spring MVC ajax call a controller using

  16. 16

    using @Controller, @Service, and @Inject in Spring MVC

  17. 17

    Passing Array of Objects to Controller using Spring MVC

  18. 18

    Calling MVC Controller Action using Html button

  19. 19

    Calling MVC Controller Action using Html button

  20. 20

    Spring MVC, how to generate temporary link

  21. 21

    Generating link using urlhelper in MVC 6 controller (vNext)

  22. 22

    Generating link using urlhelper in MVC 6 controller (vNext)

  23. 23

    How to extend Spring MVC Controller Annotation?

  24. 24

    Spring MVC How to provide injectable for controller method

  25. 25

    How to call a Spring MVC controller in jsp

  26. 26

    Spring MVC: How to return an image from controller?

  27. 27

    how to get getServletContext() in spring mvc Controller

  28. 28

    How return error message in spring mvc @Controller

  29. 29

    How to create a master controller in Spring MVC

HotTag

Archive