retrieve HTML Meta tag in servlet

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???


kulsmadyaAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
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
 
cheekycjCommented:
Is this a part of the response?

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

CJ
0
 
CEHJCommented:
Is the html file on the server or is it being uploaded to the server?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
kulsmadyaAuthor Commented:
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
 
kulsmadyaAuthor Commented:
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
 
CEHJCommented:
Yes
0
 
girionisCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.