首页 \ 问答 \ HTML 标记(HTML tag)

HTML 标记(HTML tag)

我正在阅读Servlet“HellowWorld”教程。 servelet在HelloWorldServelet.java类中定义。 超级简单的输出“地狱世界”消息到客户端请求。 唯一的html文件是下面的“index.html”。 我不明白元标记是如何工作的。 当我在Web服务器中运行该应用程序时,它会自动将此页面与URL一起使用:

HTTP://本地主机:8080 /的HelloWorld /的HelloWorld

属性“http-equiv”和“content”如何与servelet一起工作?

<html>
<head>
<meta http-equiv="Refresh" content="0; URL=HelloWorld">
</head>
</html>

I am reading a Servlet "HellowWorld" tutorial. The servelet is defined in a HelloWorldServelet.java class. Super simple to output "Hell world" message to the client request. The only html file is "index.html" below. I don't understand how the meta tag works. As I run the application in the web server, it automatically this page with the URL:

http://localhost:8080/helloworld/HelloWorld

How the attributes "http-equiv" and "content" work together with the servelet?

<html>
<head>
<meta http-equiv="Refresh" content="0; URL=HelloWorld">
</head>
</html>
更新时间:2022-04-28 17:04

最满意答案

Refresh元标记会自动将浏览器重定向到指定时间后给定的URL。

如果没有看到您正在使用的教程,我无法想象为什么您需要将它用于您的任务。

https://en.wikipedia.org/wiki/Meta_refresh


The Refresh meta-tag automatically redirects the browser to the URL given after the specified amount of time.

Without seeing the tutorial you are using, I can't imagine why you would need to use it for your task.

https://en.wikipedia.org/wiki/Meta_refresh

相关问答

更多
  • @onetwothree - 如果你只是想访问它的内容,它将是这样的。 export class MyComponent implements OnInit{ private appVersion:string; constructor(){ this.appVersion = ""; } // Runs on component creation ngOnInit(){ this.appVersion = this.getMetaDat ...
  • 对于内部网站,没有理由添加description元标记。 这确实适用于搜索引擎的使用,所以除非你使用内部搜索引擎(比如谷歌迷你 ),这完全是不必要的。 从维基百科 - 描述属性 : description属性提供了网页内容的简要说明。 这样,如果搜索引擎无法根据页面内容自动创建自己的描述,则网页作者可以为列表提供比可能显示的更有意义的描述。 (强调我的) For an internal site there is no reason to add a description meta tag. It is ...
  • 您可以使用正则表达式替换您的html标记。 例如, string myContent = Regex.Replace(description, @"<(.|\n)*?>", string.Empty); 或者 - 你可以使用.Net 4.0+的WebUtility.HtmlDecode和旧版本的HttpUtility.HtmlDecode 。 希望能帮助到你 :) You can use regex to replace your html tags. For example, string myCont ...
  • 在任何规范中都没有定义(包括HTML5草案 ) 这是一个可怜的人的版本的一个真正的HTTP标题,应该真的在标题中表达。 例如: Content-language: es Content-type: text/html;charset=UTF-8 它表示,该文件是面向西班牙语的人士(但这并不意味着该文件用西班牙语写成,例如,它可 ...
  • 标签必须始终被标签关闭符号> (如果我们忽略某些SGML规则,名义上应用于非XHTML HTML但从未在浏览器中实现)。 你的意思是要求这些元素是否需要由结束标签来关闭。 答案是非XHTML HTML(包括HTML序列化中的HTML5), meta标签和link元素不需要或允许使用结尾标签。 然而,实际上,如果您使用浏览器,那么浏览器只会忽略它们的显式结束标记,以及货物崇拜/之前的。 而且,即使正式允许/在HTML序列化中,HTML5也使得这种允许性成为规则。 在XHTML中,XML规则适用,所以每个元素无 ...
  • 实际上,只要保留元标记就可以了。 即使验证者抱怨,它也不会对任何使用您网站的人产生任何影响。 In practice, just leave the meta tags as they are. Even if the validator complains, it doesn't make a single bit of difference to anyone using your website.
  • 它将始终返回true,因为querySelectorAll在0匹配的情况下返回一个空数组。 文档 您可以使用NodeList对象的length属性来确定与指定选择器匹配的元素的数量 尝试这个: if (document.querySelectorAll('meta[content="This is not an apple"]').length > 0) { alert('Its here!'); } else { alert('Its not here') } ...
  • Razor对html进行编码以防止xss攻击。 所以你必须明确告诉剃须刀不要编码html标签。 而不是@Html.Raw(robots) @robots你会在这里使用@Html.Raw(robots) 有关xss预防的更多信息可以在这里找到 Razor encodes html to prevents xss attacks. So you'll have to explicity tell razor not to encode the html tags. Instead of @robots you' ...
  • EJS可能是最简单的,与PHP非常相似。 您还可以使用Mustache和Handlebars查看其他选项,只需对现有HTML进行最少的更改。 与EJS: <%= yourMetaTags %> ... 与胡子: {{ yourMetaTags }} ... 使用把手: {{ yourMetaTags }} ... doT.js也非常快。 看到: http://www.embeddedjs.com/ https://mustache.gi ...
  • HTML 标记(HTML tag)[2022-04-28]

    Refresh元标记会自动将浏览器重定向到指定时间后给定的URL。 如果没有看到您正在使用的教程,我无法想象为什么您需要将它用于您的任务。 https://en.wikipedia.org/wiki/Meta_refresh The Refresh meta-tag automatically redirects the browser to the URL given after the specified amount of time. Without seeing the tutorial you a ...

相关文章

更多

最新问答

更多
  • 在csproj中使用appdata环境变量(Use appdata environment variable in csproj)
  • 从背景返回后,Skobbler Map崩溃(Skobbler Map crashes after returning from background)
  • 如何保持对绑定服务的轮询?(How to keep polling a bound service?)
  • ASP.NET单选按钮jQuery处理(ASP.NET radio button jQuery handling)
  • Linux上的FORTRAN图形库(FORTRAN graphic library on Linux)
  • 我们如何根据索引更新dynamodb表(不基于primary has和range key)(how can we update dynamodb table based on index(not based on primary has and range key))
  • 功能包装避免重复(wrap of functions avoid duplicating)
  • Android BroadcastReceiver和Activity.onPause()(Android BroadcastReceiver and Activity.onPause())
  • 无法使用phonegap 2.4在Android上播放录音(unable to play audio recordings on android using phonegap 2.4)
  • VS2015 + Resharper:不要使用C#6(VS2015 + Resharper: Don't use C#6)
  • 大学电脑四级对初学者来说要多久能过
  • 特殊字符删除?(Special characters remove?)
  • Android视频教程现在网上的都比较零散呢?有些太坑爹了,感觉老师就是在想当然的讲
  • 计算同一个表中不同行之间的差异[重复](Calculate delta's between different rows in same table [duplicate])
  • Javaweb开发,技术路线是什么?该怎么写?
  • JavaScript只在php代码中执行一次(JavaScript only executes once inside php code)
  • 不兼容的字符编码:ASCII-8BIT和UTF-8(incompatible character encodings: ASCII-8BIT and UTF-8)
  • Clojure(加载文件)给出错误(Clojure (load-file) gives an error)
  • 为具有瞬态scala依赖性的spring-xd项目优化gradle(Optimize gradle for spring-xd project with transient scala dependency)
  • 如何才能在Alpha测试模式下发布我的应用程序?(How can I publish my app in Alpha test mode only?)
  • “没有为此目标安装系统映像”Xamarin AVD Manager(“No system images installed for this target” Xamarin AVD Manager)
  • maven中的Scalatest:JUnit结果(Scalatest in maven: JUnit results)
  • 使用android SDK将文件直接上传到存储桶中的文件夹(Upload a file directly to a folder in bucket using android SDK)
  • 是否应将plists导入CoreData?(Should plists be imported to CoreData?)
  • java.lang.reflect.InvocationTargetException JavaFX TableView(java.lang.reflect.InvocationTargetException JavaFX TableView)
  • 根据唯一列值动态创建多个子集(Dynamically create multiple subsets based on unique column values)
  • 使用CSS可以使HTML锚标签不可点击/可链接吗?(Is it possible to make an HTML anchor tag not clickable/linkable using CSS?)
  • 嵌套的模板可能性(Nested template possibilities)
  • 任何方式在iOS7 +上以编程方式打开蓝牙(Any way to turn on bluetooth programmatically on iOS7+)
  • 如何为给定的SQL查询编写JPA查询(How I can write JPA query for given SQL query)