This discussion is archived
1 Reply Latest reply: Aug 20, 2008 4:31 AM by 843833 RSS

Why is the pet shop ref app using old inline Java code in JSP scriplets ?

843833 Newbie
Currently Being Moderated
Is not the "Pet Store Reference Application"
supposed to illustrate how to do proper web application programming with the latest technology ?

And should not the new technolgies with JSF, JST and EL be able to eliminate the need of having java code in JSP pages ?

Were we not supposed to be able to do iteration with XML syntax (with these new technologies) instead of java code (as the example below) ?

I am kind of wondering what have really been achieved during all these years (since I was hacking JSP scriplets in the year of 2000) if we still have to use java code in the JSP pages ?
(just adding additional technologies without even eliminating the old one, creating a mess of many languages within the same JSP page...)

If we do not anymore have to use JSP scriplets, then why is not this "reference application" illustrating how to do a web application without the old JSP stuff ?

This is an example of what I am talking about in the "search.jsp" of the pet shop application:

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib prefix="ui5" uri="http://java.sun.com/blueprints/ui" %>
....
<%
SearchBean searchBean=(SearchBean)session.getAttribute("SearchBean");
if(searchBean != null) {
List<IndexDocument> hits=searchBean.getHits();
if(hits != null) {
for(IndexDocument indexDoc : hits) {
%>