We explore and extend a simple "Hello World" work flow that demonstrates the basics of web application infrastructure.
With a web development infrastructure in place, we walk through the Struts JPA MailReader to take a closer look at how it all fits together.
(This session reviews live code rather than slides.)
In the lab, we add a logon form to our web application.
From struts2-entity on courseware media
- Edit index.jsp to add link <li><a href="<s:url namespace="/user" action="login" method="input"/>">Log into MailReader</a></li>
- Copy WebRoot/expection.jsp to WebRoot
- Copy WebRoot/user/.jsp to WebRoot/user/.jsp
- Create src/main/action package
- Copy action/*.java to action package
- Create src/main/action/user package
- Copy action/user/*.java to action/user package
- Copy entity/user/*.java to entity.user package
- Copy entity/*.java to entity package
- Copy struts.xml to src/struts.xml (overwriing)
All code is provided.
- Added integrated JPA with Struts 2 to retrieve user account.