Saturday, October 10, 2009

Ant build javac compiler error

Last week I was using Ant 1.7.1 to compile the alfresco source code. I was using the JDK1.6.0.14.
The build file was giving the error
Error running .../javac.exe compiler

I rechecked the JAVA_HOME and ANT_HOME were set to correct location.

I checked the build file for error line. It was


destdir="@{projectdir}/${dir.name.build}/${dir.name.classes}"
fork="true"
memoryMaximumSize="${mem.size.max}"
debug="${javac.debug}"
target="${javac.target}"
source="${javac.source}"
encoding="${javac.encoding}"
excludes="@{compileExcludes}"
>

What I did was removed the attribute

fork="true"
memoryMaximumSize="${mem.size.max}"

And the build was successful this time.

Friday, March 06, 2009

Jsp Include directive vs action

Jsp Include directive
At JSP page translation phase, the content of the file mentioned in the include directive is included/added as it is, in the place where the directive is used. Then the total JSP page is translated into a java servlet class. The included file is a static resource like html or a JSP page. Generally JSP include directive is used to include header banners and footers content.

The JSP compilation process is that, the JSP page gets compiled only if that page has changed. If the change is only in the included file, the source JSP file will not be compiled and therefore the modification will not get reflected in the browser output.



Jsp Include action
The jsp:include action element works like a function call. At runtime, the included file will be compiled & executed and the resulted output is included with the source page. When the included JSP page is called, both the request and response objects are passed as parameters.

In case we need to pass any values to the included file, then jsp:param element can be used. If the resource is static, its content is inserted into the calling JSP file, since there is no processing needed.