This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static WebApplicationContext getCurrentWebApplicationContext() { | |
| return (WebApplicationContext) currentContextPerThread.get(Thread.currentThread().getContextClassLoader()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.context.ApplicationContext | |
| import org.springframework.context.support.FileSystemXmlApplicationContext | |
| class BeanUtil { | |
| ApplicationContext context=new FileSystemXmlApplicationContext("classpath:applicationContext.xml"); | |
| static instance = new BeanUtil(); | |
| public Object get(Object s) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 在web.xml中配置 | |
| 配置监听器: | |
| <listener> | |
| <listener-class>org.springframework.web.context.ContextLoaderListener </listener-class> | |
| </listener> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Jsp中处理: | |
| <% | |
| //第三种方式 | |
| ServletContext servletContext = request.getSession().getServletContext(); | |
| ApplicationContext ctx=WebApplicationContextUtils.getWebApplicationContext(servletContext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import javax.swing.ImageIcon | |
| import java.awt.Color | |
| import java.awt.image.BufferedImage | |
| import java.awt.image.ColorModel | |
| import java.awt.image.WritableRaster | |
| import java.awt.Graphics2D | |
| import javax.imageio.* | |
| import java.awt.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MapQueue { | |
| def max=0 | |
| def last=0 | |
| def c = [:] | |
| def q = [] | |
| def MapQueue(m){ | |
| max=m | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.lucene.analysis.Analyzer | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer | |
| import org.apache.lucene.document.Document | |
| import org.apache.lucene.document.Field | |
| import org.apache.lucene.document.LongField | |
| import org.apache.lucene.document.StringField | |
| import org.apache.lucene.document.TextField | |
| import org.apache.lucene.index.IndexWriter | |
| import org.apache.lucene.index.IndexWriterConfig | |
| import org.apache.lucene.index.Term |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://www.cnblogs.com/lcuzhanglei/archive/2012/08/01/2618381.html | |
| // 对于要排序的字段,在索引的时候可以Field.Index.NOT_ANALYZED | |
| import org.apache.lucene.analysis.Analyzer | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer | |
| import org.apache.lucene.index.IndexReader | |
| import org.apache.lucene.index.DirectoryReader; | |
| import org.apache.lucene.queryparser.classic.QueryParser | |
| import org.apache.lucene.search.IndexSearcher | |
| import org.apache.lucene.search.Query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.lucene.analysis.Analyzer | |
| import org.apache.lucene.analysis.standard.StandardAnalyzer | |
| import org.apache.lucene.index.IndexReader | |
| import org.apache.lucene.index.DirectoryReader; | |
| import org.apache.lucene.queryparser.classic.QueryParser | |
| import org.apache.lucene.search.IndexSearcher | |
| import org.apache.lucene.search.Query | |
| import org.apache.lucene.search.TopDocs | |
| import org.apache.lucene.store.FSDirectory; | |
| import org.apache.lucene.util.Version; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ReflectTest { | |
| def name | |
| def height | |
| def add(){ | |
| println "add" | |
| } | |
| def add(a){ |
OlderNewer