我有3-4个jsp页面,并且iam彼此调用它们。我可以将所有代码保存在一个页面中,但随后它变得复杂起来处理,因此打破了3-4个不同页面中的页面。并且iam成功地能够一个接一个地调用它们。但问题是当我调用这两个页面时页面重叠并且页面长度增加。
<other code above this>
<%@ include file="northern_content.jsp" %>
<%@ include file="southern_content.jsp" %>
<No code after these files are included>
我希望如果我点击一个特定的选项,那么应该加载其中一个(根据点击的选择)。 我怎样才能做到这一点。
答案 0 :(得分:1)
非常简单
<a href="northern_content.jsp">Northern Content</a>
这样,您点击页面,就会进入该页面。这就是你要找的东西吗?
或者你可以点击按钮或任何其他事件处理来写这个,如果你有一个表格
onclick="document.forms[0].action = 'northern_content.jsp'
在这里,您使用javascript来更改表单的操作