日期:2014-05-18  浏览次数:20563 次

获得阅览器信息,提示util can not resolved(急求)
我在apache上看代码,snoop.jsp这个例子程序
<body   bgcolor= "white ">
<h1>   Request   Information   </h1>
<font   size= "4 ">
JSP   Request   Method:   <%   out.print(util.HTMLFilter.filter(request.getMethod()));   %>
<br>
Request   URI:   <%=   request.getRequestURI()   %>
<br>
Request   Protocol:   <%=   request.getProtocol()   %>
<br>
Servlet   path:   <%=   request.getServletPath()   %>
<br>
Path   info:   <%   out.print(util.HTMLFilter.filter(request.getPathInfo()));   %>
<br>
Query   string:   <%   out.print(util.HTMLFilter.filter(request.getQueryString()));   %>
<br>
Content   length:   <%=   request.getContentLength()   %>
<br>
Content   type:   <%   out.print(util.HTMLFilter.filter(request.getContentType()));   %>
<br>
Server   name:   <%=   request.getServerName()   %>
<br>
Server   port:   <%=   request.getServerPort()   %>
<br>
Remote   user:   <%=   request.getRemoteUser()   %>
<br>
Remote   address:   <%=   request.getRemoteAddr()   %>
<br>
Remote   host:   <%=   request.getRemoteHost()   %>
<br>
Authorization   scheme:   <%=   request.getAuthType()   %>  
<br>
Locale:   <%=   request.getLocale()   %>
<hr>
The   browser   you   are   using   is   <%   out.print(util.HTMLFilter.filter(request.getHeader( "User-Agent ")));   %>
<hr>
</font>
</body>
我仿照这个在我的登陆页面做个输出,
<%  
System.out.println( "Remote   address: "+request.getRemoteAddr());
System.out.println( "Remote   host:   "+request.getRemoteHost());
System.out.println( "Locale:   "+request.getLocale());
System.out.println( "The   browser   you   are   using   is   ");
out.print(util.HTMLFilter.filter(request.getHeader( "User-Agent ")));
%>
但是页面提示util   can   not   resolved,我不明白这个对象是什么类型的,还是我少了什么开发包   ??


------解决方案--------------------

------解决方案--------------------
util 写出这个包的完整路径应该就没问题了!!!