Skip to main content

Posts

Showing posts with the label File Tag

Struts Generic Tags

The struts generic tags are used to control the execution flow when pages are rendered. Another use of struts generic tags are data extraction. Further Generic Tags are classified into Control Tags and Data Tags. Control Tags: The Control Tags are used for flow control, such as if, else and iterate. Here are the list of Control Tags: * if tag - Details * elseIf tag - Details * else tag - Details * append tag - Details * generator tag - Details * iterator tag - Details * merge tag - Details * subset tag - Details Data Tags: The Data Tags are used for data manipulation or creation, such as bean, push, and i18n. Here are the list of Data Tags: * action - Details * bean - Details * date - Details * include - Details * param - Details * set - Details * text - Details * property - Details Struts UI tags: Struts UI Tags are mainly designed to use the data from your action/value stack or from Data Tags. These tags are used to display the data on the...

Struts2 - File Tag (Form Tags)

In this section, we are going to describe the file tag. The file tag is a UI tag that renders an HTML file input element achieved through browsing. Add the following code snippet into the struts.xml file. struts.xml <action name="fileTag">   <result>/pages/uiTags/fileTag.jsp</result> </action> Create a jsp using the tag . It renders an HTML file input element. The parameter name is used to set a name for element which we have used as name="uploadFile" . and the parameter accept is the HTML accept attribute that indicates the accepted file mime types which we have used as accept ="text/*". fileTag.jsp <%@ taglib prefix="s" uri="/struts-tags" %> <html>   <head>   <title>File Tag Example!</title>   </head>   <body>   <h1><span style="background-color: #FFFFcc">File Tag Example! <...