DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Languages Topics

article thumbnail
Stored Procedure With Input and Output Parameters in MySQL | Callablestatement With Input and Output Params
In this video tutorial, take a closer look at stored procedures with input & output parameters in MySQL, and CallableStatement with Input&Output Params.
Updated July 15, 2022
by Ram N
· 3,687 Views · 4 Likes
article thumbnail
Getting Started With Vaadin in Spring and Java EE
If you're thinking of using Vaadin for your UI components, here are some resources, including two videos, to see how you can incorporate it into both Spring and Java EE.
Updated July 14, 2022
by Alejandro Duarte DZone Core CORE
· 13,570 Views · 9 Likes
article thumbnail
Groovy 4.0: These 10 New Features Make It AWESOME!
Sealed types, switch expressions, and record types. Here are just a few new features introduced in the latest Groovy 4.0 release. In this article, I want to show you ten things that make Groovy 4.0 amazing.
July 14, 2022
by Szymon Stepniak
· 7,600 Views · 6 Likes
article thumbnail
Introduction to Data Replication With MariaDB Using Docker Containers
Send in the clones: that’s what we do when we replicate databases. In this article, you’ll learn how to perform the most basic form of replication with MariaDB.
July 14, 2022
by Alejandro Duarte DZone Core CORE
· 48,751 Views · 4 Likes
article thumbnail
How To Perform OCR on a Photograph of a Receipt Using Java
Learn of challenges associated with processing physical receipts for digital expensing operations and discover an OCR API solution to alleviate the problem.
July 14, 2022
by Brian O'Neill DZone Core CORE
· 6,673 Views · 4 Likes
article thumbnail
Learning About the Headers Used for gRPC Over HTTP/2
In this article, we take a look some next-generation HTTP headers available for integration developers to use when designing APIs.
Updated July 13, 2022
by Kin Lane
· 47,270 Views · 4 Likes
article thumbnail
Building a REST Service That Collects HTML Form Data Using Netbeans, Jersey, Apache Tomcat, and Java
The Jersey project is very well documented so it makes it easy to learn REST with Java. In this article I’m going to build two projects. The first project will be a very simple HTML page that presents a form to the user and then submits it to a REST project residing on the same server. The second project will be the REST part. For this article I used the following tools: 1. Netbeans 7 2. Apache Tomcat 7 3. Jersey 4. Java I built this on OS X Lion. Go ahead and create a new Maven Web Application with Netbeans 7 called: MyForm Once the project has been generated take the resulting (default) index.jsp file and delete it. In its place add a file called: index.html and add the following content to it: Name: Message: Item 1: Item 2: Basically, I created a simple (ugly) form that takes a few parameters the user enters. They submit the form and the data is sent to the REST project we will soon be building. The idea here is we are using an HTTP POST to create a new message. That’s it for the first project! With Netbean’s Maven integration do a Clean and Build and then deploy the resulting WAR file to Apache Tomcat. Create another new Maven Web Application with Netbeans 7 called: RESTwithForms Add two new Java classes to the new project: 1. MyApplication 2. MessageResource The code for MyApplication.java is as follows: package com.giantflyingsaucer; import com.sun.jersey.api.core.PackagesResourceConfig; import javax.ws.rs.ApplicationPath; @ApplicationPath("/") public class MyApplication extends PackagesResourceConfig { public MyApplication() { super("com.giantflyingsaucer"); } } In a brief nutshell this code allows us to make use of some Servlet 3.0 goodies (we don’t need to create a web.xml file for this project as an example). For more details see the sections titled: Example 2.8. Reusing Jersey implementation in your custom application model and Example 2.9. Deployment of a JAX-RS application using @ApplicationPath with Servlet 3.0 at this link. The real guts of the REST project are in the MessageResource.java file as seen below: package com.giantflyingsaucer; import java.net.URI; import java.util.List; import java.util.UUID; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import javax.ws.rs.Consumes; import javax.ws.rs.core.MediaType; @Path("/messages") public class MessageResource { @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Response createMessage(@FormParam("name") String name, @FormParam("message") String message, @FormParam("thelist") List list) { if(name.trim().length() > 0 && message.trim().length() > 0 && !list.isEmpty()) { // Note 1: Normally you would persist the new message to a datastore // of some sort. I'm going to pretend I've done that and // use a unique id for it that obviously points to nothing in // this case. // Note 2: The way I'm returning the data should be more like the commented // out piece, I am being verbose for the sake of showing you how to // get the values and show that it was read. return Response.created(URI.create("/messages/" + String.valueOf(UUID.randomUUID()))).entity( name+ ": " + message + " --> the items: " + list.get(0) + " - " + list.get(1)).build(); // This is a more real world "return" //return Response.created(URI.create("/messages/" + String.valueOf(UUID.randomUUID()))).build(); } return Response.status(Response.Status.PRECONDITION_FAILED).build(); } } Note: Pay special attention to the comments. Please don’t email me stating I shouldn’t be returning text back with the values, also please don’t tell me I should be iterating the list, etc. this is just a demo. You will obviously do this differently in a production environment. The key here is simplicity and minimal code. At this point you need to add jersey-server as a dependency in your POM file. com.sun.jersey jersey-server-linking 1.9.1 With Netbean’s Maven integration do a Clean and Build and then deploy the resulting WAR file to Apache Tomcat. You are now ready to test it out. Load up the HTML file from the first project and enter some data and then submit it. If you have a tool like FireBug for Firefox, you can also see that an HTTP 201 was returned (if successful). If you don’t enter any data in the form then you should get an HTTP 412 back. With not much more work you could just as easily use something like jQuery and submit the form via AJAX.
July 13, 2022
by Chad Lung
· 66,766 Views · 4 Likes
article thumbnail
How Does MySQL Configuration Work?
The primary MySQL configuration file - my.cnf and all of its flavors and it's widely regarded as the "go-to" file whenever MySQL configuration errors occur.
July 13, 2022
by Lukas Vileikis
· 6,404 Views · 1 Like
article thumbnail
What Are the Best Performance Tuning Strategies for Your SQL Server Indexes?
Check out some of the best tools and tactics to put to work as you aim to tune and improve the performance of your SQL Server indexes.
Updated July 13, 2022
by Richard Grant
· 5,016 Views · 1 Like
article thumbnail
Java Thread Programming (Part 2)
After discussing the history of threading and how to initiate/begin a thread, now let's look at an illustration of how to leverage threads to our advantage.
July 12, 2022
by A N M Bazlur Rahman DZone Core CORE
· 6,835 Views · 8 Likes
article thumbnail
Securing Kubernetes Secrets With HashiCorp Vault
Secrets in Kubernetes are used to store sensitive information. This article will show how to secure Kubernetes secrets using Hashicorp Vault.
July 12, 2022
by Nikhil Purva
· 6,917 Views · 2 Likes
article thumbnail
Debugging Gson, Moshi, and Jackson JSON Frameworks in Production
Parsing is a major source of production failures. Some are easy to track but some are insidious. Here's how you can debug them on the fly!
July 12, 2022
by Shai Almog DZone Core CORE
· 4,962 Views · 4 Likes
article thumbnail
Six Useful T-SQL Configuration Functions and Their Use Cases
SQL Server offers several types of system functions to meet our business requirements. Learn the use cases of configuration functions in SQL Server.
July 11, 2022
by Manvendra Deo Singh
· 4,858 Views · 1 Like
article thumbnail
Swagger Parser
Learn more about swagger parser with examples.
July 11, 2022
by Hinanaaz Sanadi
· 9,486 Views · 4 Likes
article thumbnail
Increasing Cloud-Native Sustainability With Observability
Learn about the unintended environmental impact and cost of the proliferation of cloud services, frameworks, and "throw an other service at it" development.
July 11, 2022
by Chris Ward DZone Core CORE
· 4,814 Views · 2 Likes
article thumbnail
Going Beyond Java 8: Pattern Matching for instanceof
A developer and Java expert gives an overview of the instanceof operator in the recent versions of Java and how it can be used to improve your code.
Updated July 10, 2022
by Claudio De Sio Cesari
· 4,827 Views · 6 Likes
article thumbnail
How to Build a Full-Stack App With Next.js, Prisma, Postgres, and Fastify
In this article, we’ll learn how to build a Full-stack application using Next.js, Prisma, Postgres, and Fastify.
July 10, 2022
by Clara Ekekenta
· 14,897 Views · 5 Likes
article thumbnail
Common Table Expression in ClickHouse
What is Common Table Expression(CTE)? In this post, learn how to use CTE in the ClickHouse database and follow along with use cases with examples.
July 8, 2022
by Taras Baranyuk DZone Core CORE
· 9,921 Views · 8 Likes
article thumbnail
Writing Your First Python GitHub Action
Learn how to write, use, and publish a simple Python-based GitHub Action.
July 8, 2022
by Akshay Kalia
· 8,136 Views · 1 Like
article thumbnail
How to Store Text in PostgreSQL: Tips, Tricks, and Traps
In this article, we will review various options to store long text in the PostgreSQL database: @Lob attributes, TEXT, and long VARCHAR table columns. Also, we'll have a look at the difference between Hibernate 5 and 6 in storing long text data.
July 7, 2022
by Andrey Belyaev
· 24,196 Views · 9 Likes
  • Previous
  • ...
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×