Sunday, September 12, 2010

JSP / JSTL / EL

JSP
JavaServer Pages (JSP) - is the standard presentation-layer technology for the J2EE platform.

JSP scripting elements:
  • expressions
    - form: <%= javaExpression %>
    - ex: date = <%= new java.util.Date() %>
    - xml syntax: <jsp:expression>javaExpression</jsp:expression>
  • scriptlets
    - form: <% code %>
    - xml syntax: <jsp:scriplet>code</jsp:scriplet>
  • declarations
    - form: <!% code %>
    - xml syntax: <jsp:declaration>code</jsp:declaration>
Comments
  • JSP Comment - <%-- JSP Comment --%>
  • HTML Comment - <!-- HTML Comment -->
Predefined vars: request, response, session, out, application, config, pageContext and page

JSTL

JSP Standard Tag Library (JSTL) - is a collection of standard custom tag libraries that implement basic functionality common to a wide range of server-side Java applications.

EL
Expression Language (EL) - is a simplified form for JSP expression
- syntax: ${elExpression}

Source:
http://www.ibm.com/developerworks/java/library/j-jstl0211.html
http://download.oracle.com/docs/cd/E17802_01/j2ee/j2ee/1.4/docs/tutorial-update2/doc/index.html

Thursday, September 9, 2010

Line Wrap for excel cells

DO:
In report manager,
exporter.setParameter(JExcelApiExporterParameter.IS_COLLAPSE_ROW_SPAN, Boolean.TRUE);

In xml,
textField isStretchWithOverflow="true" // on long data input cells
reportElement stretchType="RelativeToTallestObject"

API: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRXlsAbstractExporterParameter.html