Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将外部URL中的标题内容包含到JSP文件中_Html_Jsp_Header_External Url - Fatal编程技术网

Html 将外部URL中的标题内容包含到JSP文件中

Html 将外部URL中的标题内容包含到JSP文件中,html,jsp,header,external-url,Html,Jsp,Header,External Url,有一个来自外部url的标题内容(比如http://sample.com/header.html)。我想在我的jsp文件中包含这个头,实际上我可以在我的jsp页面中看到这个头。当我运行我的jsp页面时,这个标题url应该显示在我的jsp页面的顶部 如果你能帮我,我将不胜感激 <%@ page contentType="text/html; charset=ISO-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/j

有一个来自外部url的标题内容(比如
http://sample.com/header.html
)。我想在我的jsp文件中包含这个头,实际上我可以在我的jsp页面中看到这个头。当我运行我的jsp页面时,这个标题url应该显示在我的jsp页面的顶部

如果你能帮我,我将不胜感激

<%@ page contentType="text/html; charset=ISO-8859-1"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    </head>
        <body>
            <c:import url="https://www.google.com/?gws_rd=ssl"  /> 
         </body>

</html>

您需要在路径中添加taglib

 <%@ page contentType="text/html; charset=ISO-8859-1"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

希望这对您有所帮助。

我们看不到任何URL。你能编辑你的帖子吗?我没有添加特定的url。我的意思是一个链接,点击它,打开一个标题内容。可以是任何标题。但它不会带来css…对吗?我想读完整的cssIt不是这样的,你可以找到有效的URL,不管它是什么。试着让我知道。我在我的原始问题中添加了一个简单的jsp代码,其中包含您的代码…您可以尝试一下,看看css没有通过请告诉我您是否知道问题所在。谢谢不,我没有看到任何错误。你试过我添加的代码来理解我的意思吗?
 <c:import url="http://external.com/some/fragment.html" />
<iframe src="http://www.google.com" style="width: 90%; height: 300px"
scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0">
</iframe>