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
| URL: http://test.com/ | |
| Source0: %{name}-%{version}.tar.gz | |
| BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | |
| %description | |
| %{summary} | |
| %prep | |
| %setup -q |
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
| <servlet> | |
| <servlet-name>AppServlet</servlet-name> | |
| <servlet-class> | |
| com.myapp.AppServlet | |
| </servlet-class> | |
| <init-param> | |
| <param-name>debug</param-name> | |
| <param-value>0</param-value> | |
| </init-param> | |
| <init-param> |
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
| function loadXml() | |
| { | |
| var file = location.protocol + "//" + location.host + location.port + "/xml/app.xml"; | |
| var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); | |
| xmldoc.async = false; | |
| xmldoc.load(file); | |
| // print some data from the xml file | |
| alert(xmldoc.getElementsByTagName("MY")[0].firstChild.nodeValue); | |
| } |
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
| /** | |
| * MyProxyDirContext extends ProxyDirContext of Tomcat | |
| * Here override the nonCacheable array | |
| */ | |
| package com.myapp; | |
| import java.util.Hashtable; | |
| import org.apache.log4j.Logger; | |
| import javax.naming.directory.DirContext; | |
| import org.apache.naming.resources.CacheEntry; |
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
| /* AppServlet extends DefaultServlet of Tomcat | |
| */ | |
| package com.myapp; | |
| import java.io.File; | |
| import javax.naming.NamingException; | |
| import javax.servlet.ServletException; | |
| import org.apache.catalina.servlets.DefaultServlet; |
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
| <servlet> | |
| <servlet-name>default</servlet-name> | |
| <servlet-class> | |
| org.apache.catalina.servlets.DefaultServlet | |
| </servlet-class> | |
| <init-param> | |
| <param-name>debug</param-name> | |
| <param-value>0</param-value> | |
| </init-param> | |
| <init-param> |
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 void buildKnowledgeBase() | |
| { | |
| //MyClass is holding this method | |
| synchronized(MyClass.class) | |
| { | |
| KnowledgeBuilder kbuilder = | |
| KnowledgeBuilderFactory.newKnowledgeBuilder(); | |
| kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ), | |
| ResourceType.DRL); | |
| assertFalse( kbuilder.hasErrors() ); |
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 void buildKnowledgeBase() | |
| { | |
| KnowledgeBuilder kbuilder = | |
| KnowledgeBuilderFactory.newKnowledgeBuilder(); | |
| kbuilder.add( ResourceFactory.newUrlResource( "file://myrules.drl" ), | |
| assertFalse( kbuilder.hasErrors() ); | |
| KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); | |
| } |
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
| package com.test; | |
| import java.io.Serializable; | |
| public class Singleton implements Serializable | |
| { | |
| private static final long serialVersionUID = 1L; | |
| private static Singleton s = null; | |
| // to block instantiation by others |
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
| package com.test; | |
| import java.lang.reflect.Constructor; | |
| import java.lang.reflect.InvocationTargetException; | |
| public class SingletonTest | |
| { | |
| public static void main(String[] args) |
NewerOlder