Folowing points explain the key differences between these 2 frameworks.
• Struts framework is matured and evolved over the years.
• JSF is immature as compare to Struts.
• Struts is based on a controller which uses Front Controller design pattern. Also it has only one event handler for a HTTP request.
• JSF is based on Page Controller design pattern and front controller Servlet handles all requests.
• Struts does not support RAD.
• Struts supports
Struts is one of the most popular web framework for Java. It comes with 2 major branches, Struts 1 and Struts 2. Both implement MVC architecture but Struts 2 is much simpler, easier to build, deploy and maintain than Struts 1.
This article will guide you through the steps to build a simple Struts 2 application using Eclipse IDE. Download Struts 2 and required libraries
Download latest version of Struts 2 from Download a Release
Select the full distribution,
Struts provides HTML tag library for easy creation of user interfaces. In this lesson I will show you what all Struts HTML Tags are available to the JSP for the development of user interfaces.
To use the Struts HTML Tags we have to include the following line in our JSP file: Java Code: <%@ taglib uri="/tags/struts-html" prefix="html" %>
above code makes available the tag to the jsp. Java Code: <html:message key="thekey"/>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
Web applications differ from conventional websites in that web applications can create a dynamic response. To make it easier to reference dynamic data from a page, the Struts framework offers a set of tags. Some of the tags mimic standard HTML tag while providing added value. Other tags create non-standard, but useful controls. While HTML provides a simple a tag for creating hyperlinks, the HTML tag often requires us to include redundant information. Also the HTML tag cannot easily access dynamic
Lets make a HelloWorld example using Struts.
Suppose you want to create a simple "Hello World" example that displays a welcome message. To create a "Hello World" example, you need to do three things:
1. Create a server page HelloWorld.jsp to present the messages Java Code: <%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
Updated 11-15-2011 at 06:21 PM by Java Tip