01 2012 档案
摘要:编写一个JSP Tag涉及三个步骤:(1)编写JSP(2)编写JSP Tag的java程序(3)编写JSP Tag库的描述文件tld(实际是一个XML文件)这三个步骤之间没有顺序约束,下面是一个简单的例子:1 编写HelloTag.jsp<%@pagecontentType="text/html"%> <html> <head><title>HelloTagsPage</title></head> <body> <%@tagliburi="/WEB-INF/classes/t
阅读全文
摘要:Struts Logic 标签库中的标签可以根据特定的逻辑条件来控制输出网页的内容,或者循环遍历集合中的所有元素,先来回顾一下Logic标签库中一些标签吧。。进行比较运算的Logic标签进行字符串匹配的Logic标签判断指定内容是否存在的Logic标签进行循环遍历的标签进行请求转发或重定向的Logic标签进行比较运算的Logic标签<logic:equal> 比较变量是否等于指定的常量<logic:notEqual> 比较变量是否不等于指定的常量<logic:greaterEqual>比较变量是否大于或等于指定的常量<logic:greateThan&
阅读全文
摘要:<taglib> <taglib-uri>http://java.sun.com/jstl/fn</taglib-uri> <taglib-location>/WEB-INF/fn.tld</taglib-location> </taglib>长度函数: fn:length 字符串处理函数: fn:contains 、 fn:containsIgnoreCase 、 fn:endsWith 、 fn:escapeXml 、 fn:indexOf 、 fn:join 、 fn:replace 、 fn:split 、 fn:
阅读全文
摘要:XML标签库JSTL提供了操作xml文件的标签库,使用xml标签库可以省去使用Dom和SAX标签库的繁琐,能轻松的读取xml文件的内容。9.5.1 XML核心标签库1.<x:parse>标签<x:parse/>标签用来解析指定的xml文件。【语法1】:<x:parse doc=”xmlDocument”{var=”name”[scope=”page|request|session|application”]|varDom=”name”[scope=”page|request|session|application”]}systemId=”systemId”filt
阅读全文
摘要:SQL标签库JSTL提供了与数据库相关操作的标签,可以直接从页面上实现数据库操作的功能,在开发小型网站是可以很方便的实现数据的读取和操作。本章将详细介绍这些标签的功能和使用方法。SQL标签库从功能上可以划分为两类:设置数据源标签、SQL指令标签。引入SQL标签库的指令代码为:<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>9.4.1 设置数据源使用<sql:setDataSource>标签可以实现对数据源的配置。【语法1】:直接使用已经存在的数据源。
阅读全文
摘要:所有标签:Tags fmt:requestEncoding fmt:setLocale fmt:timeZone fmt:setTimeZone fmt:bundle fmt:setBundle fmt:message fmt:param fmt:formatNumber fmt:parseNumber fmt:formatDate fmt:parseDate <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>jstl fmt 函数大全主要功能格式化日期格式(20
阅读全文
摘要:9. <c:forEach> 库 :Core(核心库) URI : http://java.sun.com/jsp/jstl/core 前缀 : c 描述 : <c:forEach>动作将其体反复计算固定次数,或者针对一个集合中的每个元素分别计算一次体。当前元素(如果未指定集合则为当前索引)和迭代状态可以通过嵌套变量提供给体中的动作元素。 此动作接受属性表中所列的类型集合。当前元素的类型即为底层集合的类型,仅有两个例外。对于一个基本类型的数组,当前元素将作为相应包装类(Integer、Float等等)的一个实例提供。对于一个java.util.Map,当前元素则作为一个
阅读全文
摘要:从JSP 1.1规范开始,JSP就支持在JSP中使用自定义标签了,自定义标签的广泛使用造成了程序员重复定义,这样就促成了JSTL(JavaServer Pages Standard Tag Library)的诞生。作者:杨通杆(http://hexun.com/yangtonggan/default.html)JSTL简介JSTL是一个不断完善的开放源代码的JSP标签库,是由apache的jakarta小组来维护的。JSTL只能运行在支持JSP1.2和Servlet2.3规范的容器上,如tomcat 4.x。但是在即将推出的JSP 2.0中是作为标准支持的。 JSTL目前的最新版本为1.02,
阅读全文
摘要:JavaServer Pages Standard Tag Library 1.1 Tag ReferenceTag LibrariesJSTL coreJSTL 1.1 core libraryJSTL fmtJSTL 1.1 i18n-capable formatting libraryJSTL sqlJSTL 1.1 sql libraryJSTL XMLJSTL 1.1 XML libraryJSTL functionsJSTL 1.1 functions library
阅读全文
摘要:1. attribute:设置和Action关联的ActionForm Bean在request和session范围内的key。如:Form Bean存在于request范围内,此项设为“myBenas”,则在request.getAttribute("myBenas")就可以返回该 Bean的实例。 2. classsName:和action元素对应的配置元素,默认为:org.apache.struts.action.ActionMapping. 3. forward:转发的URL路径。 4. include:指定包含的URL路径。 5. input:输入表单的URL路径
阅读全文
摘要:<HTML><BODY><FORM METHOD=POST ACTION="SaveName.jsp">What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><P><INPUT TYPE=SUBMIT></FORM></BODY></HTML>The target of the form is "SaveName.jsp", which saves the user's n
阅读全文
摘要:<%@ page import="java.util.*" %><HTML><BODY><%! Date theDate = new Date(); Date getDate() { System.out.println( "In getDate() method" ); return theDate; }%>Hello! The time is now <%= getDate() %></BODY></HTML>===========================To
阅读全文
摘要:<%@ page import="java.util.*" %><HTML><BODY><% System.out.println( "Evaluating date now" ); Date date = new Date();%>Hello! The time is now <%= date %></BODY></HTML>=======================The first line in the above example is called a &q
阅读全文
摘要:<TABLE BORDER=2><% for ( int i = 0; i < n; i++ ) { %> <TR> <TD>Number</TD> <TD><%= i+1 %></TD> </TR> <% }%></TABLE>
阅读全文
摘要:The JSP "request" variable is used to obtain information from the request as sent by the browser. For instance, you can find out the name of the client's host (if available, otherwise the IP address will be returned.) Let us modify the code as shown:<HTML><BODY><% // Thi
阅读全文
摘要:a scriptlet does not generate HTML. If a scriptlet wants to generate HTML, it can use a variable called "out".<HTML><BODY><% // This scriptlet declares and initializes "date" System.out.println( "Evaluating date now" ); java.util.Date date = new java.util
阅读全文
摘要:<HTML><BODY><% // This is a scriptlet. Notice that the "date" // variable we declare here is available in the // embedded expression later on. System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date();%>Hello! The time is now <%=
阅读全文
摘要:yum install fonts-chineseyum install fonts-ISO8859-2
阅读全文
摘要:import java.util.*;public class ab {public static void main(String[] args) {TreeSet<String> set = new TreeSet<String>(); set.add("justin");set.add("caterpillar"); set.add("momor");set.add("justin");Iterator<String> iterator = set.iterator();
阅读全文
摘要:StringTokenizer st = new StringTokenizer("this is a test"); while (st.hasMoreTokens()) { System.out.println(st.nextToken()); } String[] result = "this is a test".split("\\s"); for (int x=0; x<result.length; x++) System.out.println(result[x]);
阅读全文
摘要:1、指定欢迎页面,例如: <welcome-file-list> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index1.jsp</welcome-file> </welcome-file-list> 上面的例子指定了2个欢迎页面,显示时按顺序从第一个找起,如果第一个存在,就显示第一个,后面的不起作用。如果第一个不存在,就找第二个,以此类推。 关于欢迎页面: 访问一个网站时,默认看到的第一个页面就叫欢迎页,一
阅读全文
摘要:start_dcss start_impdhs start_epicsgw start_dhs galil1 start_dhs galil2 start_dhs galil3 start_dhs galil4 start_dhs camera start_cryojet start_adsc_detector #start_sudo_dhs_detector #start_scan345
阅读全文
摘要:下面两条命令将把sampadm用户连接到本地主机(如果没有指定主机名字,就是默认的)的sampdb数据库上去:% mysql -p -u sampadm sampdb如果需要连接到在远程主机上运行的MySQL服务器,就应在命令行指定主机:% mysql -h cobra.snake.net -p -u sampadm sampdb如果没有特别说明,以后的示例都将假定你在启动mysql时已经在命令行上把sampdb数据库选定为当前的默认数据库。如果你在启动mysql时忘了在命令行选定这个数据库,请在mysql>提示符处发出一条USE sampdb语句。
阅读全文
摘要:#create a root password formysqladmin -u root password '19740415'create user silmysql> CREATE USER sil IDENTIFIED BY '123';Host | User| % | silthen we must grant permission to sil user.mysql> grant all on *.* to 'sil'@localhost' identified by '123'sudo servi
阅读全文
摘要:The create user command:mysql> CREATE USER yy IDENTIFIED BY '123';yy表示你要建立的用户名,后面的123表示密码上面建立的用户可以在任何地方登陆。如果要限制在固定地址登陆,比如localhost 登陆:mysql> CREATE USER yy@localhost IDENTIFIED BY '123';一, 创建用户: 命令:CREATE USER 'username'@'host' IDENTIFIED BY 'password';
阅读全文
摘要:sudo yum install mysqlsudo yum install mysql-serversudo yum install mysql-develsudo service mysql startsudo service mysql stopsudo service mysql startmysqladmin -u root password '123'mysql -u root -p1. SHOW database mysql> show databases2. create database mysql> create database abccs3.
阅读全文
摘要:Linux chgrp命令功能:改变文件或目录所属的组。语法:chgrp [选项] group filename?该命令改变指定指定文件所属的用户组。其中group可以是用户组ID,也可以是/etc/group文件中用户组的组名。文件名是以空格分开的要改变属组的文件列表,支持通配符。如果用户不是该文件的属主或超级用户,则不能改变该文件的组。该命令的各选项含义为:- R 递归式地改变指定目录及其下的所有子目录和文件的属组。Linux chown命令功能:更改某个文件或目录的属主和属组。这个命令也很常用。例如root用户把自己的一个文件拷贝给用户xu,为了让用户xu能够存取这个文件,root用户应
阅读全文
摘要:The model contains the business logic and interact with the persistance storage to store, retrive and manipulate data.The view is responsible for dispalying the results back to the user. In Struts the view layer is implemented using JSP.The controller handles all the request from the user and select
阅读全文