留言板

HttpRequest aqnd Reaponse

sathya prakash A,修改在11 年前。

HttpRequest aqnd Reaponse

Junior Member 帖子: 67 加入日期: 12-6-12 最近的帖子
want to write a portlet, which sends an http-request to an other site in the internet. Then it should receive the http-response and parse it.

If it is possible, can you give me a few hints how to program this portlet?
emoticon
thumbnail
David H Nebinger,修改在11 年前。

RE: HttpRequest aqnd Reaponse

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
Sure, although you need to determine if this is really necessary. First step should be to try to use either the iframe portlet or the web proxy portlet to see if they satisfy your needs.

Otherwise, I've had success using http://www.htmlparser.org to pull a page to scrape a portion of it, refactor and render as I'd like.
sathya prakash A,修改在11 年前。

RE: HttpRequest aqnd Reaponse

Junior Member 帖子: 67 加入日期: 12-6-12 最近的帖子
Hello David,

Thanks for your reply.

I need to add a servlet / Controller to my existing Life-ray implementation. Please let me know is it possible.

we are trying to write a java program for DNS look-up(Whether the user given email address(domain) is valid or not.

Thanks in Advance.
thumbnail
David H Nebinger,修改在11 年前。

RE: HttpRequest aqnd Reaponse

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
sathya prakash A:
I need to add a servlet / Controller to my existing Life-ray implementation. Please let me know is it possible.


Sure it's possible, but again you really need to ask yourself if it is necessary or not.

we are trying to write a java program for DNS look-up(Whether the user given email address(domain) is valid or not.


If that's all you're trying to do, then a servlet is unnecessary.

This is just simple java code for communicating w/ dns, and does not need to be a separate servlet. Heck you could even wrap service builder around such a thing...