【正文】
? loaded into memory, initialization and implementation of the servlet to follow the general rules. Table 1 lists some mon situations, about the kinds of circumstances has occurred at each step. The most monly misunderstood items marked have been highlighted. In reference to the table, we should note that the servlet generated by the JSP page using _jspService methods (GET and POST requests are calling the function), is not a doGet or doPost method. Similarly, for initialization, they use jspInit method, rather than the init method. Table 1 of the JSP operate a variety of situations JSP pages into servlet will pile Servlet to Servlet loaded into server memory to call jspInit call _jspService Page first created Request a Yes Yes Yes Yes Yes 2 No No No No requests have After the server restart Request 3 No No Yes Yes Yes 4 No No No No requests have Page modified Request 5 Yes Yes Yes Yes Yes 6 No No No No requests have 。 do not use explicit Java code or a lengthy jsp: useBean element difficult to access the dynamic results. Third, the misunderstanding of the JSP Forget JSP technology is a serverside technology Here are some typical problems Marty received (most of the issues appear more than once). ? Our servers are running . How do I use the Swing ponents JSP pages as well? How do I put an image in JSP pages? I do not know what to read image file should use Java ? I / O mands. Tomcat does not support JavaScript, when the user moves the mouse over the image, how can I make the image highlight it? ? ? Our customers do not understand the JSP to use the old browser. How should I do? When our client in the browser using the View ? Source (view source code), how to stop them see the JSP Tag? All of these issues are based on the browser to the serverside process in an informed assumption. But in fact the browser does not understand the serverside process. Therefore: ? If you want to use Swing ponents applet into the page, it is important that the Java version of the browser and the Java version of the server has nothing to do. If the browser supports Java 2 platform, you can use the normal APPLET (or the Java plugin) label, even if the server using a nonJava technologies should also be the case. You do not need Java ? I / O to read the image file, you only need to store images on Web directory of resources (ie, up 2 WEBINF/classes directory), and outputs a normal IMG tag. ? You should use the SCRIPT tag, use the clientside JavaScript to create under the mouse will change the image, this does not change because the server using JSP. ? browser does not support JSP they only see the JSP page output. Thus, as with static HTML pages, like, just ensure that the JSP output of HTML and browser patibility. ? Of course, you do not need to take measures to prevent customers see JSP label, the labels on the server for processing, sent to the customer39。s strengths is the specification of many different panies controlled societies. Thus, in subsequent versions, this technology can be improved coordination. However, some organizations have developed a Javabased alternative technologies to try to fill these gaps. According to our judgments, this is wrong. JSP and Servlet technologies using the expansion of thirdparty tools, such as Apache Structs, is a good idea, as long as the benefits of the tool to pensate for the additional plexity of the tool. However, the attempt to use nonstandard tools to replace the JSP is not ideal. In selecting a technology, you need to weigh a number of factors: standardization, portability, integration, industry support and technical characteristics. JSP alternative technologies for the debate almost exclusively focused on the technica