Question: TLD and custom Tag Usage.

Hi, I am new to the custom tags and I am confused with one of the examples.
          The TLD has
          <tag>
          <name>item</name>
          <tagclass>com.taglib.wdjsp.mut.OutlineItemTag</tagclass>
          <bodycontent>JSP</bodycontent>
          <info>
          Delineates an item, possibly including subitems,
          within a nested outline.
          </info>
          <attribute>
          <name>text</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          </attribute>
          </tag>
          This TLD specifies that the tag has body content that is JSP and not empty.
          The author uses the tag in the JSP page in the following way..
          <mut:item text="What is JSP"/>
          <mut:item text="Evolution of dynamic content technologies">
          <mut:item text="Common Gateway Interface"/>
          </mut:item>
          I wonder why the usage "<mut:item text="What is JSP"/>" - where the
          bodycontent is empty - does not violate the TLD.
          Is the bodycontent optional even if it is specified in TLD. What if it is
          tagdependent?
          thanks - Sri
          

then in your code
public void setEnabled(String enabled) {
this.enabled = true;
in your endtag reset the boolean to false;
IMO, a cleaner approach would be
private boolean enabled = false;
public void setEnabled(boolean enabled) {
     this.enabled = enabled;
}The advanatge is that
<foo other_attributes enabled= "false"/> and
<foo other_attributes/> will both evaluate to false;
<foo other_attributes enabled= "true"/> will evaluate to true
<foo other_attributes enabled= "will_this_work"/> will give an exception
as the container cannot resolve it to a boolean value so that users will
be forced to use true or false (or skip the attribute) which is how it
should be.
Also note the container cannot convert runtime expressions to boolean
values. So if there's a String variable,say prompt in scope that has the
value true, then<%
String prompt = "true";
pageContext.setAttribute("prompt", prompt);
%>
<foo other_attributes enabled= "<%=prompt>"/>
will throw an error. (to do this you would have to specify rtexpr value of
this attribute to true)
For the above to work, your tag should be coded as shown below
private boolean enabled = false;
//note rtexpr value will always be Strings
//container does not provide auto conversions
public void setEnabled(String enabled) {
     this.enabled = new Boolean(enabled).booleanValue();
}cheers,
ram.

Similar Messages

  • Query about tag extensions and custom tags

    Hello,
    Can u please clarify me where are these tag extensions and custom tags are actually used. (in which conditions)
    What are the advantages in using them...
    thanks in advance..
    Jaagy.

    You have to remember that .tag are, in a way, jsp pages, so you can use other custom tags, etc.
    We use them when we need template that are mostly html, with a little bit of logic in them that we want to reuse.
    For example, we made one for or header and footer. In header.tag, we set all of our http info, from doctype to body, including default css, title, etc if they are not supplied as parameter, and in our footer we put the /body and /html tags. Now, our typical pages look like
    <%@ taglib tagdir="/WEB-INF/tags" prefix="custom" %>
    <custom:header title="Page title" />
    ... page content
    <custom:footer />Now, if we want to change some attribute for the whole page, or to put a signature in each page, we just have to change the corresponding .tag file and the whole site is update.
    Also, .tag file can be used to display selectively page fragment.
    Take a look at Sun's tutorial for more info:
    http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSPTags5.html#wp89664
    Hope this helps!
    Patrick

  • Composing mail from email web application using jsp and custom tags

    here is the send.jsp file
    <%@ page language="java" %>
    <%@ page errorPage="errorpage.jsp" %>
    <%@ taglib uri="http://java.sun.com/products/javamail/demo/webapp"
    prefix="javamail" %>
    <html>
    <head>
         <title>JavaMail send</title>
    </head>
    <body bgcolor="white">
    hi
    <javamail:sendmail
    recipients="<%= request.getParameter(\"to\") %>"
    sender="<%= request.getParameter(\"from\") %>"
    subject="<%= request.getParameter(\"subject\") %>">
    <%= request.getParameter("text") %>
    </javamail:sendmail>
    <h1>Message sent successfully</h1>
    </body>
    </html>
    Here is the java file i.e used to refer to this custom tag
    package taglib;
    import java.util.*;
    import java.net.*;
    import javax.mail.*;
    import javax.mail.Authenticator;
    import javax.mail.internet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * Custom tag for sending messages.
    public class SendTag extends BodyTagSupport {
    private String body;
    private String cc;
    private String host;
    private String recipients;
    private String sender;
    private String subject;
    * host attribute setter method.
    public void setHost(String host) {
    this.host = host;
    System.out.println("Host is : " +host);
    * recipient attribute setter method.
    public void setRecipients(String recipients) {
    this.recipients = recipients;
    System.out.println("recipients is " +recipients );
    * sender attribute setter method.
    public void setSender(String sender) {
    this.sender = sender;
    System.out.println("Sender is : " +sender);
    * cc attribute setter method.
    public void setCc(String cc) {
    this.cc = cc;
    * subject attribute setter method.
    public void setSubject(String subject) {
    this.subject = subject;
    System.out.println("subject is : " +subject);
    * Method for processing the end of the tag.
    public int doEndTag() throws JspException {
         System.out.println(" ** In do end tag");
    Properties props = System.getProperties();
    try {
    if (host != null)
    props.put("mail.smtp.host", host);
    else if (props.getProperty("mail.smtp.host") == null)
    props.put("mail.smtp.host", InetAddress.getLocalHost().
    getHostName());
    } catch (Exception ex) {
    throw new JspException(ex.getMessage());
    Session session = Session.getDefaultInstance(props,null);
         Message msg = new MimeMessage(session);
         InternetAddress[] toAddrs = null, ccAddrs = null;
    try {
         if (recipients != null) {
         toAddrs = InternetAddress.parse(recipients, false);
         msg.setRecipients(Message.RecipientType.TO, toAddrs);
         } else
         throw new JspException("No recipient address specified");
    if (sender != null)
    msg.setFrom(new InternetAddress(sender));
    else
    throw new JspException("No sender address specified");
         if (cc != null) {
    ccAddrs = InternetAddress.parse(cc, false);
         msg.setRecipients(Message.RecipientType.CC, ccAddrs);
         if (subject != null)
         msg.setSubject(subject);
         if ((body = getBodyContent().getString()) != null)
         msg.setText(body);
    else
    msg.setText("");
    Transport.send(msg);
    } catch (Exception ex) {
    throw new JspException(ex.getMessage());
    return(EVAL_PAGE);
    all the entries in taglib.tld and web.xml are correct.
    It is one of the article given at this url:
    http://java.sun.com/developer/technicalArticles/javaserverpages/emailapps/

    First, you should not take copyrighted code and post it without a copyright.
    The code you posted is copyright Sun Microsystems.
    Second, why did you post it? Did you have a question?

  • JSF dynamic include and custom tag

    Anybody has experience to enclude custom tags between <f:verbatim> </f:verbatim> ? The custom code embeded this tags won't work, my code as below:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%-- jsf:pagecode language="java" location="/JavaSource/pagecode/jsp/Server_request.java" --%><%-- /jsf:pagecode --%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@taglib uri="/WEB-INF/mytaglib.tld" prefix="first" %>
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM Software Development Platform">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="../theme/Master.css" rel="stylesheet"
         type="text/css">
    <TITLE>server_request.jsp</TITLE>
    <LINK rel="stylesheet" type="text/css" href="../theme/stylesheet.css"
         title="Style">
    </HEAD>
    <f:view>
         <BODY><hx:scriptCollector id="scriptCollector1">
         <P><hx:outputLinkEx styleClass="outputLinkEx" value="header"
                   id="linkEx1">
                   <h:outputText id="text1" styleClass="outputText" value="Header"></h:outputText>
              </hx:outputLinkEx><BR></P>
    <jsp:include page="server_req.jsp"/>
              <hx:outputLinkEx styleClass="outputLinkEx" value="Footer" id="linkEx2">
                   <h:outputText id="text2" styleClass="outputText" value="Footer"></h:outputText>
              </hx:outputLinkEx>
         </hx:scriptCollector></BODY>
    </f:view>
    </HTML>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="/WEB-INF/mytaglib.tld" prefix="first"%>
    <f:subview id="server_req">
    <f:verbatim>
    <first:hello/>
    </f:verbatim>
    </f:subview>

    I don't know if there is a solution to the problem you are having with JSP 1.1. If you look in the spec, it actually warns you that dynamic includes can not be done inside a body tag. The spec actually states that the included code shout write directly to the response and not to the BodyContent.
    I was excited to find out they had fixed this in JSP 1.2, but they seem to have foiled me again. If my tag calls PageContext.include(), the spec says that include must call the flush method, which causes BodyContent to throw an exception since flush is not a valid call.

  • Scripting variables and custom tags

    Hello,
    I wonder how I could use a scripting variable in a custom tag? I have written a tag that formats number and dates, and would like to be able to do somethin like
    <% double x = 12,345; %>
    <x:write name="x" format="xyz" />
    Also I wonder how best to implement tags with parameters? I don't suppose it's possible to nest tags or scriplets in a way like <x:bla name="test" value="<%= 12345 %>" />? It seems tedious having to create an Object just to pass a Parameter.
    Many thanks in advance for any help!
    Bjoern

    I think I found the solution,
    pageContext.setAttribute(...,...)

  • Tomcat 4.1.12 and custom tags with body

    Hi,
    I had deployed one application in tomcat 3.3.1 which used custom tags with body, and it worked fine, However recently I upgraded that application to tomcat-4.1.12
    and the tags with body stopped giving expected behaviour, however the tags without body are giving expected behaviour, I had a look at generated jsp file...
    I am pasting the generated output here
    jp.co.nttdata.sk._webtier.tagext.FormTag jspxth_sk_form_0 = (jp.co.nttdata.sk._webtier.tagext.FormTag) jspxtagPool_sk_form_action.get(jp.co.nttdata.sk._webtier.tagext.FormTag.class);
    jspxth_sk_form_0.setPageContext(pageContext);
    jspxth_sk_form_0.setParent(null);
    jspxth_sk_form_0.setAction(SKScreenDefinition.SK_I0100 );
    int jspxeval_sk_form_0 = jspxth_sk_form_0.doStartTag();
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
    javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
    _bc.clear();
    out = _bc;
    jspxth_sk_form_0.setBodyContent(_bc);
    jspxth_sk_form_0.doInitBody();
    do {
    out.write("\r\n<input type=\"hidden\" name=\"rpt_no\" value=\"<%= rpt_no %>\">\r\n<input type=\"hidden\" name=\"optnOpen\" value=\"0\">\r\n<table border=0 cellspacing=0 cellpadding=0 class=\"bdsyl\">\r\n<tr>\r\n<td class=\"innframe\">\r\n\r\n\t<table border=0 cellspacing=0 cellpadding=5 class=\"bgcol_1\">\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E/td>\r\n\t<td>\r\n\t\t\t<select name=\"rptDivCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameRptDiv != null) nLen = arrOskCodeNameRptDiv.length;\r\n%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameRptDiv.getCode();\r\n\t\tString nm = arrOskCodeNameRptDiv[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(rpt_div)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%=value%>\"><%= nm%></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��� ���E���</td>\r\n\t<td>\r\n\t\r\n\t\t\t<select name=\"prortyCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameProrty != null) nLen = arrOskCodeNameProrty.length;\r\n");
    out.write("%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameProrty[i].getCode();\r\n\t\tString nm = arrOskCodeNameProrty[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(prorty)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= value %>\"><%= nm %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E/td>\r\n\t<td><input type=\"text\" size=4 maxlength=4 name=\"rpt_dt_yyyy\" value=\"<%= rpt_dt_yyyy %>\">��� <input type=\"text\" size=2 maxlength=2 name=\"rpt_dt_mm\" value=\"<%= rpt_dt_mm %>\">���E<input type=\"text\" size=2 name=\"rpt_dt_dd\" maxlength=2 value=\"<%= rpt_dt_dd %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"rpt_dt_hh\" value=\"<%= rpt_dt_hh %>\">���E<input type=\"text\" size=2 maxlength=2 name=\"rpt_dt_mi\" value=\"<%= rpt_dt_mi %>\">���E<span class=\"fsyl_2\">�E����������������E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��� ���E���E</td>\r\n\t<td><input type=\"text\" size=20 name=\"rpt_user\" value=\"<%= Util.forHidden(rpt_user) %>\"></td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t<td>\r\n\t\r\n\t\t\t<select name=\"rptRegiUserCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOfUserName != null) nLen = arrOfUserName.length;\r\n\r\n\tfor(int i=0;i<nLen;i++){\r\n\t\tString[] arrTemp = UzUtil.extractTokens(arrOfUserName[i], SKConstants.SEPARATOR);\r\n\t\t\r\n\t\tstrSelected = \"\";\r\n\t\tif(arrTemp[0].equals(rpt_regi_user)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= arrOfUserName[i] %>\"><%= arrTemp[1] %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\r\n\t\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������</td>\r\n\t<td><input type=\"text\" size=70 name=\"rpt_title\" value=\"<%= UzString.forHidden(rpt_title)%>\"> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��������E���</td>\r\n\t<td nowrap><textarea wrap=\"physical\" rows=10 cols=72 name=\"rpt_txt\"><%= UzString.htmlEncodeForHidden(rpt_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span>      </td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������E��</td>\r\n\t<td><textarea rows=5 cols=72 name=\"rpt_effct_lmt\"><%= UzString.htmlEncodeForHidden(rpt_effct_lmt) %></textarea> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���E��� ���</td>\r\n\t<td><textarea rows=5 cols=72 name=\"reappr_cnd\"><%= UzString.htmlEncodeForHidden(reappr_cnd)%></textarea> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td nowrap class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n\t<td><input type=\"text\" size=4 name=\"rply_prf_dt_yyyy\" maxlength=4 value=\"<%= rply_prf_dt_yyyy %>\">��� <input type=\"text\" size=2 name=\"rply_prf_dt_mm\" maxlength=2 value=\"<%= rply_prf_dt_mm %>\">���E<input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_dd\" value=\"<%= rply_prf_dt_dd %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_hh\" value=\"<%= rply_prf_dt_hh %>\">���E<input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_mi\" value=\"<%= rply_prf_dt_mi %>\">���E<span class=\"fsyl_2\">�E����������������E/span></td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td>���</td>\r\n\t<td align=right><input type=\"button\" value=\"���������������\" onClick=\"openOptn()\"></td>\r\n\t</tr>\r\n<!---- ��������������������������������������� ----->\r\n\t<tr id=\"com\" style=\"display:none\">\r\n\t<td colspan=2>\r\n\t\t<table border=0 cellspacing=0 cellpadding=5>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t\t<td>\r\n\t\t\t<select name=\"crrspndUserCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOfUserName != null) nLen = arrOfUserName.length;\r\n\r\n\tif(crrspnd_user.equals(\"\")) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= SKConstants.NOTSPECIFIED %>\">���������������������E/option>\r\n<%\r\n\tfor(int i=0;i<nLen;i++){\r\n\t\tString[] arrTemp = UzUtil.extractTokens(arrOfUserName[i], SKConstants.SEPARATOR);\r\n\t\t\r\n\t\tstrSelected = \"\";\r\n\t\tif(arrTemp[0].equals(crrspnd_user)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= arrOfUserName[i] %>\"><%= arrTemp[1] %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\t\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n");
    out.write("\t\t<td>\r\n\t\t\t<select name=\"fndngDivCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameFndngDiv != null) nLen = arrOskCodeNameFndngDiv.length;\r\n\r\n\tif(fndng_div.equals(\"\")) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= SKConstants.NOTSPECIFIED %>\">���������������������E/option>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameFndngDiv[i].getCode();\r\n\t\tString nm = arrOskCodeNameFndngDiv[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(fndng_div)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= value %>\"><%= nm %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\t\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E��������</td>\r\n\t\t<td><input type=\"text\" maxlength=4 size=4 name=\"crrspnd_fin_pln_dt_yyyy\" value=\"<%= crrspnd_fin_pln_dt_yyyy %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"crrspnd_fin_pln_dt_mm\" value=\"<%= crrspnd_fin_pln_dt_mm %>\">���E<input maxlength=2 type=\"text\" size=2 name=\"crrspnd_fin_pln_dt_dd\" value=\"<%= crrspnd_fin_pln_dt_dd %>\">��� <span class=\"fsyl_2\">�E����������������E/span></td>\r\n");
    out.write("\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E��</td>\r\n\t\t<td><input type=\"text\" maxlength=4 size=4 name=\"crrspnd_fin_dt_yyyy\" value=\"<%= crrspnd_fin_dt_yyyy %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"crrspnd_fin_dt_mm\" value=\"<%= crrspnd_fin_dt_mm %>\">���E<input type=\"text\" size=2 maxlength=2 name=\"crrspnd_fin_dt_dd\" value=\"<%= crrspnd_fin_dt_dd %>\">��� <span class=\"fsyl_2\">�E����������������E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������</td>\r\n\t\t<td><textarea rows=8 cols=72 name=\"cause_txt\"><%= UzString.htmlEncodeForHidden(cause_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������E��</td>\r\n\t\t<td><textarea rows=10 cols=72 name=\"crrspnd_txt\"><%= UzString.htmlEncodeForHidden(crrspnd_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t\t<td><textarea rows=8 cols=72 name=\"rlps_prvnt_schm\"><%= UzString.htmlEncodeForHidden(rlps_prvnt_schm) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n");
    out.write("\t\t</tr>\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n<!---- ��������������������������������������� ���E----->\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n\t<td>\r\n\t\t<table border=0 cellspacing=0 cellpadding=0>\r\n\t\t<tr valign=top>\r\n\t\t<td><input type=\"radio\" name=\"mail_sendto_div_radio\" checked onClick=\"mailCheck(true)\" value=\"<%= SKConstants.CD_ONE + SKConstants.SEPARATOR + \"������\" %>\">��������������� <input type=\"radio\" name=\"mail_sendto_div_radio\" onClick=\"mailCheck(false)\" value=\"<%= SKConstants.CD_ZERO + SKConstants.SEPARATOR + \"���������E��\" %>\">���������E��Enbsp; </td>\r\n\t\t<td>\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameGroup != null) nLen = arrOskCodeNameGroup.length;\r\n\tint nExtra = (nLen/2) + (nLen%2);\r\n%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameGroup[i].getCode();\r\n\t\tString nm = arrOskCodeNameGroup[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n%>\r\n\t\t\t\t<input type=\"checkbox\" name=\"send_mail\" value=\"<%= value %>\"><%= nm %><br>\r\n<%\r\n\t\tif((i+1) == nExtra)\r\n\t\t{\r\n%>\r\n\t\t\t</td>\r\n\t\t\t<td>    </td>\r\n");
    out.write("\t\t\t<td>\r\n<%\r\n\t\t}\r\n\t}//for loop\r\n%>\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<td>���</td>\r\n\t<td align=right><br><input type=\"submit\" value=\"������������\" name=\"saveReport\">���<input type=\"submit\" value=\"���������������������\" name=\"regReport\"></td>\r\n\t</tr>\r\n\t</table>\r\n\r\n</td>\r\n</tr>\r\n</table>\r\n");
    int evalDoAfterBody = jspxth_sk_form_0.doAfterBody();
    if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
    break;
    } while (true);
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
    out = pageContext.popBody();
    What I found out that scriptlets are also encluded in string however they should not be enclosed.
    Is it a bug? or do I need to change my taghandler class...?
    Any suggestion, any help ll be really helpful
    Regards,
    Susheel

    Hi,
    I am able to resolve it,
    Actually I was using the body content as tagdependent instead of jsp.
    However the body content tagdependent works in Tomcat 3.3.1 and weblogic 5.1, 6.0.
    Anyway...

  • Leopard questions - Permissions and "Custom Access"

    I just (reluctantly) upgraded to Leopard (only because I wanted to install the iLife 09 which requires 10.5.6), and then the Permissions fun started. Install went fine and so did the updates. Then I ran Disk Warrior (new directory, repair permissions, check all files/folders).
    I tried to read all the posts I could find, but none dealt with these particular messages, so I thought I'd ask just to make sure....
    2. I have hundreds of "ACL found but not expected", but all of mine are on:
    "System/Library/User Template/" and then there seems to be every language listed.
    2. There are dozens of "permissions differ on" and they all relate to Front Row (should be -rw-r-r, they are lrw-r-r). I haven't even used Front Row....
    Can I safely ignore all of those?
    And, while I'm asking questions:
    Is the "You have custom access" showing in any Get Info window of any application a Leopard "feature" or what does it mean? When I first checked, I found that several apps (part of OS or third party) did not have me, the admin, with "read & write" access. Some had "read only" and some "no access", but all of them showed the custom access. I went through all the apps and made them "read & write", but the custom access remains. These are apps I use quite often such as Graphic Converter.
    Can I ignore the "custom access" or do I need to do something about it?

    2. There are dozens of "permissions differ on" and they all relate to Front Row (should be -rw-r-r, they are lrw-r-r). I haven't even used Front Row....
    Ignore per Mac OS X 10.5- Disk Utility's Repair Disk Permissions messages that you can safely ignore. They are innocuous and will recur each time you repair permissions.
    1. I have hundreds of "ACL found but not expected", but all of mine are on:
    "System/Library/User Template/" and then there seems to be every language listed.
    These are the result of upgrading instead of doing a fresh install of Leopard. They are basically harmless. Such errors in your Home folder can be repaired using the Reset Password selection from the Utilities menu after booting from the Leopard installer DVD. Check the bottom option to Reset ACLs and click the button. Do not make any other selections. This only affects ACLs in the Home folder. To fix all such items means you have to perform an Archive and Install of Leopard then run the 10.5.8 Combo Updater. If you don't want to do all this then just ignore the issue.
    The Custom Access is the result of the custom ACLs and simply means you've upgraded from Tiger which did not support ACLs while Leopard does.
    In fact there are literally thousands of topics and replies on these two topics throughout the Leopard forums that deal specifically with these particular messages which is why Apple issued the above linked tech note.

  • Error in  TLD(jsp custom tags)

    Hi frinend
    iam trying jsp custom tabs (taglibs)
    i worte a java class
    i worte a jsp page
    i worte a TLd file
    the proble with tlb
    it geting error like this
    org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/jsp/mytaglib.tld: (line 2, col -1): XML declaration may only begin entities.
    what is that mean
    i wrote in tld file like this
    <?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 ">
    <!-- a tag library descriptor -->
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>first</shortname>
    <uri></uri>
    <info>A simple tab library for the
    examples</info>
    <tag>
    <name>hello</name>
    <tagclass>tags.HelloTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>Say Hi</info>
    </tag>
    </taglib>
    pls help
    regards
    kedar

    try something that looks like this in your tld file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>1.2</jsp-version>
    <short-name>MyFirstTag</short-name>
    <tag>
    <name>helloparam</name>
    <tag-class>tags.HyperTag</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <name>name</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    </tag>
    </taglib>

  • Dynamic Parameter List questions: Length and Custom Values

    I've got a Crystal Report that I want to use Dynamic Values for.
    Right now... this report is simply a "SELECT stuff  FROM table" SQL query... with a parameter that the report uses to filter.
    I use a "Select DISTINCT value from table" to generate a list of values. I put those values into a txt. I then import the text into a static list. This creates a parameter list that is 11 "pages" long on the parameter screen. I also have "custom" values allowed. This is to allow for "new" values and also allow not needing to browse 11 pages for one or two known values.
    If I turn the parameter into a Dynamic List based on the same Select statement it stops at 5 pages, obviously cutting off half of the possible values.
    Dynamic List also removes the ability to do Custom Values. The filter option wouldn't be a bad alternative BUT it don't work for pages 6+ that aren't there.
    How can I remove the 5 page limit (or whatever it is) for Dynamic values?
    Thanks
    Chris
    Edited by: WernerCD on Aug 4, 2010 4:14 PM

    There is a limit of 1000 records in dynamic parameters. You can change this by adding a registry value:
    registry key : HKEY_CURRENT_USER\SOFTWARE\Business Objects\Suite 11.0\Crystal Reports\DatabaseOptions\LOV
    and then add a key called MaxRowsetRecords and give it a value.
    if you have Crystal 2008 then the above registry folder will say Suite 12.0.

  • Question about custom tags

    Hi All,
    Please tell me what is differnce between javabean and custom tags.
    thank you.

    Javabean is a data object (or a data holder) whose properties can be accessed using getters, setters - ex getName() and setName()
    JSP custom tags are merely Java classes that implement special interfaces (Tag interface). Once they are developed and deployed, their actions can be called from your HTML using XML syntax. Refer the article http://java.sun.com/developer/technicalArticles/xml/WebAppDev3/
    Cheers,
    Janesh

  • Custom Tag and CFC : Nate Weiss

    Hi,
    being a beginner I'm trying with some marginal degree of
    success to understand CFC's and Custome Tags.
    In the CFMX7 W.A.C.K. There is an example shopping cart. This
    start off as a basic affair then expands into more object based
    principles using a custom tag add products to the cart
    (ShoppingCart.cfc) and later on the same page uses a custome Tag to
    display the cart items, calling it once for each item to display.
    I am using the MVC structure under Fusebox 4, so this method
    of using the same template, (reloading etc) is alien to me as with
    MVC you usually have the data type intructions in different files
    (anyway, I digress)
    Now that I have the thing adding products and generally
    working with my "shop", I thought about having a "special offer"
    facility. With these "Hot Deals" being stored in another database
    table, with their productID and new price.
    However, obviously the shopping cart needs to be made aware
    of this. With I would have thought an extra variable in the array
    telling the custom tag to retrieve the special price and the
    product information using a diufferent inner join query to normal.
    I have attemtped this by adding an additional URL parameter
    thus /..../HSOP/Y ("Has Special Offer Price" being set to "Y")
    When this reloads the page the CFC invoke is set thus
    <CFIF IsDefined("URL.HSOP") AND #URL.HSOP# EQ "Y">
    <CFINVOKE
    COMPONENT="#SESSION.MyShoppingCart#"
    METHOD="Add"
    MERCHID="#URL.AddMerchID#"
    SOPH="Y">
    <cfelse>
    This successfully passes
    Add(SOPH = Y, MERCHID = xxxx)
    to the CFC. However I get this error......,
    ..................Element SOPH is undefined in ARGUMENTS.
    the CFC simpley isnt adding the new variable to the array...
    I think... it wont do a CFDump so there is no way of telling
    <CFFUNCTION
    NAME="Add"
    HINT="Adds an item to the shopping cart">
    <!--- Three Arguments: MerchID, Quantity and SOPH (flag
    to state if there is a special price) --->
    <CFARGUMENT NAME="MerchID" TYPE="numeric"
    REQUIRED="Yes">
    <CFARGUMENT NAME="Quantity" TYPE="numeric" REQUIRED="No"
    DEFAULT="1">
    <CFARGUMENT NAME="SOPH" type="string">
    <!--- Get structure that represents this item in cart,
    --->
    <!--- then set its quantity to the specified quantity
    --->
    <CFSET CartItem = GetCartItem(MerchID)>
    <CFSET CartItem.Quantity = CartItem.Quantity +
    Arguments.Quantity>
    <CFSET CartItem.SOPH = Arguments.SOPH>
    </CFFUNCTION>
    I cant see why this wouldn't create the variable
    "CartItem.SOPH" and set it to "Y" as passed to it.
    I notice the CFC performs an iteration of sorts to put the
    cart items into an array. But I'm afraid I cant fathom what this
    problem might be.
    Any ideas. I have attached the whole CFC code (post editing
    by me)
    MAny thanks and Happy new Year

    Hi,
    As for me, I am testing the related pdf-417 barcode scanner these days. Do you have any ideas about it? Or any good suggestion? I am totally a green hand on barcode field. Any suggestion will be appreciated. Thanks in advance.
    Best regards,
    Arron

  • JSP Custom Tags, Tag Handlers, Passing values

    Multiple questions here while I try to work with custom tags (its a requirement):
    From what I have had so far - I have a .tld file, a .java file and a .jsp page.
    (this is not a working version as I just got it from a website)
    platform: tomcat on an xp box.
    I was wondering if we can pass the parameters that are passed to the the jsp page (like blah.jsp?param1=value1&param2=valu2 ) to the tag handler?
    This is because the processing that I need to do in the handler would depend on what I have in the passed values.
    Any help in letting me know where to place those files on the tomcat context root would help. Please see, I do have a couple of servlets running on the box also and they might be in the same context root.
    Any good short tutorial link is also welcome as a short answer as I try to unravel the custom tags in jsp.

    I am using TomCat 5.5
    What I need to do using tags is to build a web-page on the fly by polling a couple of different tables in the database.
    This is to be done using a jsp and custom tag (requirement) which would be able to handle any resultsets. We also have to come up with pageContext attribute names and supply column names as those attributes. Thus we will have to come up with the meta data file and a tag library descriptor as well.
    I found a helloworld solution on a website and was trying to modify it to meet my needs. But I guess I under-estimated the work that needed to be done in this one.

  • 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.

  • JSP with Custom tags error during verify.

    Hi, i am new to JSP and Custom tag Library. The tools that i am using to deploy is "Sun Deploy Tool 8.2" with Sun Application Server. When i try to verify my JSP page i get this error message
    tests.web.AllJSPsMustBeCompilable . I guess there is nothing wrong for my code, will it be path problem, because
    i already check that i had included all the path that i need. Any idea what might cause this problem? Thank You.
    Assertion:All the JSPs that are bundled inside a web application must be compilable using a J2EE compliant JSP compiler that does not have any proprietary or optional features in it.
    For [ /tag/tag.war ]
    Error: Some JSPs bundled inside [ tag ] could not be compiled. See details below.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /currentTime.jsp
    Here are my class file :
    Custom lib java Class timetag.java
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    import java.text.SimpleDateFormat;
    public class timetag extends TagSupport{
         public int doEndTag() throws JspException
              SimpleDateFormat sdf;
              sdf = new SimpleDateFormat("HH:mm:ss");
              String time = sdf.format(new java.util.Date());
              try {
                   pageContext.getOut().print(time);
              }catch(Exception ex)
                   throw new JspException(ex.toString());
              return EVAL_PAGE;
    Tag file *.tld : examplesTag.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <taglib 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/web-jsptaglibrary_2_0.xsd"
    version="2.0">
    <tlib-version>1.0</tlib-version>
    <jsp-version>2.0</jsp-version>
    <short-name>ExamplesTags</short-name>
    <description>A set of example tag handlers.</description>
    <tag>
    <name>time</name>
    <tag-class>timetag</tag-class>
    </tag>
    </taglib>
    JSP File : currentTime.jsp
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ taglib prefix="examples" uri="/WEB-INF/examplesTags.tld" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Insert title here</title>
    </head>
    <body>
    <examples:time /> //If i remove this it will be fine.
    </body>
    </html>

    I am sorry for the double post because the format mess up..Please ignore this POST..Apologies again..Thanks

  • Applescript for custom tags

    hi there,
    has anyone had any experience with applescript and custom tags? i've gotten so far as to display the name of custom tags i've added, but i want to find a way to batch erase some i've added on several thousand pictures. any hints?
    j
    here's a snippet of the code i'm trying out. there must be some way to delete the tag, but i'm not fluent in applescript. the logic of the script has been copied off another one i've found somewhere on the net. the author is Steven Banick (http://banick.com)
    repeat with countOfPhotos from 1 to the count of selectedPhotos
    -- Get the photo's properties for the operation
    set currentPhoto to item countOfPhotos of selectedPhotos
    tell currentPhoto
    -- Reset the variables in the loop
    set the photoCustomTags to ""
    -- Retrieve the Photo Metadata
    set the photoCustomTags to the name of custom tags
    -- Scan the individual custom Tags from the assigned Custom tags
    repeat with currentcustomTag from 1 to count of photoCustomTags
    set currentcustomTag to item currentcustomTag of photoCustomTags
    -- ver quais são as custom tags e tentar apagá-las
    if currentcustomTag = CustomTagName1 then
    -- display dialog currentcustomTag
    delete the item currentcustomTag

    I'm not sure if you can delete tags, but you can certainly empty them:
    tell application "Aperture"
    set selectedImages to the selection
    repeat with i from 1 to number of items in selectedImages
    set this_item to item i of selectedImages
    try
    set value of custom tag "Image ID" of this_item to ""
    end try
    end repeat
    end tell
    Just change "Image ID" to the name of your custom tag, and make sure that you only use it on the correct images...
    Ian

Maybe you are looking for

  • XMLType table Core Dump using CLOB

    I've created an object based XMLType table based on a valid XML Schema. The Schema has an element which has been declared as a CLOB. <xs:element name="complete_entry" xdb:SQLType="CLOB" xdb:SQLName="complete_entry"/> This registers ok with Oracle and

  • I can't download anything my purchase and get message that says I don't have write access in itunes

    I am trying to downlaod music from itunes for the first time and get an error message iTunes couldn't download your purchase.  You don't have write access for your iTunes Media folder or a folder within it.  Change permissions in the finder and then

  • SPA508G not registering with UC520

    Hi I am running a UC520 (12.4(20)T2), CME7.0(0) and CUE 3.2.1. We have recently purchased an SPA508G but cant get it to register. I have added the phone loads from a software pack, but the device type doesnt appear as an option. When monitoring the t

  • Installing new HDD

    I have a 1.6Ghz with 1Gb ram iMac G5 model. First generation. It has the factory installed 80Gb hard drive. I am wanting to upgrade this to a 1Tb Seagate hard drive I found on Amazon. Some questions I have about this are: 1. Will there be heating iss

  • I need to retrieve an Object[] of all keys in java.util.Hashtable

    public abstract class ArrayFunctionality {      * Construct {@link java.lang.Object} array of keys from {@link java.util.Hashtable}      * @param h {@link java.util.Hashtable}      * @return array {@link java.lang.String}      * @throws java.lang.Ind