jsp-< c:import/>使用服务器用户名和密码 [英] jsp - <c:import /> with server username and password
本文介绍了jsp-< c:import/>使用服务器用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的jsp页面,试图从另一台服务器访问另一个jsp文件
I have a simple jsp page that is trying to access another jsp file from another server
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:import url="http://our-other-server.com/header.jsp"></c:import>
由于它是我们敏感的质量检查网站,因此受到服务器的密码保护,我可以将用户名和密码作为参数添加到吗?这是另一个站点所在的tomcat服务器.没有凭据,当然会引发500错误
As it's our sensitive QA site it's password protected from the server, can I add the username and password as parameters to ? It's a tomcat server where the other site exists. Without the credentials it throws a 500 error of course
推荐答案
如果您的环境使用HTTP Basic
访问身份验证,则可以基本上在URL上添加凭据,如下所示:
If your environment uses HTTP Basic
access authentication, you can basically add the credentials on the URL as follows:
<c:import url="http://username:password@our-other-server.com/header.jsp" />
- Wikipedia 有关HTTP基本访问身份验证.
- Wikipedia on HTTP Basic access authentication.
这篇关于jsp-< c:import/>使用服务器用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文