From: <jm...@us...> - 2005-08-04 07:39:59
|
Update of /cvsroot/struts/dialogs/war/sample-crud In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19672/war/sample-crud Added Files: crudaction-edit.jsp crudaction-error.jsp crudaction-list.jsp crudaction-lite-edit.jsp crudaction-lite-list.jsp crudaction-lite-noedit.jsp crudaction-noedit.jsp crudaction-notactive.jsp Log Message: --- NEW FILE: crudaction-edit.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>CRUDAction create/edit</title> </head> <body> <h2><bean:write name="crudform" property="itemHeader"/></h2> <!-- Standard Struts error handling --> <logic:messagesPresent> <html:messages id="error"> <li><bean:write name="error"/></li> </html:messages> <br> </logic:messagesPresent> <html:form action="/crudaction.do"> <table border="1" width="300" > <tr> <td align="left" bgcolor="#FF9966">Item ID</td> <td><bean:write name="crudform" property="itemId"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">String value</td> <td><html:text name="crudform" property="stringValue" size="15" tabindex="1"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">Num value</td> <td><html:text name="crudform" property="intValue" size="15" tabindex="1"/></td> </tr> <tr> <td colspan="2" align="right" bgcolor="#FF9966"> <INPUT type="submit" size="10" name="DIALOG-EVENT-CANCEL" value="Cancel"> <!-- Delete operation does not work with new items since they are not stored in the database yet. This can be your assignment: add a status field to BusinessObj class, and show "Delete" button for existing items only. --> <INPUT type="submit" size="10" name="DIALOG-EVENT-DELETE" value="Delete"> <INPUT type="submit" size="10" name="DIALOG-EVENT-SAVE" value="Save Changes"> </td> </tr> </table> </html:form> </body> </html:html> --- NEW FILE: crudaction-error.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>Error</title> </head> <body> <h2>Error</h2> <!-- Standard Struts error handling --> <logic:messagesPresent> <html:messages id="error"> <li><bean:write name="error"/></li> </html:messages> <br> </logic:messagesPresent> </body> </html:html> --- NEW FILE: crudaction-list.jsp --- <!-- PRG pattern example Author: Michael Jouravlev, 2004 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html locale="true"> <head> <title>Item List</title> <meta HTTP-EQUIV="Pragma" content="no-cache"> <meta HTTP-EQUIV="Expires" content="-1"> <html:base/> </head> <!-- Standard Struts error handling --> <table border="0" cellspacing="0" cellpadding="0" width=600> <tr> <td color="red"><html:errors/></td> </tr> </table> <h3>Item List</h3> <table border="1" width="100%"> <tr> <th align="left" bgcolor="CC9966">ID</th> <th align="left" bgcolor="CC9966">Str Value</th> <th align="left" bgcolor="CC9966">Int Value</th> <th align="left" bgcolor="CC9966" colspan="4">Operation</th> </tr> <!-- Show item list --> <logic:iterate id="item" name="crud-item-list" type="net.jspcontrols.dialogs.samples.crud.business.BusinessObj"> <html:form action="/crudaction.do"> <tr> <!-- Item ID --> <td><bean:write name="item" property="itemId"/></td> <!-- Item Value --> <td><bean:write name="item" property="stringValue"/></td> <!-- Item Status --> <td><bean:write name="item" property="intValue"/></td> <!-- View Item --> <td> <html:submit property="DIALOG-EVENT-DUPLICATE" value="Duplicate Item"/> </td> <!-- View Item --> <td> <html:submit property="DIALOG-EVENT-VIEW" value="View Item"/> </td> <!-- Edit Item --> <td> <html:submit property="DIALOG-EVENT-UPDATE" value="Update Item"/> </td> <!-- Delete Item --> <td> <html:submit property="DIALOG-EVENT-DELETE" value="Delete Item"/> </td> </tr> <html:hidden name="item" property="itemId"/> </html:form> </logic:iterate> </table> <br/> <html:form action="/crudaction.do"> <html:submit property="DIALOG-EVENT-CREATE" value="Create New Item"/> </html:form> </html:html> --- NEW FILE: crudaction-lite-edit.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>CRUDAction create/edit</title> </head> <body> <h2><bean:write name="crudform" property="itemHeader"/></h2> <!-- Standard Struts error handling --> <logic:messagesPresent> <html:messages id="error"> <li><bean:write name="error"/></li> </html:messages> <br> </logic:messagesPresent> <html:form action="/crudactionlite.do"> <table border="1" width="300" > <tr> <td align="left" bgcolor="#FF9966">Item ID</td> <td><bean:write name="crudform" property="itemId"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">String value</td> <td><html:text name="crudform" property="stringValue" size="15" tabindex="1"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">Num value</td> <td><html:text name="crudform" property="intValue" size="15" tabindex="1"/></td> </tr> <tr> <td colspan="2" align="right" bgcolor="#FF9966"> <INPUT type="submit" size="10" name="DIALOG-EVENT-CANCEL" value="Cancel"> <INPUT type="submit" size="10" name="DIALOG-EVENT-SAVE" value="Save Changes"> </td> </tr> </table> </html:form> </body> </html:html> --- NEW FILE: crudaction-lite-list.jsp --- <%@ page import="java.util.ArrayList, net.jspcontrols.dialogs.samples.crud.CRUDFormSample, net.jspcontrols.dialogs.samples.crud.business.BusinessObj" %> <!-- PRG pattern example Author: Michael Jouravlev, 2004 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html locale="true"> <head> <title>Item List</title> <meta HTTP-EQUIV="Pragma" content="no-cache"> <meta HTTP-EQUIV="Expires" content="-1"> <html:base/> </head> <!-- Standard Struts error handling --> <table border="0" cellspacing="0" cellpadding="0" width=600> <tr> <td color="red"><html:errors/></td> </tr> </table> <h3>Item List</h3> <table border="1" width="100%"> <tr> <th align="left" bgcolor="CC9966">ID</th> <th align="left" bgcolor="CC9966">Str Value</th> <th align="left" bgcolor="CC9966">Int Value</th> <th align="left" bgcolor="CC9966" colspan="4">Operation</th> </tr> <% synchronized(session) { ArrayList items = (ArrayList) session.getAttribute(CRUDFormSample.CRUD_LIST_KEY); // Create test sample of three items if (items == null) { items = new ArrayList(); items.add(new BusinessObj()); items.add(new BusinessObj()); items.add(new BusinessObj()); session.setAttribute(CRUDFormSample.CRUD_LIST_KEY, items); } } %> <!-- Show item list --> <logic:iterate id="item" name="crud-item-list" type="net.jspcontrols.dialogs.samples.crud.business.BusinessObj"> <html:form action="/crudactionlite.do"> <tr> <!-- Item ID --> <td><bean:write name="item" property="itemId"/></td> <!-- Item Value --> <td><bean:write name="item" property="stringValue"/></td> <!-- Item Status --> <td><bean:write name="item" property="intValue"/></td> <!-- View Item --> <td> <html:submit property="DIALOG-EVENT-DUPLICATE" value="Duplicate Item"/> </td> <!-- View Item --> <td> <html:submit property="DIALOG-EVENT-VIEW" value="View Item"/> </td> <!-- Edit Item --> <td> <html:submit property="DIALOG-EVENT-UPDATE" value="Update Item"/> </td> <!-- Delete Item --> <td> <html:submit property="DIALOG-EVENT-DELETE" value="Delete Item"/> </td> </tr> <html:hidden name="item" property="itemId"/> </html:form> </logic:iterate> </table> <br/> <html:form action="/crudactionlite.do"> <html:submit property="DIALOG-EVENT-CREATE" value="Create New Item"/> </html:form> </html:html> --- NEW FILE: crudaction-lite-noedit.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>CRUDAction View</title> </head> <body> <h2>View item</h2> <!-- Standard Struts error handling --> <logic:messagesPresent> <html:messages id="error"> <li><bean:write name="error"/></li> </html:messages> <br> </logic:messagesPresent> <html:form action="/crudactionlite.do"> <table border="1" width="300" > <tr> <td align="left" bgcolor="#FF9966">Item ID</td> <td><bean:write name="crudform" property="itemId"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">String value</td> <td><bean:write name="crudform" property="stringValue"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">Num value</td> <td><bean:write name="crudform" property="intValue"/></td> </tr> <tr> <td colspan="2" align="right" bgcolor="#FF9966"> <INPUT type="submit" size="10" name="DIALOG-EVENT-CLOSE" value="Close"> </td> </tr> </table> </html:form> </body> </html:html> --- NEW FILE: crudaction-noedit.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>CRUDAction View</title> </head> <body> <h2>View item</h2> <!-- Standard Struts error handling --> <logic:messagesPresent> <html:messages id="error"> <li><bean:write name="error"/></li> </html:messages> <br> </logic:messagesPresent> <html:form action="/crudaction.do"> <table border="1" width="300" > <tr> <td align="left" bgcolor="#FF9966">Item ID</td> <td><bean:write name="crudform" property="itemId"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">String value</td> <td><bean:write name="crudform" property="stringValue"/></td> </tr> <tr> <td align="left" bgcolor="#FF9966">Num value</td> <td><bean:write name="crudform" property="intValue"/></td> </tr> <tr> <td colspan="2" align="right" bgcolor="#FF9966"> <INPUT type="submit" size="10" name="DIALOG-EVENT-CLOSE" value="Close"> </td> </tr> </table> </html:form> </body> </html:html> --- NEW FILE: crudaction-notactive.jsp --- <!-- Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <html:html> <head> <title>CRUDAction Not Active</title> </head> <body> <h2>Not Active Or Expired</h2> <table border="1" width="400" > <tr> <td align="left" bgcolor="#FF9966">The item that you're looking for, is expired.</td> </tr> <tr> <td align="right" bgcolor="#FF9966"> <html:link page="/cruditemlist.do">Go to item list</html:link> </td> </tr> </table> </body> </html:html> |