6 Replies Latest reply: Nov 8, 2012 1:53 AM by RMishra RSS

    Can we use  <include-prelude>...</include-prelude> in ATG9.1??

    RMishra
      In web.xml i'm using:
      <jsp-property-group>
      ........................
      ..........................
      <url-pattern>*.jsp</url-pattern>
      <page-encoding>UTF-8</page-encoding>
      <include-prelude>/common/prelude.jspf</include-prelude>
      </jsp-property-group>

      I am using ATG9.1. In jsp page I am unable to get prelude.jspf. In ATG10 we it (<include-prelude>/common/prelude.jspf</include-prelude>) is working fine. I want to try for ATG9.1. Can someone make it clear?
      -RMishra

      Edited by: RMishra on Nov 7, 2012 4:57 PM
        • 1. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
          Gurvinder
          Yes you can use prelude.jspf in ATG9.1.
          Infact if you see the commerce reference store of 9.1, in the web.xml you ll see

          <jsp-config>
          <jsp-property-group>
          <url-pattern>*.jsp</url-pattern>
          <page-encoding>UTF-8</page-encoding>
          <scripting-invalid>true</scripting-invalid>
          <include-prelude>/includes/prelude.jspf</include-prelude>
          </jsp-property-group>
          </jsp-config>
          • 2. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
            RMishra
            Hi Gurvinder,
            I am using ATG 9.1, mysql 5.1, jboss4.2..
            I am using /common/prelude.jsp:
            I have src/a.b.c.ResourceBundle.properties,
            /WEB-INF/tld/dspjspTaglib1_0.tld,
            /WEB-INF/tld/dspjspTaglib1_0.tld,
            /WEB-INF/lib/jstl.jar
            /WEB-INF/lib/standard.jar

            In web.xml I have:
            <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
            ...................
            ...................
            <jsp-config>
                 <taglib>
                      <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
                      <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
                 </taglib>          
                 <taglib>
                      <taglib-uri>http://www.atg.com/taglibs/daf/dspjspTaglib1_0</taglib-uri>
                      <taglib-location>/WEB-INF/tld/dspjspTaglib1_0.tld</taglib-location>
                 </taglib>
                 
                 <jsp-property-group>
                      <url-pattern>*.jsp</url-pattern>
                      <page-encoding>UTF-8</page-encoding>
            <include-prelude>/common/prelude.jspf</include-prelude>
                 </jsp-property-group>
                 
            </jsp-config>
            </we-app>

            <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
            <%@ taglib prefix="dsp" uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" %>
            <fmt:setBundle basename="a.b.c.ResourceBundle" var="abcBundle" />

            While I am running application, getting below error:
            18:48:14,342 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
            org.apache.jasper.JasperException: /addClub.jsp(43,10) According to TLD or attribute directive in tag file, attribute bundle does not accept any expressions
            at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
            at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
            ..................
            ....................
            18:48:13,625 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
            java.lang.ClassNotFoundException: org.apache.jsp.addClub_jsp
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

            Kindly Help.
            -RMishra
            • 3. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
              Nitin Khare
              The issue seems to be related to version mismatch of JSTL. Your web-app deployment descriptor (web.xml) is declared for spec version 2.4 so you should be using JSTL 1.1 which is compatible for 2.4. The URI which you specified is
              <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> which is valid for JSTL 1.0 and you should be using correct URI for JSTL 1.1 as below:

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

              Hope this helps.
              • 4. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
                RMishra
                Thanks Nitin,
                If I'm clicking /WEB-INF/tld/fmt.tld tld, I am able to show URI=http://java.sun.com/jstl/fmt and /WEB-INF/tld/fmt.tld, URI=http://java.sun.com/jstl/core.
                So can you tell what should I do to correct it?
                -RMishra
                • 5. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
                  Nitin Khare
                  You are seeing that in tld because that tld itself might be for JSTL1.0

                  Referring taglibs through web.xml is no longer required since JSP 2.0 which is what you would be using when you specify "2.4" in web.xml. So you can comment out all the taglib references from your web.xml. Refer to taglibs through compatible URI from JSPs only. You can create a top.jspf or taglibs.jsp which can have all the taglib references as below:

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

                  <%-- DSP --%>
                  <%@ taglib prefix="dsp" uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0" %>

                  You can then include this page in other pages at the top manually or through prelude.

                  Also check the jstl.jar and standard.jar present within WEB-INF\lib. Open the manifest file for both these JARs and check the Specification-Version specified there which should also match the version you are trying to use (1.1 in this case).
                  • 6. Re: Can we use  <include-prelude>...</include-prelude> in ATG9.1??
                    RMishra
                    Thanks Gurvinder & Nitin.
                    Whole problem was I was using jstl.jar, standard.jar of version1.0. I replaced with 1.1. So working fine.
                    -RMishra