java - 如何从 JSP 页面返回到 index.html(登录页面)?

标签 java html jsp web-applications servlets

我从这里开始:

enter image description here

使用该代码:

<!DOCTYPE html>
<html>
<head><title>Bank application</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<table class="title">
  <tr><th>Web Bank application</th></tr>
</table>

<br/>
<fieldset>
  <legend>Login Page - please enter your Username and Password</legend>
  <form action="loginPage"> 
    Username: <input type="text" name="username"><br>
    Password : <input type="text" name="password"><br>
    <input type="submit" value="Login">
  </form>
</fieldset>

<br/>
<br/>
<br/>

<fieldset>
  <legend>Registration</legend>
  <form action="register"> 
    First name: <input type="text" name="firstName"><br>
    Last name : <input type="text" name="lastName"><br>
    Address   : <input type="text" name="address"><br>
    ID-number : <input type="text" name="idnumber"><br>
    User-Name : <input type="text" name="userName"><br>
    Password  : <input type="text" name="password"><br>
    <input type="submit" value="Register">
  </form>
</fieldset>

<br/>
<br/><br/><br/><br/><br/><br/>
</body></html>

当我从一个页面移动到另一个页面时,我到达了这里:

enter image description here

使用该代码:

<!DOCTYPE html>
<html>
<head><title>Authentication failed - a problem has occurred!</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<h1>Sorry , but you are not registered to our bank!</h1>

<fieldset>
  <legend>Please press here to continue</legend>
  <form action="goingBack"> 
    <input type="submit" value="Press here">
  </form>
</fieldset>

</body></html>

我想回到 index.html - 程序启动时我看到的第一页(上面的第一张图片)。

我该怎么做?我怎样才能转发回 index.html

问候

最佳答案

只需在最后一个 HTML 中添加指向上一页的链接即可:

<!DOCTYPE html>
<html>
<head><title>Authentication failed - a problem has occurred!</title>
<link rel="stylesheet"
      href="./css/styles.css"
      type="text/css"/>
</head>
<body>
<h1>Sorry , but you are not registered to our bank!</h1>

<fieldset>
  <legend>Please press here to continue</legend>
  <form action="goingBack"> 
    <input type="submit" value="Press here">
  </form>
</fieldset>

 <a href="index.jsp">Go Back</a> <!-- add this -->

</body></html>

关于java - 如何从 JSP 页面返回到 index.html(登录页面)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11842267/

相关文章:

java - 带路径的圆顶角

java - 类文件常量池中缺少类

java - 为什么集合的未定义泛型类型默认为 Object,即使绑定(bind)到其他类也是如此?

javascript - 如何创建减号和加号按钮来更新字段?

html - 使用 wget 作为地址,其中包括 #

Javascript 鼠标悬停事件 Acting Squirrely

java - 让文本转语音工作并将其连接到 java

java - 如何根据 Struts 2 中的提交按钮将用户重定向到不同的页面

javascript - 通过单选按钮选择一行时,将一行数据复制到同一页面的文本字段

mysql - 将 jsp 变量设置为链接 id 的值