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-11-05 22:11

满意答案

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

相关问答

更多

如何从静态HTML页面读取数据,例如元标记?(How can I read data from my static HTML page, such as the meta tag?)

@onetwothree - 如果你只是想访问它的内容,它将是这样的。 export class MyComponent implements OnInit{ private appVersion:string; constructor(){ this.appVersion = ""; } // Runs on component creation ngOnInit(){ this.appVersion = this.getMe...

HTML:元描述标签的用途(HTML: Meta description tag's uses)

对于内部网站,没有理由添加description元标记。 这确实适用于搜索引擎的使用,所以除非你使用内部搜索引擎(比如谷歌迷你 ),这完全是不必要的。 从维基百科 - 描述属性 : description属性提供了网页内容的简要说明。 这样,如果搜索引擎无法根据页面内容自动创建自己的描述,则网页作者可以为列表提供比可能显示的更有意义的描述。 (强调我的) For an internal site there is no reason to add a description meta tag. I...

如何在视图MVC中删除元标记的html标记?(How to remove html tag of meta tag in view MVC?)

您可以使用正则表达式替换您的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 m...

用于内容语言的HTML元标记(HTML meta tag for content language)

<meta name="language" content="Spanish"> 在任何规范中都没有定义(包括HTML5草案 ) <meta http-equiv="content-language" content="es"> 这是一个可怜的人的版本的一个真正的HTTP标题,应该真的在标题中表达。 例如: Content-language: es Content-type: text/html;charset=UTF-8 它表示,该文件是面向西班牙语的人士(但这并不意味着该文件用西班牙语写成,...

您需要在HTML中关闭元标记和链接标记吗?(Do you need to close meta and link tags in HTML?)

标签必须始终被标签关闭符号> (如果我们忽略某些SGML规则,名义上应用于非XHTML HTML但从未在浏览器中实现)。 你的意思是要求这些元素是否需要由结束标签来关闭。 答案是非XHTML HTML(包括HTML序列化中的HTML5), meta标签和link元素不需要或允许使用结尾标签。 然而,实际上,如果您使用浏览器,那么浏览器只会忽略它们的显式结束标记,以及货物崇拜/之前的。 而且,即使正式允许/在HTML序列化中,HTML5也使得这种允许性成为规则。 在XHTML中,XML规则适用,所以...

HTML5:验证未注册的标记的“正确”行为是什么?(HTML5: What is the “correct” behavior for validation of unregistered tags?)

实际上,只要保留元标记就可以了。 即使验证者抱怨,它也不会对任何使用您网站的人产生任何影响。 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.

你如何检查是否存在使用JavaScript的HTML元标记?(How do you check if a html Meta tag exist using JavaScript?)

它将始终返回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') } <head...

使用剃刀在HTML页面标题中输出元标记(Output meta tag in html page header using razor)

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...

使用Express动态地将元标记注入HTML(Inject meta tag dynamically to HTML with Express)

EJS可能是最简单的,与PHP非常相似。 您还可以使用Mustache和Handlebars查看其他选项,只需对现有HTML进行最少的更改。 与EJS: <html><head><%= yourMetaTags %> ... 与胡子: <html><head>{{ yourMetaTags }} ... 使用把手: <html><head>{{ yourMetaTags }} ... doT.js也非常快。 看到: http://www.embeddedjs.com/ https://mustac...

HTML 标记(HTML tag)

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 ...

相关文章

更多

HTML meta标签

meta标签 :属性标签 . 网页元标签 &lt;meta http-equiv=&quot;Con ...

HTML 排版标记

HTML 排版标记包括换行、hr(横线)、p(段落)、pre等 示例: &lt;html&gt ...

HTML 字体标记

标题标签 &lt;hn&gt; ==&gt; n的取值范围是1~6; 1.1~6从大到小. ...

关于微信公众号内嵌网页的几个meta标签

最近在做微信公众平台内嵌app,其实也就是web app=&quot;=,不过就是基于微信内置浏览器( ...

删除Hbase的META中多余表项

由于操作HBase比较粗犷,有时直接在Hadoop中删除hbase对应的表,导致.META.中还记录着 ...

在HTML中使用javascript

1&gt;页面中直接在script标签中书写 &lt;html&gt;&lt;head&gt;&lt; ...

HTML转义标签

空格 空格是 HTML 中最普通的字符实体。 通常情况下,HTML 会裁掉文档中的空格。假如你在文档 ...

在html使用CSS的方式

结合方式01: 在标签上加入style属性. 属性的值就是css代码. 示例: & ...

html适应手机

微信公众账号开发,用php echo 'html字符串'。发现微信浏览器不能正常加载页面,字体过小,且 ...

HTML5 Video元素【HTML5教程 - 第三篇】

现代互联网中,我们大量的使用视频,在HTML5定义中提供了一个统一的方式来展示视频内容。浏览器支持 首 ...

最新问答

更多

绝地求生、荒野行动、香肠派对 哪个更好玩???(都是吃鸡类游戏)

PC上的绝地求生,是最早也是最火的大逃杀游戏。 荒野行动是网易抄袭蓝洞绝地求生制作的手游。相似度90%,还有他一起出的终结折2,这2款正在被蓝洞告,打官司呢。 手游上的绝地求生有2部都是蓝洞授权(收钱)给腾讯开发的正版ID手游。所以跟PC上做的一模一样,蓝洞也没话说。 加上吃鸡国服也是腾讯独家代理,所以根本没有什么可说的。只要这个类型的 过于相似的,腾讯都可以借蓝洞之手起诉。打压同行是国内BAT最爱干的事嘛! 香肠派对画风虽然不一样,但核心玩法还是跟人家正版的一样的,同样也是没有被授权的。 98

如何在jQuery集合中选择第n个jQuery对象?(How to select the nth jQuery object in a jQuery collection?)

你可以使用eq : var rootElement = $('.grid').find('.box').eq(0); rootElement.find('.a'); /* Use chaining to do more work */ You can use eq: var rootElement = $('.grid').find('.box').eq(0); rootElement.find('.a'); /* Use chaining to do more work */

ASP NET使用jQuery和AJAX上传图像(ASP NET upload image with jQuery and AJAX)

您可以自己手动设置FormData键和值。 Upload 创建FormData并设置新的键/值 $("#btnUpload").on("click", function(e) { e.preventDefault(); var file = $("#imguploader").get(0).file

SQL Server XML查询中包含名称空间的位置(SQL Server XML query with namespaces in the where exist)

您可能希望使用#temp.identXml.query而不是#temp.identXml.query 。 您可以在这里阅读更多相关信息SQL Server XML exists() 我相信你也可以像这样使用它 Select #temp.identXml.value('(/*:PersonIdentity/*:MasterIndexes/*:PersonIndex/*:SourceIndex)[1]','varchar(100)') as Ident ,#temp.identXml.value(

宁夏银川永宁县望远镇哪里有修mp5的?

胜利街有家电维修,电脑城,银川商场多得很…

我想用更新的日期标记所有更新的行(I would like to mark all updated rows with the date that they have been updated)

您可以使用更新后触发的触发器来执行此操作。 给出如下表: create table your_table (id int primary key, val int, last_update datetime) 每当您更新表中的内容时,此触发器将设置last_update值。 CREATE TRIGGER trigger_name ON your_table AFTER UPDATE AS BEGIN UPDATE your_table SET your_ta

郑州会计培训班

招生的,至于时间吗,就看你自己的时间段了,你可以致电0371-63300220.他们会帮你选择一下的。离你最近,最专业的培训班。

如何定位数组中的负数,并得到所有正数的总和?(How to target e negative number from an array, and get the sum of all positive numbers?)

只需创建一个条件来检查它是正数还是负数,然后定义一个空的数组negatives ,如果数字是负数,则将其推到负数组中,如果是正数,则将其添加到sum变量中,请查看下面的工作示例。 function SummPositive( numbers ) { var negatives = []; var sum = 0; for(var i = 0; i < numbers.length; i++) { if(numbers[i] < 0) { negati

在响应图像上叠加网格(Overlay grid on responsive image)

使用两个linear-gradient s,我们可以创建两个简单的线条,然后每隔n%重复一次background-size 。 它看起来像这样: background: linear-gradient(to bottom, #000 2px, transparent 2px), linear-gradient(to right, #000 2px, transparent 2px); background-size: 10%; 两个渐变创建两条相交的线,长度为百分比,如下所示: 使用默认的b

无法让POST在Azure网站上运行(Could not get POST to work on Azure Website)

最后我找到了答案......我不得不删除尾随的斜线! 我使用了“ https://example.com/api/messages/ ”,这将自动产生GET,无论我使用PostAsync还是PostAsJsonAsync。 使用“ https://example.com/api/messages”,GET和POST似乎都运行良好! Finally I've found the answer.... I had to remove the trailing slash! I've used "ht