In spring mvc, when we return ModelAndView / Model object, does this get serialized to be sent on HTTP? Just like it happens in REST API that the @ResponseBody annotated method returned value is serialized. If not, how is Model object transferred over HTTP in Spring MVC as I have read that objects can't be transferred over HTTP without serialization?
Does ModelAndView serialize model before sending response to client
358 views Asked by Shweta Priyadarshani At
1
There are 1 answers
Related Questions in SPRING
- HTTPS configuration in Spring Boot, server returning timeout
- Multi Tenancy in Spring - Partitioned Data Approach
- How to create beans of the same class for multiple template parameters in Spring
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Springboot: How to get an entity optional property and check null?
- How do I propagate the current SecurityContext to my @RabbitListener in Spring Boot?
- Spring's XML based bean configuration for Object Mapper's Case Insensitive property
- Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. I'm using Postgresql
- springboot class org.hibernate.mapping.Bag cannot be cast to class org.hibernate.mapping.SimpleValue
- Issue while deploying JDK 17 and Spring 6 application in Tomcat 10.1.20
- Spring JPA Data Auditing - How to design it?
- Springframework test: Async not started
- Error: Cannot invoke "jakarta.servlet.http.HttpSession.getAttribute(String)" because "session" is null
- How does spring-retry determine which methods to retry when @Retryable is placed at the class level?
- problem with edge server registration in Eureka
Related Questions in REST
- Query parameter works fine with fastapi application when tested locally but not working when the FastAPI application is deployed on AWS lambda
- Add an http GET/POST entry point to a Django with channels websocket
- Difficulty creating a data pipeline with Fabric Datafactory using REST
- Flutter connection to a local api
- Accessing REST API Status Codes using Azure Data Factory Copy Activity (or similar)?
- Mass Resource deletion in REST
- why when I check endpoint /tasks, an error always appears "error : invalid token" even though I have entered the appropriate token that I got
- How to prevent users from creating custom client apps?
- How to create a REST API with .NET Framework?
- Efficiently Handling Large Number of API Calls with Delphi 10.4 and OmniThreadLibrary
- Put Request throwing 401 [no body] Unauthorized
- Converting img src data to octet-stream
- Implementing Email Verification and Notification System in a Full-Stack Application with React Frontend and Node Backend
- Micronaut - Add Controller from external library
- Moving Template or OVA to Datastore using vCenter API
Related Questions in SPRING-MVC
- springboot class org.hibernate.mapping.Bag cannot be cast to class org.hibernate.mapping.SimpleValue
- Spring security causing 404 with message "No static resource login"
- Getting error while deploying war in tomcat 9
- Why Jackson needs a default constructor?
- what is error for the below springmvc code?
- Expected a JavaScript module script but the server responded with a MIME type of "text/html" -- when integrating Angular FrontEnd with spring MVC
- How to manage exceptions thrown in filters(common filters not only spring-security)?
- Bean Validaton : org.springframework.web.bind.MethodArgumentNotValidException
- Where I use @ExtendsWith(MockitoExtension.class) and @SpringBootTest anyone clarify me with example
- maven clean install and mvn spring-boot:run gives me on POST request 401 (Unauthorized) error
- How to deploy Tibco GI to windows 10
- Spring Boot request body validation not working
- maintain the session after logout in existing spring mvc project
- kendo is not defined after upgrade springboot from 2.0 to 3.1
- Cors not allowed to completed the request in Spring MVC
Related Questions in SERIALIZATION
- Deserialize XML with optional different name
- How to serialize Any with Kotlin serialization?
- Flink Stuck on Broadcast
- How do I add serialization into Kotlin Jet Compose project?
- fix django login bug
- How to execute code "before_serialize"? or How can I sanitize attributes before they are serialized?
- Ical.net Serialization Error when serializing 12:00 AM Midnight
- how can i unserialize Symfony transport messages?
- How to change a queryset in Django?
- How to serialize object to JSON format which inherits IList and has other properties
- Json.stringify() is ignoring a object property after xlsx.sheet_to_json
- how to make aiogram.Message from telethon.Message
- implementin filter for vector of custom struct in RUST
- How to properly Serialize/Deserialize an ArrayList with Custom Objects?
- Append serialized objects to a single file and load Rust
Related Questions in MODELANDVIEW
- Skipping GET URL that returns ModelAndView from Spring Security Config
- Testing using a Mockito in Spring boot app of a method that takes the Model as a parameter
- How to pass two list as @RequestBody in Spring boot controller
- How to pass Spring boot Model from one jsp page to another?
- Why doesn't ModelAndView add a property?
- How to use a variable via Java method parameter?
- Does ModelAndView serialize model before sending response to client
- Controller doesn't recognizes Template using ModelAndView
- convert ModelAndView object to []byte array
- Multiple Datatable Of same Table Not Loading during Ajax call
- spring to spring boot 2.4.5 migration: Not able to send ModelAndView as a result from spring controller in Ajax call from UI
- Why the first property can be parse but no the second property of the same object
- how to use c:forEach with arrayList?
- How do I manipulate the http response using ModelAndView in java?
- How to bind Java object to HTML form using Spring MVC and Pebble template engine
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
It depends. It depends on the view technology in use. But for most they will be exposed as request attributes and that is done in the
View. TheAbstractViewhas code for this which is used by mostViewimplementations.For something like Freemarker the model is exposed both as request attributes but also added to the Freemarker internal model object. This is so that Freemarker can render the page and you could also use tags in the template to retrieve the request attributes.
Depending on the actual view technology used if something gets serialized depends. For things generating HTML, PDF, Excel etc. nothing will be serialized. All the rendering and processing is done on the server and the end result (the complete view) is being sent to the client.
However, for view technologies like the
MappingJackson2JsonView(there are others as well) that will actually serialize the model using Jackson. But in the end, this will be JSON that is sent over HTTP.So what is sent over HTTP is at least never the actual model but depends on the view technology in use.