The title is not part of the header info for a web page. It is part of the html document itself - the stuff between the <title> and </title> . The only way I know to grab the title from prior experience is to use regex to parse it from the document. I have done this many times before in Perl but I am a newbie to Java so I am afraid I cannot help you with that one. In Perl the regex expression would look like this -
$gallery =~ m/< *title *>([^<>]*)< *\/title *>/i; (that \/ in front of the second mention of title/ is not a "V", it is a backward slash\ and a forward slash/) This even accounts for those idiot webpage "gurus" out there who have more than one title tag in the document or have stupidly embedded another tag within the title tag. Believe me I have seen it all.... : ) Hope this gets you on the right track. Albert Dewey CppSolutions Richard Yee wrote: > Does anyone know how to retrieve the title of an HTML document? The title > does not appear to be among the headers that are returned by > getHeaderNames() or getHeader(). I'd like to be able to just get the title > of a document without having to parse the data returned from the HTTP HEAD > or GET commands. > > Regards, > > Richard ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
