菜单
  
    Misconceptions About JSP 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?32407
    • 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 client.
    Confusing Translation Time with Request Time
        A JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points:
    • The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified.
    • Loading into memory, initialization, and execution follow the normal rules for servlets.
    The most frequently misunderstood entries are highlighted. When referring to the table, note that servlets resulting from JSP pages use the _jspService method (called for both GET and POST requests), not doGet or doPost. Also, for initialization, they use the jspInit method, not the init method. JSP page translated into servlet Servlet compiled Servlet loaded into server's memory jspInit called _jspService called.
    2. What are application frameworks:
    A framework is a reusable, semi-complete application that can be specialized to produce custom applications. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products.
    A framework provides developers with a set of backbone components that have the following characteristics:
    1.They are known to work well in other applications.
    2. They are ready to use with the next project.
    3. They can also be used by other teams in the organization.
    Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects.
  1. 上一篇:Android开发环境英文文献和中文翻译
  2. 下一篇:服务器端的程序英文文献和中文翻译
  1. 汽车乘员舱的声振耦合英文文献和中文翻译

  2. 立体光照成型的注塑模具...

  3. 数控机床英文文献和中文翻译

  4. 工业机械手英文文献和中文翻译

  5. 低频振动的铁路车轴的状...

  6. 接头的形状对沥青塞接头...

  7. 数控加工技术英文文献和中文翻译

  8. 中考体育项目与体育教学合理结合的研究

  9. 酸性水汽提装置总汽提塔设计+CAD图纸

  10. 河岸冲刷和泥沙淤积的监测国内外研究现状

  11. java+mysql车辆管理系统的设计+源代码

  12. 杂拟谷盗体内共生菌沃尔...

  13. 十二层带中心支撑钢结构...

  14. 大众媒体对公共政策制定的影响

  15. 乳业同业并购式全产业链...

  16. 电站锅炉暖风器设计任务书

  17. 当代大学生慈善意识研究+文献综述

  

About

751论文网手机版...

主页:http://www.751com.cn

关闭返回