开发者

Can I write a java application for Login purpose?

I need to handle Login functionality to a particular site say www.abc.com. I had already registered to this particular sit开发者_运维技巧e, hence can I give the username and password hardcoded in my application so that I can have connected to the server directly.


For Plain answer I would say Yes! , going into details there are many things to consider while making a java program for login many site needs HTTPs sessions and cookie handling, some also require JavaScript enabled browsers to handle login procedures. If you are making some kind of Robot App to login to that website and do some pre-assigned jobs. I would recommend you to consider using Embedded browser.

for Using browser in Java see http://djproject.sourceforge.net/ns/


The short answer to your question is yes, but you might not want to do that. Also, why not use a https so that your users can login directly?


Yes you can write Java code to do that. Check http://hc.apache.org/httpcomponents-client-ga/index.html. Check http://hc.apache.org/httpcomponents-client-ga/examples.html for examples. You can see there are examples for authentication as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜