Using EL How to write a custom tag?

I want to write a tag wich takes input and output as it is.Like when i pass an primitive types then it directly pass no transfer as we are puting "" literial to the values and pass it.
For Example:
<fun:add i1=10 i2=20 />
check my code as i write tld ,and classes
------ function.jsp ------
<%@ taglib uri="http://jakarta.apache.org/explang/funtion-taglib"
prefix="fun" %>
<%=<fun:add i1=10 i2=20 /> %>
----------function.tld-------------
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_2_0.dtd">
<taglib>
<tlib-version>1.2</tlib-version>
<jsp-version>2</jsp-version>
<short-name>fun</short-name>
<tag>
<name>add</name>
<tag-class>exp.MyClass</tag-class>
<body-content>TAGDEPENDENT</body-content>
<resolver-class>exp.MyVarRes</resolver-class>
<expression-class>exp.MyExp</expression-class>
<attribute>
<name>i1</name>
<required>true</required>
</attribute>
<attribute>
<name>i2</name>
<required>true</required>
</attribute>
</tag>
</taglib>
---------evalutor&other classes-------
------MyClass.java-------
package explang;
public class MyClass{
public int add(int x,int y){
return(x+y);
--------MyExp----------------
package explang;
import javax.servlet.jsp.el.*;
public class MyExp extends Expression{
public Object evaluate(VariableResolver vr)throws ELException{
try{
System.out.println("Execute evalute on MyExp");
return Class.forName("java.lang.Integer.class");
}catch(Exception e){ return null;}
------------MyExpEval----------------------
package explang;
import javax.servlet.jsp.el.*;
public class MyExpEval extends ExpressionEvaluator{
private int i1,i2;
public void setI1(Integer i1){
this.i1=i1.intValue();
public void setI2(Integer i2){
this.i2=i2.intValue();
public java.lang.Object evaluate(java.lang.String name,java.lang.Class cls,javax.servlet.jsp.el.VariableResolver vr,javax.servlet.jsp.el.FunctionMapper fm)
throws ELException{
MyClass mc=new MyClass();
try{
mc=(MyClass)cls.newInstance();
}catch(Exception e){ }
int res=mc.add(i1,i2);
return new Integer(res);
public javax.servlet.jsp.el.Expression parseExpression(java.lang.String name,java.lang.Class cls,javax.servlet.jsp.el.FunctionMapper fm)
throws ELException{
return null;
------------MyVarRes------
package explang;
import javax.servlet.jsp.el.*;
import javax.servlet.jsp.PageContext;
public class MyVarRes implements VariableResolver{
private PageContext mCtx;
public MyVarRes(PageContext ctx){
System.out.println("Intialize the PageContext");
this.mCtx=ctx;
public Object resolveVariable(String pName )throws ELException{
if("pageContext".equals(pName))
return mCtx;
else
return mCtx.findAttribute(pName);
public Object resolveVariable(String name,Object gtype)throws ELException{
if(gtype instanceof java.lang.Long)
return (java.lang.Integer)gtype;
return null;
Is there any solution plz guide me,i have somewhere stuck in the middle bcz of this?

I want to write a tag wich takes input and output as
it is.Like when i pass an primitive types then it
directly pass no transfer as we are puting ""
literial to the values and pass it.
For Example:
<fun:add i1=10 i2=20 /> Can't do that, and even if you could, you shouldn't.
1: Correct XHTML syntax requires the quotes, and custom tags were designed to fit into XHTML syntax.
2: What would you possibly gain? doing <fun:add i1="10" i2="20" /> will translate the values to the appropriate data type for you - if you declare your set-method to have a Long prameter, then these values will be translated to Longs... Same for primitives...
check my code as i write tld ,and classes
------ function.jsp ------
<%@ taglib
uri="http://jakarta.apache.org/explang/funtion-taglib"
prefix="fun" %>
<%=<fun:add i1="10" i2="20" /> %>What are you trying to do here? You can't put a custom tag inside a scriptlet/expression like that. You would either use custom tags OR scriptlets, not both. After all, what goes between <% ... %> tags (and <%= ... %>) needs to be Java code. And <fun:add i1="10" i2="20"/> is not java code.

Similar Messages

  • Using EL How to Write a Customize tag

    I want to write a tag wich takes input and output as it is.Like when i pass an primitive types then it directly pass no transfer as we are puting "" literial to the values and pass it.
    For Example:
    <fun:add i1=10 i2=20 />
    check my code as i write tld ,and classes
    ------ function.jsp ------
    <%@ taglib uri="http://jakarta.apache.org/explang/funtion-taglib"
    prefix="fun" %>
    <%=<fun:add i1="10" i2="20" /> %>
    ----------function.tld-------------
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
         "http://java.sun.com/j2ee/dtd/web-jsptaglibrary_2_0.dtd">
    <taglib>
    <tlib-version>1.2</tlib-version>
    <jsp-version>2</jsp-version>
    <short-name>fun</short-name>
    <tag>
    <name>add</name>
    <tag-class>exp.MyClass</tag-class>
    <body-content>TAGDEPENDENT</body-content>
    <resolver-class>exp.MyVarRes</resolver-class>
    <expression-class>exp.MyExp</expression-class>
    <attribute>
    <name>i1</name>
    <required>true</required>
    </attribute>
    <attribute>
    <name>i2</name>
    <required>true</required>
    </attribute>
    </tag>
    </taglib>
    ---------evalutor&other classes-------
    ------MyClass.java-------
    package explang;
    public class MyClass{
    public int add(int x,int y){
    return(x+y);
    --------MyExp----------------
    package explang;
    import javax.servlet.jsp.el.*;
    public class MyExp extends Expression{
    public Object evaluate(VariableResolver vr)throws ELException{
         try{
              System.out.println("Execute evalute on MyExp");
    return Class.forName("java.lang.Integer.class");
         }catch(Exception e){ return null;}
    ------------MyExpEval----------------------
    package explang;
    import javax.servlet.jsp.el.*;
    public class MyExpEval extends ExpressionEvaluator{
    private int i1,i2;
    public void setI1(Integer i1){
    this.i1=i1.intValue();
    public void setI2(Integer i2){
    this.i2=i2.intValue();
    public java.lang.Object evaluate(java.lang.String name,java.lang.Class cls,javax.servlet.jsp.el.VariableResolver vr,javax.servlet.jsp.el.FunctionMapper fm)
    throws ELException{
         MyClass mc=new MyClass();
    try{
    mc=(MyClass)cls.newInstance();
    }catch(Exception e){ }
    int res=mc.add(i1,i2);
    return new Integer(res);
    public javax.servlet.jsp.el.Expression parseExpression(java.lang.String name,java.lang.Class cls,javax.servlet.jsp.el.FunctionMapper fm)
    throws ELException{
    return null;
    ------------MyVarRes------
    package explang;
    import javax.servlet.jsp.el.*;
    import javax.servlet.jsp.PageContext;
    public class MyVarRes implements VariableResolver{
         private PageContext mCtx;
         public MyVarRes(PageContext ctx){
              System.out.println("Intialize the PageContext");
              this.mCtx=ctx;
         public Object resolveVariable(String pName )throws ELException{
              if("pageContext".equals(pName))
    return mCtx;
    else
    return mCtx.findAttribute(pName);
    public Object resolveVariable(String name,Object gtype)throws ELException{
    if(gtype instanceof java.lang.Long)
    return (java.lang.Integer)gtype;
    return null;
    Is there any solution plz guide me,i have somewhere stuck in the middle bcz of this?

    I want to write a tag wich takes input and output as
    it is.Like when i pass an primitive types then it
    directly pass no transfer as we are puting ""
    literial to the values and pass it.
    For Example:
    <fun:add i1=10 i2=20 /> Can't do that, and even if you could, you shouldn't.
    1: Correct XHTML syntax requires the quotes, and custom tags were designed to fit into XHTML syntax.
    2: What would you possibly gain? doing <fun:add i1="10" i2="20" /> will translate the values to the appropriate data type for you - if you declare your set-method to have a Long prameter, then these values will be translated to Longs... Same for primitives...
    check my code as i write tld ,and classes
    ------ function.jsp ------
    <%@ taglib
    uri="http://jakarta.apache.org/explang/funtion-taglib"
    prefix="fun" %>
    <%=<fun:add i1="10" i2="20" /> %>What are you trying to do here? You can't put a custom tag inside a scriptlet/expression like that. You would either use custom tags OR scriptlets, not both. After all, what goes between <% ... %> tags (and <%= ... %>) needs to be Java code. And <fun:add i1="10" i2="20"/> is not java code.

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • How to clear the custom tags in the phonebook?

    some time create a label on the agenda of the phone contacts, your name is "profile", but now I want to delete because it is no longer useful, but not how to delete this custom tag.
    I want to know how can i delete this custom tag?

    Hi,
    We need to use FREE statement.
    please do this way:
    For
    form exit_program .
      call method cc1->free.
      call method cc2->free.
      call method cc3->free.
      call method cc4->free.
      call method cl_gui_cfw=>flush.
      if sy-subrc <> 0.
        call function 'POPUP_TO_INFORM'
          exporting
            titel = lv_repid
            txt1  = 'Error in Flush'(500)
            txt2  = sy-subrc.
      endif.
    endform.                    " exit_program
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK'.
          perform exit_program.
          set screen '0'.
        when 'EXIT' or 'CANC'.
          perform exit_program.
          leave program.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    thanx.

  • Which planning function i have to use and how to write this planning fucnti

    Hi Bi Guru's,
    I have rolled out  BW SEM-BPS Planning Layout's for the Annual Budget in my organistaion.
    There are two levels of layout given for the each sales person.
    1)  Sales quantity to be entered Material and  country wise for all 12 months ( April 2009 to March 2010)
    2)  Rate per unit and to entered in second sheet, Material and country wise for the total qty entered in the first layout.
    Now i need to calculate the sales vlaue for each period and for the each material.
    Which planning function i have to use and how to write this planning fucntion.
    Please suggest me some solution ASAP.
    Thanks in Advance,
    Nilesh

    Hi Deepti,
    Sorry to trouble you...
    I require your help for the following scenario for caluclating Sales Value.
    I have Plan data in the following format.
    Country   Material    Customer    Currency    Fiscyear    Fiscper           Qty         Rate        Sales Value
    AZ          M0001      CU001          #             2009          001.2009        100.00                        
    AZ          M0001      CU002          #             2009          001.2009        200.00                        
    BZ          M0001      CU003          #             2009          001.2009        300.00
    BZ          M0001      CU003          #             2009          002.2009        400.00
    BZ          M0002      CU003          #             2009          002.2009        300.00
    AZ          M0001       #               USD          2009             #                                 10.00
    BZ          M0001       #               USD          2009             #                                 15.50
    BZ          M0002       #               USD          2009             #                                 20.00
    In the Above data the Rate lines are entered in the Second Layout, Where the user enters on the Country Material Level with 2009 value for FISCYEAR.
    I am facing problem with this type of data. 
    I want to store the sales value for each Material Qty.
    Please suggest some solution.
    Re
    Nilesh

  • How to Write a CUstomer Exit for a variable in BEx

    Hi,
    How to write a customer exit variable in bex Query designer
    Do i need developers key for this (If so what type of key do i need so that i can ask basis tean to generate)
    Info Object: ZEXP_DTE (Expiry Date)
    Variable on ZEXP_DTE :
    ZEDTE
    Type: Customer Exit
    Can any one please tell me how to write a code in CMOD from this (Step-by Step)
    Expiry Date > Current Cal Day
    As arun said
    'l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.'
    I want to insert the above code for the above customer exit but as i am new to BW as  ABAP please explain me what are the steps involved in CMOD
    Thanks

    Hi,
    To write customer exit for a variable, you require Access key.
    Contact your BASIS to get that.
    Access Key,BASIS?
    To write Customer exit,
    User Exits
    User Exit for Variable
    /thread/809285 [original link is broken]
    Hope these helps u...
    Regards,
    KK.

  • Is possible to write a custom tag inside another custom tag ??

    Hi
    I�m trying to reduce the time needed to code mi app presentation layer, it uses some custom tags with certain configuration, i would like to know if its possible to do something like this inside my custom tag doAfterBody().
    public int doAfterBody() throws JspException {
              JspWriter writer=bodyContent.getEnclosingWriter();
              try {
                   writer.print("<customTag:myAnotherTag someEspecificConfigurationParams="someEspecificValues"/>");
              } catch (IOException e) {
                   pageContext.getServletContext().log("Error: "+e.getMessage());
              }return SKIP_BODY;
         }The goal is to simplify the jsp code because the configuration params for the custom tags (css styles and similar) are allways the same.
    That don�t work, it simply prints <customTag:myAnotherTag/> in screen but the tag is not evaluated, i�ve tried too something like
    public int doAfterBody() throws JspException {
              if (repeat) {
                   JspWriter writer = bodyContent.getEnclosingWriter();
                   try {
                        writer.print("<customTag:myAnotherTag/>");
                   } catch (IOException e) {
                        pageContext.getServletContext().log("Error: " + e.getMessage());
                   repeat = false;
                   return EVAL_BODY_AGAIN;
              return SKIP_BODY;
         }And it doesn�t worked worked. Maybe using the taghandler classes and calls to the doAfterBody could make it work, but when you need to nest tags it could be a little hell of coupling calls, so before doing it i would like to know if what i want is possible. After reading some books i tought it could work because the stack of out objects, but i can�t make it work.
    Another idea is to inherit from tagHandler and override some properties in the tags, but i don�t like the idea to much.
    So, can anyone help me??
    Thanks.

    You cannot do that and I have listed out the reason and a possible solution in this post http://forum.java.sun.com/thread.jspa?threadID=697243 from yesterday.
    cheers,
    ram.

  • How to create a custom tag for a custom converter

    In Jdeveloper 11g, I have a project where I have created a custom converter class that impements the javax.faces.convert.Converter class. I have registered the converter with an id in the faces-config.xml file of the project, and the converter works fine by using the <f:converter type="myconverter"> tag. However, the custom converter has a field which I would like to set from the tag itself. Hence, I would like to add an attribute to <f:converter> tag if possible or create a custom tag that has the attribute.
    I have done some reserach and I found that a custom tag can be implemented: I need to create a class which extends from the ConverterTag class or javax.faces.webapp.ConverterElTag class, which I did, but I also need to create ".tld" (tag library) file which defines the tag itself.
    The part about creating the ".tld" file and registring the new tag is what I'm not sure how to do.
    Does someone know how to do this?
    thank you

    Hi frank,
    that's a good document, and it explains how to make a custom converter. I already created the custom converter, it converts a number to any currency pattern. I know java already has a currency converter, but it doesn't support Rupee currency format, and I need that format.
    My converter works, but I would like to pass the pattern of the format through an attribute in a tag. Since f:converter doesn't seem to support that, I created a custom tag which uses my converter, and it enables me to pass a pattern to the converter.
    All of that works, but I need to be able to pass the pattern as an EL expression, and it's not evaluating the expression before passing it to the converter. It just passes the whole expression as a string. I'm thinking It may be something I'm doing wrong.
    this is the tag library definition file:
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.2</tlib-version>
    <jsp-version>2.1</jsp-version>
    <short-name>custom</short-name>
    <uri>custom-currency-converter</uri>
    <description>
    custom currency custom tag library
    </description>
    <tag>
    <name>CurrencyConverter</name>
    <tag-class>
    converter.Tag.CurrencyConverterTag
    </tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <name>pattern</name>
    <type>java.util.String</type>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    Edited by: Abraham Ciokler on Feb 4, 2011 11:20 AM

  • Using gateway'd URLs in JSP custom tag attributes

    Hello,
    I am running Plumtree G6 using a gateway prefix to gateway Javascript from a remote server. I have recently discovered, thanks to people's help on the forum here, that in certain cases, you need to wrap a URL in a pt:url tag in order for Plumtree to recognize it as a URL that has to be gateway'd (i.e. a URL inside of a Javascript function).
    However, I have a custom tag that contains a contextPath attribute. This custom tag then includes other XML files that get included in the final page that is displayed. I am passing this value as my contextPath:
    <mytag:body sessionName="mysession" campusName="SampleCampus" contextPath="<pt:url pt:href='http://localhost:7021/application/scripts' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>"/>
    However, in the resulting content that is created from this custom tag, the contextPath value is still set to <pt:url pt:href=......./>, and not the actual gateway'd URL. I would have thought that Plumtree would have recognized and gateway'd this URL before it got substituted in the custom tag.
    Does anyone have any thoughts on how to get around a problem like this? One thought I had was to get ahold of the gateway URL value and pass that value directly in my contextPath attribute. Is it possible to get that gateway value, or is there a better solution here?
    Thanks again for any help you can provide.

    Chris,
    I added your code, changed the portlet's web service to send a login token for this portlet, and was then getting some ClassNotFoundExceptions related to Axis classes. So, I went and added all of the jar files from the devkit's lib directory (i.e. plumtree\ptedk\5.3\devkit\WEB-INF\lib), recompiled, and those errors went away. But, now I see the following error:
    java.lang.NoSuchFieldError: RPC
         at com.plumtree.remote.prc.soap.QueryInterfaceAPISoapBindingStub.(QueryInterfaceAPISoapBindingStub.java:27)
         at com.plumtree.remote.prc.soap.QueryInterfaceAPIServiceLocator.getQueryInterfaceAPI(QueryInterfaceAPIServiceLocator.java:43)
         at com.plumtree.remote.prc.soap.QueryInterfaceProcedures.(QueryInterfaceProcedures.java:37)
         at com.plumtree.remote.prc.xp.XPRemoteSession.(XPRemoteSession.java:202)
         at com.plumtree.remote.prc.xp.XPRemoteSessionFactory.GetTokenContext(XPRemoteSessionFactory.java:80)
         at com.plumtree.remote.portlet.xp.XPPortletContext.getRemotePortalSession(XPPortletContext.java:261)
         at com.plumtree.remote.portlet.PortletContextWrapper.getRemotePortalSession(PortletContextWrapper.java:45)
         at jsp_servlet._collabrasuite.__riarooms._jspService(__riarooms.java:325)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    I am using version 5.3 of the EDK, and running Plumtree Foundation G6. Have you ever seen an error like this before?
    Thanks again for all of your help.

  • How To create a custom tag in jsf

    I'm trying to create a custom tag in jsf.what should be the approach to create it.it would be better if somebody will explain me from the skretch.

    There's a decent tutorial here, Priyo:
    http://www.exadel.com/tutorial/jsf/HowToWriteYourOwnJSFComponents.pdf
    Hope it helps,
    Illu

  • How can I evaluate custom tag in custom tag output.

    Hi,
              I have a custom tag which returns the following String
              <html>
              Hello there <util:getName/>
              </html>
              Currently the <util:getName/> just prints to the html page. What I
              want is for that tag to be evaluated. Can this be done?
              So in my first jsp, I have the following:
              <cache:getHtml/>
              This cache:getHtml is the tag above that returns the chunk of html.
              The reason that I want this done is that the html is created by an
              xslt transformation but I cache the result of this transformation but
              I need the result to contain some dynamic data so if I could get the
              custom tag to work that would be ideal.
              Thanks in advance,
              IH
              

              >outputs another custom tag, which I store in a page-scope bean
              Send us your JSP code to [email protected] otherwise it not so easy to understand
              "Hrishi Dixit" <[email protected]> wrote:
              >
              >
              >For the record, the eval tag does NOT do this... not even close. I need
              >to do
              >exactly this - I have a custom tag that outputs another custom tag, which
              >I store
              >in a page-scope bean, and then try to get the eval tag to evaluate it,
              >but it
              >simply renders it as it. I think all the eval tag can do is evaluate
              >SCRIPTLET
              >code, it cannot actually process custom tags.
              >
              >..Hrishi
              >
              >"Dmitry Namiot" <[email protected]> wrote:
              >>
              >>See eval tag in Coldtags suite:
              >>http://www.servletsuite.com/jsp.htm
              >>
              >>
              >>[email protected] (IH) wrote:
              >>>Hi,
              >>>
              >>>
              >>>I have a custom tag which returns the following String
              >>>
              >>><html>
              >>>Hello there <util:getName/>
              >>></html>
              >>>
              >>>Currently the <util:getName/> just prints to the html page. What I
              >>>want is for that tag to be evaluated. Can this be done?
              >>>
              >>>So in my first jsp, I have the following:
              >>>
              >>><cache:getHtml/>
              >>>
              >>>This cache:getHtml is the tag above that returns the chunk of html.
              >>
              >>>
              >>>The reason that I want this done is that the html is created by an
              >>>xslt transformation but I cache the result of this transformation but
              >>>I need the result to contain some dynamic data so if I could get the
              >>>custom tag to work that would be ideal.
              >>>
              >>>
              >>>Thanks in advance,
              >>>
              >>>IH
              >>
              >
              

  • How to write the custom Function Module to trigger the Alert.

    Hi all,
    I have developed a custom alert category in Tx - alrtcatdef. Now i want to trigger it from my custom function module. what should i do or what is the procedure to trigger the alert from my custom function module.
    Arul Jothi

    hi arul,
    try this program.
    RSALERTTEST.
    check out this link...
    <a href="/people/ginger.gatling/blog/2005/12/02/innovative-ways-to-use-alerts:///people/ginger.gatling/blog/2005/12/02/innovative-ways-to-use-alerts
    regs,
    jaga

  • How to create the customizing TAG coloum in So10  transaction

    Hi All,
      I need to create the Tag Coloum in in SO10 ( standard text) transaction .
    Basically i want to create the customised tag format and attach it to the format where we will see all the standard tag in so10.
      I need to create the TAG in which first line should be start from 0.00 and from the second line onwards it should be start from the 2.3 .
    Dhiraj.

    Dhiraj,
    What you will have to do is to create a separate STYLE in sMART FORMS transaction and assign that STYLE to the TEXT in S010. You can do that Format --> Change STYLE.
    The tag column contains format keys which define the output formatting of the text or initiate control commands. The format keys possible and their respective meanings are defined in styles or forms. If a style or form is assigned to a text module you can use the paragraph formats defined there to format your text. Format keys which can be defined by the user can consist of one or two characters.
    I have not tried this though.
    regards,
    Ravi
    Note : Please mark the helpful answers

  • Variable declaration in the custom tag

    Hey,
    I am using JSP2.0 to write a custom tag. and I need to declare a script variable in my tag so that it can be referenced in a jsp file. At the beginning, I used name-given and my tag works as it supposed to do. But I don't like to make the variable name hard-coded in my tag so that I changed name-given to name-from-attribute as folllows:
    <jsp:directive.variable name-from-attribute="var" alias="local" variable-class="java.util.ArrayList" scope="AT_END"/>
    <jsp:scriptlet>
    out.println(local.getClass().getName());
    </jsp:scriptlet>     
    According to my understanding, variable "local" should be able to be referenced in my tag file and when the tag created in a jsp file
    <tags:myTag var="myTest" />
    the variable myTest should be able to be referenced in this jsp file too. But whenever I try this in jsp: out.println(myTest.getClass().getName());
    I always got this error" myTest cannot be resolved"
    I am totally stuck here. Someone could please give me some hints? thanks a lot!

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • Custom Tag - how to use tag value= %=jsp% / ?

    Hello friends,
    I am new to custom tags. I have written simple tags that handle value="some hard-coded stuff">.
    But cannot not implement jsp-supplied values? Could you please help with advice?
    Basically, how to implement a custom tag that would allow:
    <mylib:mytag value=<%=somejsp%> />
    Thank you!

    Just define it in your .tld ...
    Example:
    <attribute>
    <name>comments</name>
    <required>false</required>
    //IF this is set to true, u can add your jsp stuff... in your value
    <rtexprvalue>true</rtexprvalue>
    <type>String</type>
    </attibute>
    Usually, the .tld goes in WEB-INF/lib ... some people just put it in WEB-INF/

Maybe you are looking for