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#»¹ÊÇjava£¬¶¼ËµjavaÒÔºóµÄÇ°¾°·Ç³£µÄÀÖ¹Û£¬Ö÷ÒªÊÇÌåÏÖÔÚÒƶ¯Í¨ÐÅƽ̨ÉÏ£¬µ«ÊÇC#×÷Ϊ΢ÈíµÄ“ɱÊÖïµ”£¬Óë´Ëͬʱ΢Èí×÷Ϊҵ½çÀÏ´óµÄµØλËÓÖÄܺ³¶¯ÄÄ£¬Î´À´µÄÔƼÆËã¶Ô¼ÆËã»úÖÕ¶Ëƽ̨µÄ¸ïÃüÐԵĸı䣬windows²Ù×÷ϵͳµÄ°ÔÖ÷µØλ²ÅÓпÉÄܱ»º³¶¯¡£c#µÄ·½±ã¼òµ¥Ó ......
ÕûÌåϵͳ²ÉÓÃJavaÖÐSpring ,Struts, Hibernate×é³É¡£
ÔÚActionÖУº
public ActionForward orgview(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) {
// TODO Auto-generated method stub
ActionForward forward = new ActionForward("strpath");
Http ......
ÍøÉÏJAVAµ÷ÓÃDLLµÄÎÄÕ²»ÉÙÁË£¬µ«·¢ÏÖÓÐЩ»¹ÊÇÓÐÎÊÌâ¡£¸ÕºÃÑо¿ÁËһϣ¬ÉÔ×ö¸ü¸Äºó£¬ÔÚVC2005ÉϲâÊÔͨ¹ý£¬£¨ReleaseºÍDebug°æ±¾¾ù¿É£©¡£
¸ü¸Äµã£º
1¡¢#include "jni.h"
2¡¢½«jni_md.hÖеģº#define JNICALL __stdcall±äΪ£º#define JNICALL __cdecl (º¯ÊýʹÓõÄÓ¦¸ÃÊÇcÓïÑÔµÄȱʡµ÷Ó÷½Ê½_cdecl·½Ê½£¬·ñÔòDLLÀ ......
ÉùÃ÷£º±¾ÎIJ¢·Ç±¾ÈËËùд£¬ÊÇÍøÉÏ¿´µ½µÄ£¬µ«ÊǸÃÎÄûÓбêÃ÷³ö´¦£¬ËùÒÔ±¾ÈËÒ²²»ÖªµÀ
×÷ΪJava³ÌÐòÔ±À´Ëµ£¬×îÍ´¿àµÄÊÂÇéĪ¹ýÓÚ¿ÉÒÔÑ¡ÔñµÄ·¶Î§Ì«¹ã£¬¿ÉÒÔ¶ÁµÄÊéÌ«¶à£¬ÍùÍùÈÝÒ×ÎÞËùÊÊ´Ó¡£ÎÒÏë¾ÍÎÒ×Ô¼º¶Á¹ýµÄ¼¼ÊõÊé¼®ÖÐÌôÑ¡³öÀ´Ò»Ð©£¬°´ÕÕѧϰµÄÏȺó˳Ðò£¬ÍƼö¸ø´ó¼Ò£¬ÌرðÊÇÄÇЩÏë²»¶ÏÌá¸ß×Ô¼º¼¼ÊõˮƽµÄJava³ÌÐòÔ±ÃÇ¡£
Ò»¡¢ ......