Spring MVC Controllers, JAVA Programming

Assignment Help:
I want to upload an item object with it''s image is it possible that i pass a complete object of my Item along with it''s image from my Controller if yes then how may i Do it? and I need a Json Pattern also which will be coming from client side.

What would be the Json pattern for my following Item Object.

Class Item{

String ItemID;
String ItemName;
String CategoryID;
List imagesList;

}

Class Image{

String imageId;
String imageTitle;
byte[] image;
}



and one more thing. Please tell me how can I pass two parameters in my Controller. e.g. if I want to pass Item object in the Request Body along with an extra parameter say String UserID. HOw may I write the following code.

@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public void add(@RequestBody Item myItem, String UserID)

{ ...... }

and please tell me what if I pass in the Request in Json format. What will be it looks like?

{ "Item" : { "ItemID": "1", ......}, "UserID" : "hello"}

will it be like this or what? because i tried it i''m getting the Object and string as Null. I also tried it with @RequestParam but same got NULL while debugging.

Currently i''m dealing with this by this.

Class ItemUserPost{
Item item;
String UserID;
}



I''m storing this object in MongoDB. Will be my whole collection of Item will stored along with the images? or i have to use a MultiPart and GridFS API for this. Kindly please refer if related question already posted.

Please Help Urgent.

Thanks in Advance.

Related Discussions:- Spring MVC Controllers

Write a short note on image preloading process, Write a short note on image...

Write a short note on image preloading process? The primary use of image preloading procedure is to download the image within the cache before it is actually required to displa

Develop program using interactive brokers api, Develop Program using Intera...

Develop Program using Interactive Brokers API Project Description: We require a Matlab function using the Interactive Brokers API for real time trading with three arguments:

Moving blobs, Don''t know how to write this...can anyone help me?

Don''t know how to write this...can anyone help me?

Student, need help in assignment

need help in assignment

Add extra features to exciting minecraft plugin, Add extra Features to exci...

Add extra Features to exciting Minecraft plugin Project Description: I own a minecraft server and have a minigame plug-in but at the end of the game the map need to regenerat

Write a algoritm to play blackjack , Draw: loops through the list of cards ...

Draw: loops through the list of cards drawing them in a single row starting from the screen position referred to by the 'x' and 'y' fields of the Hand class. You can limit the numb

Decision tree algorithm, how to give dataset to a decision tree which is wr...

how to give dataset to a decision tree which is written by java using weka software?

Overview of struts?, Struts is a framework with set of co operating servlet...

Struts is a framework with set of co operating servlets, classes and JSP tags that create a reusable MVC 2 design.     1. Client (Browser) : A request from the cli

Solving problems about traffic jam, Computer programming Project Descrip...

Computer programming Project Description: Solving various problems about traffic jam Skills required: C# Programming, Java, C++ Programming, PHP, Software Architecture

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd