Syntax to use Struts LOGIC tag library

< logic:match > and < logic:notMatch>

< logic:match >-This tag matches the selector attributes(String) by specified constant variable.If the value is a substring (appropriately limited by the location attribute), the nested body content of this tag is evaluated< logic:notMatch >– This tag macthes between the selector attributes(String) by specified constant variable. If the value is not a substring (appropriately limited by the location attribute), the nested body content of this tag is evaluated.

Example Code for < logic:match > and < logic:notMatch>

1.Create of Modify the index.jsp page whic is the welcome page for the users.It displays a Textbox nested inside the form where the text is to be entered.index.jsp

2.Create an Jsp page and name it as LogicMatchTag.jsp.It is the output page for user which contains the logic tags to Match the text and display whether the specified constant value is a substring or not.

5.Create or modify struts config file struts-config.xml with action mappings.Struts-config file contains the information about the configuration of the struts framework to the application.It contains the action mappings which helps to select Action,ActionForm and other information for specific user’s request’s.

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.