在Servlet中有没有办法知道JS是否在浏览器上启用?还想要在浏览器上安装的flash版本。我只想在Servlet上获取所有这些信息。我们需要在最后记录这些信息。
答案 0 :(得分:0)
有办法,
JsServlet
添加无脚本标记
< NOSCRIPT>
< img src="{PATH TO YOUR SERVLET}" >
< /noscript>
从Servlet
编辑:servlet代码为
public class JsServlet extends HttpServlet{
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
/*Write your code that you wan't */
/*You are here means the browser dose not support javaScript*/
BufferedImage buffer = new BufferedImage(1, 1,
BufferedImage.TYPE_INT_RGB);
response.setContentType("image/png");
OutputStream os = response.getOutputStream();
ImageIO.write(bufferedImage, "png", os);
os.close();
}