【问题标题】:i want to read the content of html and i need to change it with the required text我想阅读 html 的内容,我需要用所需的文本来改变它
【发布时间】:2018-01-19 17:34:03
【问题描述】:

<!DOCTYPE html>
<html>
<head>
  <meta charset="ISO-8859-1">
  <title id="title1">Amazon Home</title>
</head>
<body>
  <p id="p1">Hello World</p>
  <form action="Translate" method="post">
    <label id="l1">UserName</label><input type="text" name="uid"></br></br>
    <label id="l2">Password</label><input type="password" name="pwd"></br></br>
    <input type="submit" value="submit" id="sub">
  </form>
  <p id="p2">Some text here</p>
</body>
</html>

如何将上述 html 的内容(例如 Amazon Home、Hello World、用户名、密码、提交、此处的一些文本)获取到 servlet 或 jsp.... 并且在我的数据库中,我有等效的内容文本另一种语言如下图所示。因此,如果我将这些字符串从 html 获取到任何层,那么我必须用另一个字符串(在我的数据库中)替换内容。 (不使用像document.getElementById("l1").innerHTML="Nom d'utilisateur";)这样的javascript

-----+-------------+-------------------+ | id | f_key | f_value | +----+-------------+-------------------+ | 1 | Hello_World | Bonjour le monde | | 2 | UserName | Nom d'utilisateur | | 3 | Password | mot de passe | | 4 | submit | soumettre | | 5 | Amazon_Home | Amazon Accueil | +----+-------------+-------------------+

【问题讨论】:

  • &lt;form action="&lt;url_to_servlet&gt;" method="post"&gt;

标签: java html mysql jsp


【解决方案1】:

在 jsp 中使用资源包根据您的情况更改文本

【讨论】:

  • 对于 ResourceBundle 需要使用 .properties 文件,但我没有使用 .properties 文件
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-07-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-16
  • 1970-01-01
相关资源
最近更新 更多