About JSP

1-10 of 37Refresh
Tutorial
241

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook HTML output: Open the [New JSP File ... ), selecting New > Other... > Web > JSP File and clicking Next. The parent folder should be WEB-INF (to prevent direct access to the JSP bypassing Spring). Enter guest as the jsp file name - use exactly
Tutorial
241

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook HTML output: Open the [New JSP File ... ) and selecting New > JSP... Enter guest as the jsp file name - use exactly that case sensitive class name. The Folder should be WEB-INF (to prevent accessing the JSP directly not through Spring). Click
Tutorial
238

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the Web Pages node (in the [Projects] window) and selecting New > JSP... Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish
Tutorial
238

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File ... > Other... > Web > JSP File and clicking Next. Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish to create the new JSP file. Now replace the content of the new
Tutorial
238

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File] dialog box by right clicking the Web Pages node (in the [Projects] window) and selecting New > JSP... Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish
Tutorial
238

Step 5: Add a JSP Page

In this step we will add the JSP that generates the guestbook page output: Open the [New JSP File ... > Other... > Web > JSP File and clicking Next. Enter guest as the jsp file name - use exactly that case sensitive class name. Click Finish to create the new JSP file. Now replace the content of the new
Tutorial
53

Step 4: Add a Controller Class

) guestDao.persist(new Guest(name)); // Prepare the result view (guest.jsp): return new ModelAndView("guest.jsp", "guestDao", guestDao); } } The GuestController class is defined as ... guest has registered (using a JSP form that will be added in the next tutorial step) - a new Guest
Tutorial
53

Step 4: Add a Controller Class

) guestDao.persist(new Guest(name)); // Prepare the result view (guest.jsp): return new ModelAndView("guest.jsp", "guestDao", guestDao); } } The GuestController class ... : If a new guest has registered (using a JSP form that will be added in the next tutorial step) - a new
Tutorial
39

Step 4: Add a Servlet Class

", guestDao.getAllGuests()); request.getRequestDispatcher("/guest.jsp").forward(request ... : If a new guest has registered (using a JSP form that will be added in the next tutorial step) - a new ... is forwarded to the JSP page (which is presented in the next tutorial step). The JSP uses the "guest
Tutorial
39

Step 4: Add a Servlet Class

.setAttribute("guests", guestList); request.getRequestDispatcher("/guest.jsp ... has registered (using a JSP form that is shown in the next tutorial step) - a new Guest entity object ... the database and stored in the request's "guest" attribute. Then the processing is forwarded to the JSP page