jsp页面和Action互动

xiaoxiao2026-06-21  28

1、从jsp页面中获取参数值 ;form表单;用request对象获取参数;如果放到session里就用session获取

 

2、获取Action中的值:设置:request.setAttribute()

                                获取:request.getAttribute()

3、截取url上的值:  有一个连接<a href="delete.do?method=<%=myuser.getUsername() %>">删除</a>

           点击“删除”的时候,触发Action.java并想把参数传过去,          String username = request.getParameter("method")。  开始是用String username = (String) request.getAttribute("method")来获取,但是没有成功。         说明:request.getQueryString()是获取?号之后的内容。

 

转载请注明原文地址: https://www.6miu.com/read-5050512.html

最新回复(0)