文件main.jsp中的Javascript
<script>
var form = null;
var item = null;
window.onload = init;
function init(){
form = document.getElementsByTagName('form')[0];
item = document.getElementById("selectedItem"
我反对在单击表单按钮后向控制器servlet发送请求,它需要检查用户是否已登录以及按下了哪个按钮。
第一部分运行得很好,但当我尝试将结果设置为参数并将请求转发到JSP页面时,参数"Button“总是返回null。有没有人能告诉我为什么会这样?也许有更好的方法可以做到这一点?
Servlet:
request.setAttribute("Buttons", "Add a new coupon");
request.getRequestDispatcher("/admin_main.jsp").forward(request,response
我想在两个jsp页面之间传递一个字符串(用户名),
Login.jsp和Details.jsp。
请告诉我怎么做?
I tries this in Login.Jsp
<html>
......
<%
session.setAttribute("key","value");
%>
.....
</html>
In Details.jsp
<html>
......
<%
session.getAttribute("key");
%>
.....
</html>
It
在我的JSP页面中,我在提交页面时使用post方法。因此,一旦我从第1页转到第2页,在第2页中,如果我按F5键,我就会得到警告
"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."
我知道这个问题有点讽刺,但请给我一个主意。我不能将我的方法从POST改为GET,因为我需要发送大量的数据。
提前谢谢..。
编辑:,在我的Page1.JS