Archive for May, 2010

1. As per MVC architecture we separate JSP as Presentation tier. And Business layer as servlet.
2. is that it allows the work of web applications and application developers to be separated.
3. For write html tags in servlet out.writer() toomany html code in out object.
4. Security is reduced if we use both Pres. And business logic Combined.
5. Taglib is not able to use in servlet.
6. While it is possible to embed Java statements directly into JSP pages,
developers have realized that this is best avoided and now prefer custom tags.


Read Full Post »

<%@ page isTheadSafe=”false” %>

Read Full Post »

JSP compiler

A JSP compiler is used in the background to generate a Servlet from the JSP page.

Read Full Post »


Read Full Post »

Here is an application sample for simple Ant Scripts used.

<!– Root tag is project, madatory name and default and basedir –>

<project name=”AntApplication” default=”compile” basedir=”.”>

<!– First tell our project localtion in path area –>
<property name=”path” value=”E:\J2EEWorkspace – Bonifici\AntApplication”/>

<!– Second tell our project source localtion in src, ejb, lib, lib_bridge, lib_client area –>
<property name=”src” value=”${path}\src”/>
<property name=”ejb” value=”${src}\ejb_BE”/>
<property name=”lib” value=”${src}\lib”/>
<property name=”lib_bridge” value=”${src}\lib_bridge”/>
<property name=”lib_client” value=”${src}\lib_client”/>

<!– Third set temp directory location for ant making into jar –>
<property name=”output” value=”E:\J2EEWorkspace – Bonifici\AntApplication\projectbuild”/>

<property name=”buildout” value=”E:\J2EEWorkspace – Bonifici\AntApplication\projectbuild\buildout”/>

<!– Fourth set output jars location for deployment –>
<property name=”jars” value=”E:\J2EEWorkspace – Bonifici\Jars”/>

<!– Fiveth create temp directory for each sub-folder –>
<property name=”build” value=”${output}\build”/>
<property name=”build_lib” value=”${output}\lib”/>
<property name=”build_ejb” value=”${output}\ejb”/>
<property name=”build_bridge” value=”${output}\bridge”/>
<property name=”build_client” value=”${output}\client”/>

<!– Sixth jars into classpath dependency jars –>
<property name=”classpath” location=”${build};



<!– Seventh create classpath reference id for build below jars –>
<path id=”classpathref”>
<pathelement path=”${classpath}”/>

<!– Eigth now compile all .class file along with dependency jars –>
<target name=”compile”>
<mkdir dir=”${build}”/>
<javac nowarn=”true” srcdir=”${src}” destdir=”${build}”>
<classpath refid=”classpathref”/>

<!– Nineth create jar like BH, BE etc… with respective name required –>
<target name=”libBH”>
<mkdir dir=”${build_lib}”/>
<javac listfiles=”true” debug=”on” nowarn=”true” srcdir=”${lib}” destdir=”${build_lib}”>
<classpath refid=”classpathref”/>
<copy todir=”${build_lib}”>
<fileset dir=”${lib}” excludes=”**/*.java”/>
<jar jarfile=”${jars}\lib_BE_PagamentiRb_81.jar” basedir=”${build_lib}”/>

<target name=”clean”>
<delete dir=”${build}”/>

<!– Tenth create ejb jars –>
<target name=”ejb”>
<mkdir dir=”${build_ejb}”/>
<javac listfiles=”true” nowarn=”true” debug=”on” srcdir=”${ejb}” destdir=”${build_ejb}”>
<classpath refid=”classpathref”/>
<mkdir dir=”${build_ejb}\META-INF”/>
<copy todir=”${build_ejb}\META-INF”>
<fileset dir=”${ejb}\META-INF”/>
<jar jarfile=”${jars}\ejb_BE_PagamentiRb_81.jar” basedir=”${build_ejb}”/>
<java classname=”weblogic.appc” fork=”yes” classpath=”${classpath}”>
<!– weblogic.ejbc – <arg value=”${JarsBuild}\test.jar”/> –>
<arg value=”${jars}\ejb_BE_PagamentiRb_81.jar”/>

<!– similary you add for lib_bridge and etc… –>


Thanks & Regards,
Rajeshkumar. E |

Read Full Post »

Read Full Post »

JSP page life cycle


When first time a JSP page is request necessary servlet code is generated and loaded in the servlet container.
Now until the JSP page is not changed the compiled servlet code serves any request which comes from the browser.
When you again change the JSP page the JSP engine again compiles a servlet code for the same.

  • JSP page is first initialized by jspInit() method. This initializes the JSP in much the same way as servlets are initialized,

when the first request is intercepted and just after translation.

  • Every time a request comes to the JSP, the container generated _jspService() method is invoked, the request is processed,

and response generated.

  • When the JSP is destroyed by the server, the jspDestroy() method is called and this can be used for clean up purposes

Read Full Post »

Older Posts »