Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #3284

Re: get head tag data

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Stanimir Stamenkov <s7an10@netscape.net>
Newsgroups comp.lang.java.programmer
Subject Re: get head tag data
Date Tue, 26 Apr 2011 23:01:41 +0300
Organization A noiseless patient Spider
Lines 24
Message-ID <ip78b4$g22$1@dont-email.me> (permalink)
References <13d79f2e-d496-4896-ad0b-2ab658818b51@l2g2000prg.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 26 Apr 2011 20:01:40 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="2F9wFk8uhjDHDbuneVzw7g"; logging-data="16450"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+D3ENoPYQTeu4RZUqfIQce"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.2pre) Gecko/20110426 SeaMonkey/2.1pre
In-Reply-To <13d79f2e-d496-4896-ad0b-2ab658818b51@l2g2000prg.googlegroups.com>
X-Face )>>ChyF_H<b)u~Zjgo/=wa~;=qyW%.F\L.d^fKL[;y\=tY\]M}2t(a^;PKS}9g|k@\vkA<P Q|4?kcJ52334f:CaCrQZ=]D~txPPh6[y{xHkZ+4/KPKZ~|*K#?EqeP0W]iU*Ldy-hyjh0)N4c.I<m) K}GsUUe0)~24Xp`Jt
Cancel-Lock sha1:9qwMXVQDMqCNXN4cqP6c2IldSNg=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3284

Show key headers only | View raw


Tue, 26 Apr 2011 11:15:51 -0700 (PDT), /kapil/:

> i want to retrieve data that is available in between <head></head>
> tag...in jsp using programming..
> any one know that how to fetch that data..??

If you have the whole jsp content in a String variable, you could 
use regular expression, e.g.:

     String jspContent;
     ...
     String headContent = jspContent
             .replaceAll("(?s).*<head>(.*)</head>.*", "$1");
     System.out.println(headContent);

You may read the java.util.regex.Pattern class documentation and the 
Java Tutorial lesson on Regular Expressions for more info:

http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html

http://download.oracle.com/javase/tutorial/essential/regex/index.html

-- 
Stanimir

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

get head tag data kapil <kapil.purohit1441@gmail.com> - 2011-04-26 11:15 -0700
  Re: get head tag data Stanimir Stamenkov <s7an10@netscape.net> - 2011-04-26 23:01 +0300
    Re: get head tag data "John B. Matthews" <nospam@nospam.invalid> - 2011-04-26 16:14 -0400
      Re: get head tag data kapil <kapil.purohit1441@gmail.com> - 2011-04-28 02:55 -0700

csiph-web