{"id":193,"date":"2007-09-06T00:00:00","date_gmt":"2007-09-06T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=193"},"modified":"2007-09-06T00:00:00","modified_gmt":"2007-09-06T00:00:00","slug":"Logic Empty Tag (<logic:empty>...<\/logic:empty>)","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=193","title":{"rendered":"Logic Empty Tag (<logic:empty>&#8230;<\/logic:empty>)"},"content":{"rendered":"<p><H3><FONT color=#000080>empty tag &#8211;<\/FONT><FONT color=#0000ff>&nbsp;<I>If the requested variable is either null or an empty string then we use this tag to evaluate the contents contained in the nested body parts of this tag.<\/I><\/FONT><\/H3><br \/>\n<P><FONT color=#000080>Tag evaluation of the nested body content occurs only if the specified value is either <B>absent<\/B> (i.e. <CODE>null<\/CODE>), an <B>empty string<\/B> (i.e. a <CODE>java.lang.String<\/CODE> with a length of zero), or an <B>empty <CODE>java.util.Collection<\/CODE> or <CODE>java.util.Map<\/CODE> <\/B>(tested by the isEmpty() method on the respective interface).<\/FONT><\/P><br \/>\n<P><FONT color=#000080><B>Attributes of Empty Tag<\/B><\/FONT><\/P><br \/>\n<DIV class=indent><br \/>\n<TABLE class=tag-attributes borderColor=#ffffcc cellPadding=0 bgColor=#ffffcc><br \/>\n<THEAD><br \/>\n<TR><br \/>\n<TH class=attribute><FONT color=#000080>Attribute Name<\/FONT><\/TH><br \/>\n<TH><FONT color=#000080>Description<\/FONT><\/TH><\/TR><\/THEAD><br \/>\n<TBODY><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><FONT color=#000080><B>name<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>This attribute specifies a&nbsp; JSP bean variable which is required to make comparison.&nbsp;<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>property<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>The variable contains the property of the bean which is required to make comparison and is specified by the <CODE><B>name<\/B><\/CODE> attribute.&nbsp;<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><FONT color=#000080><B>scope<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>This specifies the bean scope within which&nbsp; the bean is searched&nbsp; by the <CODE>name<\/CODE> property, or &#8220;any scope&#8221; if not specified.<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<H1><FONT color=#000080>Logic notEmpty Tag (&lt;logic:notEmpty&gt;&#8230;&lt;\/logic:notEmpty&gt;)&nbsp;<\/FONT><\/H1><br \/>\n<H3 id=notEmpty><STRONG><FONT color=#000080>notEmpty<\/FONT><\/STRONG><FONT color=#0000ff> &#8211; <\/FONT><FONT color=#0000ff><I>If the requested variable is neither null nor an empty string then we use this tag to evaluate the contents contained in the nested body parts of this tag.<BR><\/I><\/FONT><\/H3><br \/>\n<P id=notEmpty><FONT color=#000080>Tag evaluation of the nested body content occurs only if the specified value is <B>available<\/B> (i.e.not <CODE>null<\/CODE>) and is not an empty string (i.e. a <CODE>java.lang.String<\/CODE> with a length of zero).<BR><BR><B>Attributes of notEmpty Tag<\/B><\/FONT><\/P><br \/>\n<DIV class=indent><br \/>\n<TABLE class=tag-attributes borderColor=#ffffcc bgColor=#ffffcc><br \/>\n<THEAD><br \/>\n<TR><br \/>\n<TH class=attribute><FONT color=#000080>Attribute Name<\/FONT><\/TH><br \/>\n<TH><FONT color=#000080>Description<\/FONT><\/TH><\/TR><\/THEAD><br \/>\n<TBODY><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><FONT color=#000080><B>name<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>This attribute specifies a&nbsp; JSP bean variable which is required to make comparison.&nbsp;&nbsp;<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>property<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>The variable contains the property of the bean which is required to make comparison and is specified by the <CODE><B>name<\/B><\/CODE> attribute.&nbsp;<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><FONT color=#000080><B>scope<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>This specifies the bean scope within which&nbsp; the bean is searched&nbsp; by the <CODE>name<\/CODE> property, or &#8220;any scope&#8221; if not specified.<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<H2>&nbsp;<\/H2><br \/>\n<H2><FONT color=#000080>Example Illustrating the use of the Empty<\/FONT><FONT color=#000080>&lt;logic:empty&gt;<\/FONT><FONT color=#000080> and the notEmpty <\/FONT><FONT color=#000080>&lt;logic:notEmpty&gt; logic tags<\/FONT><FONT color=#000080>.<\/FONT><\/H2><br \/>\n<P><FONT color=#000080>Here you will learn to use the Struts&nbsp; Logic tags. We will cover an example that will show&nbsp; a comparison between&nbsp; the two logic tags (ie..<\/FONT><FONT color=#000080>&lt;logic:empty&gt; and the &lt;logic:notEmpty&gt;).<\/FONT><\/P><br \/>\n<P><FONT color=#000080><B>Example code<\/B><\/FONT><\/P><br \/>\n<P><B><FONT color=#000080>Creating an <\/FONT><\/B><FONT color=#000080><B>Action&nbsp; Class<\/B><\/FONT><\/P><br \/>\n<P><FONT color=#000080>Develop a simple action class <\/FONT><CODE><FONT color=#0000ff>EmptyAction.java.<\/FONT><\/CODE><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"70%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><br \/>\n<DIV class=java align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=3 bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><!-- start source code --><br \/>\n<TD vAlign=top noWrap align=left><CODE><FONT color=#7f0055><B>package&nbsp;<\/B><\/FONT><FONT color=#000000>roseindia.net;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>java.io.*;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>java.util.*;<\/FONT><BR><BR><FONT color=#000080>\/**<\/FONT><\/CODE><br \/>\n<P><CODE><FONT color=#000080>*&nbsp;@author&nbsp;Amit&nbsp;Gupta<BR>*&nbsp;@Web&nbsp;http:\/\/www.roseindia.net<BR>*&nbsp;@Email&nbsp;<A href=\"mailto:struts@roseindia.net\">struts@roseindia.net<BR><BR><\/A>**\/<BR><\/FONT><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.servlet.http.HttpServletRequest;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.servlet.http.HttpServletResponse;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.servlet.ServletException;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>org.apache.struts.action.*;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#7f0055><B>public&nbsp;class&nbsp;<\/B><\/FONT><FONT color=#000000>EmptyAction&nbsp;<\/FONT><FONT color=#7f0055><B>extends&nbsp;<\/B><\/FONT><FONT color=#000000>Action&nbsp;<\/FONT><BR><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#000000>ActionForward&nbsp;execute<\/FONT><FONT color=#000000>(<\/FONT><FONT color=#000000>ActionMapping&nbsp;mapping,<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>ActionForm&nbsp;form,<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>HttpServletRequest&nbsp;request,<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>HttpServletResponse&nbsp;response<\/FONT><FONT color=#000000>)<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>throws&nbsp;<\/B><\/FONT><FONT color=#000000>IOException,&nbsp;ServletException&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>return&nbsp;<\/B><\/FONT><FONT color=#000000>mapping.findForward<\/FONT><FONT color=#000000>(<\/FONT><FONT color=#2a00ff>&#8220;success&#8221;<\/FONT><FONT color=#000000>)<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#000000>}<\/FONT><\/CODE> <\/P><\/TD><!-- end source code --><\/TR><\/TBODY><\/TABLE><\/DIV><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><B><FONT color=#000080>Creating Form Bean<\/FONT><\/B><\/P><br \/>\n<P><FONT color=#000080>Our form bean class contains only one property <B>text<\/B>. Here is the code of FormBean <\/FONT><FONT color=#0000ff>(<CODE><B><\/B>EmptyForm<\/CODE>.java)<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"70%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><br \/>\n<DIV class=java align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=3 bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><!-- start source code --><br \/>\n<TD vAlign=top noWrap align=left><CODE><FONT color=#7f0055><B>package&nbsp;<\/B><\/FONT><FONT color=#000000>roseindia.net;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>org.apache.struts.action.*;<\/FONT><BR><BR><FONT color=#000080>\/**<BR><BR>*&nbsp;@author&nbsp;Amit&nbsp;Gupta<BR>*&nbsp;@Web&nbsp;http:\/\/www.roseindia.net<BR>*&nbsp;@Email&nbsp;<A href=\"mailto:struts@roseindia.net\">struts@roseindia.net<BR><\/A><BR>**\/<BR><\/FONT><\/CODE><br \/>\n<P><CODE><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.servlet.http.HttpServletRequest;<\/FONT><BR><FONT color=#7f0055><B>import&nbsp;<\/B><\/FONT><FONT color=#000000>javax.servlet.http.HttpServletResponse;<\/FONT><BR><FONT color=#ffffff><\/FONT><BR><FONT color=#7f0055><B>public&nbsp;class&nbsp;<\/B><\/FONT><FONT color=#000000>EmptyForm&nbsp;<\/FONT><FONT color=#7f0055><B>extends&nbsp;<\/B><\/FONT><FONT color=#000000>ActionForm&nbsp;<\/FONT><BR><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>private&nbsp;<\/B><\/FONT><FONT color=#000000>String&nbsp;text&nbsp;=&nbsp;<\/FONT><FONT color=#2a00ff>&#8220;&#8221;<\/FONT><FONT color=#000000>;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#000000>String&nbsp;getText<\/FONT><FONT color=#000000>()&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>return&nbsp;<\/B><\/FONT><FONT color=#000000>text;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>public&nbsp;<\/B><\/FONT><FONT color=#7f0055><B>void&nbsp;<\/B><\/FONT><FONT color=#000000>setText<\/FONT><FONT color=#000000>(<\/FONT><FONT color=#000000>String&nbsp;text<\/FONT><FONT color=#000000>)&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#000000>{<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><FONT color=#7f0055><B>this<\/B><\/FONT><FONT color=#000000>.text=text;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;<\/FONT><FONT color=#000000>}<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;<\/FONT><BR><FONT color=#ffffff>&nbsp;&nbsp;&nbsp;&nbsp;<\/FONT><BR><FONT color=#000000>}<\/FONT><\/CODE> <\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><B><FONT color=#0000ff>Defining form Bean in struts-config.xml file<\/FONT><\/B><\/P><br \/>\n<P><FONT color=#000080>Add the following entry in the struts-config.xml file for defining the&nbsp;form bean<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=0 width=\"56%\" bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\">&lt;form-bean name=&#8221;EmptyForm&#8221; type=&#8221;roseindia.net.EmptyForm&#8221;\/&gt;<\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P>&nbsp;<B><FONT color=#0000ff>Developing the Action Mapping in the struts-config.xml<BR><\/FONT><\/B><FONT color=#000080><BR>Here, Action mapping helps to select the method from the Action class for&nbsp;specific requests.<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=0 width=\"40%\" bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\">&lt;action path=&#8221;\/EmptyAction&#8221;<BR>type=&#8221;roseindia.net.EmptyAction&#8221;<BR>name=&#8221;EmptyForm&#8221;<BR>scope=&#8221;request&#8221;<BR>input=&#8221;\/pages\/input.jsp&#8221;&gt;<BR>&lt;forward name=&#8221;success&#8221; path=&#8221;\/pages\/output.jsp&#8221;\/&gt;<BR>&lt;\/action&gt;<\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Developing the <\/FONT><FONT color=#0000ff>input.jsp<\/FONT><FONT color=#000080> page<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=0 width=\"42%\" bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\">&lt;%@ taglib uri=&#8221;\/tags\/struts-html&#8221; prefix=&#8221;html&#8221; %&gt;<BR>&lt;%@ taglib uri=&#8221;\/tags\/struts-logic&#8221; prefix=&#8221;logic&#8221; %&gt;<BR><BR>&lt;html:html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;Using &amp;lt;logic&amp;gt; Tags&lt;\/title&gt;<BR>&lt;\/head&gt;<BR><BR>&lt;body&gt;<BR>&lt;h1&gt;Using &amp;lt;logic&amp;gt; Tags&lt;\/h1&gt;<BR><BR>&lt;html:form action=&#8221;\/EmptyAction&#8221; method =&#8221;post&#8221;&gt;<BR><BR>&lt;h2&gt;Enter your name:&lt;\/h2&gt;<BR>&lt;html:text property=&#8221;text&#8221;\/&gt;<BR><BR>&lt;br&gt;<BR>&lt;br&gt;<BR><BR>&lt;html:submit value=&#8221;Submit&#8221;\/&gt;<BR><BR><BR>&lt;html:cancel\/&gt;<BR>&lt;\/html:form&gt;<BR>&lt;\/body&gt;<BR>&lt;\/html:html&gt;<BR><BR><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Developing the <\/FONT><FONT color=#0000ff>output.jsp<\/FONT><FONT color=#000080> page<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE borderColor=#ffffcc cellSpacing=0 cellPadding=0 width=\"50%\" bgColor=#ffffcc border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\">&lt;%@ taglib uri=&#8221;\/tags\/struts-bean&#8221; prefix=&#8221;bean&#8221; %&gt;<BR>&lt;%@ taglib uri=&#8221;\/tags\/struts-logic&#8221; prefix=&#8221;logic&#8221; %&gt;<BR><BR>&lt;HTML&gt;<BR>&lt;HEAD&gt;<BR>&lt;TITLE&gt;Here&#8217;s Your Data&#8230;&lt;\/TITLE&gt;<BR>&lt;\/HEAD&gt;<BR><BR>&lt;BODY&gt;<BR>&lt;H3&gt;Here&#8217;s Your Data&#8230;&lt;\/H3&gt;<BR><BR>&lt;h4&gt;The text field text:&lt;\/h4&gt;<BR><BR>&lt;bean:write name=&#8221;EmptyForm&#8221; property=&#8221;text&#8221;\/&gt;<BR><BR><FONT color=#0000ff>&lt;logic:notEmpty name=&#8221;EmptyForm&#8221; property=&#8221;text&#8221; scope=&#8221;request&#8221;&gt;<BR>&lt;h4&gt;Using the tag &amp;lt;logic:notEmpty &amp;gt; &lt;\/h4&gt;&nbsp;<BR>Results:not Empty<BR>&lt;\/logic:notEmpty&gt;<BR><BR><BR>&lt;logic:empty name=&#8221;EmptyForm&#8221; property=&#8221;text&#8221; scope=&#8221;request&#8221;&gt;<BR>&lt;h4&gt;Using the tag&amp;lt;logic:empty &amp;gt;&lt;\/h4&gt;&nbsp;<BR>Results: Empty<BR>&lt;\/logic:empty&gt;<\/FONT><BR><BR>&lt;\/BODY&gt;<BR>&lt;\/HTML&gt; <\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Add the following line in the index.jsp to call the form.<\/FONT><\/P><br \/>\n<P><FONT color=#0000ff>&lt;li&gt;<BR>&lt;html:link page=&#8221;\/pages\/input.jsp&#8221;&gt;Struts File Upload&lt;\/html:link&gt;<BR>&lt;br&gt;<BR>Example demonstrates&nbsp; how EmptyAction Class works.<BR>&lt;\/li&gt;<BR><\/FONT><\/P><br \/>\n<P><B><FONT color=#0000ff>Building and Testing the Example&nbsp;<\/FONT><\/B><\/P><br \/>\n<P><FONT color=#000080>To build and deploy the application go to Struts\\Strutstutorial directory and type ant on the command prompt. This will deploy the application. Open the browser and navigate to the <\/FONT><FONT color=#0000ff>input.jsp<B> <\/B><\/FONT><FONT color=#000080>page. Your browser displays the following&nbsp; page.<\/FONT><\/P><br \/>\n<P><FONT color=#000080>Writing nothing to the <\/FONT><FONT color=#0000ff><B>out.jsp <\/B>page <\/FONT><FONT color=#000080>displays the<\/FONT><FONT color=#000080> working of&nbsp; the&nbsp; <B>Empty Logic tag &lt;logic:empty &gt;&nbsp;<\/B><\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"44%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><IMG height=365 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-empty.gif\" width=386 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P>&nbsp;<FONT color=#000080>Writing nothing <\/FONT><FONT color=#000080>displays the following <\/FONT><FONT color=#0000ff><B>out.jsp <\/B>page<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"33%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><IMG height=317 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-empty1.gif\" width=287 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Now&nbsp; write any data to the <\/FONT><FONT color=#0000ff>input.jsp<\/FONT><FONT color=#000080> to see the working of&nbsp; the <B>notEmpty logic tag<\/B><\/FONT><B><FONT color=#000080> &lt;logic:notEmpty &gt;<\/FONT><\/B><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"32%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><IMG height=357 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-notEmpty.gif\" width=386 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>The<\/FONT> <FONT color=#000080>&lt;logic:<\/FONT><FONT color=#000080>notEmpty <\/FONT><FONT color=#000080>&gt; evaluated here displays the <\/FONT><FONT color=#0000ff>output.jsp<\/FONT><FONT color=#000080> as<\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"33%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><IMG height=348 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-notempty1.gif\" width=317 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>empty tag &#8211;&nbsp;If the requested variable is either null or an empty string then we use this tag to evaluate the contents contained in the nested body parts of this tag. Tag evaluation of the nested body content occurs only if the specified value is either absent (i.e. null), an empty string (i.e. a java.lang.String &hellip; <a href=\"https:\/\/www.strongd.net\/?p=193\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Logic Empty Tag (<logic:empty>&#8230;<\/logic:empty>)<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/193\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}