it Java code or verbose jsp:useBean elements. 10.4 Misconceptions About JSP Forgetting JSP Is Server-Side Technology Here are some typical questions Marty has received (most of them repeatedly). • Our server is running JDK 1.4. So, how do I put a Swing component in a JSP page? • How do I put an image into a JSP page? I do not know the proper Java I/O commands to read image files. • Since Tomcat does not support JavaScript, how do I make images that are highlighted when the user moves the mouse over them? • Our clients use older browsers that do not understand JSP. What should we do? • When our clients use "View Source" in a browser, how can I prevent them from seeing the JSP tags? All of these questions are based upon the assumption that browsers know something about the server-side process. But they do not. Thus: • For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant. If the browser supports the Java 2 platform, you use the normal APPLET (or Java plug-in) tag and would do so even if you were using non-Java technology on the server. • You do not need Java I/O to read image files; you just put the image in the directory for Web resources (i.e., two levels up from WEB-INF/classes) and output a normal IMG tag. • You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIPT tag; this does not change just because the server is using JSP. • Browsers do not "support" JSP at all—they merely see the output of the JSP page. So, make sure your JSP outputs HTML compatible with the browser, just as you would do with static HTML pages. • And, of course you need not do anything to prevent clients from seeing JSP tags; those tags are processed on the server and are not part of the output that is sent to the 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 毕业设计外文翻译来自于论文先生网,如该文注明了作者及出处,请在转载引用时保留。否则因《毕业设计外文翻译》一文引起的法律纠纷请自负。 |