Java ELϵÁÐ 2.JUEL¿ìËÙÈëÃÅ
¡¡¡¡inkfish·Ò룬ÇëÎðÉÌÒµÐÔÖÊ×ªÔØ£¬×ªÔØÇë×¢Ã÷À´Ô´£¨http://blog.csdn.net/inkfish
£©¡£±¾ÎÄÊÇÎÒѧϰJUELͬʱ£¬¶ÔÔÍøÕ¾½øÐеļòµ¥µÄ·Ò룬ÔÍøÕ¾µØÖ·£ºhttp://juel.sourceforge.net/guide/start.html
¡£
¿ìËÙÈëÃÅ
¡¡¡¡JUEL
·¢Ðаæ°üº¬ÏÂÃæÒ»Ð©jarÎļþ£º£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
¡¡¡¡1.juel-api-2.2.x.jar
——°üº¬javax.el
°üϵÄһЩÀà
¡¡¡¡2.juel-impl-2.2.x.jar
——°üº¬de.odysseus.el
ʵÏÖÀà
¡¡¡¡3.juel-spi-2.2.x.jar
——°üº¬META-INF/service/javax.el.ExpressionFactory
·þÎñÌṩ×ÊÔ´µÄ¶¨Ò壨Èç¹ûÄãµÄclasspathÀïÓжà¸öELµÄʵÏÖ£¬¶øÄãÓÖÏ£ÍûʹÓÃJUELµÄʵÏÖ£¬ÄÇôÐèÒªµ÷ÓÃExpressionFactory.newInstance()
£©
¡¡¡¡4.juel-2.2.x.jar
——°üº¬java.el
°üϵÄÀ࣬²¢ÇÒ°üº¬de.odysseus.el
ϵÄʵÏÖÀ࣬¶øÇÒ»¹ÓзþÎñÌṩ½Ó¿Ú£¨spi£©
¡¡¡¡Ò²¾ÍÊÇ˵£ºjuel-2.2.x.jar = juel-api-2.2.x.jar + juel-impl-2.2.x.jar + juel-spi-2.2.x.jar
¡££¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
¡¡¡¡ÏÂÃæÊÇËùÓÐÄãÔÚÄãµÄÓ¦ÓÃÖÐʹÓÃELËùÐèÒªµÄ£¨¼ÙÉèÄãÒѾ°Ñjuel-2.2.x.jar
·Åµ½classpathÏ£¬²¢ÇÒµ¼ÈëÁËjavax.el.*
£©£º£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
¡¡¡¡1.¹¤³§ºÍÉÏÏÂÎÄ£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
//ExpressionFactoryÀàµÄʵÏÖÊÇde.odysseus.el.ExpressionFactoryImpl
ExpressionFactory factory = new de.odysseus.el.ExpressionFactoryImpl();
//de.odysseus.el.util provides°üÌṩ¼´Ê±¿ÉÓõÄ×ÓÀàELContext
de.odysseus.el.util.SimpleContext context = new de.odysseus.el.util.SimpleContext();
¡¡¡¡2. º¯ÊýºÍ±äÁ¿£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
//ÉèÖÃmapº¯Êýmath:max(int, int)ʹÓÃjava.lang.Math.max(int, int)
context.setFunction("math", "max", Math.class.getMethod("max", int.class, int.class));
//map±äÁ¿fooÉèÖÃΪ0
context.setVariable("foo", factory.createValueExpression(0, int.class));
¡¡¡¡3. ½âÎöºÍÇóÖµ£¨À´Ô´£ºhttp://blog.csdn.net/inkfish£©
//½âÎö±í´ïʽ
ValueExpression e = factory.createValueExpression(context, "${math:max(foo,bar)}", int.class);
//ÉèÖö¥¼¶µÄÊôÐÔ"bar"ֵΪ1
factory.createValueExpression(context, &qu
Ïà¹ØÎĵµ£º
Ê×ÏÈ˵Ã÷Ò»ÏÂÕâ¸ö”¿ì”µÄº¬Òå,ÎÒÏëÒÔǰÄÇЩÌÖÂÛÕâ¸ö»°ÌâµÄÈ˵±È»ÈÏΪÕâ¸ö¿ìÊÇÖ¸³ÌÐòµÄÔËÐÐËÙ¶È,ÖÁÓÚ”Èí¼þ¿ª·¢ËÙ¶È”¿ÖÅÂÏëҲûÏë,»òÐíÈÏΪÈí¼þ¿ª·¢ËٶȺÍÕâ¸ö»°Ìâ³¶²»ÉÏÒ»µã¹ØÏµ.ÄÇôÕâ¸öÎÊÌâÔÚÍøÉÏËÑËÑ,ËѵÄÒ»´ó¶Ñ,ÄÇЩc/c++ÕóÓªµÄÁÐÁ˺ܶàÀý×ÓÀ´ËµÃ÷c/c++¿ì, javaÕóÓªµÄÒ²ÊÇÈç´ ......
One:14109
Two:14000
Three:15141
four:14297
package com.zbalpha.test;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class ListTest {
public static void main(String args[]){
List<Long> ......
Ê×ÏÈÊÇbuild sample
Óöµ½µÄµÚÒ»¸ö´íÎó
ADCDMST:/Z19/usr/lpp/cicsts/cicsts32/samples/dfjcics: >make -f makefile jvm
make: Error -- FSUM9383 Configuration file `/etc/startup.mk' not found
ÐÞ¸´£ºcp /samples/startup.mk /etc/startup.mk
export JAVA_HOME=/Z19/usr/lpp/jav ......
import java.util.prefs.*;
public class Registery {
String[] keys = {"oa"};
String[] values = {"reg"};
//°ÑÏàÓ¦µÄÖµ´¢´æµ½±äÁ¿ÖÐÈ¥
public void writeValue() { ......