Monday 25 March 2013

Steps to invoke EJB - using JSP

Follow the below steps to invoke EJB:


Invoke EJB (Entity Beans) - 1st step
Invoke EJB (Entity Beans) - 2nd step
Invoke EJB (Entity Beans) - 3rd step
Invoke EJB (Entity Beans) - 4th step

After following above 4 steps, we can see output in below jsp:


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@page
    language="java" contentType="application/xhtml+xml; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt"
    prefix="fmt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<%@ include file="include/JSTLEnvironmentSetup.jspf"%> <title>MyNewJSPTemplate.jsp</title>
</head>

<fmt:setLocale value="${CommandContext.locale}" />
<fmt:setBundle basename="${sdb.directory}/TutorialNLS" var="tutorial" />
<body><p>Hello World!.</p>
<h1><fmt:message key="WebSphereCommerceInformation" bundle="${tutorial}" /> </h1>
<h2><fmt:message key="Tutorial" bundle="${tutorial}" /> </h2>
<c:import url="${jspStoreDir}include/eMarketingSpotDisplay.jsp">              <c:param name="emsName" value="MySpot" />
</c:import>
<h3><fmt:message key="ParametersFromCmd" bundle="${tutorial}" /> </h3>
<fmt:message key="ControllerParm1" bundle="${tutorial}" />
<c:out value="${controllerParm1}"/> <br />

<fmt:message key="ControllerParm2" bundle="${tutorial}" />
<c:out value="${controllerParm2}"/> <br /> <br />
<c:if test="${mndbInstance.calledByControllerCmd}">   <fmt:message key="Example" bundle="${tutorial}" /> <br />
   <fmt:message key="CalledByControllerCmd" bundle="${tutorial}" /> <br />
   <fmt:message key="CalledByWhichControllerCmd" bundle="${tutorial}" />
   <b><c:out value="${mndbInstance.callingCommandName}" /></b> <br /> <br />
</c:if>
<fmt:message key="UserName" bundle="${tutorial}" /><c:out value="${mndbInstance.userName}"/> <br />

<fmt:message key="Points" bundle="${tutorial}" />
<c:out value="${mndbInstance.points}"/> <br />
<fmt:message key="Greeting" bundle="${tutorial}" /><c:out value="${taskOutputGreetings}"/> <br /> <br />
<c:if test="${!empty taskOutputUserId}">   <fmt:message key="UserId" bundle="${tutorial}" />
   <c:out value="${taskOutputUserId}"/> <br />
   <fmt:message key="FirstInput" bundle="${tutorial}" />
   <b><c:out value="${mndbInstance.userName}"/></b>
   <fmt:message key="RegisteredUser" bundle="${tutorial}" /> <br />
   <fmt:message key="ReferenceNumber" bundle="${tutorial}" />
   <b><c:out value="${taskOutputUserId}"/></b> <br /> <br />
</c:if>

<c:if test="${empty taskOutputUserId}">
   <fmt:message key="FirstInput" bundle="${tutorial}" />
   <b><c:out value="${mndbInstance.userName}"/></b>
   <fmt:message key="NotRegisteredUser" bundle="${tutorial}" /> <br />
</c:if>
<h2><fmt:message key="BonusAdmin" bundle="${tutorial}" /> </h2>
<c:if test="${!empty taskOutputUserId}">
    <ul>
        <li>
            <b>
            <fmt:message key="PointBeforeUpdate" bundle="${tutorial}" />
            <c:out value="${oldBonusPoints}"/>
            </b>
        </li>
        <li>
            <b>
            <fmt:message key="PointAfterUpdate" bundle="${tutorial}" />
            <c:out value="${bdbInstance.bonusPoint}" />
            </b>
        </li>
    </ul>
</c:if>


<br />
<b><fmt:message key="EnterPoint" bundle="${tutorial}" /></b><p />


<form name="Bonus" action="MyNewControllerCmd">
<table>
    <tr>
        <td>
            <b>Logon ID </b>
        </td>
        <td>
            <input type="text" name="input1" value="<c:out value="${userName}"/>" />
        </td>
    </tr>
    <tr>
        <td>
            <b>Bonus Point</b>
        </td>
        <td>
            <input type="text" name="input2" />
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" />
        </td>
    </tr>
</table>
</form>

</body></html>

No comments:

Post a Comment