Pages

Sunday, February 12, 2012

JSP code samples

// declaring variables , and methods
<%!
int lastProjectID=-1;
public String getStyle(long currentProjectID){
    return "class=alternative";
}
// printing in html

<% out.write( String.format("%s",project.getSubProjectName())); %>//with semicolone

or

<% =String.format("%s",project.getSubProjectName())) %>//without semicolone