JSP / NOTES</>↗JSP17 Aug 2012
In this example you’ll see how to add comments in JSP page / JSP scriptlets. To add comments we can use either the JSP comment style or HTML comment style. The different between this is that the HTML comment will be sent or included in the webpage while the JSP comment is not included in […]
JSP / NOTES</>↗JSP17 Aug 2012
There are three types of scripting elements available when writing a JSP page. These scripting elements includes: Scriptlets which is a block of Java code. Expression that can be evaluated and the result is printed out. Declarations can be used to declares variables or methods. Scriptlets A scriptlets is a block of Java code that […]
SERVLET / NOTES</>↗Servlet16 Aug 2012
The Servlet API doesn’t provide a direct way to delete a cookie in a Servlet application. If you want to delete a cookie you have to create a cookie that have the same name with the cookie that you want to delete and set the value to an empty string. You also need to set […]
XML / NOTES</>↗XML14 Aug 2012
In this example you will learn how to define a bean’s / pojo’s properties as an XML attribute in JAXB. To define properties as an XML attribute we use the @XmlAttribute annotation. In the Student class below the id property will be defined as an attribute of the student root element. While the name and […]
XML / NOTES</>↗XML14 Aug 2012
In this example you’ll learn how to use the JAXB @XmlElementWrapper annotation. This annotation can be used to generate a wrapper element around an XML element representation. When no name defined, the @XmlElementWrapper annotation uses the property name as the wrapper element name. Let’s see the code snippet below. Here is the code snippet for […]
XML / NOTES</>↗XML13 Aug 2012
JAXB, Java Architecture for XML Binding, it uses JAXB annotations to convert POJO to or from XML file. In this example you will learn how to convert an object / POJO into an XML document using JAXB. The process of converting an object into XML also known as marshalling. In this snippet our POJO is […]