English Sentence Loading...
英语句子加载中...
这二天在学习struts2,发现struts2比struts1要强很多,无论是配置文件的配置强难还是代码的简单化,Struts2无疑要强过Struts1,下面来说说如果把String2部署到resin3下的时候,你可能会遇到这强一个错误。
Loading .tld files from global classpath
[02:13:37.031] com.caucho.xml.XmlParseException: jar:file:/D:/book/WEB-INF/lib/standard.jar!/META-INF/permittedTaglibs.tld:12: <jsp-version> is an unexpected tag (parent <taglib> starts at 7).
[02:13:37.031]
Loading .tld files from global classpath
[02:13:37.031] com.caucho.xml.XmlParseException: jar:file:/D:/book/WEB-INF/lib/standard.jar!/META-INF/permittedTaglibs.tld:12: <jsp-version> is an unexpected tag (parent <taglib> starts at 7).
[02:13:37.031]
can't load com.sun.tools.javac.Main2006-11-30 16:57错误描述:
Resin can't load com.sun.tools.javac.Main. Usually this means that the
JDK tools.jar is missing from the classpath, possibly because of using
a JRE instead of the JDK. You can either add tools.jar to the classpath
or change the compiler to an external one with <java compiler='javac'/>
Resin can't load com.sun.tools.javac.Main. Usually this means that the
JDK tools.jar is missing from the classpath, possibly because of using
a JRE instead of the JDK. You can either add tools.jar to the classpath
or change the compiler to an external one with <java compiler='javac'/>
如何使用spring的作用域:
程序代码
这里的scope就是用来配置spring bean的作用域,它标识bean的作用域。
在spring2.0之前bean只有2种作用域即:singleton(单例)、non-singleton(也称prototype),Spring2.0以后,增加了session、request、global session三种专用于Web应用程序上下文的Bean。因此,默认情况下Spring2.0现在有五种类型的Bean。当然,Spring2.0对Bean的类型的设计进行了重构,并设计出灵活的Bean类型支持,理论上可以有无数多种类型的Bean,用户可以根据自己的需要,增加新的Bean类型,满足实际应用需求。
程序代码<bean id="role" class="spring.chapter2.maryGame.Role" scope="singleton"/>
这里的scope就是用来配置spring bean的作用域,它标识bean的作用域。
在spring2.0之前bean只有2种作用域即:singleton(单例)、non-singleton(也称prototype),Spring2.0以后,增加了session、request、global session三种专用于Web应用程序上下文的Bean。因此,默认情况下Spring2.0现在有五种类型的Bean。当然,Spring2.0对Bean的类型的设计进行了重构,并设计出灵活的Bean类型支持,理论上可以有无数多种类型的Bean,用户可以根据自己的需要,增加新的Bean类型,满足实际应用需求。
拦截器(interceptor)是动态拦截action的调用对象,通过interceptor可以由用户自己定义在一个action执行前后所要执行的代码,也可以阻止action的执行。
谈到拦截器,还有一个拦截器栈的概念。拦截器栈就是将若干个拦截器按照一定的顺序连接成一条链。在访问被拦截的对象时,拦截器栈中的拦截器会按照事先定义好的顺序被调用。
在Struts2中拦截器的实现方式比较简单,就是在一个请求到达FilterDispatcher的时候,通过读取struts.xml来得到配置的拦截器信息,并实例化这些拦截器,使之成为一个序列,然后按照配置好的顺序逐个调用这些拦截器。
下面是Struts2的架构图,从这个架构图中可以看出interceptor的执行时机
我的电脑已经是第二次坏了,这次CPU风扇给烧了,原因是因为主板的控温电路坏了,以至于风扇被烧,更导致只要CPU过热就会报警,结果今天溜溜修了一天,结果当时试的时候是好的,回家之后玩了2小时又报警了...TNND,看来周末还得跑一趟,真T郁闷了....真不顺.
一分钱
37
0






