??xml version="1.0" encoding="utf-8" standalone="yes"?>
2.Call FacesContext.renderResponse() to skip the rest of the life cycle up to Render Response.
3.Call FacesContext.responseComplete() to skip the rest of the life cycle entirely.
See "Immediate Components" on page 287 for an example of using FacesContext.renderResponse().
The call to renderResponse() skips the rest of the life cycle—including validation of the rest of the input components in the form—up to Render Response. Thus, the other validations are skipped and the response is rendered normally (in this case, the current page is redisplayed).
To summarize, you can skip validation when a value change event fires by doing the following:
Adding an immediate attribute to your input tag
Calling FacesContext.renderResponse() at the end of your listener
Variable Name | Meaning |
---|---|
header | A Map of HTTP header parameters, containing only the first value for each name. |
headerValues | A Map of HTTP header parameters, yielding a String[]array of all values for a given name. |
param | A Map of HTTP request parameters, containing only the first value for each name. |
paramValues | A Map of HTTP request parameters, yielding a String[]array of all values for a given name. |
cookie | A Map of the cookie names and values of the current request. |
initParam | A Map of the initialization parameters of this web application. Initialization parameters are discussed in Chapter 10. |
requestScope | A Map of all request scope attributes. |
sessionScope | A Map of all session scope attributes. |
applicationScope | A Map of all application scope attributes. |
facesContext | The FacesContext instance of this request. This class is discussed in Chapter 6. |
view | The UIViewRoot instance of this request. This class is discussed in |
Finally, if the name is still not found, it is passed to the VariableResolver of the JSF application. The default variable resolver looks up managed-bean elements in a configuration resource, typically the faces-config.xml file.
Consider, for example, the expression
#{user.password}
The term user is not one of the predefined(预定? objects. When it is encounteredQ遇刎ͼ for the first time, it is not an attribute name in request, session, or application scope.
Therefore, the variable resolver processes the faces-config.xml entry:
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>com.corejsf.UserBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
The variable resolver calls the default constructor of the class com.corejsf.User-Bean. Next, it adds an association to the sessionScope map. Finally, it returns the object as the result of the lookup.
When the term user needs to be resolved again in the same session, it is located in the session scope
Composite Expressions
You can use a limited set of operators inside value expressions:
Arithmetic operators + - * / %. The last two operators have alphabetic variants div and mod.
Relational operators < <= > >= == != and their alphabetic variants lt le gt ge eq ne. The first four variants are required for XML safety.
Logical operators && || ! and their alphabetic variants and or not. The first variant is required for XML safety.
The empty operator. The expression empty a is true if a is null, an array or String of length 0, or a Collection or Map of size 0.
The ternary ?: selection operator.
Operator precedence follows the same rules as in Java. The empty operator has the same precedence as the unary - and ! operators.
Generally, you do not want to do a lot of expression computation in web pages—that would violate the separation of presentation and business logic. However, occasionally, the presentation layer can benefit from operators. For example, suppose you want to hide a component when the hide property of a bean is true. To hide a component, you set its rendered attribute to false. Inverting the bean value requires the ! (or not) operator:
<h:inputText rendered="#{!bean.hide}" ... />
Finally, you can concatenate plain strings and value expressions by placing them next to each other. Consider, for example,
<h:outputText value="#{messages.greeting}, #{user.name}!"/>
The statement concatenates four strings: the string returned from #{messages. greeting}, the string consisting of a comma and a space, the string returned from #{user.name}, and the string consisting of an exclamation mark.
上文Q《core JavaServer™ Faces, Second Edition?/span>
For example, suppose that in our quiz application, the startOverAction returns the string "again" instead of "startOver". The same string can be returned by the answerAction. To differentiate between the two navigation cases, you can use a from-action element. The contents of the element must be identical to the method expression string of the action attribute:
This rule applies to all pages that start with the prefix /secure/. Only a single * is allowed, and it must be at the end of the ID string.
上文Q《core JavaServer™ Faces, Second Edition?/span>(This mechanism is attractive for builder tools because it separates navigation, beans, etc.)
Redirecting the page is slower than forwarding because another round trip to the browser is involved. However, the redirection gives the browser a chance to update its address field.
Figure 3-8 shows how the address field changes when you add a redirection element, as follows:
Without redirection, the original URL (localhost:8080/javaquiz/index.faces) is unchanged when the user moves from the /index.jsp page to the /success.jsp face. With redirection, the browser displays the new URL (localhost:8080/ javaquiz/success.faces).
Tip
![]() |
Use the redirect element for pages that the user might want to bookmark. |
把握的反面就是放弃,选择了一个机会,q于放弃了其他所有的可能?span style="color: red">当新的机会摆在面前的时候,敢于攑ּ已经获得的一切,q不是功亏一,q不是半途而废Q这是ؓ了谋求更大的发展I间Q或者什么都不ؓQ只因ؓ喜欢q样做,因ؓQ年d是最大的Z。hQ只有在三十岁之前才会有q个胆量Q有q个别资本,有这个资根{?nbsp;
2、失?nbsp;
不是不在乎,是在乎不赗三十岁前最怕失ȝ不是已经拥有的东西,而是梦想。爱情如果只是一个过E,那么正是q个q龄应当l历的,如果要承担结果,三十岁以后,可能会更有能力,更有资格?span style="color: red">其实Q三十岁之前我们要做的事情很多,E纵即逝,q久地沉溺在已经乾涸的爱河的沛_中,与这个年龄的生命节奏不合?nbsp;
3、离?nbsp;
不是不在乎,是一切还来得及。一位三十八岁的奛_与老公l婚十五q_h十三q_l于分手。她_「如果说后来不愿意离婚是Z孩子Q那他第一ơ提出离婚我没有同意Q现在想来真不知道ؓ什么。如果那个时候早分手Q我的生zȝ不会是今天这个样子。现在再重新开始,总觉得一切都晚了?nbsp;
4、漂?nbsp;
漂泊不是一U不q,而是一U资根{趁著没有家室拖累,著w体健康Q此时不飘何旉Q当Ӟ漂泊的不一定是w体Q也许只是惛_梦境。新世纪的时领袖是飘一代,渴望漂泊的h惟一不飘的是那颗心?nbsp;
5、失?nbsp;
三十岁以前就到׃的滋呛_然是一件不q的事,但不一定是坏事?span style="color: red">三十岁之前就q早地固定在一个职业上l此一生也许才是最大的不幸。失业也许让你想起埋藏很久而尘的梦想Q也怼唤醒q你自己都从未知道的潜能。也怽本来没什么梦惻Iq时候也会D你去做梦?nbsp;
6、时?nbsp;
不要q赶时尚。按说青qh应该是最时尚的,但是独立思考和个性生zL重要。在q个物质C会Q其实对时尚的追求早已经成ؓ寚wqq求?span style="color: red">今天Q时是物欲和世俗的同义语?/span>
7、格?nbsp;
q是资的东西,「小资」这个词在今天又二度行Q追求格调就是他们的专利。小资们_有格调要满四大要gQ智慧、素充R自信和金钱。格调就是把「高」理解成I著、气质、爱好的品味和室内装潢。也是大老粗只会表现谈吐的庸俗,「小资」们已经有能力庸俗他们的心灵了。主观念倒不是非要另c,另类已经成ؓq轻늚L了,在今天,老土倒显得另cR关键是当今C会是一个创造观늚时代Q而不是一个固守陈旧观늚时代?nbsp;
8、评?nbsp;
我们最不应该做出的牺牲是因ؓ别h的评仯改变自我,因ؓ那些对你指手画脚的h自己也不知道他们遵从的规则是什么?span style="color: red">千万不要只遵从规矩做事,规矩q在创造之中,要根据自q判断做每一件事Q虽然这样会ȝ一炏V?/span>
9、幼E?nbsp;
不要怕h说我们幼E,q正说明你还q轻Q还充满zd。「成熟」是个吓人的词儿Q也是个害h的词ѝ成熟和q稚是对一个h最大而无当、最不负责Q、最没用的概括。那些庸人,l不会有他们q稚。不信,到哪天你被生zd得老气横秋Q暮气沉沉的时候,Z一定会说你成熟了,你就会知道「成熟」是个什么东ѝ?nbsp;
10、不适应
在一首摇滚里有这么一句:「这个城市改变了我,q个城市不需要我。?span style="color: red">不要盲目地适应你生存的环境Q因为很可能q环境自w已l不适应q个C会的发展了?/span>
11、失?nbsp;
我的老师曄跟我_一个hL要在感情上失恋一ơ,在事业上p|一ơ,在选择上失误一ơ,才能长大。不要说p|是成功之母那L老话Q?span style="color: red">p|来得早好Q要是三十岁Q四十岁之后再经历失败,有些事,很可能就来不及了?nbsp;
12、错?nbsp;
q是q轻人的专利?/span>
13、浅?nbsp;
如果每看一ơ《泰坦尼克号》就一ơ眼泪,每看一ơ《大话西游》就W得直不赯Q就会有人笑你浅薄。其实那只能说明你的经依旧非常敏锐Q对哪怕非常微q刺激都会q速做出适应的反应;{你的感觉迟钝了Qh们就会说你深沉了?nbsp;
14、明?nbsp;
不是不必在乎Q是不能在乎。明星在商品C会是一U消费品Q花了钱Q听了歌Q看了电影,明星们的表现再好Q不q是物超所D己Q也不值得崇拜呀Q就像你在地摊上׃十块׃的裙子,别h都猜是八癑֝׃的,物超所g吧?你就崇拜上这w裙子了Q?nbsp;
15、代?nbsp;
不是不计代hQ而是要明白做M事都要付Z仗对我们q个q龄的h来说Q这l不是一句废话。否则,要到三十岁的时候才会明白自己曾l付Z多少代hQ却不明白ؓ什么付出,更不明白自己得到了多,得到什么?nbsp;
16、孤?nbsp;
q是׃出的代h?nbsp;
17、失?nbsp;
包括感情上的Q事业上的,也许仅仅是今天花了冤枉钱没买到可心的东西Q朋友家高朋满自己却插不上一句话。过分在乎失意的感受不是拿命q的捉弄来捉弄自己,是拿别人的错误来惩|自己?nbsp;
18、缺?nbsp;
也许你个子矮Q也怽长得不好看,也许你的嗓音像唐老鸭、、、那么你的优势就是你不会被自p面的薄的亮Ҏ耽搁Q少׃些时_走一些弯Q直接发C内在的优势,直接挖掘自己深层的潜能?nbsp;
19、误?nbsp;
如果Z恶意Q那么解释也没有用;如果Z善意Q就不需要解释。专门说到「误会」倒不是因Z个h在三十岁之前被h误会的时候更多,而是q个q龄的h想不开的时候更多?nbsp;
20、谣a
q是一U传染病Q沈默是最好的疫苗。除非你能找Z染源Q否则解释恰C成ؓ病毒传播最理想的条件?nbsp;
21、疯?nbsp;
q是q轻人最好的心理调适,只能说明你精力旺盛,w心健康。说你「疯狂」是某些生活压抑、心力交瘁的中老年人恶意的评hQ他们就像一部年久修的机器,最需要调适,但只能微调,一ơ大修就会让他们完诞?nbsp;
22、稳?nbsp;
三十岁之前就在乎E_的生z,那只有两U可能,要么是中了彩票Q要么就是未老先衰?nbsp;
23、压?nbsp;
中年够承受多大压力检验的是他的韧性;q轻承受多大压力Q焕发的是他的潜能?nbsp;
24、出?nbsp;
也许是个ZQ也许是个陷阱。除非从考大学的那一M抱著这个目标,否则Q对待出国的态度应该像对待爱情一P努力争取Q成败随~?/span>?nbsp;
25、薪?nbsp;
只是lh打工Q薪水再高也高不到哪儿去。所?span style="color: red">在三十岁之前Q机会远比金钱重?/span>Q?span style="color: red">事业q比金钱重要Q?span style="color: red">来q比金钱重要。对大多Ch来说Q?span style="color: red">三十岁之前干事业的首要目标绝不是挣钱Q而是挣未?/span>?nbsp;
26、存?nbsp;
q倒不一定是因ؓ我们钱少Q年Mh现在谁都知道钱是有生命的。机会这么多Q条件这么好Q可以拿钱去按揭Q做今天的事Q花明天的钱Q也可以拉KL资,拉K厅R充c?span style="color: red">钱只有在它流通的q程中才是钱Q否则只 是一叠世界上质量最好的废纸?nbsp;
27、房?nbsp;
除非你买房子是ؓ了升|要嘛是你结婚了。我有个同学Q家在外圎ͼ大学毕业之后Q单位没有宿舍,安q他买了一套房子。他曄有过d京工作的ZQ但是他觉得刚买了房子就dq城市说不q去Q就攑ּ了。到现在他工作稳定,但一事无成。唯一的成就是结婚了Qƈ且有了孩子,因ؓ他觉得不该让q房子永q空著,所以房子变成了家。房子是都市生活的寓aQ这个寓a不应该过早的和我们相兟?nbsp;
28、年?nbsp;
奛_子一q二十五开始隐瞒自qq龄Q其实大可不必。现在青q期都gq到四十五岁了,二十五又得了什么呢Q?nbsp;
29、在?nbsp;
q是一U拿不v、放不下的心态,它的反面不是攑ּQ而是天马行空Q自p在,永远保持革命乐观M的精?/span>
一、连接MYSQL?
格式Q?mysql -hL地址 -u用户?Qp用户密码
1、例1Q连接到本机上的MYSQL?
首先在打开DOSH口Q然后进入目?mysqlbinQ再键入命omysql -uroot -pQ回车后提示你输密码Q如果刚安装好MYSQLQ超U用户root是没有密码的Q故直接回R卛_q入到MYSQL中了QMYSQL的提C符是:mysql>
2、例2Q连接到q程L上的MYSQL。假设远E主机的IP为:110.110.110.110Q用户名为root,密码为abcd123。则键入以下命oQ?
mysql -h110.110.110.110 -uroot -pabcd123
Q注:u与root可以不用加空|其它也一P
3、退出MYSQL命oQ?exit Q回车)
二、修改密码?
格式Qmysqladmin -u用户?-p旧密?password 新密?
1、例1Q给root加个密码ab12。首先在DOS下进入目录mysqlbinQ然后键入以下命?
mysqladmin -uroot -password ab12
注:因ؓ开始时root没有密码Q所?p旧密码一就可以省略了?
2、例2Q再root的密码改为djg345?
mysqladmin -uroot -pab12 password djg345
三、增加新用户。(注意Q和上面不同Q下面的因ؓ是MYSQL环境中的命oQ所以后面都带一个分号作为命令结束符Q?
格式Qgrant select on 数据?* to 用户名@dL identified by \"密码\"
?、增加一个用户test1密码为abcQ让他可以在ML上登录,q对所有数据库有查询、插入、修攏V删除的权限。首先用以root用户q入MYSQLQ然后键入以下命令:
grant select,insert,update,delete on *.* to test1@\"%\" Identified by \"abc\";
但例1增加的用h十分危险的,你想如某个h知道test1的密码,那么他就可以在internet上的M一台电脑上d你的mysql数据库ƈ对你的数据可以ؓ所Ʋؓ了,解决办法见例2?
?、增加一个用户test2密码为abc,让他只可以在localhost上登录,q可以对数据库mydbq行查询、插入、修攏V删除的操作Qlocalhost指本C机,即MYSQL数据库所在的那台LQ,q样用户即用知道test2的密码,他也无法从internet上直接访问数据库Q只能通过MYSQLL上的web|讉K了?
grant select,insert,update,delete on mydb.* to test2@localhost identified by \"abc\";
如果你不想test2有密码,可以再打一个命令将密码消掉?
grant select,insert,update,delete on mydb.* to test2@localhost identified by \"\";
在上我们讲了登录、增加用戗密码更改等问题。下我们来看看MYSQL中有x据库斚w的操作。注意:你必首先登录到MYSQL中,以下操作都是在MYSQL的提C符下进行的Q而且每个命o以分L束?
一、操作技?
1、如果你打命令时Q回车后发现忘记加分P你无重打一遍命令,只要打个分号回R可以了。也是说你可以把一个完整的命o分成几行来打Q完后用分号作结束标志就OK?
2、你可以使用光标上下键调Z前的命o。但以前我用q的一个MYSQL旧版本不支持。我现在用的是mysql-3.23.27-beta-win?
二、显C命?
1、显C数据库列表?
show databases;
刚开始时才两个数据库Qmysql和test。mysql库很重要它里面有MYSQL的系l信息,我们改密码和新增用户Q实际上是用这个库q行操作?
2、显C库中的数据表:
use mysqlQ/Q打开库,学过FOXBASE的一定不会陌生吧
show tables;
3、显C数据表的结构:
describe 表名;
4、徏库:
create database 库名;
5、徏表:
use 库名Q?
create table 表名 (字段讑֮列表)Q?
6、删库和删表:
drop database 库名;
drop table 表名Q?
7、将表中记录清空Q?
delete from 表名;
8、显C中的记录Q?
select * from 表名;
三、一个徏库和以及插入数据的实?
drop database if exists school; //如果存在SCHOOL则删?
create database school; //建立库SCHOOL
use school; //打开库SCHOOL
create table teacher //建立表TEACHER
(
id int(3) auto_increment not null primary key,
name char(10) not null,
address varchar(50) default ’深圳’,
year date
); //l束
//以下为插入字D?
insert into teacher values(’’,’glchengang’,’深圳一?#8217;,’1976-10-10’);
insert into teacher values(’’,’jack’,’深圳一?#8217;,’1975-12-23’);
注:在徏表中Q?Q将ID设ؓ长度?的数字字D?int(3)q让它每个记录自动加一:auto_incrementq不能ؓI?not null而且让他成ؓdDprimary keyQ?Q将NAME设ؓ长度?0的字W字D(3Q将ADDRESS设ؓ长度50的字W字D,而且~省gؓ深圳。varchar和char有什么区别呢Q只有等以后的文章再说了。(4Q将YEAR设ؓ日期字段?
如果你在mysql提示W键入上面的命o也可以,但不方便调试。你可以以上命令原样写入一个文本文件中假设为school.sqlQ然后复制到c:\\?/span>Qƈ在DOS状态进入目?/span>\\mysql\\binQ然后键入以下命令:
mysql -uroot -p密码 < c:\\school.sql
如果成功Q空Z行无M昄Q如有错误,会有提示。(以上命o已经调试Q你只要?/的注释去掉即可用)?
四、将文本数据转到数据库中
1、文本数据应W合的格式:字段数据之间用tab键隔开Qnull值用\\n来代?/span>.
例:
3 rose 深圳二中 1976-10-10
4 mike 深圳一?1975-12-23
2、数据传入命?load data local infile \"文g名\" into table 表名;
注意Q你最好将文g复制?/span>\\mysql\\bin目录?/span>Qƈ且要先用use命o打表所在的库?
五、备份数据库Q(命o在DOS?/span>\\mysql\\bin目录下执?/span>Q?
mysqldump --opt school>school.bbb
注释:数据库school备䆾到school.bbb文gQschool.bbb是一个文本文Ӟ文g名Q取,打开看看你会有新发现?
后记Q其实MYSQL的对数据库的操作与其它的SQLcL据库大同异Q您最好找本将SQL的书看看。我在这里只介绍一些基本的Q其实我也就只懂q些了,呵呵。最好的MYSQL教程q是“晏子“译的“MYSQL中文参考手?#8220;不仅免费每个相关|站都有下蝲Q而且它是最权威的。可惜不是象\"PHP4中文手册\"那样是chm的格式,在查扑և数命令的时候不太方?/span>
源文?<http://inclear.bokee.com/5197086.html>
MENU: Window->Preferences->General->Workspace::Text file encoding: Other[UTF-8] |
1. MENU: Window->Preferences->Java->Compiler::Compiler compliance level: 6.0 2. MENU: Window->Preferences->Java->Installed JREs::(Add...)jdk1.6.0 3. MENU: Window->Preferences->MyEclipse->Application Servers->Tomcat->Tomcat 6.x::Enable,%Apache-tomcat-6.0.10% Window->Preferences->MyEclipse->Application Servers->Tomcat->Tomcat 6.x->JDK::jdk1.6.0 |