I have 2 JSP pages, in the first I have input text forms, I want to display the values inserted in another JSP page. (using Spring MVC).
Spring Boot is considered a module of the Spring framework for packaging the Spring-based application with sensible defaults. Spring MVC is considered to be the model view controller-based web framework under the Spring framework. Use. For building a Spring-powered framework, default configurations are provided by it.
The MVC term signifies that it follows the Model View Controller design pattern. So, Spring MVC is an integrated version of the Spring framework and Model View Controller. It has all the basic features of the core Spring framework like Dependency Injection and Inversion of Control.
To answer your questions, Spring is easy to learn because the whole framework is designed to work with POJOs, instead of relying on special interfaces, abstract classes or such.
Spring MVC framework is an open source Java platform that provides comprehensive infrastructure support for developing robust Java based Web applications very easily and very rapidly. Spring framework was initially written by Rod Johnson and was first released under the Apache 2.0 license in June 2003.
Put your variable that you want to transfer to the next page in a hidden field (put the fields in the same form which take you to next page. then get your parameter by JSTL. this is an example :
<form:form action="/nextPage" method="POST" commandName="cmd">
<input type="hidden" value="Myname" name="nom" />
<input type="hidden" value="myPPR" name="ppr" />
</form:form>
the controller :
@RequestMapping(value="/nextPage",method=RequestMethod.POST)
public String FicheService(@ModelAttribute CMDBean cmd,BindingResult result,@RequestParam("nom") String nom, @RequestParam("ppr") Integer ppr,ModelMap model){
model.addAttribute("ppr", ppr);
model.addAttribute("nom", nom);
}
then get them in the second page like that :
<c:out value="${ppr}" />
<c:out value="${nom} />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With