aspose file tools*
The moose likes Servlets and the fly likes Browser Capabilities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Browser Capabilities" Watch "Browser Capabilities" New topic
Author

Browser Capabilities

Jothi Pandyan
Greenhorn

Joined: Sep 11, 2000
Posts: 11
Is there any way to determine the Browser capabilities using Java(servlets)
thanks in advance.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
John,
Are you asking all the browserName,version,cookies enabled or not related info?
regds
maha anna
Jothi Pandyan
Greenhorn

Joined: Sep 11, 2000
Posts: 11
yes, I want to know, how to determine the browser Name, version, cookies enabled, etc.
thanks maha anna.
Rajpal Kandhari
Ranch Hand

Joined: Aug 26, 2000
Posts: 126
Hello Joyti,
Have you come to know what you were asking for. If yes, then pls either post you're ans in the forum or mail to me as i was also looking for doing the same thing using Servlets. Iknow this thing is possible with JavaScript.
mail me at rajpal_java@yahoo.com
Regards
Raj.


Regards,<P>Raj.<BR>-------------------------<BR>Afforts should be Appriciated.<BR>-------------------------
Hemanth Presingu
Ranch Hand

Joined: Oct 01, 2000
Posts: 30
The following methods on the HTTPRequest object will give information about the request and browser.
Hope this is what you are looking for.
-Hemanth

out.println("getCharacterEncoding: " + request.getCharacterEncoding());
out.println("getContentLength: " + request.getContentLength());
out.println("getContentType: " + request.getContentType());
out.println("getProtocol: " + request.getProtocol());
out.println("getRemoteAddr: " + request.getRemoteAddr());
out.println("getRemoteHost: " + request.getRemoteHost());
out.println("getScheme: " + request.getScheme());
out.println("getServerName: " + request.getServerName());
out.println("getServerPort: " + request.getServerPort());
out.println("getAuthType: " + request.getAuthType());
out.println("getMethod: " + request.getMethod());
out.println("getPathInfo: " + request.getPathInfo());
out.println("getPathTranslated: " + request.getPathTranslated());
out.println("getQueryString: " + request.getQueryString());
out.println("getRemoteUser: " + request.getRemoteUser());
out.println("getRequestURI: " + request.getRequestURI());
out.println("getServletPath: " + request.getServletPath());
out.println();
out.println("Parameters:");
Enumeration paramNames = request.getParameterNames();
while (paramNames.hasMoreElements()) {
String name = (String) paramNames.nextElement();
String[] values = request.getParameterValues(name);
out.println(" " + name + ":");
for (int i = 0; i < values.length; i++) {
out.println(" " + values[i]);
}
}
out.println();
out.println("Request headers:");
Enumeration headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String name = (String) headerNames.nextElement();
String value = request.getHeader(name);
out.println(" " + name + " : " + value);
}
out.println();
out.println("Cookies:");
Cookie[] cookies = request.getCookies();
for (int i = 0; i < cookies.length; i++) {
String name = cookies[i].getName();
String value = cookies[i].getValue();
out.println(" " + name + " : " + value);
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Browser Capabilities