如何判断页面是否是JSP生成的?
由于有许多编程语言可用于开发 Web 应用程序。在不查看源代码的情况下,有哪些方法可以识别 Web 应用程序是用 Java 编写的?
Since there are many programming languages that can be used to develop a web application. Without looking at the source code, what are some ways to identify that a web application was written in Java?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
可能是 URL 上的
.jsp
扩展名。然而,这并不一定意味着它是一个 JavaServer Pages 脚本(例如,我可以设置 .jsp 文件以在服务器上使用 PHP 进行渲染),也不是每个 JSP 页面都有
.jsp
扩展名(我如果我愿意的话,可以在我的服务器上使用 JSP 进行 .html 渲染,甚至隐藏页面上的扩展名)。Probably a
.jsp
extension on the URL.However, this doesn't necessarily imply it is a JavaServer Pages script (e.g. I could set .jsp files to render using PHP on a server), nor does every JSP page have a
.jsp
extension (I could make .html render using JSP on my server if I liked, or even hide the extensions on pages).大多数时候会有一些提示,但本质上 Web 服务器提供 html 标记,因此可以将其配置为隐藏服务器端的内容。因此,没有明确的方法可以判断一个站点是用 java 编写的。
Most of the times there are a few hints but essentially the web servers serve html markup so it could be configured to hide the server side stuff. So there can be no definitive way of telling that a site was written in java.
检查网址。如果页面以 .jsp 结尾,则它是 Java 服务器页面。另外,检查页面请求的响应标头。可能有一个 X-Powered-By 标头或类似的内容表明它是由 java 提供支持的。
Check the URL. If the pages end in .jsp, it's a Java Server page. Also, examine the response headers on your page request. There may be an X-Powered-By header or something similar that says it's powered by java.
如果 URL 包含扩展名,请查看该扩展名是否为 .jsp、.jsf 或 .jspx。可以隐藏它,但如果它有这些扩展之一,那么可以肯定它是用 Java 编写的。
If the URL contains an extension, see if that extension is .jsp, .jsf or .jspx. It's possible to hide that, but if it has one of those extensions it's a pretty sure bet that it's written in Java.
我认为你找不到它,URL可以像.jsp,.jspx,.do,.action,.zul/.zhtml(zk框架),甚至没有扩展名,例如/servlet/http-header-test。
一种可能的方法(也不应该依赖它)是检查响应的
Server
http-header,以下示例是Tomcat
服务器返回的响应:I don't think you can findout it, the URL can like .jsp, .jspx, .do, .action, .zul/.zhtml(zk framework) and even no extension such as /servlet/http-header-test.
A posible way (should not rely on it too) is check the
Server
http-header of response, the following example is a response returned byTomcat
server:Struts 库喜欢(曾经?)使用 .do 扩展名。
The Struts library likes to (used to?) use .do extensions.