Building s2 Applications
Building s2 Applications
<package name="default"
extends="struts-default">
<default-action-ref name="Hello"/>
<html>
<head>
<title>Hello</title>
</head>
<body>
<h2><s:text name="hello.message"/></h2>
</body>
</html>
resources.properties
hello.message = Congratulations! Struts is up and running ...
# Add your messages here ...
Hello World!
Welcome.jsp
<%@ taglib prefix="s" uri="/tags" %>
<html>
<body>
<h3>Options</h3>
<ul>
<li><a href="<s:url action="Register"/>">
Register</a></li>
<li><a href="<s:url action="Logon"/>">
Sign On</a></li>
</ul>
</body>
</html>
Pick your Poison!
Review – Why Frameworks?
Code re*** ********** of
In********* Concerns
development Don't ******
Long-term Yourself
m**********
by a team
Review – Why Frameworks?
Code reuse Separation of
Incremental Concerns
development Don't Repeat
Long-term Yourself
maintenance
by a team
Review
The key framework components are:
****** *******
****** *******
****** ****
Custom tags
user.name getUser().getName()
user.toString() getUser().toString()