Docker Introduction
Sometimes in java you get an inputstream, you need to process it the first time to process the data then you need it again to output the contents. To do thi...
Sometimes when you’re working on jsp pages and you need to set a base url for all pages, and this value needs to be available for use, then use the followin...
The Template pattern formalizes the idea of defining an algorithm in a class, but leaving some of the details to be implemented in subclasses. Reasons for ...
Observer pattern - one subject many observers, state changes in the subject must be notified to all observers. Observers first register with the subject, on...
What is encapsulation? Encapsulation can be used to hide implementation details but it can also be used to separate your application into logical parts. Fin...
Method overloading, is when method with same name co-exists in same class but they must have different method signature. Method overloading is done via ...
String is immutable StringBuffer and StringBuilder is mutable StringBuffer is synchronized thread safe. StringBuilder is not thread safe but operation is fa...
How to get the date in bat? Windows XP.for /f “tokens=1-4 delims=/ “ %%a in (‘date /t’) do (set year=%%a& set month=%%b& set day=%%c& set weekd...
If you want to use the image manipulation toolkit included with the JDK.when using this in eclipse:Image image = Toolkit.getDefaultToolkit().getImage(“tray.g...
Hi All I am looking for a java package that will help me in checking a stream of data.This will be used on the network and will probably do the checking on ...
case insensitive search for a string Properties properties = System.getProperties(); properties.list(System.out); String osname = (String)pr...
using tomcat to connect to ldapedit server.xml<Realm className=”org.apache.catalina.realm.JNDIRealm”debug=”99”connectionName=”cn=root”connectionPassword=...
add security-constraint, login-config, security-role into web.xml<security-constraint> <display-name>securityconstraint</display-name...
Clearing logs or file purging should be done at the systems level and not at the programming or applications level because cleaning logs or deleting files ...
favour composition over inheritance. even though you have common code in the base class and child classes uses those methods it is better to move those com...
use template method when you need a base class to contain a certain behaviour with some base algorithms while having the subclasses implement those other b...
use delegation when you need an object to contain behaviour of two other objects containing the same methods.some object pretending to be another object but...
use abstract factory if you need platform independence, for example if you have an api that creates buttons and you need to modify the library so that you ...
struts redirect howto different web contextswebappA sendredirect to webappBString url = response.encodeRedirectURL(“urlwithparameters”);System.out.println(“...
struts tags usageusing arraylist and mapsdefine in your action<pre>List urlName = new ArrayList();for (Iterator i = st.iterator(); i.hasNext();) {Str...
Create a struts action - LogoutAction.java<pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;back...
If you need to setup ssl (‘https’) connections to your apache2 webserver then use the following steps. sudo mkdir /etc/apache2/ssl sudo openssl req -x509...
Alias /pds /packaging/sun/pds <directory packaging="" pds="" sun=""> Options Indexes Order allow,deny Allow from all </directory> Make changes ...
apache httpd reverse proxy settings howtoLoadModule proxy_module modules/mod_proxy.soLoadModule proxy_ajp_module modules/mod_proxy_ajp.soLoadModule proxy_ba...
Use prstat to see the Processes and CPU loadUse vmstat 2 2 to indicate the free memoryUse iostat to see internal disksUse netstat to see network infoUse mpst...
How to setup a virtualhost in Apache for example same ip apache 80 port -> tomcat 8080 port (use reverse proxy) apache 19080 port -> tomcat 9080 port(...
for tomcatadd crossContext=”true” to server.xml for the web applications context:<pre><Context docBase=”C:/eclipse/workspace/WebAppA/WebContent” p...
Must have constant improvement.Go over each topic.Create examples for each topic.Doesn’t matter if it takes time, that is what improvement means.
change directory in preferencesgoto file -> consolidate library to move files
web 1.0 people just put their static information on the webweb 1.5 some interactivity mainly online shoppingweb 2.0 is all about interactivity and communicat...
use jetty to run program To use the Jetty Plugin just add the following in your pom.xml: <project> ... <build> <plugins> &l...
Here are some basic maven commands for setting up your project: JavaWebapp mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=co...
Maven dependency management Scenario: jar file from repository not in the format you want. <pre style="background-color: #eeeeee; border: 1px dashed rgb(1...
infoqredbooksstackoverfloww3schoolshttp://java-source.net/
http://www.itconversations.com/
Things NOT to do:how not to do thingsdon’t just do, confirm the requirements in writing before implementing.reduce the risk of customers saying i didn’t ask ...
Must have a environment setup so that the company can run right.Must have a file server where commonly used files can be stored eg. slide templates.This ca...
This is a simple example of webservices using jax-ws spring component.It is a contact application that allows you to store your addresses.The webservice retr...
This is a blog on how I implemented webservices using the spring framework.In part 1 we setup a simple spring web application. A simple contactapplication wh...
public static String getPreviousDN(String dn) { String retString = null; try { DirContext DirCtx = DriverLocator.getInstance().get...
Hibernate annotations - hibernate without the mapping filesnote: you must use jdk1.5, hibernate 3.2 core and annotationscreate hibernate.cfg.xml<pre st...
saving to application scoperequest.getSession().getServletContext().setAttribute(“applicationmap”, map);retrieving from application scopeMap smap = (Map)r...
close projectopen .project fileadd<nature>org.eclipse.wst.common.project.facet.core.nature</nature>open projectright click project -> proper...
This is an example on writing a Message Driven Bean in JBossif you decide to use jboss as your application servercomponents usedjboss-4.0.5.GAeclipse 3.2xdo...
This is an example on writing a Message Driven Bean in JBossif you decide to use jboss as your application servercomponents usedjboss-4.0.5.GAeclipse 3.2xdo...
This is a simple example of webservices using jax-ws spring component.It is a contact application that allows you to store your addresses.The webservice retr...
Requirement: Got a video that was encoded using HEVC, couldn’t play it on my device so have to convert it to mpeg4. The tool ffmpeg was replaced in previous...
If you tried the gcm playground and it does not work then try gcm quickstart tutorial. git clone https://github.com/googlesamples/google-services.git You ...
If you use jenkins and you have a project that uses gradle, how do you create a task that builds the project and deploy the artifact to tomcat? For this exa...
If you use jenkins and you have a project that uses gradle, how do you create a task that builds the project and deploy the artifact to tomcat? For this exa...
Sometimes when you’re working on jsp pages and you need to set a base url for all pages, and this value needs to be available for use, then use the followin...