Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

retrieve HTML Meta tag in servlet

Posted on 2002-06-27
8
503 Views
Last Modified: 2013-11-24
hi,
i want to get the value of meta tag defined in the html header in servlet.
if the html header contains
<meta name="myName" content="abc">

then in servlet, i want to retrieve the value of myName.

How should i do it???


0
Comment
Question by:kulsmadya
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 7114528
Is this a part of the response?

AFAIK, you can't read response headers in Servlets.

CJ
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7115008
Is the html file on the server or is it being uploaded to the server?
0
 

Author Comment

by:kulsmadya
ID: 7115319
i will get the http post message from a servlet.
& the post message will contain the header fields defined like meta as i have mentioned above.
So, i need to read these meta fields in my servlet for further processing.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 7115383
I'm not sure how meta tags should be getting in to the header fields of a POST request. These are the sorts of headers usually found in an HTTP request:

From
Accept
Accept-Encoding
Accept-Language
User-Agent
Referer
Authorization
Charge-To
If-Modified-Since
Pragma

I order for the servlet to receive and read meta tags, you would have to do something like:

1. Read the meta tags at the client and put them into a POST query string
or
2. Upload the html file and extract its meta tags
0
 

Author Comment

by:kulsmadya
ID: 7115429
for ur 2nd option,

do i need to parse the html page & find the META Tag & get the name & content? is this what u meant???
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 7118182
Yes
0
 
LVL 35

Expert Comment

by:girionis
ID: 8893467
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to CEHJ

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 65
configure dependency in POM for new database 3 34
printf performancy 11 69
Java 8 to Java 6 8 20
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question