JSP TagLibrary...

Hi Everyone,
I have a doubt in how lifecycle of taglib works...
public abstract void setPageContext(javax.servlet.jsp.PageContext);
public abstract void setParent(javax.servlet.jsp.tagext.Tag);
public abstract javax.servlet.jsp.tagext.Tag getParent();
public abstract int doStartTag() throws javax.servlet.jsp.JspException;
public abstract int doEndTag() throws javax.servlet.jsp.JspException;
public abstract void release();
Above is the sequence in which methods are called.
THIS IS MY JSP PAGE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<%@ taglib uri="cs6386-taglib.tld" prefix="cs6386" %>
<TITLE><cs6386:first_tag /></TITLE>
</HEAD>
<BODY>
<H1><cs6386:first_tag /></H1>
<cs6386:second_tag />
</BODY>
</HTML>
My question is
IN THE ABOVE PROGRAM I HAVE CALLED 3 TIMES THE TAG CLASS. SO EACH AND EVERYTIME IT WILL CALL doSTARTTAG() METHOD.IS THIS RELATED TO CREATING NEW INSTANCE...SO IF I DIDN'T CODE doENDTAG() IS IT GOING TO BE A PROBLEM..OR HOW IT EXCATLY WORKS...
THANX IN ADVANCE...
SENTHIL

I describe the tag handler lifecycle and what you need to be aware of in an article about JSP 1.2 on the ONJava.com site:
http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html
I'm pretty sure the "Lifecycle" section at the end answers your questions.

Similar Messages

  • Unable to open JSP taglibrary error

    I am trying to write in JSP to connect our Oracle database with no luck at this point. I am getting an error early on in the code. My trouble shooting effort has isolated this line of code: <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> as producing this error message "Unable to open taglibrary http://java.sun.com/jstl/core : Parse Error in the tag library descriptor: External entity not found: http://java.sun.com/dtd/web-app_2_3.dtd.". Any ideas? Any help would be appreciated.

    You can try checking if the JSP is picking standard.jar that contains the JSTL core tags implementation...
    -Shefali

  • Preparing JSP Taglibrary for JSTL and EL

    I have a taglibrary I've been working on that generates live GoogleMaps using 100% java (no javascript or AJAX needed by the developer). I would like to incorporate this library within JSTL, so users can place the GoogleMaps tags within JSTL tag (i.e. sql tag and c tags) so they can generate maps using database data to add markers, etc.
    Is there any special preparation needed to allow tags to accept EL as attribute values or is this built-in?
    Thanks in advance. I'm not a big JSTL user or I would have generated a test page myself.

    You need to allow your tags to accept EL?
    In a JSP2.0 container (eg Tomcat 5) it is built in. ${expr} is a runtime expression just like <%= expr %> is. So if you can use <%= expr %> with a tag, you can use ${expr}. As long as you have a JSP2.0 container (eg Tomcat 5) and have enabled the EL (by having your web.xml defined as being version 2.4)
    For older apps, still in Servlet2.3/JSP1.2 you couldn't use EL without modifying the tags. You would have to provide the EL evaluator yourself (there is one in jakarta commons) and evaluate each attribute using that manually. Effectively it is a complete duplicate set of tags just for EL.
    Struts-el is one example. Also JSTL1.0 had standard and rt versions for using ${expr} and <%= expr %> respectively with the tags.
    Does that answer your question?

  • Jsp newbie having trouble using JSP's with Jdev 10.1.3

    Hi,
    Have been bashing my head for about two hours with this, if anyone can help will substantially improve my life.
    First off apologies if question is stupid or obvious I am a jsp newbie.
    Have been experimenting with using the Jsp Taglibrary for tabbed panes in a browser.
    http://www.ditchnet.org/tabs/
    I have followed all the installation instructions but in JDeveloper when I build I get the message
    Error(18,2): method setJspContext(javax.servlet.jsp.PageContext) not found in class org.ditchnet.jsp.taglib.tabs.handler.TabConfigTag
    Any idea what jar file I'm missing.
    I'm a bit lost, thanks

    Arrrrrrrrgh,
    Sorted my problem.
    Rebuilt project, works fine now, no idea what was going on (just generally!).
    Thanks for input Shay
    Mark

  • Compilation erros when tld in jar

    Running Jdev 11g 11.1.1.0.2 I am unable to compile a simple struts2 web application because of this jsp taglibrary issue:
    No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.I have added the struts2 tag lib in the Project Properites-->JSP Tag Libraries section pointing to tld within the struts2 jar:
    jar:file:/C:/development/lib/struts-2.1.6/lib/struts2-core-2.1.6.jar!/META-INF/struts-tags.tldThe jsp editor understands the struts tags and provides hints but the compilation fails. I can get this to work if I extract the tld file, place it locally, and explicitly map to it in my web.xml:
    <jsp-config>
        <taglib>
          <taglib-uri>/struts-tags</taglib-uri>
          <taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
        </taglib>
      </jsp-config>But I shouldn't have to do this! Any help would be greatly appreciated. Thanks!

    Thanks BalusC,
    I tried version 2.4 already but I still got the same problem.
    Any other possible reason?
    My web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app 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"
    version="2.4">
    <taglib>
    <taglib-uri>http://www.myTags.com/tags/util</taglib-uri>
    <taglib-location>/WEB-INF/lib/util.jar</taglib-location>
    </taglib>
    I can make it work if I take the tld out and put it under WEB-INF, and changed the web.xml tablib-location to /WEB-INF/util.tld. I just don't know why it doesn't work if it is in a jar.
    Thanks.

  • Taglib uri problem

    Hi all
    I created a web module project and add a JSP file u201CcustomTagWelcome.jspu201D and a TLD file u201Cadvjhtp1-taglib.tldu201D to the webContent directory. I added also a tag handler
    u201CWelcomeTagHandleru201D.
    The jsp code:
    <?xml version = "1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <!-- Fig. 10.30: customTagWelcome.jsp               -->
    <!-- JSP that uses a custom tag to output content. -->
    <%-- taglib directive --%>
    <%@ taglib uri = "advjhtp1-taglib.tld" prefix = "advjhtp1" %>
    <html xmlns = "http://www.w3.org/1999/xhtml">
       <head>
          <title>Simple Custom Tag Example</title>
       </head>
       <body>
          <p>The following text demonstrates a custom tag:</p>
          <h1>
             <advjhtp1:welcome />
          </h1>
       </body>
    </html>
    The tld content:
    <?xml version = "1.0"?>
    <!DOCTYPE taglib PUBLIC
       "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
          "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <!-- a tag library descriptor -->
    <taglib>
       <tlibversion>1.0</tlibversion>
       <jspversion>1.1</jspversion>
       <shortname>advjhtp1</shortname>
       <info>
          A simple tab library for the examples
       </info>
       <!-- A simple tag that outputs content -->
       <tag>
          <name>welcome</name>
          <tagclass>
             com.deitel.advjhtp1.jsp.taglibrary.WelcomeTagHandler
          </tagclass>
          <bodycontent>empty</bodycontent>
          <info>
             Inserts content welcoming user to tag libraries
          </info>
       </tag>
       <!-- A tag with an attribute -->
       <tag>
          <name>welcome2</name>
          <tagclass>
             com.deitel.advjhtp1.jsp.taglibrary.Welcome2TagHandler
          </tagclass>
          <bodycontent>empty</bodycontent>
          <info>
             Inserts content welcoming user to tag libraries. Uses
             attribute "name" to insert the user's name.
          </info>
          <attribute>
             <name>firstName</name>
             <required>true</required>
             <rtexprvalue>true</rtexprvalue>
          </attribute>
       </tag>
       <!-- A tag that iterates over an ArrayList of GuestBean -->
       <!-- objects, so they can be output in a JSP            -->
       <tag>
          <name>guestlist</name>
          <tagclass>
             com.deitel.advjhtp1.jsp.taglibrary.GuestBookTag
          </tagclass>
          <teiclass>
             com.deitel.advjhtp1.jsp.taglibrary.GuestBookTagExtraInfo
          </teiclass>
          <bodycontent>JSP</bodycontent>
          <info>
             Iterates over a list of GuestBean objects
          </info>
       </tag>
    </taglib>
    In the u201Cothersu201D tab of web.xml I choose the tag-libs and for Taglib Location I choose the advjhtp1-taglib.tld. The Taglib Location is advjhtp1-taglib.tld. I added u201Cadvjhtp1-taglib.tldu201D as URI .  
    When I run the jsp in browser
    http://devsrv:50000/servlet_jsp/customTagWelcome.jsp
    I get the following exception:
    #1.5 #0019DB661008005B0000008A000013B000044FA2C2FDE9C9#1213460381553#com.sap.engine.services.servlets_jsp.server.jsp.JSPParser#sap.com/servlet_jsp_test#com.sap.engine.services.servlets_jsp.server.jsp.JSPParser#Guest#0####b16b6e103a2d11ddb85a0019db661008#SAPEngine_Application_Thread[impl:3]_20##0#0#Error#1#/System/Server#Plain###application [servlet_jsp] Runtime error in compiling of the JSP file <C:/usr/sap/EP7/JC00/j2ee/cluster/server0/apps/sap.com/servlet_jsp_test/servlet_jsp/servlet_jsp/root/customTagWelcome.jsp> !
    The error is: com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Tag library descriptor cannot be found for uri:].
    Exception id: [0019DB661008005B00000088000013B000044FA2C2FDE89A]#
    #1.5 #0019DB661008005B0000008B000013B000044FA2C2FDEBF1#1213460381553#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#sap.com/servlet_jsp_test#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#Guest#0####b16b6e103a2d11ddb85a0019db661008#SAPEngine_Application_Thread[impl:3]_20##0#0#Error##Plain###application [servlet_jsp] Processing HTTP request to servlet [jsp] finished with error. The error is: com.sap.engine.services.servlets_jsp.server.exceptions.WebIOException: Internal error while parsing JSP page [C:/usr/sap/EP7/JC00/j2ee/cluster/server0/apps/sap.com/servlet_jsp_test/servlet_jsp/servlet_jsp/root/customTagWelcome.jsp].
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:118)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.getClassName(JSPServlet.java:238)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.compileAndGetClassName(JSPServlet.java:429)
         at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:169)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Tag library descriptor cannot be found for uri:].
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.JspTaglibDirective.verifyAttributes(JspTaglibDirective.java:146)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.JspDirective.parse0(JspDirective.java:141)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.JspDirective.parse(JspDirective.java:102)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.ElementCollection.parse(ElementCollection.java:89)
         at com.sap.engine.services.servlets_jsp.lib.jspparser.syntax.ParserImpl.parse(ParserImpl.java:536)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.initParser(JSPParser.java:340)
         at com.sap.engine.services.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:106)
         ... 18 more
    What is wrong with URI?
    Thanks in advance
    Yoel

    Hi,
    You need to add an entry for the <taglib-location> and <taglib-uri>
    in the web.xml for using a tld in the project.
    And then need to use the same url name in the jsp.
    You can go through the following link for the details about web.xml:
    http://edocs.bea.com/wls/docs61/webapp/web_xml.html#1017621
    Thanks
    Ritushree

  • Error while running JSP with custom tag

    I am trying to run a jsp with a tag and I am getting the following error when I run the jsp:
    "Unable to open taglibrary /WEB-INF/jsp/mytaglib.tld : Parse Error in the tag library descriptor: External parameter entity "%(DOCTYPE);" has characters after markup."
    I have no idea what this is, can anyone help me here?
    tx
    -AB

    Its difficult to tell without looking at your TLD file i.e. mytaglib.tld
    However, a guess is that you may be refering to an invalid or otherwise corrupted DTD from your TLD.
    Check that out.
    The official DTD for TLDs in JSP 1.1 is http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
    and the official DTD for TLDs in JSP 1.2 is http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd

  • Using scriplets in jsp-tag attribute

    I have a strange problem with a custom taglibrary that I'm trying to write.
    When I use the tag in a jsp like underneath the first outputs the right value (Welcome Hans), but the output of the second time shows: Welcome <%= test %>
    This is a part of the JSP:
    <% String test = "Hans"; %>
    <arto:hello name="Hans" />
    <arto:hello name="<%= test %>" />
    I realy don't know how to let the tag display the value of the string in my jsp.
    Can anyone give me some advice?
    Thanks,
    Hans
    The files are:
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class HelloTag extends TagSupport {
    private String name;
    public void setName(String name) {
    this.name = name;
    public int doStartTag() throws JspException {
    try {
    pageContext.getOut().print("Welcome " +name);
    } catch (IOException ioe) {
    throw new JspException("Error: IOException while writing to client");
    return SKIP_BODY;
    public int doEndTag() throws JspException {
    return SKIP_PAGE;
    The JSP:
    <%@ taglib uri="arto" prefix="arto" %>
    <%
    String test = "Hans";
    %>
    <arto:hello name="<%= test %>" />
    <arto:hello name="Hans" />
    The TLD:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname></shortname>
    <uri></uri>
    <info></info>
    <tag>
    <name>hello</name>
    <tagclass>HelloTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>Tag with Parameter</info>
    <attribute>
    <name>name</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    </taglib>

    In the tld for the name attribute, use
    <rtexprvalue>true</rtexprvalue>
    This specifies that the attribute value can be a run-time expression. Otherwise, the value is taken as a literal.

  • HELP: JSP + XML + XSLT = HTML?

    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation I had a JSP
    that contained XML tags... they were filled in at runtime and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer. SAXON checked
    for the inline XSL specified and then used that to transform the document
    into HTML.
    It worked well, but there were some other features missing/not documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library that comes with the
    distribution, but it seems to be very finicky. I followed the directions and
    I got it to do a sort of roundabout transformation. But it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly... that is, if I
    don't hard-code the XSL file in the x:xslt element in the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic specific
    elements/tags that I have to include in the XML file that Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't cause too much
    traffic.

    Craig,
    I've since discovered how to do it with the WL Taglibrary... and have
    moved on =)
    It has to do with the EXTREMELY BADLY documented x:xml tag that can
    appear within the x:xslt tag body...
    So the WL Tag Library allows something like the following.
    (Please note, angled brackets are omitted in this post to prevent html
    parsing)
    [x:xslt stylesheet="sheet.xsl"]
    [x:xml]
    Here is the XML to run the sheet on.
    This should have all relevant XML syntax: the PIs, the doctype,
    root elements etc...
    [x:xml]
    [x:xslt]
    And that DOES work. But not very well. WL, a little prematurely
    incorporated versions 1.2 of Xerces and Xalan in their product -- and
    these versions have some irritating bugs.
    Also -- There tag library doesn't copy the source XML across as UTF-8
    .. so a lot of the Japanese I have embedded there (from a DB) gets
    mangled somewhere in their code...
    AND -- If you hammer a little bit on an JSP/XML that uses the WL Tag
    Library (eg clicking refresh lots of times in IE)... I get huge
    amounts of irritating exceptions appearing in the log files.
    NullPointerExceptions
    XSL Parsing Exceptions
    XML Parsing Exceptions
    but completely unpredictably...
    In my eyes.. the WL XML/XSL Tag Library using the incorporated and
    untouchable Xalan and Xerces (v1.2) is virtually unusable.
    What a pain.
    BUT! Apache offers a similar OPEN SOURCE XSL Tag Library available
    here:
    http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html
    And it uses the standard, non-weblogic-incorporated, Xerces and Xalan
    (which means you can provide whatever version you want).. and it works
    impressively well.
    It has almost identical performance as the WL Taglib, and without all
    of the bizarre exceptions being thrown.
    And it does proper passing of the character encoding type!
    If only the taglib did caching though =(
    The performance hit over pure JSP is huge. Almost two orders of
    magnitude. On my desktop box I can get around 500Requests/Sec if I am
    returning HTML direct from a JSP... while if I produce XML that gets
    processed by XSL into HTML the Requests/Sec drops to 5!!!!
    Caching. Caching. And more Caching. A lot of DiskIO is going on with
    the XML/XSL/XHTML chain of events.
    I hope this helps!
    I'd be curious as to what you find out as well.
    Dylan Parker
    On 5 Mar 2001 07:20:00 -0800, "Craig Macha"
    <[email protected]> wrote:
    >
    Yep, I feel Dylan's pain.
    I am trying to accomplish the same thing. A JSP page generating
    dynamic XML content and then utilizing an XSLT stylesheet to transform
    all the content into XHTML.
    Does anyone have some examples that show exactly how to accomplish
    this? Can I do this with WLS and the XML taglib that comes with
    it? Or do I have to move on to something like Cocoon to get this
    capability?
    Any insight would be greatly appreciated.
    Thanks,
    Craig Macha
    "Dylan Parker" <[email protected]> wrote:
    Hello, all.
    I am trying out Weblogic 6 and I am trying to get the
    JSP + XML + XSLT =>
    HTML chain working.
    I am coming from using Orion and SAXON.. and in that situation
    I had a JSP
    that contained XML tags... they were filled in at runtime
    and then using
    Servlet-Chaining was passed along to the SAXON XSLT Processer.
    SAXON checked
    for the inline XSL specified and then used that to transform
    the document
    into HTML.
    It worked well, but there were some other features missing/not
    documented
    that we now need.
    With Weblogic I am trying to use the XSLT Tag Library
    that comes with the
    distribution, but it seems to be very finicky. I followed
    the directions and
    I got it to do a sort of roundabout transformation. But
    it doesn't seem to
    work quite right.
    The best I can get is the following:
    I have an 'xslt' directory url-pattern-mapped to xslt.jsp
    (as instructed)...
    but can't figure out how to specify the xsl file on-the-fly...
    that is, if I
    don't hard-code the XSL file in the x:xslt element in
    the xslt.jsp it
    complains about some XML file not having a root element.
    Ideal situation:
    1. I have a JSP that includes XML elements.
    2. It is filled from a database at runtime and specifys
    (using a PI) what
    XSL stylesheet it is to be processed with.
    3. Somehow (fingers crossed) the XML is processed and
    transformed into HTML
    by the appropriate XSL file.
    I think I am mostly stuck moving between steps 2 and 3.
    Can anyone give me some hints? Are there some Weblogic
    specific
    elements/tags that I have to include in the XML file that
    Weblogic will
    catch and re-direct to the XSL Parser?
    Please, anyone, if you have some information, I would
    much appreciate it.
    Dylan Parker
    PS - I apologize for the cross-post, I hope it doesn't
    cause too much
    traffic.

  • How to use tags from taglib in jsp

    i am using tomcat. I don't know where the taglibrary is stored i.e in which folder and how can i access that library and use it in the jsp pages.

    Refer to
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSPTags4.html
    thanks,
    Deepak

  • JSP screens at runtime

    how can i create JSP screens at runtime with just an XML file. this is my project for the college. actually i'm new to jsp and xml. i've got a mail which was sent by the guide to me. if u can understand what they are trying to explain, then plz help me out.
    following is the description of my project as given by my guide.
    Framework is designed to customize user needs in Less programming time and deliver with standard. Any Web based enterprise project requires maintenance of masters. These Operations at times have no business logic. Framework deals with such type of operations creating screens for programmer with just an XML file.
    In Framework request in the form of parameter is sent to Centralized Servlet.
    << Mention entries in web.xml >>
    Servlet reads the value of parameter by name "command". Servlet identifies the command and gets the respective handler and process the request in handler. A Handler is skeletal for servlet, which process the required logic for respective command. Handler helps in forwarding the request to another jsp through Servlet��s Request Dispatcher
    The below points can help u all in devloping the project, I mean the format and tags etc. Use this as the basis and try to search in the net to explore more on XML and develop u'r project.
    The XML file format is as follows:
    1. XML file.
    XML file name should be same as table name.
    For Eg:- If master maintenance screen has to be created for the table coursemaster, then the XML file name should be coursemaster.xml
    2. XML file structure.
    It has starting node by name Root. Which indicates parent node.
    <Root type = "ca" >
    Next specifies the child node under Root, which should be similar to the XML file name.
    <coursemaster type = "cp" >
    To specify the user-friendly module name, which can be displayed in UI screen. You need to use
    <Module name="coursemaster" col="2" />
    Note:
    The value, which you specify under name attribute, should be the value that is present in language properties file, which helps in displaying the heading in respective languages like German, English, Korean etc.
    The attribute col="2" specifies number of columns that the screen should display UI controls. The value specified should be only multiples of 2, i.e. 2,4,6,8 etc.
    All the field names , the order in which they occur, and fields used to list on screen for search page should be specified between <Attribute></Attribute> nodes.
    To specify order of controls that should occur on screen.
    <Order value="vccourseid,vccoursename,vcduration,vccredits,ifee" />
    Note:
    Fieldnames are separated by commas.(These are the fieldnames present in table)
    There should not be space between a comma and fieldname.
    To specify fields for querying.
    <QryResAttrs value="vccompanycode,vcunitcode,vcitemcode,dtvalidfrom,dtvalidupto" />
    Note:
    Here the fields, which are keys, and the fields, which are required through out the module, should be specified. First half should contain keys and then followed by fieldname for the rest of module.
    To specify type of controls for all fields and there property.
    The control properties are specified in <Attr> node with following attributes to specify properties.
    Name �� Value should be similar to fieldname in table and one of the attribute in Order node.
    Label �� Used to represent label on the screen, should be present in language properties file.
    Display �� control type, the following list of controls are present in e-easy framework.
    Design Algorithm:
    Step 1: In ��Framework��, request in the form of parameter is sent to Centralized Servlet.
    Step 2: The Servlet reads the value of parameter by the name ��command��.
    Step3: Servlet identifies the command and gets the respective handler and processes the request in handler.
    Step 4: Handler helps in forwarding the request to another JSP through Servlets Request Dispatcher.
    As soon as Servlet reads the parameter value for ��command��, it accesses AppMap.xml, which stores all information about command values, the respective handler and JSPs. The java class, which reads the contents of AppMap.xml and gets respective information through meaningful methods, is ApplicationMap.class. The structure of AppMap.xml is as follows.
    <command handler= ��handler_name�� jsp= ��JSPname.jsp��>
    The JSPs used in ��The Framework��:
    As the Controls are unknown, Display is unknown; Jsps puts the task to Tag Libraries to create Body for the jsps.
    When a request is forwarded to jsp, the jsp executes the TagLibrary present in it. Tag libraries are present in taglib folder in Web-Inf directory as reports.tld file.
    Class files for Respective Tag libraries and their actions.
    To provide heading to JSP page table.
    TagLibrary name is heading.
    Java file is com.ample.tag.FormHead.java
    <tag>
    <name>heading</name>
    <tagclass>com.ample.tag.FormHead</tagclass>
    <info> Tag for displaying form </info>
    </tag>
    To provide title to JSP page.
    <tag>
    <name>title</name>
    <tagclass>com.ample.tag.FormTitle</tagclass>
    <info> Tag for displaying title </info>
    </tag>
    To generate Body for JSP with Controls depending on particular table in database:
    <tag>
    <name>form</name>
    <tagclass>com.ample.tag.FormTag</tagclass>
    <info> Tag for displaying form </info>
    </tag>
    To generate label for jsp Controls depending on particular table in database:
    <tag>
    <name>label</name>
    <tagclass>com.ample.tag.FormLabel</tagclass>
    <info> Tag for displaying label</info>
    </tag>
    For example displaying ADD page, to add a record to database.
    All Form actions are carried out by tag library ��form�� which calls com.ample.tag.FormTag. Depending on ��command�� from servlet, respective jsps are displayed, which goes to FormTag with body message. In this case, Command=��create�� body message = CRE_USR . FormTag will read this message, and calls respective method to perform the task. The method reads the xml content with all specifications, and generates page writing back to page context of jsp.
    Xml file for coursemaster.xml
    <?xml version="1.0" ?>
    <Root type="ca">
    <coursemaster type="cp">
    <Module name="coursemaster" col="2" />
    <Key name="vccourseid" type="general" />
    <Attribute>
    <Order value="vccourseid,vccoursename,vcduration,vccredits,ifee" />
    <QryResAttrs value="vccourseid,vccoursename,ifee" />
    In the xml file, Query Attributes are
    <QryResAttrs value="vccourseid, vccoursename, ifee" />
    <Attr name="vccourseid" label="courseid" display="text" type="rp" format="String" width="24" table="coursemaster" read="+" write="+" update="-" query="+" jsfunc="isAlphanumeric" errmessage="Should be a String" align="right" />
    <Attr name="vccoursename" label="coursename" display="text" type="rp" format="String" width="24" table="coursemaster" read="+" write="+" update="+" query="+" jsfunc="isAlphanumeric" errmessage="Should be a String" align="center" />
    <Attr name="vcduration" label="duration" display="text" type="rp" format="String" width="24" table="coursemaster" read="+" write="+" update="+" query="+" jsfunc="isAlphanumeric" errmessage="Should be a String" align="center" />
    <Attr name="vccredits" label="credits" display="text" type="p" format="String" width="24" table="coursemaster" read="+" write="+" update="+" query="+" jsfunc="isAlphanumeric" errmessage="Should be a String" align="center" />
    <Attr name="ifee" label="fee" display="text" type="p" format="integer" width="24" table="coursemaster" read="+" write="+" update="+" query="+" align="center" jsfunc="isInteger" errmessage="Should be a Integer" />
    </Attribute>
    </coursemaster>
    </Root>

    Could it be that your import should state the package only, and not the class and therefore your're confusing the compiler?
    Example:
    From:
    <%@ page import="com.aquitecintl.procurement.item.SCItemCopyApp" %>
    <jsp:useBean id="iCpy" type="com.aquitecintl.procurement.item.SCItemCopyApp" scope="session" />
    To:
    <%@ page import="com.aquitecintl.procurement.item.*" %>
    <jsp:useBean id="iCpy" type="com.aquitecintl.procurement.item.SCItemCopyApp" scope="session" />

  • Problem in embedd ing calendar in jsp using struts framework

    hi
    i am working on one application which needs date as ainput and have to store in database. i have embedd one calendar coming in popup but it is working with mozila not in internet explorer. plz give me some suggestion to put this calendar on my jsp.
    thanx
    Gyan

    gyan.poddar wrote:
    but it is working with mozila not in internet explorerSounds like a Javascript problem rather than JSP/Java problem.
    If this Javascript is generated by some JSP tag, then I would report it at the website/forum/mailinglist of the taglibrary in question. If this Javascript is just customized or some other 3rd party script, then either fix it or report it at their own website.

  • Navigation Tag Library JSP Example?

    Hi All,
    I am trying to follow "Top-Level Navigation iView" example from "SAP NetWeaver Developer's Guide".
    In help they have given JSPCode but have not mentioned in which directory I have to make JSP file and in "portalapp.xml" what type of entry I have to write in it. i.e. "<component>, <property>".
    I need to know which entry I have to make in "Portalapp.xml" for JSP component and under which directory(PORTAL-INF) I have to made JSP file.
    Please let me know where I can find step by step instruction for Navigation iView example.
    I will award full points to useful answer.
    Thanks in Advance
    Ashish.

    Hi Mr.Chowdary,
    Thanks for your reply and step by step instruction. I followed steps as you describe.  I have one question about "portalapp.xml"
    Your answer is really helped me.
    I go through "portalapp.xml" my question is regarding <components> element. As describe in <component-config> <property name="ClassName" value="com.sap.portal.navigation.LightTopLevelNavigation"/>
    There is no "LightTopLevelNavigation.java" file. As per my under standing there should be a java file with name "LightTopLevelNavigation.java" extended from "AbstractPortalComponent" class and keep it under "src.core" or "src.api" folder.
    To define a component you should have related java file. please correct me if I am wrong or explain me what is the significant of <component> element when you do not have any "JAVA" file with LightTopLevelNavigation.java
    Please guide me as I am new to EP.
    <components>
        <component name="LightTopLevelNavigation">
          <component-config>
            <property name="ClassName" value="com.sap.portal.navigation.LightTopLevelNavigation"/>
            <property name="SafetyLevel" value="no_safety"/>
          </component-config>
          <component-profile>
            <property name="NavigationTagLibrary" value="/SERVICE/com.sap.portal.navigation.navigationtaglibrary/taglib/TagLibrary.tld"/>
            <property name="EPCFLevel" value="0"/>
            <property name="com.sap.portal.iview.ShowTray" value="false"/>
            <property name="com.sap.portal.reserved.iview.IsolationMode" value="EMBEDDED"/>
            <property name="NumOfDisplayLevels" value="2">
              <property name="category" value="Navigation"/>
              <property name="plainDescription" value="Number of Display Levels"/>
              <property name="longDescription" value="Specifies the number of levels displayed in the light top-level navigation"/>
            </property>
          </component-profile>
        </component>
      </components>
    Thanks for your help and guidence. Full points will be awarded once my doubts are cleared.
    Thanks.
    Ashish

  • JSP xml to html

    I keep getting this error when I try to transform an xml file into html.
    org.apache.jasper.JasperException: Unable to open taglibrary http://jakarta.apache.org/taglibs/xsl-1.0 : null
    Here is the jsp file
    <%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0"
    prefix="xsltlib" %>
    <html>
    <head>
    <title>Book Inventory</title>
    </head>
    <body bgcolor="white">
    <center>
    Welcome
    <font color="red">
    On Sale Today ...
    </font>
    <p></p>
    <xsltlib:apply xml="cdcatalog.xml" xsl="cdcatalog.xsl"/>
    </center>
    </body>
    </html>

    org.apache.jasper.JasperException: Unable to open
    taglibrary http://jakarta.apache.org/taglibs/xsl-1.0 :
    nullWell, like the first answer to your post, it's like the error message says:
    The file ist not there! Try to open it with your browser and you'll get an error message.
    I think, it's not a good idea to reference remote URLs, because not everyone got a dedicated line. So download the xsl-taglib from
    http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/xsl/
    The documentation and all other stuff is located at
    http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html
    Hope this helps.

  • Pagination using JSP Presentations.

    Hi,
    I have implemented a search function in my JSP presentation. The search shows an array of bpm objects in a table and I want to put them in pages with a pagination like google does. I've tried with a taglib, importing the jar in my library and modifying the web.xml of the workspace. But it doesn´t work because I don't know How to use the bpm instances inside scriplets. How can I implement this functionality, is that possible?. I know that this kind of jsp works different than in a normal web application because we use the jsp fuego taglibrary.
    Thanks for your help,
    Guillermo

    About the fuego tags and scriplets, for example, I have created a group[] of BPMObjects, then I call my BPM Object method by an invoke instruction in my jsp. This method has the query and constructs the group of BPMObjects. My problem is when I try to manage this array with Java inside an Scriplet, because the pager taglib requires it.
    I understand how to use the rownum for pagination, my doubt in this case are the parameters that I have to send to BPM from the links of my jsp. ( First _1_ _2_ _3_ _4_ _5_ Last) . Do you have an example or documentation about how to send this parameters?
    You mencioned DynamicSQL, I used it to implement the SQL script. About this, I have decide what is better to implement when I call a SELECT. I know that the DynamicSQL improves performance because it sends the statement and runs in the database server. Another option is to use a "Parametric Query" but I don't know if the performance is the same than a DynamicSQL. On the other hand, I'm implementing Stored procedures and call them from bpm to improve performance, leaving the execution of the SQL Statement to the database server. It is successful when the stored procedure is an insert or update, but when the procedure is for SELECT, I don't know how to receive the cursor from the stored procedure and stores the values inside my BPM objects group[]. Do you have any idea about this?
    Thanks Mark,
    Guillermo
    Edited by: user9241304 on 07-abr-2010 15:41

Maybe you are looking for