This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Developer Career Masterplan: Build your path to senior level and beyond with practical insights from industry experts and have Heather VanCura and Bruno Souza on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Converting database format to java

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently working on my backend part for my React web application. I have created my project as maven and from there created the web folder with ReactJS. So I have my backend part in src and frontend in the web folder.

I have some challenges with my backend part which is in the programming language java. I am in the process of developing it so that it cooperates with my frontend.

My Backend (Order.java) looks like this:



I'm working on programming my backend api to display my data like this:



I have tried and created an array called orderedItems with various values. But I just can't get it to make sense. I've tried to do this, but it doesn't work.



The code above gives me error, I've no idea why it should.

Can someone help me converting the format to java code?

Trying to get my backend api to work. I just need to make so my backend prints the data as the format shown above.
 
author & internet detective
Posts: 41762
885
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the exact error message you are getting? Can you show the context of the code (that shows the three variables you reference)?
 
Bobo King
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:What is the exact error message you are getting? Can you show the context of the code (that shows the three variables you reference)?






 
Bobo King
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Cooke wrote:Please don't edit your posts after replies have been made as it makes it look like the other participants in the conversation haven't read your question properly and makes their post look like nonsense.

Conversations go forwards in time, so answer questions and add more information as a replies.



Thanks for info, will do.
 
Bobo King
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:What is the exact error message you are getting? Can you show the context of the code (that shows the three variables you reference)?



Here's the error from the console:



The code above gives me error 415. I've found out that 415 error means unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format. So it might be with the format I am sending from my backend and my frontend has another format, is that correct?

Here's how I am using the POST request in my frontend:


Here's my context:

 
reply
    Bookmark Topic Watch Topic
  • New Topic