- 1、本文档共12页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
jsp 构 架--2种方式(JSP framework --2 ways)
jsp 构 架--2种方式(JSP framework --2 ways)
author
The JSP framework --2 modes: Model I and Model II
Author: Lance Lavandowska translation: blueski
If you often go to Servlet or JSP newsgroup or mailing list, then will see a lot about Model I and Model II method are discussed. What is what kind of, it depends on your personal preferences, team work strategies and the orthodox OOP.
Simply speaking, Model I (business logic) business logic code (presentation code) and said together (as in HTML); Model II advocated to maximize all the code in the content representation outside.
[B]Model I: a simple single level application [/B]
If everyone is in a well versed in Java and HTML environment, or you alone doing all the work, if everyone has a clear structure and programming, so this method is very effective, but this assumption is beyond the scope of this article. The first advantage of this approach is that if your application changes, you only need to maintain a file. But the biggest drawback is readability! Unless very carefully, otherwise your HTML and Java code are mixed, and difficult to maintain.
In the example below, we will add a TimeZone element, so as to make it into a JSP file, it will return to the TimeZone based on time. If you do not submit TimeZone, then the default is the default time server.
=====================================================================
xml version= 1 ?
H1Time JSP/H1
jsp:scriptlet
//the parameter zone shall be equal to a number between 0 and 24 (inclusive)
TimeZone timeZone = TimeZone.getDefault (//returns the default); TimeZone for the server
If (request.getParameterValues (zone)! = null)
{
String timeZoneArg = request.getParameterValues (zone) [0];
TimeZone = TimeZone.getTimeZone (GMT+ + timeZoneArg + : 00);
Gets a TimeZone. For this example / were just going to assume
A positive / / its argument not a negative one.
}
//since were basing our time from GMT, well set our Locale to Brittania, and get a Calendar.
Calendar myCalendar = Calen
您可能关注的文档
- html代码优化注意事项(HTML code optimization considerations).doc
- html 标签(HTML tags).doc
- htc自带程序(HTC comes with program).doc
- html各种标签的含意(HTML implications of various labels).doc
- html如何实现身份证号码验证(How does HTML implement identity card number verification).doc
- html常用标签全集(HTML tags).doc
- hp-5l6l激光打印机卡和加粉处理技巧(Hp-5l6l laser printer card and powder handling skills).doc
- html标签 , 属性名称 , 简介(HTML tags, property names, profiles).doc
- html滚动代码(HTML scroll code).doc
- htm标签1-4(Htm tag 1-4).doc
最近下载
- 小学科学人教鄂教版六年级下册第一单元《生物与环境》教案(2023春.pdf VIP
- 人教鄂教版科学六年级下册第一单元生物与环境单元教案.pdf VIP
- 一例高血压患者的护理个案.docx VIP
- 青岛版六年级下册科学《生物与环境》大单元教学方案与反思.docx VIP
- 甘肃《建筑抗震加固工程消耗量定额》.pdf
- 高中英语1.5万考点.pptx VIP
- 新人教鄂教版六年级下册科学第一单元《生物与环境》全单元课件.pptx VIP
- CFMOTO春风动力450SR S CF400-9(6AQV-380101-3000-11 CN233)摩托车使用手册.pdf
- 水电站砂石系统施工组织设计(221页).docx VIP
- 2024新人教版初中英语七年级下册重点知识点归纳(复习必背).pdf VIP
文档评论(0)