Monday, 7 October 2013

Difference between the @include directive and the jsp:include action.

Came across this when I was doing some research on cachespec.xml .

There are two JSP include mechanisms: the @include directive and the jsp:include
action


@include directive :

  • static
  • it is interpreted at compile time. 
  • It includes text from the referenced HTML or JSP file before the including JSP is
  • compiled. 
  • Once the including JSP has been compiled, subsequent changes to the
  • included file have no effect on the output produced by the including JSP, until it is
  • recompiled.


eg: <%@include file="../../Common/JSTLEnvironmentSetup.jspf" %>


 jsp:include

  • dynamic. 
  • The referenced JSP is re-executed each time the including JSP is execute. 
  • The resulting dynamically generated text (referred to as a "JSP fragment") is included in the output of the
  • including JSP.


eg:  <jsp:include page="../AddressbookSubsection/AccountForm.jsp" flush="true">
<jsp:param name="addressId" value="${final.contactInfoIdentifier.uniqueID}" />
<jsp:param name="firstName" value="${final.contactName.firstName}"/>
<jsp:param name="lastName" value="${final.contactName.lastName}"/>
.
                                        .
                                        ....
</jsp:include>

When the WebSphere Application Server dynamic cache caches the output of a JSP,
it also caches the JSP fragments produced by executing its jsp:include actions.
Subsequent requests for the including JSP are served from the cache as long as all its
included fragments can also be served from the cache. If any of its fragments are no
longer in the cache (a "cache miss") the including JSP is re-executed. However, any
fragments still in the cache are included, thus avoiding re-execution of the
jsp:include actions that produced them.

Configuring gmail settings in websphere commerce

Step 1: Go to Administration Console : https://<hostname> : <port>/webapp/wcs/admin/servlet/ToolsLogon?XMLFile=adminconsole.AdminConsoleLogon

for local : https://localhost:8002/webapp/wcs/admin/servlet/ToolsLogon?XMLFile=adminconsole.AdminConsoleLogon



Step 2: Go to Site Level.
 i). Click Configuration -> Transports -> Email



ii).  hostname : smtp.gmail.com
      port : 465
      username : your gmail id
      password : your gmail password


Step 3: Do the same for store level.
           Go back to the first page of Admin Console and select your store and click OK.
           Do the  i) and ii) of Step 2.

Step 4: Again go to Configuration. Select Message Types.
           Select the email you to configure.

           I selected Message for Notifying the Merchant of an Order.
                    i). Accept default and press Next.

                    ii). Enter the same details here.



Step 5: Now go to WAS Admin Console.
          i). Right click server form RAD and go to Administration -> Run administrative console.

          ii). Go to Security -> SSL Certificate and Key Management.
          iii). Key Strokes and Certificates on the right side.

          iv). Select NodeDefaultKeyStore.

          v). Select Signer Certificates on the right side.

          vi). Click Retrieve from Port .

          vii). Give host as smtp.gmail.com , port : 465 and Alias : Gmail. And Click Retrieve Signer Information.

          viii). Click Apply. And don't forget to Save.
          ix). Now go back to the (iii). And select NodeDefaultTrustStore and repeat the steps (v) to (viii).


Step 6 : Restart the server.