Home » Tag Archives: MVC

Tag Archives: MVC

MVC is dead – what comes next?

software-development-2-logo

React.js, Elm, Cycle.js, and other UI frameworks introduced a new way of building user interfaces. By applying principles from functional reactive programming to UI development, they even changed how we think about user interfaces. In no time, these approaches have simply smashed the seemingly inevitable dominance of MVC and its siblings (MVP, MVVM etc.). This article, which is the first in ...

Read More »

Java EE 8 MVC: Global exception handling

java-interview-questions-answers

In the previous previous posts we learned about various ways to access request information (e.g. query or path parameters) in Java EE MVC. This post shows how to apply global exception handling to an MVC application. Assume we have a controller method that might throw an IllegalArgumentException: @Controller @Path("illegal-argument") public class ExceptionController { [email protected]   public String doWork() {     // code that might throw an IllegalArgumentException   } } We could now add a ...

Read More »

Java EE 8 MVC: Working with bean parameters

java-interview-questions-answers

In the last posts we saw how to access query, path and form parameters in MVC Controllers. This post shows how multiple parameters can be mapped to an object using the @BeanParam annotation. Let’s reuse the simple HTML form from the post about form parameters: <form action="submit" method="post">   <label>ID:</label>   <input type="text" name="id" />   <label>Name:</label>   <input type="text" name="name" />   <label>Role:</label>   <select name="role"> <option value="admin">Admin</option> <option value="reporter">Reporter</option> <option value="accountant">Accountant</option>   </select>   <input type="submit"/> </form> This defines ...

Read More »

MVC 1.0 in Java EE 8: Getting started using facelets

java-interview-questions-answers

MVC 1.0 is an action-based Model-View-Controller web framework, which will be a part of future Java EE 8. It will live side by side with component-based JSF framework and will provide an alternative for building HTML+javascript oriented applications with full control over URLs. This post summarizes what needs to be done in order to use Facelets instead of default JSP ...

Read More »

Java EE 8 MVC: Working with query parameters

java-interview-questions-answers

In the previous post about the new Java EE MVC Framework we had a detailed look on Controllers. In this and the following posts we will see how to access various types of request data in MVC Controllers. Java EE MVC makes heavy use of JAX-RS and most of the things we will see in this and the next posts ...

Read More »

Three steps to follow MVC while building Java Web application

java-interview-questions-answers

Step #1 DO Always process URL(POST forms, link clicking etc) by servlet / action bean and never by JSP WHY ActionBeans (whatever certain framework call those classes) and rarely servlets are controllers intended for processing user input. JSPs are view engine dedicated to rendering representation of software to client. Separating user input processing and HTML rendering prevents you from temptation ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns