Accessing custom tag value in scripting code

Hi All,
How can i access my custom tag value in scripting code?
For example, assuming my tag is <myTag:display value="myValue"/>, how can i System.out this value in scripting code? I wanna do <% System.out.prinln(xxx); %> where xxx should be my custom tag value.
Thanks in advance,
Leo.

I understand that you want to store "myValue" somewhere accesible by scripting. The more easy and portable way is to store that value in an attribute, for instance:
<myTag:display value="myValue" var="myVar" scope="session"/>And in the custom tag code:
// translate scope string to PageContext scope values
pageContext.setAttribute(var, value, scope);This ensures compatibility with Java Standard TagLibrary and EL:
<c:out value="${myVar}"/>And finally, scripting:
<% Object value = pageContext.findAttribute(var); %>

Similar Messages

  • How to invoke a funtion on a custom tag value?

    Hello,
    I have a custom tag used in my code.
    It is used as follows:
    <b:testtag name="Title"/>
    This outputs a String value.
    This is used in my HTML as follows:
    <b:testtag name="Title"/>
    This part of the code works fine. However i now want to invoke some funtion on the String outputted before actually outputing it. To be more specific, i need to convert the string to uppercase before outputting it.
    So my question is, Is there anyway to directly invoke the String.toUpperCase method on the tag output?
    If not, another way of achieving this is to store the value returned by the custom tag into a java String variable in a scriplet code, and invoke the String.toUpperCase method.
    Any idea how to go about with this? Particularly, i would like to know if it is possible to store the value outputted by the tag into a java variable in a scriplet code?
    If not is there any other way of converting the tag output value to uppercase?
    Please help!
    Thanks in advance

    Solution one: Change your tag so it outputs in uppercase
    Solution two: use a tag from a String taglib and put that tag around your tag
    example taglib:
    http://jakarta.apache.org/taglibs/doc/string-doc/intro.html
    example bit of code
    <a href='some test url here'><str:upperCase><b:testtag name="Title"/></str:upperCase></a>

  • Urgent-how to access custom tag from jsp tag

    I have a problem accessing a custom tag from a jsp expression.
    Details: I have a custom tag that returns a string variable. I need to access that variable from jsp expression <%%>.
    Can any body help me?

    Tags don't "return" values as in the normal sense.
    They can only support TEI (Tag Extra Information) that just stuffs a declared variable into the page's state.
    For example, if the tag class had a public method called getValue(), you could do the following:
    <xmp:mytag id="foo"/>
    <%
    out.println("value is " + foo.getValue());
    %>

  • How to use a variable of jsp custom tag in my java code?

    hi folks,
    i got a folderList tag like this:
    ArrayList list = new ArrayList(20);
    %>
    <foo:folderList path="${attributes.newsPath}" var="year" contentType="folder">
    <%
              list.add(${year.contentEntryName});   // of course, this doesn't work
    %>
    </foo:folderList>I think, its clear what I want to do. I am just wondering how I can use my Variable "year" in the Java code between <% %>...

    <% list.add(year.getContentEntryName()); %>
    You have to have defined in the custom tag that "var" relates to a scripting variable that you want defined.
    <tag>
      <variable>
        <name-given>var</name-given>
        <variable-class>myPackage.myClass</variable-class>
        <declare>true</declare>
        <scope>NESTED</scope>
      </variable>
    </tag> Cheers,
    evnafets

  • Access custom variable value in web.xml context-param?

    My requirement or need is to access a variable value either in a class in my Model project or a backing bean in my View project. For example, one variable I need to access is an application server I am integrating with - 'testserver' or 'productionserver' - I want to be able to configure this within an external file so that I do not have to re-compile my application to change the variable.
    I was thinking about placing this variable in the web.xml <context-param> section as:
    <context-param>
    <param-name>servername</param-name>
    <param-value>testserver</param-value>
    </context-param>
    I need to access this value within a class (not a servlet) on an Application Module service method, though if needed, I could access it from a backing bean and pass it to the service method (less desirable.) Is this a good approach and how do access this variable from within a Java class including any imports I need to do (code example)?
    Thanks and Happy New Year!
    Hopefully most everyone is out spending time with friends and family versus stuck trying to complete a project like me...

    I found an example from SRDemo that provides what I was looking for:
    String serverhostaddress =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("param-name-var-in-webxml");

  • Comparing custom tags values to request parameters?

    my question is how to compare a taglibrary value to jsp value ..is this even possible?
    my code is as follows and in <!----> tags shows what I want to do...
    basically I want to check if the sql column is equal to a request parameter... ANY HELP WILL BE GREATLY APPRECIATED SINCE I AM STUCK ON THIS FOR A WHILE NOW...
    <%@ page import="java.io.*, java.sql.*, com.simpleneasy.*"%>
    <%@ taglib uri="taglibdb.tld" prefix="sql" %>
    <jsp:useBean id="sub" class="com.simpleneasy.SubPropertyBean"></jsp:useBean>
    <jsp:useBean id="prop" class="com.simpleneasy.PropertyBean"></jsp:useBean>
    <html>
    <table>
    <sql:openConnection driver=<%=getServletContext.getInitParameter("dbdriver")%> url="<%=getServletContext.getInitParameter("url")%>" user="<%=getServletContext.getInitParameter("user")%>" password="<%=getServletContext.getInitParameter("password")%>" id="db"/>
    <% String str ="select * from " + prop.getTableName();
    boolean edit = false;
    if (request.getParameter("action").equalsIgnoreCase("edit"))
    edit = false; %>
    <form name="addedit">
    <td>Property:</td>
    <sql:setquery query="<%=str%>" res="sel"/>
    <td><select name="propid">
    <sql:forEachRow>
    <% if (edit){%>
    <!--over here i want check
    if <sql:getColumn position="1" res="sel"> is equal to request.getParameter("propid") if it is then mark that option as selected...
    -->
    <option value="<sql:getColumn position="1" res="sel"/>"><sql:getColumn position="2" res="sel"/></option>
    <% } else {%>
    <option value="<sql:getColumn position="1" res="sel"/>"><sql:getColumn position="2" res="sel"/></option>
    <%}%>
    </sql:forEachRow>
    </select></td>
    more code continues...

    sorry for making it look like someone had replied, but I am experiencing exactly the same problem as you, I would appreciate if you could keep in touch and help me if possible whne and if u get the answer.
    I tried this as example code
    if (request.getParameter("param").compareTo("comparison"))
    And find that my JSP has a null pointer exception......
    Thanks my mail address is my user name here with hotmail, in addition at the end thanks

  • How to access custom attribute value on the timecard at runtime

    I have created 2 attributes; Project and Task.
    Once a employee selects the Project from the Projects custom LOV I want the Task LOV to display only the tasks related to that particular project.
    How to access the PROJECT_ID during runtime which the user selects from Projects LOV?

    Hi
    I have added the below text in the ldt file.
    But its not working? Any suggestions?
    What may be going wrong?
    # CSR Project List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRPROJECT"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_PROJECT"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "211"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom1VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE6 =
    "XxcsrProjectId|Projects List|RESULT|N"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom1VO"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "Projects List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Project List
    # CSR Task List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRTASK"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_TASK"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "212"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom2VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom2VO"
    QUALIFIER_ATTRIBUTE14 =
    "HxcCuiTaskProjectId|PROJECT|Y"
    QUALIFIER_ATTRIBUTE15 =
    "pro_id = ::XxcsrProjectId"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute2"
    QUALIFIER_ATTRIBUTE28 = "Task List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Task List
    ###########################################################

  • Cusotm Tags; Output Jsp script

    Hi All,
    I have an issue i would like to settle, and for this i need your help.
    I'm trying to implement custom tags within my jsp pages. These custom tags will contain component code (mainly html tables etc). These components each have there own jsp tags within. When i try to output the component, the component is shown but the jsp tags within it are not processed so usually finish the script such as <c:out ... etc! i would like for that to be rendered before it is outputed by the BodyTagSupport .
    Regards
    Nick

    The lifecycle of jsp tags and the way they are evaluated makes it impossible to do what you seek. Jsp tags write html output to the browser - they cannot generate output which can be further processed by the jsp engine. Thus if the output of a jsp tag is code containing more tags, those tags would be printed out to the browser - they wouldnt be taken up for evaluation.
    ram.

  • Handling Exceptions in Custom Tags??

    Hi,
              what is the preferred way to handle an exception that is thrown from jsp
              code in the body of a custom tag? The code below obviously causes a null
              pointer exception inside of the custom tag. When the code executes, a
              ServletException ( javax.servlet.ServletException: runtime failure in custom
              tag 'golfPage' ) is thrown back. Is there any way to structure code so that
              you get a better idea of what actually went wrong in the body of the custom
              tag?
              <golf:golfPage navRoot="admin_overview" title="Admin Overview" >
              <br>
              <%
              Hashtable ht = null;
              ht.put("test","test null pointer");
              %>
              </golf:golfPage>
              

    Never mind... got the answer to my question:
    http://www.ajug.org/archive/ajug-members/10306/msg00030.html
    The encode methods are executed in the JSP which is why the implicit exception object is available... while the decode methods are executed as part of the Faces Servlet lifecycle and hence the exception object must be gotten from the request attribute...
    I guess I need to take Servlet 101 all over again...

  • How can a custom tag write multiple fragments in the response ?

    I have a custom tag that needs to write at least 2 html/xhtml fragments into the response in order to be html compliant. The custom tag outputs a script that must be located in the head section and other elements that refers to the script.
    Events handlers of html input elements follow this pattern. The handler may need to refer to script functions defined in the head section of the document.
    Is it possible with the custom tag architecture to handle this scenario ?

    I don't think so, unless the tag wraps the entire page, but that's harder to do. Maybe a tag could wrap the whole page and you could have another inner tag that acts as a marker of where to put things (kinda like Jakarta Commons Tiles tags).
    Otherwise, you could use 2 tags and share data put in the request scope by the header tag in the subsequent body tags.
    Or since you are writing Javascripts with the one tag, you don't strictly need to put the JS in the head. Although I'm not sure about that restriction in XHTML.

  • Writing Cookie from Custom Tag

    Hi Everyone.
    I am attempting to write a cookie from a custom tag with the following code.
    private void writeCookie(){
             Cookie cookie = new Cookie("TEST", "cookie_value_from_tag");
         cookie.setMaxAge(60*60*24*7* 52);
         cookie.setComment("Test_CookieFromCuttomTag");
         cookie.setPath("/student");
         javax.servlet.http.HttpServletResponse resp = (javax.servlet.http.HttpServletResponse)pageContext.getResponse();
         System.out.println("Adding test cookie from CustomTag");
         resp.addCookie(cookie);
         System.out.println("DONE Adding test cookie from CustomTag");
        }The cookie never appears on my machine.
    I see the messages that wrap the resp.addCookie() method
    so I know the code is being called.
    What am I doing Wrong?
    My Browser is set to accept ALL cookies.
    I am using Tomcat 4.1.27
    Any and all help is greatly appreciated
    Sean

    Actually, the cookie is not writing when I am using <jsp:include>
    It works fine when I do not use include
    the jsp I am using to include is
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:registration="urn:jsptld:/WEB-INF/enrollment.tld"
    xmlns:html="urn:jsptld:/WEB-INF/struts-html.tld"
    xmlns:logic="urn:jsptld:/WEB-INF/struts-logic.tld"
    xmlns:bean="urn:jsptld:/WEB-INF/struts-bean.tld"
    xmlns:common="urn:jsptld:/WEB-INF/common.tld"
    version="2.0" >
    <jsp:directive.page language="java" contentType="text/html;charset=UTF-8"/>
    <html  xmlns:jsp="http://java.sun.com/JSP/Page">
      <body>
          <jsp:include flush="true" page="forgotPasswordChallenge.jsp"/>
          <jsp:include flush="true" page="new_forgotPassword.jsp"/>
          <common:validation_message/>
      </body>
    </html>
    </jsp:root>the custom tag is <common:validation_message/>
    Any Ideas on why this is occuring?

  • Custom Tag - Unable to Load Library

    I'm working on a project that needs to access custom tags. .
    We are using CFMX Version 6,1,0,63958 Edition Enterprise Operating
    system Windows 2003 OS version 5.2
    The Web application relies on 4 custom tags written in C++. I
    can get the first tag to work. The other tags work on my developer
    edition (CFMX 7), but I cannot
    get them to work on Version 6.1. I get the error "Unable to
    Load Library". These other custom tags each call an external DLL
    from within side them and I
    believe that this is what's causing the problem. I've tried
    researching this problem for months, checking the forums, Google,
    etc. but nothing has worked.
    I have a deadline coming up soon, so any help or advice to
    get me in the right direction
    to solve this problem would be greatly appreciated. I don't
    know what to do and I need a solution!
    Thanks

    That worked. It was looking for the dll in CFusionMX\Lib
    instead of in the CFX\custom tags folder.

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • How to access variables passed in custom tag body

    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".
    Edited by: coolkomal on Jun 3, 2009 7:45 AM

    coolkomal wrote:
    I am developing custom tags in my application. I need to pass some variables from the .jsp file into tag file. I want these to be passed as body of the tag rather than as tag parameter. It seems the correct syntax for this is:
    <myTags:display> someVariable </myTags:display>
    Question 1: Can I not use this as: <myTags:display someVariable /> Since this tag will be used at many places in the jsp, I dont want to write myTags:display twice for every usage.
    <myTags:display var="<%=someVariable>"/> is a valid syntax for performing respective action of that variable. You can also use EL to pass the variable ${someVariable} provided the custom tag provide support for EL.
    >
    Question 2:
    I want to call the tags from main.jsp like:
    <% String var1 = "Display Me Please"; %>
    <myTags:display var1 />
    Just ensure that you declare all the related variables in Main.jsp and statically include Main.jsp in your jsp such that you do the checking
    [http://java.sun.com/products/jsp/tags/11/syntaxref117.html]
    >
    I want the tag file to do some processing on the value stored in var1. I've written the following code in tag file, display.tag:
    <jsp:doBody var="theBody" />
    <% Object obj = (Object) request.getAttribute ("theBody"); %>This code snippet gives me access to obj which has the value "var1". Now how do I access the value that is contained in "var1".Can be done provided you code it the right way. Start learning basics of how to create custom taglibraries to gain more knowledge on how things can be managed.
    [http://java.sun.com/javaee/5/docs/tutorial/doc/bnalj.html]

  • For your reference: A real life AppleScript script regarding custom tags

    I'm working through a collection of photographs from iPhoto. One problem I have is that I have more than one set of the photographs and trying to eradicate duplicates and identify the true original images is rather difficult.
    One thing that can help is referring to the complete EXIF data from the image file. Unfortunately, Aperture doesn't give us the complete EXIF set, only a subset. In addition, Aperture doesn't allow us to see the File date/time; only the Image date/time.
    So I wrote this script. Before running the script, I batch renamed all of the images in my subject project using '<counter 4>—<Master Name>' to be sure that every image had a unique name. I then exported the masters from the subject project using '<Version Name>', the reason being that Aperture doesn't allow access to the file name via AppleScript. GraphicConverter will read the EXIF data from this exported set and the script will write most of the EXIF data back to the image in Aperture via custom tags.
    One caveat: Aperture is *slow*. It requires almost 4 seconds to write each custom tag. With 6000+ images in my subject project, this script will take a while to complete.
    The script:
    tell application "Aperture"
    activate
    tell project "untitled Project" of folder ""
    -- set theImages to every image version
    -- move through the images one by one, deleting and creating the appropriate
    -- custom tags from exif text obtained from exported versions via GraphicConverter.
    repeat with i from 1 to theImages's length
    tell theImages's item i
    -- tell image version id "++s5iIgRT1uKC8lrxd5bMg" -- test image
    delete (every custom tag whose name begins with "GC–")
    set exifdata to getEXIF(name) of me
    repeat with i from 1 to exifdata's length
    copy ("GC– " & exifdata's item i's first item) to tName
    copy (exifdata's item i's second item) to tValue
    make new custom tag with properties {name:tName, value:tValue}
    end repeat
    end tell
    end repeat
    end tell
    end tell
    return
    property exportedImagesFolder : alias "Bulbul:- exported from Aperture -:Canon IXUS 2:"
    property exifTagsToIgnore : {"Make", ¬
    "Model", ¬
    "Resolution unit", ¬
    "Y and C positioning", ¬
    "Exposure time", ¬
    "F number", ¬
    "Exif version", ¬
    "Meaning of each component", ¬
    "Shutter speed", ¬
    "Aperture", ¬
    "Exposure bias", ¬
    "Maximum lens aperture", ¬
    "Metering mode", ¬
    "Flash", ¬
    "Lens focal length", ¬
    "Unknown tag (1)", ¬
    "Owner Name", ¬
    "Color Space", ¬
    "Interoperability Index", ¬
    "Focal plane resolution unit", ¬
    "White balance", ¬
    "Resolution unit", ¬
    "Offset to JPEG SOI", ¬
    "Bytes of JPEG data"}
    to getEXIF(vName)
    copy alias ((exportedImagesFolder as string) & vName & ".jpg") to vFile
    tell application "GraphicConverter"
    copy (get file exif of vFile) to theEXIF
    end tell
    set AppleScript's text item delimiters to ","
    repeat with i from 1 to theEXIF's length
    set theEXIF's item i to ¬
    {text item 3 of theEXIF's item i, text from text item 4 to -1 of theEXIF's item i}
    end repeat
    set AppleScript's text item delimiters to ""
    set newEXIF to {}
    set fileDate to ""
    set imageDate to ""
    repeat with i from 1 to theEXIF's length
    copy theEXIF's item i's first item to tName
    if tName is not in exifTagsToIgnore and ¬
    tName does not start with "Unknown" then
    set end of newEXIF to theEXIF's item i
    if tName begins with "File date and time" then
    set fileDate to date (theEXIF's item i's second item)
    else if tName begins with "Date and time of original" then
    set imageDate to date (theEXIF's item i's second item)
    end if
    end if
    end repeat
    if fileDate is not "" and imageDate is not "" then
    if fileDate is less than (imageDate + 24 * 60 * 60) then
    set end of newEXIF to {"File & Image Same Date", "True"}
    else
    set end of newEXIF to {"File & Image Same Date", "False"}
    end if
    end if
    return newEXIF
    end getEXIF

    Correction 1:
    please uncomment the line near the top of the script that reads:
    -- set theImages to every image version
    Correction 2:
    writing the custom tags via AppleScript gets faster after Aperture's done it a few times.

Maybe you are looking for

  • Help - Importing Large Images Fails

    Hi, I use Flash primarily for animation.  The project I'm working on currently is a hefty 1920 X 1080 square pixel file and currently weighs in at 187mb because of all the sounds and jpg images.  It's 2 minutes long. The problem occuring is new to me

  • Officejet pro L7590 wont print

    Brand new ($72) ink cartridge in printer and still says out of ink!   printer wont scan fax or anything but there is a new ink cartridge in printer!   HELP!

  • Alternate fact table without disturbing the existing fact table in EIS

    I have a question in EIS, how to load or work with alternate fact table, without disturbing the existing fact table, pls provide me with some procedure and steps thank u in advance sunil

  • Pavilion s3240.sc TV tuner!

    I have a HP Pavilion Slimline s3240.sc, with integrated: ASUSTeK LNA Tiger Hybrid TV Tuner. - Combined with a MAXIMUM DA 1200 Indoor TV antenna "For DVB-T, VHF and UHF". -> The antenna works great when I tested with a television. But I am not able to

  • Help with organizing

    I have just got my mac and Love it !!! I would like to go Digital as far as paperwork is concerned, I have Client Information sheets of clients I see all day, and the paperwork keeps piling up.... here is the layout i need: http://public.me.com/delul