{"id":198,"date":"2007-09-06T00:00:00","date_gmt":"2007-09-06T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=198"},"modified":"2007-09-06T00:00:00","modified_gmt":"2007-09-06T00:00:00","slug":"Logic Present Tag (<logic:present >...<\/logic:present >) ","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=198","title":{"rendered":"Logic Present Tag (<logic:present >&#8230;<\/logic:present >)"},"content":{"rendered":"<p><FONT size=4><STRONG><FONT color=#000080>present tag<\/FONT><I><FONT color=#0000ff> -This tag evaluates its nested body contents if the specified value is present in the request.<\/I><\/STRONG><\/FONT><\/FONT><br \/>\n<DIV class=indent><br \/>\n<P><FONT color=#000080>This tag checks the current request and depending on which attribute is specified, it evaluates the nested body content of this tag only if the specified value <STRONG>is<\/STRONG> <B>present.&nbsp;<\/B><\/FONT><\/P><\/DIV><br \/>\n<P><FONT color=#000080><B>Attributes of Present Tag<\/B><\/FONT><\/P><br \/>\n<TABLE 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>cookie<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks&nbsp; the existence of a cookie with the specified name.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>header<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of an HTTP header with the specified name. The name match is performed in a case insensitive manner.<\/FONT><\/P><\/TD><\/TR><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>It checks the existence of a JSP bean, in any scope, with the specified name. If <CODE>property<\/CODE> is also specified, checks for a non-null property value for the specified property.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>parameter<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of at least one occurrence of the specified request parameter on this request, even if the parameter value is a zero-length string.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><FONT color=#000080><B>property<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of a non-null property value, returned by a property getter method on the JSP bean (in any scope) that is specified by the <CODE>name<\/CODE> attribute. Property references can be simple, nested, and\/or indexed.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>role<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks whether the currently authenticated user (if any) has been associated with any of the specified security roles. Use a comma-delimited list to check for multiple roles.&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>The bean scope within which to search for the bean named by the <CODE>name<\/CODE> property, or &#8220;any scope&#8221; if not specified.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><FONT color=#000080><B>user<\/B><\/FONT><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks whether the currently authenticated user principal has the specified name.<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<H1>&nbsp;<\/H1><br \/>\n<H1><FONT color=#000080>Logic notPresent Tag (&lt;logic:not Present&gt;&#8230;&lt;\/logic:not Present&gt;)&nbsp;<\/FONT><\/H1><br \/>\n<H3 id=notEmpty><STRONG><FONT color=#000080>not<\/FONT><\/STRONG><B><FONT color=#000080 size=4>P<\/FONT><\/B><B><FONT color=#000080 size=4>resent tag<\/FONT><FONT color=#0000ff size=4><I> -This tag evaluates its nested body content if the specified value is not present in the request.<\/I><\/FONT><\/B><\/H3><br \/>\n<P id=notEmpty><FONT color=#000080>Tag evaluation of the nested body content occurs only if the specified value is not <B>available<\/B> in the request i.e&#8230; works in reverses to present tag.<BR><BR><B>Attributes of notPresent&nbsp; Tag<\/B><\/FONT><\/P><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><B><FONT color=#000080>cookie<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks&nbsp; the existence of a cookie with the specified name.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><B><FONT color=#000080>header<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of an HTTP header with the specified name. The name match is performed in a case insensitive manner.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><B><FONT color=#000080>name<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of a JSP bean, in any scope, with the specified name. If <CODE>property<\/CODE> is also specified, checks for a non-null property value for the specified property.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><B><FONT color=#000080>parameter<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of at least one occurrence of the specified request parameter on this request, even if the parameter value is a zero-length string.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><B><FONT color=#000080>property<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks the existence of a non-null property value, returned by a property getter method on the JSP bean (in any scope) that is specified by the <CODE>name<\/CODE> attribute. Property references can be simple, nested, and\/or indexed.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><B><FONT color=#000080>role<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks whether the currently authenticated user (if any) has been associated with the specified security role.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=evenRow><br \/>\n<TD align=middle><B><FONT color=#000080>scope<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>The bean scope within which to search for the bean named by the <CODE>name<\/CODE> property, or &#8220;any scope&#8221; if not specified.<\/FONT><\/P><\/TD><\/TR><br \/>\n<TR class=oddRow><br \/>\n<TD align=middle><B><FONT color=#000080>user<\/FONT><\/B><\/TD><br \/>\n<TD><br \/>\n<P><FONT color=#000080>It checks whether the currently authenticated user principal has the specified name.<\/FONT><\/P><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<P id=notEmpty>&nbsp;<\/P><br \/>\n<H2>&nbsp;<\/H2><br \/>\n<H2><FONT color=#000080>Example Illustrating the use of the present &lt;logic:present &gt; and the notPresent &lt;logic:notPresent &gt; logic tags.<\/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..&lt;logic:present &gt; and the &lt;logic:notPresent &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>LogicAction.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><B><FONT color=#7f0055>package<\/FONT><FONT color=#000080>&nbsp;<\/FONT><\/B><FONT color=#000080>roseindia.net;<BR><BR><B>import&nbsp;<\/B>java.io.*;<BR><B>import&nbsp;<\/B>java.util.*;<BR><BR>\/**<\/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><B>import&nbsp;<\/B>javax.servlet.http.HttpServletRequest;<BR><B>import&nbsp;<\/B>javax.servlet.http.HttpServletResponse;<BR><B>import&nbsp;<\/B>javax.servlet.ServletException;<BR><B>import&nbsp;<\/B>org.apache.struts.action.*;<BR><BR><B>public&nbsp;class&nbsp;<\/B>LogicAction <B>extends&nbsp;<\/B>Action&nbsp;<BR>{<BR>&nbsp;&nbsp;<B>public&nbsp;<\/B>ActionForward&nbsp;execute(ActionMapping&nbsp;mapping,<BR>&nbsp;&nbsp;&nbsp;&nbsp;ActionForm&nbsp;form,<BR>&nbsp;&nbsp;&nbsp;&nbsp;HttpServletRequest&nbsp;request,<BR>&nbsp;&nbsp;&nbsp;&nbsp;HttpServletResponse&nbsp;response)<BR>&nbsp;&nbsp;&nbsp;&nbsp;<B>throws&nbsp;<\/B>IOException,&nbsp;ServletException&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>return&nbsp;<\/B>mapping.findForward(&#8220;success&#8221;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}<\/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>(<\/FONT><CODE><FONT color=#0000ff>Logic<\/FONT><\/CODE><FONT color=#0000ff><CODE>Form<\/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><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><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;&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()&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;void&nbsp;<\/B><\/FONT><FONT color=#000000>setText(String&nbsp;text)&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%\"><FONT color=#000080>&lt;form-bean name=&#8221;<CODE>LogicForm<\/CODE>&#8221;&nbsp; type=&#8221;roseindia.net.<CODE>LogicForm<\/CODE>&#8221; \/&gt;<\/FONT><\/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%\"><FONT color=#000080>&lt;action path=&#8221;\/LogicAction&#8221;<BR>type=&#8221;roseindia.net.LogicAction&#8221;<BR>name=&#8221;LogicForm&#8221;<BR>scope=&#8221;request&#8221;<BR>input=&#8221;\/pages\/InputLogic.jsp&#8221;&gt;<BR>&lt;forward name=&#8221;success&#8221; path=&#8221;\/pages\/output.jsp&#8221;\/&gt;<BR>&lt;\/action&gt;<\/FONT><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Developing the<\/FONT><FONT color=#0000ff> InputLogic.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%\"><FONT color=#000080>&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>&lt;%@ taglib uri=&#8221;\/tags\/struts-bean&#8221; prefix=&#8221;bean&#8221; %&gt;<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;\/LogicAction&#8221; method =&#8221;post&#8221;&gt;<BR><BR>&lt;h2&gt;Enter text :&lt;\/h2&gt;<BR>&lt;html:text property=&#8221;text&#8221;\/&gt;<BR>&lt;html:submit value=&#8221;Submit&#8221;\/&gt;&nbsp;<BR>&lt;html:cancel\/&gt;<BR>&lt;\/html:form&gt;<BR>&lt;\/body&gt;<BR>&lt;\/html:html&gt;<BR><BR><\/FONT><\/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<P><FONT color=#000080><B>Notice the property values<\/B><\/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>&lt;BODY&gt;<BR>&lt;H4&gt;Here&#8217;s Your Data&#8230;&lt;\/H4&gt;<BR><BR>&lt;h4&gt;The text entered is:<BR><BR>&lt;bean:write name=&#8221;LogicForm1&#8243; property=&#8221;text&#8221;\/&gt;&lt;\/h4&gt;<BR><BR><FONT color=#0000ff>&lt;logic:present name=&#8221;LogicForm1&#8243; <B>property=&#8221;text&#8221;<\/B> &gt;<BR>&lt;h5&gt;Using the tag &amp;lt;logic:present &amp;gt; &lt;\/h5&gt;&nbsp;<BR>Result: Successfully supported&nbsp;<BR>&lt;\/logic:present&gt;<BR><\/FONT><br \/>\n<P><FONT color=#0000ff>&lt;logic:notPresent name=&#8221;LogicForm1&#8243; <B>property=&#8221;text1&#8243; <\/B>&gt;<BR>&lt;h5&gt;Using the tag&amp;lt;logic:notPresent&amp;gt;&lt;\/h5&gt;&nbsp;<BR>Result: Support for a Variable other than a String is not Present &lt;\/logic:notPresent&gt;<\/FONT><BR><BR>&lt;\/BODY&gt;<BR>&lt;\/HTML&gt;<\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>Add the following line in the <\/FONT><FONT color=#0000ff>index.jsp<\/FONT><FONT color=#000080> to call the form.<\/FONT><\/P><br \/>\n<P><FONT color=#0000ff>&lt;li&gt;<BR>&lt;html:link page=&#8221;\/pages\/InputLogic.jsp&#8221;&gt;Struts File Upload&lt;\/html:link&gt;<BR>&lt;br&gt;<BR>Example demonstrates&nbsp; how LogicAction Class works.<BR>&lt;\/li&gt;<BR><\/FONT><\/P><br \/>\n<P><B><FONT color=#000080>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 InputLogic.jsp<B> <\/B>page. Your browser displays the following&nbsp; page.<\/FONT><\/P><br \/>\n<P><FONT color=#000080>Writing&nbsp; a text string to the <B>InputLogic.jsp <\/B>page lets you to see the working of&nbsp; the&nbsp; <B>present Logic tag &lt;logic:present &gt;&nbsp;and the notPresent Logic tag &lt;logic:notPresent &gt;.&nbsp;<\/B><\/FONT><\/P><br \/>\n<DIV align=left><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"43%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=\"100%\"><IMG height=297 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-present.gif\" width=375 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<P><FONT color=#000080>It displays the following <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=377 src=\"http:\/\/www.roseindia.net\/struts\/struts-logictags\/logic-present1.gif\" width=548 border=0><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>present tag -This tag evaluates its nested body contents if the specified value is present in the request. This tag checks the current request and depending on which attribute is specified, it evaluates the nested body content of this tag only if the specified value is present.&nbsp; Attributes of Present Tag Attribute Name Description cookie &hellip; <a href=\"https:\/\/www.strongd.net\/?p=198\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Logic Present Tag (<logic:present >&#8230;<\/logic:present >)<\/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-198","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/198","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=198"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}