开发者

prblem in accessing a Java servlet from PHP Script [closed]

开发者_JAVA技巧 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I am trying to invoke a Java servlet from PHP. When I access the servlet from a browser I always get the results. But when I access it from a pHP script. I am not getting the results properly. Sometimes I dont get the results at all.


If servelt's get method is implemented then you may request a Servlet url in PHP code by setting href of anchor tag or set action attribute of form tag.

  1. <a href="http://example.com/myservlet">Test</a>
  2. <form method='GET' action='http://example.com/myservlet'>

If POST method is implemented in servlet class then use form tag. Set method='POST' and action='http://example.com/myservlet'.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜