Solved

retrieve HTML Meta tag in servlet

Posted on 2002-06-27
8
500 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split string containing \r\n in Java 46 43
MySQL  on Tomcat 8 43
How to execute a Python program and gather return output in Java 2 25
Unhandled exception type Exception 18 28
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now