Servlet call from URL.

One of the most simple and yet having a number of configurations thing is a scratch Servlet call from a request URL or from REST or through a web service.  Sure, we all can copy-paste from existing code, such configurations whenever required, but knowing saves half of your time. This blog cum tutorial will show …

Advertisements

Spring Annotations : One line description to make sense out of them

@Autowired : Binding one class with another by type@Resource : Binding one class with another by name @RequestMapping : To map url with function/class@RequestHeader : To map parameter to header variable@modelAttribute : To map parameter with attribute present in model@RequestParam : To map parameter with attribute present in request@SessionAttribute : To map parameter with attribute present …

Perform var1.contains(var2) in jsp

In jsp, performing equals or not equals is pretty simple :for equals :<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><c:if test="${var1 eq var2}">for not equals : <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><c:if test="${var1 ne var2}">To perform contains function, following snippet will be used : <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><c:if test="${fn:contains(var1, 'test')}">

Passing a parameter from controller to jsp using Map

A parameter can be passed from controller to jsp in several number of ways.Using MAp is one of those ways . Following is the code snippet of how parameter can be passed through map : Controller.java Map<String, Object> passParameter() { final Map<String, Object> responseMap = new HashMap<String, Object>(); responseMap.put("quant", 11); return responseMap; } Hello.jsp <%@ …