How to access url parameters in Action classes Struts 2

后端 未结 4 1463
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 07:39

I\'m new to Java EE and Struts2. I need to know if I\'m doing it wrong or not.

I\'ve got a link like this : http://localhost:8080/myProject/deleteUser?idUser=42

4条回答
  •  我在风中等你
    2020-12-15 07:58

    public class MyAction extends ActionSupport {
        HttpServletRequest request;
        String idUser = request.getParameter("idUser");
        System.out.println(idUser);
    
    }
    

    Try this!

提交回复
热议问题