Posts

Showing posts from August, 2014

Featured Post

JSP File Upload Program

<%@ page import = "java.io.*,java.util.*, javax.servlet.*" %> <%@ page import = "javax.servlet.http.*" %> <%@ page import = "org.apache.commons.fileupload.*" %> <%@ page import = "org.apache.commons.fileupload.disk.*" %> <%@ page import = "org.apache.commons.fileupload.servlet.*" %> <%@ page import = "org.apache.commons.io.output.*" %> <% File file ; int maxFileSize = 5000 * 1024 ; int maxMemSize = 5000 * 1024 ; ServletContext context = pageContext . getServletContext (); String filePath = context . getInitParameter ( "file-upload" ); // Verify the content type String contentType = request . getContentType (); if (( contentType . indexOf ( "multipart/form-data" ) >= 0 )) { DiskFileItemFactory factory = new DiskFileItemFactory (); // maximum size that will be stored in memory ...

Http Status Codes

Code: Message: Description: 100 Continue Only a part of the request has been received by the server, but as long as it has not been rejected, the client should continue with the request 101 Switching Protocols The server switches protocol. 200 OK The request is OK 201 Created The request is complete, and a new resource is created  202 Accepted The request is accepted for processing, but the processing is not complete. 203 Non-authoritative Information   204 No Content   205 Reset Content   206 Partial Content   300 Multiple Choices A link list. The user can select a link and go to that location. Maximum five addresses   301 Moved Permanently The requested page has moved to a new url  302 Found The requested page has moved temporarily to a new url  303 See Other The requested page can be found under a different url  304 Not Modified   305 Use Proxy   306 Unused This code was used in a previous version. It is no lon...

Spring ApplicationContext CustomEvent

Spring CustomEvent Example ------------------------------------ import org . springframework . context . ApplicationEvent ; public class CustomEvent extends ApplicationEvent { public CustomEvent ( Object source ) { super ( source ); } public String toString (){ return "My Custom Event" ; } } import org . springframework . context . ApplicationEventPublisher ; import org . springframework . context . ApplicationEventPublisherAware ; public class CustomEventPublisher implements ApplicationEventPublisherAware { private ApplicationEventPublisher publisher ; public void setApplicationEventPublisher ( ApplicationEventPublisher publisher ){ this . publisher = publisher ; } public void publish () { CustomEvent ce = new CustomEvent ( this ); publisher . publishEvent ( ce ); } } import org . springframework . context . ApplicationListener ; ...

Spring Events Handled by ApplicationContext

Here mentioned below events gets triggered by ApplicationContext and its associated class  ApplicationContextListener S.N. Spring Built-in Events & Description 1 ContextRefreshedEvent This event is published when the  ApplicationContext  is either initialized or refreshed. This can also be raised using the refresh() method on the  ConfigurableApplicationContext  interface. 2 ContextStartedEvent This event is published when the  ApplicationContext  is started using the start() method on the ConfigurableApplicationContext  interface. You can poll your database or you can re/start any stopped application after receiving this event. 3 ContextStoppedEvent This event is published when the  ApplicationContext  is stopped using the stop() method on the ConfigurableApplicationContext  interface. You can do required housekeep work after receiving this event. 4 ContextClosedEvent This event is published when the  ApplicationC...

jsp action vs jsp directive

Image
About Me Research SEO Training Vedic Astrology Contact --> Narayana Dasa.pdf Vedic Astrology Integrated Approach Brihat Parasar Hora Sastra.pdf Buddhi Gati Dasa.pdf Kundali Analysis Vedic Software PVR Lessons Astrology Material --> To prevent duplication of same output logic across multiple jsp's of the web app ,include mechanism is used ie.,to promote the re-usability of presentation logic include directive is used <%@ include file = "abc.jsp" %> when the above instruction is received by the jsp engine,it retrieves the source code of the abc.jsp and copy's the same inline in the current jsp. After copying translation is performed for the current page Simply saying it is static instruction to jsp engine ie., whole source code of "abc.jsp" is copied into the current page 2) When to use  include action  ? include tag doesn't include the source code of the included page into the current page...