r/JavaDev • u/1_the_only_me • Jul 06 '17
r/JavaDev • u/ozzya • Jun 05 '17
I'm in need of some help with attempting to create a java servlet with an HTTP GET T that would take multiple parameters and return the result from an external API.
Hi All,
Trying to create a java servlet with a HTTP GET that would take multiple parameters and return the result from an external API. Something like this… Localhost:8001/companyLookup/?name=ABCCompany&address=123Street Parameters will be passed via the URL and the first or best match would be returned.
I am a novice when it comes to Servlets and am using JDeveloper 11g to do this. This is what I have so far…
public void doGet() throws ServletException, IOException {
String url = "www.google.com";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
// optional default is GET
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
System.out.println("\nSending 'GET' request to URL : " + url);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String output;
StringBuffer response = new StringBuffer();
while ((output = in.readLine()) != null) {
response.append(output);
}
in.close();
//print result
System.out.println(response.toString());
} When I try to run this within JDeveloper11g I get this …
HTTP method GET is not supported by this URL
Any help would be greatly appreciated.
r/JavaDev • u/hipsterfromiowa • May 28 '17
Catapult Game - Help me get a start on the game!
I am stuck on making this game. I am new to Java and need a starting point for this game, I figure making some variables but I don't know what after. We need to use the random function for the wall.
In this game, the user has a catapult that can launch projectiles. In each round of the game, the computer places a wall in front of the user. The user aims their catapult by setting the launch angle and speed. The computer then computes whether the projectile makes it over the wall and informs the user. The user gets points for clearing the wall and loses points for hitting the wall. The game continues through successive rounds until the user quits.
r/JavaDev • u/pantera75035 • Apr 20 '17
I used to be a C and Java developer working on core java long time ago. I switched over to management and lost touch with programming for almost 15 years. I am looking to get back to programming. Where do you suggest I start. I'd like get understanding of frameworks and start. Your help is apprecia.
r/JavaDev • u/geekonjava • Apr 08 '17
j2HTML - Java HTML5 generation Library - Tell Me How - A Place for Technology Geekier
r/JavaDev • u/geekonjava • Apr 07 '17
ScribeJava - OAuth client Java library - Tell Me How - A Place for Technology Geekier
r/JavaDev • u/dhirajray • Feb 14 '17
Spring Boot Password Encoding Using Bcrypt Encoder
r/JavaDev • u/WeberO • Feb 17 '14
Mod Help
So as we have gotten started we have realized that we don't know much of what we need to know but that's fine, that's why we started, to learn. But now we have a problem, we don't know how to assign different textures to different sides of blocks (x, y, z). If any of you can help it would be much appreciated. When we figure out the solution we will add it to this post in an edit. Thanks Weber
r/JavaDev • u/WeberO • Feb 14 '14
Dev Update #1
Hello, Erik and i are currently teaching ourselves how to write java Minecraft. It might sound a little stupid but right now we are teaching ourselves how to put different textures on sides of blocks. We are making a weapon mod based on FPS games and plan to make it compatible with other big mods. Thanks for reading this, and have a nice day.