How to access url parameters in Action classes Struts 2

后端 未结 4 1465
佛祖请我去吃肉
佛祖请我去吃肉 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 08:00

    Well, I'm not a Struts expert, but what I do in my Struts 2.2 project (and it works ok) is:

    String paramValue = ServletActionContext.getRequest().getParameter("paramName");
    

    Here paramName would be "idUser".

提交回复
热议问题