Where can I run EJBs ?

Where can I run EJBs ?

EJBs are built for more than just a Java EE application server. They can also execute in aJava EE Web Profile container or plain Java SE environment (Java SE ! yeah – Easy JavaBeans !).

EJB Lite

  • Required to support only a subset of the features which are provided by the full EJB specification – a lightweight version of the same
  • A Java EE Web Profile certified container has to support the EJB Lite spec

Contiue reding here……

Exception Handling using JSTL tag….

Here in this post we will learn how to handle Exception in jsp page using JSTL tags

Here is the sample code for this app…

index.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<strong>Exception Handling Example</strong><br>
<a href="<c:url value='Check.jsp' />" >Go to Exception Page</a><br>
<br>
<%-- The above line is similar to response.encodeURL("url") method of servlet --%>
</body>
</html>

when we click on Go to Exception Page it will send u too Check.jsp page contain the following code:
check.jsp

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<body>
<strong>Exception Handling Example</strong>
<br>
<c:catch var=”myexception” ><%—This is similar to try { }catch{} of normal exception handling –-%>
<strong>Inside the Catch Block : >></strong>
<br>
<br>
<% int x = 10/0; %>
</c:catch>
<%– the <c:chosoe> , c:when and c:otherwise is equivalant to if {}else {} statement !! thanx –%>

<c:choose>
<c:when test=”${myexception != null}” >
There was an Exception : ${myexception.message}<br><br>
</c:when>
<c:otherwise >
No Problem thanks!!
</c:otherwise >
</c:choose>
</body>
</html>

——————————————————–
at int x=10/0; there is devide by zero exception which is catch by the above given block

the running example can be found here