What is the Java alternative for PHP CUrl [duplicate] - java

This question already has answers here:
Closed 11 years ago.
Possible Duplicates:
How to use curl in Java
cURL equivalent in JAVA
I am a PHP developer, I am very much comfortable with PHP Curl for getting HTML page, as well as posting the form data.
Recently i have a requirement, to do the same functionality in Java, like above. It is very fine if we can do that in Spring FrameWork.

If you want to use something Spring-specific check out the Spring RestTemplate.
The Jersey Client is another REST-oriented API that is popular.
Apache HttpClient is a solid, mature choice.
And of course there are the good old Sun JDK URL and URLConnection APIs.

Related

Tools in Java/Spring to interact with a Restful API [duplicate]

This question already has answers here:
Call another rest api from my server in Spring-Boot
(9 answers)
Closed 2 years ago.
I'm building a Java application that needs to access an external Restful API.
I need to perform POST, GET and PUT on this API.
In PHP I used curl and in C# I used HTTPClient.
Which tool should I use in Java/Spring? I'm new in Java and I'm kind lost.
Use RestTemplate as Spring's way of sending HTTP methods
RestTemplate offers templates for common scenarios by HTTP method, in addition to the generalized exchange and execute methods that support of less frequent cases
Here are examples of using GET/ POST/ PUT methods

Does jersey currently support OAuth 2 on server side?

I want to create REST application with jersey and provide its api for other services. Which approach can be used? I found here answers older than 7 years ago.
Maybe does someone know better aproaches?

create a REST service using jersey? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I followed this (paragraph 7) tutorial to create a Rest service using jersey. However in the end i was kinda disappointed as it wasn't exactly what i was looking for.
What i had in mind was to create a java server with jersey that a client could make post requests to it , and the server could save the data in a MySQL database.
In the tutorial i was shown maybe how to make a post request? And even for that i used some html and 4 different java classes without any explanation on what anything does. In php the same thing was less than 40 lines of code and everything actually made sense.
I am not sure where to go from here , as everyone suggested to me to read this tutorial for what i needed. But i can't see why as i don't understand its purpose.
Do you know any tutorial i could have a look at , or point me to the right direction here? I ve never developed in java before neither have i used tomcat , so everything seems pretty new to me. I was used to php and apache.
The tutorial you have mentioned focus on creating RESTful Webservices with Java. It aims at distributed systems, where a client can make requests to a server. I think the tutorial is very helpful for that matter.
On the other hand, you seem to be searching for a tutorial that helps you creating a web application that can save/retrieve data to/from a database. You can find one, for example, in http://zetcode.com/tutorials/jeetutorials/mysqldatabase/
Then, for web clients, you have different alternatives, such as GWT or JSF. Also, for the persistence layer you might want to check Hibernate or JPA.
Relatively to Tomcat, it implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a "pure Java" HTTP web server environment for Java code to run. In short, Tomcat is the place where you deploy and run your Java web application; like you deploy a PHP application in Apache (with PHP installed).

Fetch data from other Website [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I make a raw HTTP request in Java?
I am monitoring a website which updates transaction data every few seconds, so for having better performance I need to store those data and analyze them (like plotting, etc.).
My question is how I can make a request to that server by Java EE and get the values which are available in a table in that site?
I should add that I do not search a solution by .net or php, and I have tried by JQuery, java HTTPRequest but I did not found the solution.
Any idea will be appreciated.
If they provide some sort of API/webservice that is best way to communicate,
if not and if the source site doesn't have any issue with the data you are taking from them you could use HTTP requests to get HTML response and parse the portion you want using JSoup
Have you actually tried anything yourself yet? SO is not a code generation tool.
That being said, this seems to be of interest: How do I make a raw HTTP request in Java?

What is Javas answer to Winforms / WPF / Silverlight in 2011 [duplicate]

This question already has answers here:
What is Java's answer to WPF? [closed]
(3 answers)
Closed 9 years ago.
We are doing an evaluation of what to use for client technology, I was wondering what Java has to offer.
I know that this is a close duplicate to this question:
What is Java's answer to WPF?
But the answer in the above question is over 2 years old, so the answer today could be different.
This 2011 Java wil lunch JavaFX 2.0, you will use the JavaFX API's with core Java language instead of the JavaFX Script in 1.x versions.
I concur with the others here that JavaFX was probably intended to be Sun's answer to WPF and Silverlight, but it's never quite reached the standard that Microsoft's technologies have.
Another Java alternative to Silverlight is BlazeDS and Spring BlazeDS which use a Java application server as the backend, and Adobe Flash as the client (using Flex). I've never used it, but the combination looks pretty similar to using Silverlight.
JavaFX is in full swing and Oracle has already made early access release available. More answers can be found here, but surely a competitor is in the making that will give its counterpart a tough time soon
I think that JavaFX still lives. You can check Eclipse Rich Ajax Platform too. I think this is suitaible answer to Silverlight.

Categories

Resources