CHAPTER 10.1 and 10.2
The JSP manual help I to understand that Java Server Pages is very much efficient because it is dynamic, it extends to dynamically generated content. I understand that there is no restriction, JSP can be use on java script form or HTML form. HTML with java code inside or java code with HTML inside.
The manual also discuss about the difference of JSP to Servlets. There are certain function that JSP could perform which Servlets could not. Meaning the performance of JSP is much better than the Servlets.
The benefits of JSP are as fallows:
1) It is easier to write and maintain the HTML;
2) You can use standard Web-site development tools;
3) You can divide up your development team. Programmers can work on dynamic code.
But we should not neglect the use of Servlets for a reason that project varies. There are project that require the use of Servlets, there are project that requires the use of JSP or it could be both and combine it with (MVC) Model View Controller architecture. So we should learn how to manage the JSP as well as the Servlets.
CHAPTER 11
In this chapter it seems that the author encourage to lessen the use of Java code in JSP for it will affect the performance. The flow of codes will became complicated for the JSP, also it is hard to maintain. Limiting the amount of Java code in JSP is much better.
Strategies for invoking dynamic code from JSP.
*Call Java code directly.
*Call Java code indirectly.
*Use beans.
*Use the MVC architecture.
*Use the JSP expression language.
*Use custom tags.
Putting Java code into the servlet will be generated from the JSP page, it is a Java scripting element.
These are the three forms in scripting element:
1) Expressions = <%= Java Expression %>
2) Scriptlets = <% Java Code %>
- 3) Declarations = <%! Field/Method Declaration %>
Having 25 lines of Java codes that you need to invoke.
To limit the amount of Java code in JSP, it is best to put the 15 lines of codes in a separate Java class put the Java class in WEB-INF/classes/directoryMatchingPackageName, and use one or two lines of JSP-based Java code to invoke it.
There are Importance in using packages, it separates Web pages so that the conflicts of names must be avoided between the servlet and the projects. It is better to use packages than the portable one.
<%= Java Expression %> this JSP expression is use insert values directly to the output.
Current time: <%= new java.util.Date() %> evaluated, converted to a string, and inserted in the page.
There are servers that delete the source code but still there are locations wherein you can access the source code : Tomcat Autogenerated Servlet Source Code, JRun Autogenerated Servlet Source Code, Resin Autogenerated Servlet Source Code.
This chapter discuss about the codes , declaration , syntax, JSP scriplets and others. Honestly these are hard to grasp but it helps me to broaden my idea regarding the structures of the JSP and Servlets.
CHAPTER 12
This chapter made the previous chapter 11 more understandable than before because it has a detailed structure regarding Chapter 11. Almost similar but much more helps the previous chapter to be more