You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(16) |
Sep
(10) |
Oct
(1) |
Nov
(2) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(148) |
Feb
(80) |
Mar
(41) |
Apr
(85) |
May
(247) |
Jun
(345) |
Jul
(237) |
Aug
(241) |
Sep
(439) |
Oct
(321) |
Nov
(413) |
Dec
(302) |
2004 |
Jan
(143) |
Feb
(147) |
Mar
(200) |
Apr
(107) |
May
(15) |
Jun
(36) |
Jul
(11) |
Aug
(1) |
Sep
(36) |
Oct
|
Nov
(6) |
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
(115) |
May
(74) |
Jun
(215) |
Jul
(82) |
Aug
(47) |
Sep
(32) |
Oct
(8) |
Nov
(70) |
Dec
(24) |
2006 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jm...@us...> - 2005-11-09 03:20:50
|
Update of /cvsroot/struts/dialogs/war/mailreaderpages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29970/war/mailreaderpages Modified Files: home.jsp Log Message: Index: home.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/mailreaderpages/home.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** home.jsp 23 Sep 2005 06:37:57 -0000 1.1 --- home.jsp 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- <html> <head> + <!-- Direct access to /mailreaderpages/* is prohibited, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> *************** *** 12,15 **** --- 13,19 ---- <body> + Context Path: [<%= request.getContextPath() %>] + + <h3><bean:message key="index.heading"/></h3> *************** *** 41,45 **** --- 45,55 ---- <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> + <p><html:link action="Tour"><bean:message key="index.tour"/></html:link></p> <p><html:link action="/Tour"><bean:message key="index.tour"/></html:link></p> + <p><html:link action="/Tour.do"><bean:message key="index.tour"/></html:link></p> + <p><a href="Tour.do">Tour</a></p> + <p><a href="/Tour.do">/Tour</a></p> + <p><a href="sf/Tour.do">sf/Tour</a></p> + <p><a href="/sf/Tour.do">/sf/Tour</a></p> </body> </html> |
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29970/src/net/jspcontrols/dialogs/actions Modified Files: DialogAction.java DialogMapping.java DialogRuleSet.java EventForward.java Added Files: TransferForward.java Log Message: --- NEW FILE: TransferForward.java --- package net.jspcontrols.dialogs.actions; import org.apache.struts.action.ActionForward; /** * Created by IntelliJ IDEA. * User: mjouravlev * Date: Jul 20, 2005 * Time: 11:21:22 AM * To change this template use Options | File Templates. */ public class TransferForward extends ActionForward { public static final ActionForward DIALOG_RELOAD = new ActionForward(); /** * <p>Construct a new instance of an <code>ActionForward</code> * object with values, default for an event forward object: * <code>path</code> is set to null, <code>redirect</code> is * set to true.</p> * * <p>Event forward objects are intended to handle the first phase * of two-phase request processing, thus they use redirect * by default.</p> */ public TransferForward() { super(null, true); } /** * <p>Construct a new instance with the specified path.</p> * * @param path Path for this instance */ public TransferForward(String path) { super(path, true); } } Index: DialogAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DialogAction.java 23 Sep 2005 06:37:56 -0000 1.3 --- DialogAction.java 9 Nov 2005 03:20:42 -0000 1.4 *************** *** 22,25 **** --- 22,26 ---- import org.apache.struts.action.ActionMessages; import org.apache.struts.Globals; + import org.apache.struts.config.ForwardConfig; import javax.servlet.http.HttpServletRequest; *************** *** 27,30 **** --- 28,33 ---- import javax.servlet.http.HttpSession; import java.util.Enumeration; + import java.util.Map; + import java.util.HashMap; /** *************** *** 192,196 **** * @author Michael Jouravlev */ ! public abstract class DialogAction extends SelectAction { /** --- 195,228 ---- * @author Michael Jouravlev */ ! public class DialogAction extends SelectAction { ! ! ! /** ! * <p>Return the logical names of all locally defined forwards for this ! * mapping. If there are no such forwards, a zero-length array ! * is returned.</p> ! */ ! synchronized public void resolveEvents(ActionMapping mapping) { ! System.out.println("DialogAction.resolveEvents <--"); ! if (keyMethodMap == null) { ! System.out.println("DialogAction.resolveEvents: initializing frozenMethodMap"); ! Map methodMap = new HashMap(); ! ForwardConfig fcs[] = mapping.findForwardConfigs(); ! for (int i = 0; i < fcs.length; i++) { ! if (fcs[i] instanceof EventForward) { ! EventForward eventForward = (EventForward ) fcs[i]; ! methodMap.put(eventForward.getName(), ! eventForward.getHandler()); ! System.out.println("DialogAction.resolveEvents: " + ! "added (" + eventForward.getName() + ", " + ! eventForward.getHandler() + ")"); ! } ! } ! if (!methodMap.isEmpty()) { ! keyMethodMap = methodMap; ! } ! } ! System.out.println("DialogAction.resolveEvents -->"); ! } /** *************** *** 326,329 **** --- 358,378 ---- /** + * Provides mapping between event names (keys) and handler methods (values). + * This method may be overriden by a subclass. Important: if you define + * action mappings using new syntax (with "component" element), then if + * "event" subelements are defined for a component, getKeyMethodMap will + * not be called. + * <p> + * In other words, define the event-to-method mapping either in + * struts-config.xml file, or in the code using getKeyMethodMap method. + * + * @return Map, containing association between event names (keys) and + * handler methods (values). + */ + protected Map getKeyMethodMap() { + return keyMethodMap; + } + + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). *************** *** 344,347 **** --- 393,399 ---- HttpServletResponse response) throws Exception { + // Load event-to-method mapping from struts-config.xml file, if defined + resolveEvents(mapping); + // Is this an input process with POST? boolean isInput = isInput(request); *************** *** 375,389 **** return null; ! } else if (actionForward == EventForward.DIALOG_RELOAD) { // Use reload path if defined in <component input=... /> if (mapping instanceof DialogMapping && mapping.getInput() != null) { ! return new EventForward(mapping.getInput()); // If no reload path defined in the action mapping, use real // address since we are redirecting through browser anyway. } else { ! return new EventForward(request.getServletPath()); } --- 427,441 ---- return null; ! } else if (actionForward == TransferForward.DIALOG_RELOAD) { // Use reload path if defined in <component input=... /> if (mapping instanceof DialogMapping && mapping.getInput() != null) { ! return new TransferForward(mapping.getInput()); // If no reload path defined in the action mapping, use real // address since we are redirecting through browser anyway. } else { ! return new TransferForward(request.getServletPath()); } *************** *** 443,450 **** } - //System.out.println("Dialog reload mapping: " + reloadPath); - //System.out.println("request," + - // " request.getServletPath(): " + request.getServletPath() + - // "\n, request.getRequestURI(): " + request.getRequestURI() + - // "\n, request.getPathInfo(): " + request.getPathInfo() + - // "\n, request.getQueryString(): " + request.getQueryString()); --- 495,496 ---- Index: DialogMapping.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogMapping.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DialogMapping.java 4 Aug 2005 07:39:44 -0000 1.1 --- DialogMapping.java 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 60,64 **** public ActionForward reload() { ! return EventForward.DIALOG_RELOAD; } --- 60,64 ---- public ActionForward reload() { ! return TransferForward.DIALOG_RELOAD; } Index: DialogRuleSet.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogRuleSet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DialogRuleSet.java 23 Sep 2005 06:37:56 -0000 1.2 --- DialogRuleSet.java 9 Nov 2005 03:20:42 -0000 1.3 *************** *** 57,63 **** // digester.addFactoryCreate ! // ("struts-config/action-mappings/component/event", // new DialogForwardFactory()); digester.addObjectCreate ("struts-config/action-mappings/component/event", --- 57,67 ---- // digester.addFactoryCreate ! // ("struts-config/action-mappings/component/transfer", // new DialogForwardFactory()); + /* + * Event (based on ForwardConfig) + */ + digester.addObjectCreate ("struts-config/action-mappings/component/event", *************** *** 76,79 **** --- 80,106 ---- "property", "value"); + /* + * Transfer forward (with redirection) + */ + + digester.addObjectCreate + ("struts-config/action-mappings/component/transfer", + "net.jspcontrols.dialogs.actions.TransferForward"); + + digester.addSetProperties + ("struts-config/action-mappings/component/transfer"); + + digester.addSetNext + ("struts-config/action-mappings/component/transfer", + "addForwardConfig", + "net.jspcontrols.dialogs.actions.TransferForward"); + + digester.addSetProperty + ("struts-config/action-mappings/component/transfer/set-property", + "property", "value"); + + /* + * Render forward (no redirection) + */ digester.addObjectCreate Index: EventForward.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/EventForward.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EventForward.java 4 Aug 2005 07:39:44 -0000 1.1 --- EventForward.java 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 6,39 **** * Created by IntelliJ IDEA. * User: mjouravlev ! * Date: Jul 20, 2005 ! * Time: 11:21:22 AM * To change this template use Options | File Templates. */ public class EventForward extends ActionForward { ! public static final ActionForward DIALOG_RELOAD = ! new ActionForward(); /** * <p>Construct a new instance of an <code>ActionForward</code> ! * object with values, default for an event forward object: * <code>path</code> is set to null, <code>redirect</code> is ! * set to true.</p> * ! * <p>Event forward objects are intended to handle the first phase ! * of two-phase request processing, thus they use redirect ! * by default.</p> */ public EventForward() { ! super(null, true); } ! /** ! * <p>Construct a new instance with the specified path.</p> ! * ! * @param path Path for this instance ! */ ! public EventForward(String path) { ! super(path, true); } --- 6,42 ---- * Created by IntelliJ IDEA. * User: mjouravlev ! * Date: Nov 8, 2005 ! * Time: 11:28:20 AM * To change this template use Options | File Templates. */ public class EventForward extends ActionForward { ! String handler; ! ! public String getHandler() { ! return handler; ! } ! ! public void setHandler(String handler) { ! this.handler = handler; ! } /** * <p>Construct a new instance of an <code>ActionForward</code> ! * object with values, default for an render forward object: * <code>path</code> is set to null, <code>redirect</code> is ! * set to false.</p> * ! * <p>Render forward objects are intended to handle the second phase ! * of two-phase request processing, thus they use server-side ! * forwarding by default.</p> */ public EventForward() { ! super(); } ! public EventForward(String name, String handler) { ! super(name, null, false); ! this.handler = handler; } |
From: <jm...@us...> - 2005-11-09 03:20:50
|
Update of /cvsroot/struts/dialogs/war/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29970/war/WEB-INF Modified Files: database.xml struts-config.xml validation.xml Log Message: Index: database.xml =================================================================== RCS file: /cvsroot/struts/dialogs/war/WEB-INF/database.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** database.xml 23 Sep 2005 06:37:56 -0000 1.1 --- database.xml 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 3,33 **** <user username="www" fromAddress="fr...@ma..." fullName="qwerty" password="www" replyToAddress="to...@ma..."> </user> - <user username="ttt" fromAddress="fr...@ma..." fullName="qwerty" password="ttt" replyToAddress="to...@ma..."> - </user> <user username="uuu" fromAddress="fr...@ma..." fullName="qwerty" password="uuu" replyToAddress="to...@ma..."> </user> <user username="user" fromAddress="Joh...@so..." fullName="John Q. User2" password="pass" replyToAddress="to...@ma..."> <subscription host="mail.com" autoConnect="false" password="john" type="imap" username="john"> </subscription> ! <subscription host="mail5.com" autoConnect="false" password="ffff" type="pop3" username="ffff"> </subscription> <subscription host="mail.ru" autoConnect="true" password="JohnQ" type="pop3" username="JohnQ"> </subscription> ! <subscription host="yahoo.com" autoConnect="false" password="JohnDoe" type="pop3" username="JohnDoe"> </subscription> <subscription host="mail4.com" autoConnect="true" password="ssss" type="imap" username="ssss"> </subscription> </user> - <user username="ooo" fromAddress="Joh...@so..." fullName="UUU John Q. User" password="ooo" replyToAddress="to...@ma..."> - </user> <user username="wwwww" fromAddress="fr...@ma..." fullName="Quark Express" password="wwwww" replyToAddress=""> </user> <user username="scott" fromAddress="fr...@ma..." fullName="qwerty" password="tiger" replyToAddress="to...@ma..."> </user> ! <user username="cccc" fromAddress="fr...@ma..." fullName="UUU John Q. User" password="cccc" replyToAddress=""> </user> <user username="eee" fromAddress="fr...@ma..." fullName="qwerty" password="eee" replyToAddress="to...@ma..."> </user> ! <user username="sysdba" fromAddress="fr...@ma..." fullName="qwerty" password="aaa" replyToAddress="to...@ma..."> </user> <user username="aaaaa" fromAddress="fr...@ma..." fullName="qwerty" password="bbbbb" replyToAddress="to...@ma..."> --- 3,33 ---- <user username="www" fromAddress="fr...@ma..." fullName="qwerty" password="www" replyToAddress="to...@ma..."> </user> <user username="uuu" fromAddress="fr...@ma..." fullName="qwerty" password="uuu" replyToAddress="to...@ma..."> </user> + <user username="ttt" fromAddress="fr...@ma..." fullName="qwerty" password="ttt" replyToAddress="to...@ma..."> + </user> <user username="user" fromAddress="Joh...@so..." fullName="John Q. User2" password="pass" replyToAddress="to...@ma..."> <subscription host="mail.com" autoConnect="false" password="john" type="imap" username="john"> </subscription> ! <subscription host="yahoo.com" autoConnect="false" password="JohnDoe" type="pop3" username="JohnDoe"> </subscription> <subscription host="mail.ru" autoConnect="true" password="JohnQ" type="pop3" username="JohnQ"> </subscription> ! <subscription host="mail5.com" autoConnect="false" password="ffff" type="pop3" username="ffff"> </subscription> <subscription host="mail4.com" autoConnect="true" password="ssss" type="imap" username="ssss"> </subscription> </user> <user username="wwwww" fromAddress="fr...@ma..." fullName="Quark Express" password="wwwww" replyToAddress=""> </user> + <user username="ooo" fromAddress="Joh...@so..." fullName="UUU John Q. User" password="ooo" replyToAddress="to...@ma..."> + </user> <user username="scott" fromAddress="fr...@ma..." fullName="qwerty" password="tiger" replyToAddress="to...@ma..."> </user> ! <user username="sysdba" fromAddress="fr...@ma..." fullName="qwerty" password="aaa" replyToAddress="to...@ma..."> </user> <user username="eee" fromAddress="fr...@ma..." fullName="qwerty" password="eee" replyToAddress="to...@ma..."> </user> ! <user username="cccc" fromAddress="fr...@ma..." fullName="UUU John Q. User" password="cccc" replyToAddress=""> </user> <user username="aaaaa" fromAddress="fr...@ma..." fullName="qwerty" password="bbbbb" replyToAddress="to...@ma..."> Index: struts-config.xml =================================================================== RCS file: /cvsroot/struts/dialogs/war/WEB-INF/struts-config.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** struts-config.xml 23 Sep 2005 06:37:56 -0000 1.11 --- struts-config.xml 9 Nov 2005 03:20:42 -0000 1.12 *************** *** 52,56 **** view = "/mailreaderpages/home.jsp" type = "net.jspcontrols.mailreader.HomeAction"> ! <event name = "subscriptions" path = "/Subscriptions.do?DIALOG-EVENT-INIT"/> <render name = "failure" path = "/mailreaderpages/error.jsp" /> </component> --- 52,66 ---- view = "/mailreaderpages/home.jsp" type = "net.jspcontrols.mailreader.HomeAction"> ! ! <!-- Input events (request key for submit button) --> ! <event name = "DIALOG-EVENT-LOGON" handler = "onLogon"/> ! <event name = "DIALOG-EVENT-SIGNUP" handler = "onAccountSignup"/> ! <event name = "DIALOG-EVENT-ACCUPDATE" handler = "onAccountUpdate"/> ! <event name = "DIALOG-EVENT-SUBSCRIPTIONS" handler = "onSubscriptions"/> ! ! <!-- Transfer from one action to another, usually using redirection --> ! <transfer name = "subscriptions" path = "/Subscriptions.do?DIALOG-EVENT-INIT"/> ! ! <!-- Render a view, usually by forwarding to a JSP page --> <render name = "failure" path = "/mailreaderpages/error.jsp" /> </component> *************** *** 60,65 **** type = "net.jspcontrols.mailreader.LogonAction" form = "LogonForm"> ! <event name = "error" path = "/Logon.do" /> ! <event name = "success, cancel, logout" path = "/Home.do" /> <render name = "notloggedin" path = "/mailreaderpages/logon.jsp" /> <render name = "loggedin" path = "/mailreaderpages/logoff.jsp" /> --- 70,75 ---- type = "net.jspcontrols.mailreader.LogonAction" form = "LogonForm"> ! <transfer name = "error" path = "/Logon.do" /> ! <transfer name = "success, cancel, logout" path = "/Home.do" /> <render name = "notloggedin" path = "/mailreaderpages/logon.jsp" /> <render name = "loggedin" path = "/mailreaderpages/logoff.jsp" /> *************** *** 71,78 **** type = "net.jspcontrols.dialogs.actions.crud.CRUDAction" form = "RegistrationForm"> ! <event name = "ON-CREATE-SUCCESS, ON-EDIT" path = "/Registration.do" /> ! <event name = "ON-LOAD-FAILURE" path = "/erroraction.do"/> ! <event name = "ON-CANCEL, ON-CLOSE, ON-STORE-SUCCESS" path = "/Home.do"/> ! <event name = "ON-STORE-FAILURE, ON-INVALID-DATA" path = "/Registration.do"/> <render name = "CRUD-UI-MODE-NEW, CRUD-UI-MODE-UPDATE" path = "/mailreaderpages/registration.jsp"/> <render name = "CRUD-UI-MODE-INACTIVE" path = "/Home.do" redirect="true"/> --- 81,88 ---- type = "net.jspcontrols.dialogs.actions.crud.CRUDAction" form = "RegistrationForm"> ! <transfer name = "ON-CREATE-SUCCESS, ON-EDIT" path = "/Registration.do" /> ! <transfer name = "ON-LOAD-FAILURE" path = "/erroraction.do"/> ! <transfer name = "ON-CANCEL, ON-CLOSE, ON-STORE-SUCCESS" path = "/Home.do"/> ! <transfer name = "ON-STORE-FAILURE, ON-INVALID-DATA" path = "/Registration.do"/> <render name = "CRUD-UI-MODE-NEW, CRUD-UI-MODE-UPDATE" path = "/mailreaderpages/registration.jsp"/> <render name = "CRUD-UI-MODE-INACTIVE" path = "/Home.do" redirect="true"/> *************** *** 85,95 **** type = "net.jspcontrols.mailreader.SubscriptionAction" form = "SubscriptionForm"> ! <event name="ON-CREATE-SUCCESS, ON-DUPLICATE-SUCCESS" path="/Subscriptions.do" /> ! <event name="ON-PREVIEW, ON-EDIT" path="/Subscriptions.do"/> ! <event name="ON-LOAD-FAILURE, ON-DELETE-FAILURE" path="/mailreaderpages/crudaction-error.jsp" redirect="false"/> ! <event name="ON-DELETE-SUCCESS, ON-STORE-SUCCESS, ON-STORE-FAILURE, ON-INVALID-DATA" path="/Subscriptions.do" /> ! <event name="ON-CANCEL, ON-CLOSE" path="/Subscriptions.do"/> ! <event name="ON-PREVPAGE, ON-NEXTPAGE" path="/Subscriptions.do"/> ! <event name="ON-HOME" path="/Home.do"/> <render name="CRUD-UI-MODE-NEW, CRUD-UI-MODE-UPDATE" path="/mailreaderpages/subscription.jsp"/> <render name="CRUD-UI-MODE-INACTIVE" path="/mailreaderpages/subscriptions.jsp"/> --- 95,123 ---- type = "net.jspcontrols.mailreader.SubscriptionAction" form = "SubscriptionForm"> ! ! <!-- Input events (request key for submit button) --> ! <event name = "DIALOG-EVENT-INIT" handler = "onInit"/> ! <event name = "DIALOG-EVENT-PREVPAGE" handler = "onPrevPage"/> ! <event name = "DIALOG-EVENT-NEXTPAGE" handler = "onNextPage"/> ! <event name = "DIALOG-EVENT-BACKHOME" handler = "onBackHome"/> ! ! <event name = "DIALOG-EVENT-CREATE" ! handler = "onCreate" ! outcome = "ON-CREATE-SUCCESS, ON-CREATE-FAILURE"/> ! ! <event name = "DIALOG-EVENT-UPDATE" handler = "onEdit"/> ! <event name = "DIALOG-EVENT-DELETE" handler = "onDelete"/> ! <event name = "DIALOG-EVENT-SAVE" handler = "onSave"/> ! ! <!-- Transfer from one action to another, usually using redirection --> ! <transfer name="ON-CREATE-SUCCESS, ON-DUPLICATE-SUCCESS" path="/Subscriptions.do" /> ! <transfer name="ON-PREVIEW, ON-EDIT" path="/Subscriptions.do"/> ! <transfer name="ON-LOAD-FAILURE, ON-DELETE-FAILURE" path="/mailreaderpages/crudaction-error.jsp" redirect="false"/> ! <transfer name="ON-DELETE-SUCCESS, ON-STORE-SUCCESS, ON-STORE-FAILURE, ON-INVALID-DATA" path="/Subscriptions.do" /> ! <transfer name="ON-CANCEL, ON-CLOSE" path="/Subscriptions.do"/> ! <transfer name="ON-PREVPAGE, ON-NEXTPAGE" path="/Subscriptions.do"/> ! <transfer name="ON-HOME" path="/Home.do"/> ! ! <!-- Render a view, usually by forwarding to a JSP page --> <render name="CRUD-UI-MODE-NEW, CRUD-UI-MODE-UPDATE" path="/mailreaderpages/subscription.jsp"/> <render name="CRUD-UI-MODE-INACTIVE" path="/mailreaderpages/subscriptions.jsp"/> Index: validation.xml =================================================================== RCS file: /cvsroot/struts/dialogs/war/WEB-INF/validation.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** validation.xml 23 Sep 2005 06:37:56 -0000 1.1 --- validation.xml 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 56,60 **** --- 56,63 ---- <field property="nestedUser.fromAddress" depends="required,email"> + <!-- <arg key="prompt.fromAddress"/> + --> + <arg key="${RegistrationForm.nestedUser.fromAddress}" resource="false"/> </field> *************** *** 66,70 **** --- 69,76 ---- <field property="nestedUser.replyToAddress" depends="email"> + <!-- <arg key="prompt.replyToAddress"/> + --> + <arg key="RegistrationForm.nestedUser.replyToAddress" resource="false"/> </field> |
From: <jm...@us...> - 2005-11-09 03:20:50
|
Update of /cvsroot/struts/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29970 Modified Files: build.properties tomcat.bat Log Message: Index: build.properties =================================================================== RCS file: /cvsroot/struts/dialogs/build.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.properties 28 Jun 2005 01:36:10 -0000 1.7 --- build.properties 9 Nov 2005 03:20:42 -0000 1.8 *************** *** 1,2 **** ! j2ee.home=c:/j2eesdk ! tomcat.home=P:/Tomcat4-1-31 --- 1,2 ---- ! j2ee.home=c:/j2ee ! tomcat.home=C:/Tomcat4-1-30 Index: tomcat.bat =================================================================== RCS file: /cvsroot/struts/dialogs/tomcat.bat,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tomcat.bat 24 Jun 2005 07:09:35 -0000 1.6 --- tomcat.bat 9 Nov 2005 03:20:42 -0000 1.7 *************** *** 1,5 **** @rem Tomcat directory ! set CATALINA_HOME=p:\Tomcat4-1-31 ! set CATALINA_BASE=p:\Tomcat4-1-31 @rem start Tomcat --- 1,5 ---- @rem Tomcat directory ! set CATALINA_HOME=C:\Tomcat4-1-30 ! set CATALINA_BASE=C:\Tomcat4-1-30 @rem start Tomcat |
From: <jm...@us...> - 2005-11-09 03:20:50
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29970/src/net/jspcontrols/mailreader Modified Files: HomeAction.java LogonAction.java SubscriptionAction.java Log Message: Index: HomeAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader/HomeAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HomeAction.java 23 Sep 2005 06:37:57 -0000 1.1 --- HomeAction.java 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 18,23 **** import java.util.ArrayList; - import java.util.Map; - import java.util.HashMap; import java.util.Locale; import javax.servlet.http.HttpServletRequest; --- 18,21 ---- *************** *** 33,37 **** import org.apache.commons.logging.LogFactory; import net.jspcontrols.dialogs.actions.DialogAction; ! import net.jspcontrols.dialogs.actions.EventForward; import net.jspcontrols.mailreader.memory.UserDatabase; --- 31,35 ---- import org.apache.commons.logging.LogFactory; import net.jspcontrols.dialogs.actions.DialogAction; ! import net.jspcontrols.dialogs.actions.TransferForward; import net.jspcontrols.mailreader.memory.UserDatabase; *************** *** 86,89 **** --- 84,88 ---- throws Exception { + System.out.println("HomeAction getContextPath [" + request.getContextPath() + "]"); // // Initialize messages and database *************** *** 120,143 **** /** - * <p>Provides mapping from event names (keys) to handler methods (values). - * Each handler method must have the same signature as <code>execute</code>. - * This method is called only once after application started.</p> - * - * @return Map, containing association between event names (keys) and - * handler methods (values). - */ - protected Map getKeyMethodMap() { - Map methodMap = new HashMap(); - // By default, getInitKey() returns "DIALOG-EVENT", the standard - // event prefix for SelectAction and DialogAction - methodMap.put(getInitKey()+"-LOGON", "onLogon"); - methodMap.put(getInitKey()+"-SIGNUP", "onAccountSignup"); - methodMap.put(getInitKey()+"-ACCUPDATE", "onAccountUpdate"); - methodMap.put(getInitKey()+"-LOCALE", "onLocale"); - methodMap.put(getInitKey()+"-SUBSCRIPTIONS", "onSubscriptions"); - return methodMap; - } - - /** * <p>Handles logon event. Forwards to "logon" mapping.</p> */ --- 119,122 ---- *************** *** 232,236 **** // in Struts Dialogs v. 1.23. You need to set up DialogRuleSet // in your web.xml file. ! return EventForward.DIALOG_RELOAD; } } --- 211,215 ---- // in Struts Dialogs v. 1.23. You need to set up DialogRuleSet // in your web.xml file. ! return TransferForward.DIALOG_RELOAD; } } Index: LogonAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader/LogonAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LogonAction.java 23 Sep 2005 06:37:57 -0000 1.1 --- LogonAction.java 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 18,22 **** import net.jspcontrols.dialogs.actions.DialogAction; ! import net.jspcontrols.dialogs.actions.EventForward; import net.jspcontrols.mailreader.business.User; import net.jspcontrols.mailreader.memory.UserDatabase; --- 18,22 ---- import net.jspcontrols.dialogs.actions.DialogAction; ! import net.jspcontrols.dialogs.actions.TransferForward; import net.jspcontrols.mailreader.business.User; import net.jspcontrols.mailreader.memory.UserDatabase; *************** *** 134,138 **** // Show page corresponding to current state of Logon component ! return EventForward.DIALOG_RELOAD; } --- 134,138 ---- // Show page corresponding to current state of Logon component ! return TransferForward.DIALOG_RELOAD; } *************** *** 169,173 **** if (!errors.isEmpty()) { this.saveDialogErrors(request.getSession(), errors); ! return EventForward.DIALOG_RELOAD; // Successfully logged in; navigate to home page --- 169,173 ---- if (!errors.isEmpty()) { this.saveDialogErrors(request.getSession(), errors); ! return TransferForward.DIALOG_RELOAD; // Successfully logged in; navigate to home page Index: SubscriptionAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader/SubscriptionAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubscriptionAction.java 23 Sep 2005 06:37:57 -0000 1.1 --- SubscriptionAction.java 9 Nov 2005 03:20:42 -0000 1.2 *************** *** 28,34 **** import net.jspcontrols.dialogs.actions.crud.ICRUDForm; import net.jspcontrols.dialogs.actions.crud.CRUDConstants; ! import net.jspcontrols.dialogs.actions.EventForward; ! ! import java.util.Map; /** --- 28,32 ---- import net.jspcontrols.dialogs.actions.crud.ICRUDForm; import net.jspcontrols.dialogs.actions.crud.CRUDConstants; ! import net.jspcontrols.dialogs.actions.TransferForward; /** *************** *** 42,64 **** /** - * <p>Provides mapping from event names (keys) to handler methods (values). - * Each handler method must have the same signature as <code>execute</code>. - * This method is called only once after application started.</p> - * - * @return Map, containing association between event names (keys) and - * handler methods (values). - */ - protected Map getKeyMethodMap() { - Map map = super.getKeyMethodMap(); - // By default, getInitKey() returns "DIALOG-EVENT", the standard - // event prefix for SelectAction and DialogAction - map.put(getInitKey()+"-INIT", "onInit"); - map.put(getInitKey()+"-PREVPAGE", "onPrevPage"); - map.put(getInitKey()+"-NEXTPAGE", "onNextPage"); - map.put(getInitKey()+"-BACKHOME", "onBackHome"); - return map; - } - - /** * <p>Handles init event. Clears messages, switches CRUD state to inactive * and reloads the component.</p> --- 40,43 ---- *************** *** 77,81 **** // Show page corresponding to "Logged Out" state ! return EventForward.DIALOG_RELOAD; } --- 56,60 ---- // Show page corresponding to "Logged Out" state ! return TransferForward.DIALOG_RELOAD; } |
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/wizardaction/rules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/wizardaction/rules Removed Files: SignupWizard.java StepConfirm.java StepDetails.java StepSignup.java Log Message: Removed duplicates from older packaging. --- SignupWizard.java DELETED --- --- StepConfirm.java DELETED --- --- StepDetails.java DELETED --- --- StepSignup.java DELETED --- |
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/dialogloginaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/dialogloginaction Removed Files: DialogLoginAction.java DialogLoginActionControl.java DialogLoginForm.java Log Message: Removed duplicates from older packaging. --- DialogLoginAction.java DELETED --- --- DialogLoginActionControl.java DELETED --- --- DialogLoginForm.java DELETED --- |
From: <jm...@us...> - 2005-10-04 22:57:56
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/wizardaction/wizardsubclassed In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/wizardaction/wizardsubclassed Removed Files: SubclassedSignupForm.java Log Message: Removed duplicates from older packaging. --- SubclassedSignupForm.java DELETED --- |
From: <jm...@us...> - 2005-10-04 22:57:56
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/crudaction/business In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/crudaction/business Removed Files: BusinessObj.java Log Message: Removed duplicates from older packaging. --- BusinessObj.java DELETED --- |
From: <jm...@us...> - 2005-10-04 22:57:56
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/wizardaction/wizardsimple In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/wizardaction/wizardsimple Removed Files: SimpleSignupAction.java SimpleSignupForm.java Log Message: Removed duplicates from older packaging. --- SimpleSignupAction.java DELETED --- --- SimpleSignupForm.java DELETED --- |
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/crudaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/crudaction Removed Files: CRUDActionSample.java CRUDFormSample.java CRUDListActionSample.java ItemListActionSample.java Log Message: Removed duplicates from older packaging. --- CRUDActionSample.java DELETED --- --- CRUDFormSample.java DELETED --- --- CRUDListActionSample.java DELETED --- --- ItemListActionSample.java DELETED --- |
From: <jm...@us...> - 2005-10-04 22:57:55
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/childaction In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/childaction Removed Files: EmbeddedAction.java EmbeddedActionResin.java EmbeddedActionTomcat.java embedded_0002dchild_0002dlogin_jsp.java embedded_0002dchild_0002dlogout_jsp.java Log Message: Removed duplicates from older packaging. --- EmbeddedAction.java DELETED --- --- EmbeddedActionResin.java DELETED --- --- EmbeddedActionTomcat.java DELETED --- --- embedded_0002dchild_0002dlogin_jsp.java DELETED --- --- embedded_0002dchild_0002dlogout_jsp.java DELETED --- |
From: <jm...@us...> - 2005-10-04 22:57:55
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/wizardaction/accounts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23392/src/net/jspcontrols/dialogs/samples/wizardaction/accounts Removed Files: UserAccounts.java Log Message: Removed duplicates from older packaging. --- UserAccounts.java DELETED --- |
From: <jm...@us...> - 2005-09-28 16:57:58
|
Update of /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28594/src/documentation/content/xdocs/strutsdialogs Modified Files: index.xml Log Message: Index: index.xml =================================================================== RCS file: /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs/index.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.xml 28 Sep 2005 01:04:59 -0000 1.15 --- index.xml 28 Sep 2005 16:57:44 -0000 1.16 *************** *** 44,51 **** </ul> ! <p>The Front Controller pattern does not specify exact details of how the state should be managed, ! or how a response should be handled after a view is rendered. Out-of-the-box Struts framework does ! not provide much help on these subjects. Quite contrary, official Struts documentation suggest ! practices that may complicate the matters.</p> </section> --- 44,49 ---- </ul> ! <p>The Front Controller pattern does not specify the exact details of how the state should be managed, ! or how a response should be handled after a view is rendered.</p> </section> *************** *** 58,63 **** where to queue output data to, and where to store information between requests.</p> ! <p>Struts documentation does not specify how exactly to prepare JSP page, and how to handle form ! submission. Struts users came up with idea of pre-action (output action, setup action) and post-action (input action) dispatchers, so actions and JSP pages are interlaced, while action-relevant business data (green oval on the picture below) is located outside of an action:</p> --- 56,60 ---- where to queue output data to, and where to store information between requests.</p> ! <p>Struts users came up with idea of pre-action (output action, setup action) and post-action (input action) dispatchers, so actions and JSP pages are interlaced, while action-relevant business data (green oval on the picture below) is located outside of an action:</p> *************** *** 76,86 **** to one used in ASP.NET framework, while keeping your investments into Struts.</p> ! <p>One of the ASP.NET concepts is a unity of page markup (ASPX) and business-related code (C# or VB). ! A page layout and widgets are defined in the markup, while corresponding class handles ! page lifecycle and incoming events. This concept is especially easy to grasp for programmers of desktop applications:</p> <source> Before page is displayed, the code behind it initializes page data. After page is rendered, activating a widget in the browser window ! generates event, which is dispatched to a handler. </source> --- 73,84 ---- to one used in ASP.NET framework, while keeping your investments into Struts.</p> ! <p>One of the ASP.NET concepts is the unity of page markup (ASPX) and business-related code (C# or VB). ! A page layout and widgets are defined in the markup, while page lifecycle and incoming events are ! handled by corresponding class file. This concept is especially easy to grasp for programmers ! of desktop applications:</p> <source> Before page is displayed, the code behind it initializes page data. After page is rendered, activating a widget in the browser window ! generates event, which is dispatched to a handler. defined in the class. </source> *************** *** 117,139 **** <title>State management</title> ! <p>Struts Dialogs does not introduce new classes to manage application state. Instead, it uses ! the class which already exists in the Struts core, ActionForm. Official Struts guidelines recommend ! using ActionForm with request scope, only to collect input data. This decision entails developers ! to use custom objects to queue output data and to store information between requests.</p> ! ! <p>Struts Dialogs suggests to use session scope for ActionForm. One simple change in the config file ! promotes ActionForm from simple request buffer to stateful input/output object. In JSF terms, ! ActionForm now acts as a backing bean for JSP page. There is nothing groundbreaking in using ! session scope for ActionForm, or in storing output data in it. Online poll shows that about 60% of ! respondents use ActionForm for queueing output data.</p> ! <p>With changing ActionForm scope to session, it is possible now to initialize form bean only once, and to reuse data between requests. This is convenient for form resubmissions, for page reloading or for navigating back to previous resource. Having all resource data in a single ActionForm simplifies JSP page. Struts automatically populates ActionForm ! with submitted data, now you can use this data to render a page without ! additional efforts. Session scope justifies the usage of nested properties within ActionForm, ! which allows to use business objects or DTOs directly, without copying their data to ActionForm ! and from ActionForm.</p> </section> --- 115,134 ---- <title>State management</title> ! <p>Struts Dialogs does not introduce new classes to manage application state. ! Instead, it uses existing ActionForm class as a first-class stateful input/output object. ! In JSF terms, ActionForm now acts as a backing bean for JSP page. There is nothing ! groundbreaking in using session scope for ActionForm, or in storing output data in it. ! Online poll shows that about 60% of respondents use ActionForm for queueing output data.</p> ! <p>With changing ActionForm scope to session, it is possible to initialize form bean only once, and to reuse data between requests. This is convenient for form resubmissions, for page reloading or for navigating back to previous resource. Having all resource data in a single ActionForm simplifies JSP page. Struts automatically populates ActionForm ! with submitted data on input phase, the same data can be used for presentation on render phase ! without additional efforts.</p> ! ! <p>Session scope justifies the usage of nested properties within ActionForm. It is easy and ! convenient to use business objects or DTOs as nested properties instead of copying their ! data to ActionForm and from ActionForm.</p> </section> |
From: <jm...@us...> - 2005-09-28 01:05:09
|
Update of /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16014/src/documentation/content/xdocs/strutsdialogs Modified Files: index.xml Log Message: Index: index.xml =================================================================== RCS file: /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs/index.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** index.xml 23 Sep 2005 07:23:42 -0000 1.14 --- index.xml 28 Sep 2005 01:04:59 -0000 1.15 *************** *** 10,31 **** <section id="overview_new"> <title>Overview</title> ! <p><strong>Struts Dialogs</strong> combines Front Controller pattern of classic Struts with Page Controller features ! of ASP.NET and JSP. It implements event handling, basic state management, provides simplified control flow and facilitates ! component development.</p> ! <ul> ! <li><strong>Simplified control flow</strong> - concerns between actions, action forms and JSP pages are cleanly separated.</li> ! <li><strong>Event handling</strong> - command links and form submissions are processed ! by an action, which a JSP page corresponds to.</li> ! <li><strong>State management</strong> - session-scoped ActionForm is elevated from simple request buffer to stateful input/output object.</li> ! <li><strong>Component development</strong> - It is possible to create standalone and embedded components without portal ! engine and portlet API.</li> ! <li><strong>Web Wizards</strong> - create web wizards, similar to traditional desktop wizard dialogs.</li> </ul> </section> <section id="controlflow"> ! <title>Simplified control flow</title> <p>Struts is a controller framework that adheres closely to the principles of Front Controller Pattern (<link href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/FrontController.html">J2EE Front Controller pattern</link>, --- 10,36 ---- <section id="overview_new"> <title>Overview</title> ! <p><strong>Struts Dialogs</strong> is a library for Struts 1.2.x framework, which improves ! development process and makes applications more robust and user-friendly. ! Struts Dialogs combines best features of Struts Front Controller pattern with ! Page Controller features of ASP.NET. It implements event handling, basic state management, ! provides simplified control flow and facilitates component development.</p> <ul> ! <li><strong>Simplified control flow</strong> - cleaner separation of concerns between actions, ! action forms and JSP pages.</li> ! <li><strong>Event handling</strong> - uniform processing of command links and form submission ! events.</li> ! <li><strong>State management</strong> - using session-scoped form bean as first-class stateful input/output object.</li> ! <li><strong>Easier configuration</strong> - improved request/response cycle is controlled with ! less XML markup and fewer Java classes.</li> ! <li><strong>Component development</strong> - either standalone or visually embedded components ! without portal engine and portlet API.</li> ! <li><strong>Web Wizards</strong> - controlled flow of web pages for a given web resource, ! similar to traditional desktop wizard dialogs.</li> </ul> </section> <section id="controlflow"> ! <title>Front Controller pattern</title> <p>Struts is a controller framework that adheres closely to the principles of Front Controller Pattern (<link href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/FrontController.html">J2EE Front Controller pattern</link>, *************** *** 36,116 **** <li><strong>Action</strong>: Dispatcher (J2EE); part of Command (.NET)</li> <li><strong>ActionForm</strong>: part of Command (.NET)</li> ! <li><strong>JSP</strong>: view</li> </ul> ! <p>The Front Controller pattern does not specify how the state should be managed, or where a request should be directed ! after a view is rendered. Out-of-the-box Struts does not provide much help on these subjects. Quite contrary, ! official Struts documentation suggest practices that may complicate the matters.</p> ! <section id="traditionalflow"> ! <title>Traditional Struts approach</title> ! <p>ActionForm was initially designed as convenience object for input data. Struts guidelines recommend using ! ActionForm with request scope, which prevents from storing state information in it. It is up to ! the developer to decide where to queue output data, and where to store information between requests.</p> ! <p>Struts documentation does not specify how exactly JSP preparation and form submission should ! be handled. Struts users came up with idea of pre-Action (output Action, setup Action) and post-Action ! (input Action) dispatchers, so actions and JSP pages are interlaced:</p> ! <figure src="images/struts-pre-post-action.gif" alt="Pre- and Post- actions"/> ! <p>The problem here is that one JSP can relate to several actions, and the only way to determine ! the action (or actions) that handle the submission of the page, is to look through the JSP code. ! Because of many-to-many relationships between actions and JSP pages, web application becomes ! hard to maintain right from the start.</p> </section> <section id="codebehind"> ! <title>Code-behind for Struts</title> ! ! <p>Struts Dialogs employs code-behind pattern similar to one used in .NET framework, ! while keeping your investments into Struts.</p> ! <p>One of the .NET concepts is a unity of page markup (ASP) and business-related code (C# or VB). ! A page layout and widgets are defined in the markup, while corresponding code-behind class handles ! page lifecycle and incoming events. This concept is especially easy to grasp for desktop applications ! programmers: before page is displayed, the code behind it initializes page data. After page is rendered, ! activating a widget in the browser window generates event, which is dispatched to a handler.</p> ! <p>This pattern can be implemented in Struts with no change to core classes or tag libraries. It even can ! be improved, because Struts allows to define several markup pages corresponding to one action.</p> ! <p>First you need to change your mindset. Forget about traditional Struts pre-actions and post-actions. ! Do not think in terms of pages either. Think in terms of web resources. Recall that internet is about ! web resources, not about mere pages. A page is just a visualization of resource in its current state at ! a given time. An address identifies a resource, not a particular representaion of it. Resource can be rendered ! differently depending on its state.</p> ! <figure src="images/struts-dialog-action.gif" alt="Dialog action"/> ! <p>In Struts Dialogs each resource is serviced by one action class. Depending on resource state, ! the action class can render different views,defined in JSP pages. Each JSP page belongs to ! one action class only, which is called <em>parent action</em>. Data, submitted from a page, is handled by the parent ! action. If submitted data changed resource state, the action may render a different page the next time resource ! is accessed.</p> ! </section> ! </section> ! <section id="eventhandling"> ! <title>Event handling</title> ! <p>Official Struts documentation does not specify, how exactly form input should be handled. ! It is common practice to prepare content for JSP page with one action, and to collect input data ! in another action. This wide-spread net of single-task actions makes development more complicated ! than it could be.</p> ! <p>Struts Dialogs offers a different approach, which is used by frameworks like .NET and JSF. ! Form submission generates input event, which is handled in action class. Action class defines ! handler methods for every input event. Input events can be generated not only by submitting a form, ! but also by clicking on a command link.</p> ! <p>Direct linking from JSP page to another resource is discouraged. Instead, a command link should ! generate an event, which would be handled by parent action class. Only action class should decide ! which resource to navigate to next. This approach allows to define all navigation targets in the <code>struts-config.xml</code> ! file, thus having a clear representation of web application structure.</p> </section> - <section id="state_management"> <title>State management</title> --- 41,117 ---- <li><strong>Action</strong>: Dispatcher (J2EE); part of Command (.NET)</li> <li><strong>ActionForm</strong>: part of Command (.NET)</li> ! <li><strong>JSP page</strong>: view</li> </ul> ! <p>The Front Controller pattern does not specify exact details of how the state should be managed, ! or how a response should be handled after a view is rendered. Out-of-the-box Struts framework does ! not provide much help on these subjects. Quite contrary, official Struts documentation suggest ! practices that may complicate the matters.</p> ! </section> ! <section id="traditionalflow"> ! <title>Struts: traditional request/response cycle</title> ! <p>Class <code>ActionForm</code> was initially designed as convenience object for input data. ! Struts guidelines recommend using ActionForm in request scope. This precludes ! from storing state information in ActionForm. It is up to developer to decide ! where to queue output data to, and where to store information between requests.</p> ! <p>Struts documentation does not specify how exactly to prepare JSP page, and how to handle form ! submission. Struts users came up with idea of pre-action (output action, setup action) and ! post-action (input action) dispatchers, so actions and JSP pages are interlaced, while ! action-relevant business data (green oval on the picture below) is located outside of an action:</p> ! <figure src="images/struts-pre-post-action.gif" alt="Pre- and Post- actions"/> ! <p>Each interactive JSP page is handled by at least two actions, and each action can render ! different pages. Because of many-to-many relationships between actions and JSP pages, ! web application becomes hard to maintain right from the start.</p> </section> <section id="codebehind"> ! <title>Struts Dialogs: code-behind and event handling</title> ! <p>Struts Dialogs makes development simpler by employing code-behind pattern similar ! to one used in ASP.NET framework, while keeping your investments into Struts.</p> ! <p>One of the ASP.NET concepts is a unity of page markup (ASPX) and business-related code (C# or VB). ! A page layout and widgets are defined in the markup, while corresponding class handles ! page lifecycle and incoming events. This concept is especially easy to grasp for programmers of desktop applications:</p> ! <source> Before page is displayed, the code behind it initializes page data. ! After page is rendered, activating a widget in the browser window ! generates event, which is dispatched to a handler. ! </source> ! <p>This pattern is implemented by Struts Dialogs with no changes to core Struts classes ! or tag libraries. Moreover, it is improved, because Struts allows to define several ! markup pages corresponding to one Java class.</p> ! <p>To use event-dispatching actions one should think in terms of <em>web resources</em>. ! Internet is about web resources, not about ! mere pages. A page is just a visualization of a resource in its current state at ! a given time. An address identifies a resource, not a particular representaion of it. ! A resource can be rendered differently depending on its state.</p> ! <figure src="images/struts-dialog-action.gif" alt="Dialog action"/> ! <p>In Struts Dialogs each resource is represented by one action (which consists of ! an action class and a form bean). Depending on resource state, an action can render ! one view or another. Views, corresponding to an action, are defined as JSP pages. ! Each JSP page belongs to one action only, which is called a <em>parent action</em>.</p> ! <p>Submission of a form from JSP page generates input event, which is handled by ! the page's parent action. Action class defines handler methods for every input event. ! Input events can be generated not only by submitting a form (POST), but also by ! clicking on a command link (GET). Think of enhanced <code>DispatchAction</code>.</p> ! <p>Direct linking from JSP page to another resource is possible, but discouraged. ! Instead, a command link should generate an event, which would be handled by parent action ! class. It is up to an action class to decide where to navigate next. This approach ! allows to define all navigation targets in the <code>struts-config.xml</code> file, ! having a clear representation of web application structure.</p> </section> <section id="state_management"> <title>State management</title> *************** *** 131,137 **** or for navigating back to previous resource. Having all resource data in a single ActionForm simplifies JSP page. Struts automatically populates ActionForm ! with submitted data, now you can use this data to render a page without any additional efforts. Session scope justifies the usage of nested properties within ActionForm, ! which allows to use business objects or DTOs directly without copying their data to ActionForm and from ActionForm.</p> --- 132,138 ---- or for navigating back to previous resource. Having all resource data in a single ActionForm simplifies JSP page. Struts automatically populates ActionForm ! with submitted data, now you can use this data to render a page without additional efforts. Session scope justifies the usage of nested properties within ActionForm, ! which allows to use business objects or DTOs directly, without copying their data to ActionForm and from ActionForm.</p> |
From: <jm...@us...> - 2005-09-23 07:36:42
|
Update of /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31820/src/documentation/content/xdocs/strutsdialogs Modified Files: mailreader-registration.xml Log Message: Index: mailreader-registration.xml =================================================================== RCS file: /cvsroot/struts/struts-site/src/documentation/content/xdocs/strutsdialogs/mailreader-registration.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mailreader-registration.xml 23 Sep 2005 07:23:42 -0000 1.1 --- mailreader-registration.xml 23 Sep 2005 07:36:34 -0000 1.2 *************** *** 3,7 **** <document> <header> ! <title>Struts Dialogs Mail Reader: Subscriptions</title> </header> --- 3,7 ---- <document> <header> ! <title>Struts Dialogs Mail Reader: Registration</title> </header> *************** *** 10,144 **** <section id="overview"> <title>Overview</title> ! <p><strong>Subscriptions</strong> component performs the following functions:</p> ! <ul> ! <li>Displays a list of email subscriptions</li> ! <li>Allows to create a new sibscription</li> ! <li>Allows to update existing subscription</li> ! </ul> ! <p>Subscriptions component is controlled by one action (SubscriptionAction.java) ! and has two views: <code>subscriptions.jsp</code> and <code>subscription.jsp</code>.</p> ! ! <p><code>subscriptions.jsp</code> displays a list of email subscriptions. ! It is shown to a logged-in user, if there is no <em>current</em> subscription.</p> ! <figure src="images/mailreader-subscriptions.gif" alt="MailReader Subscriptions"/> ! <p/> ! <p>If current subscription exists, <code>subscription.jsp</code> displays it ! to a logged-in user. It can be either a new subscription...</p> ! <figure src="images/mailreader-subscription-create.gif" alt="MailReader Create Subscription"/> ! <p>...or an existing subscription:</p> ! <figure src="images/mailreader-subscription-update.gif" alt="MailReader Update Subscription"/> ! ! </section> ! ! <section id="subscriptionaction"> ! <title>SubscriptionAction.java</title> ! <p><code>SubscriptionAction</code> class does not differ much from standard ! all-in-one <link href="crudaction.html">CRUD Component</link>. The major difference ! is that Subscription action first verifies if a user is logged in. If not, ! it redirects to Login action. If user is logged in, then Subscription action ! handles input events in standard way for DialogAction class. In real application ! this code should be placed in an interceptor or servlet filter. Struts Chains, ! introduced in Struts 1.3, should allow easy implementation of generic interceptors ! like login interceptor.</p> ! <source> ! public class SubscriptionAction extends CRUDAction { ! ... ! public ActionForward execute(ActionMapping mapping, ! ActionForm form, ! HttpServletRequest request, ! HttpServletResponse response) ! throws Exception { ! ! // If user not found, redirect to login action ! HttpSession session = request.getSession(); ! if (session.getAttribute(Constants.USER_KEY) == null) { ! return mapping.findForward("logon"); ! } ! ! // User is valid, perform standard event processing ! return super.execute(mapping, form, request, response); ! } ! ... ! } ! </source> ! </section> ! ! <section id="subscriptionslist"> ! <title>Subscriptions list</title> ! <p>If <em>current</em> subscription does not exist, Subscrpiptions action displays ! subscrpiption list. This list can be split into pages. Default page size is four ! rows. Struts-EL is used to access actionform data.</p> ! <source> ! <table> ! <thead> ! <tr> ! <th>Host</th> ! <th>Username</th> ! <th>Server Type</th> ! <th >Auto</th> ! <th>Operation</th> ! </tr> ! </thead> ! ! <logic:present name="user" scope="session"> ! <!-- Show subscription list --> ! <logic-el:iterate id="subscription" ! collection="${SubscriptionForm.subscriptions}" ! offset="${SubscriptionForm.offset}" ! length="${SubscriptionForm.pagesize}" ! type="net.jspcontrols.mailreader.business.Subscription"> ! <tr> ! <td><c:out value="${subscription.host}"/></td> ! <td><c:out value="${subscription.username}"/></td> ! <td><c:out value="${subscription.type}"/></td> ! <td><c:out value="${subscription.autoConnect}"/></td> ! <td> ! <html-el:link ! href="Subscriptions.do?DIALOG-EVENT-UPDATE&host=${subscription.host}"> ! Edit ! </html-el:link> ! <html-el:link ! href="Subscriptions.do?DIALOG-EVENT-DELETE&host=${subscription.host}"> ! Delete ! </html-el:link> ! </td> ! </tr> ! </logic-el:iterate> ! </logic:present> ! </table> ! ! <html:form action="/Subscriptions.do"> ! <html:submit property="DIALOG-EVENT-CREATE" value="New Subscription"/> ! <html-el:submit property="DIALOG-EVENT-PREVPAGE" value="Previous Page" ! disabled="${SubscriptionForm.firstpage}"/> ! <html-el:submit property="DIALOG-EVENT-NEXTPAGE" value="Next Page" ! disabled="${SubscriptionForm.lastpage}"/> ! <html:submit property="DIALOG-EVENT-BACKHOME" value="Cancel"/> ! </html:form> ! </source> ! </section> ! ! <section id="subscription"> ! <title>Creating and updating subscriptions</title> ! <p>The major difference of this version of MailReader application from original ! Ted Husted's version is that action form has session scope and current subscription ! is nested within the action form. Fortunately, Subscrption business object (BO) ! has only String and boolean fields, so no conversion is needed and it is easy to ! retain invalid values in the form.</p> ! <p>When a user creates new subscription, a new <code>Subscription</code> object is created and ! nested in the <code>SubscriptionForm.java</code> class. If a user wants to update ! existing subscription, then it is cloned into a detached object, which in turn, is ! nested within <code>SubscriptionForm.java</code> class. Therefore, changes to ! nested subscription do not affect persistent data. If the user cancels the update ! process, then detached subscription is simply deleted from memory.</p> ! <p>Subscription action creates new or updates existing subscription based on input ! event generated by button on <code>subscriptions.jsp</code> page. DIALOG-EVENT-CREATE ! creates new subscription, DIALOG-EVENT-UPDATE selects a subscription as current and ! updates it.</p> ! </section> ! ! <section id="next"> ! <title>Next: Registration component</title> ! <p>Proceed to <link href="mailreader-registration.html">Registration</link> component.</p> </section> --- 10,14 ---- <section id="overview"> <title>Overview</title> ! <p>Under construction</p> </section> |
From: <jm...@us...> - 2005-09-23 07:23:50
|
Update of /cvsroot/struts/struts-site/src/documentation/resources/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29016/src/documentation/resources/images Added Files: mailreader-home-mainmenu.gif mailreader-home-welcome.gif mailreader-login.gif mailreader-logout.gif mailreader-matrix.gif mailreader-subscription-create.gif mailreader-subscription-update.gif mailreader-subscriptions.gif Log Message: --- NEW FILE: mailreader-home-mainmenu.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-home-welcome.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-login.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-logout.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-matrix.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-subscription-create.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-subscription-update.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: mailreader-subscriptions.gif --- (This appears to be a binary file; contents omitted.) |
From: <jm...@us...> - 2005-09-23 06:38:12
|
Update of /cvsroot/struts/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798 Modified Files: StrutsDialogs.ipr StrutsDialogs.iws Log Message: Added MailReader Demo; Added component RuleSet Index: StrutsDialogs.ipr =================================================================== RCS file: /cvsroot/struts/dialogs/StrutsDialogs.ipr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StrutsDialogs.ipr 11 Jul 2005 07:16:47 -0000 1.1 --- StrutsDialogs.ipr 23 Sep 2005 06:37:55 -0000 1.2 *************** *** 27,30 **** --- 27,32 ---- <root type="simple" url="jar://P:/Tomcat4-1-31/server/lib/tomcat-coyote.jar!/" /> <root type="simple" url="jar://P:/Tomcat4-1-31/common/lib/jasper-runtime.jar!/" /> + <root type="simple" url="jar://$PROJECT_DIR$/war/WEB-INF/lib/commons-beanutils.jar!/" /> + <root type="simple" url="jar://$PROJECT_DIR$/war/WEB-INF/lib/commons-digester.jar!/" /> </root> </classPath> *************** *** 75,79 **** </component> <component name="JavadocGenerationManager"> ! <option name="OUTPUT_DIRECTORY" /> <option name="OPTION_SCOPE" value="protected" /> <option name="OPTION_HIERARCHY" value="true" /> --- 77,81 ---- </component> <component name="JavadocGenerationManager"> ! <option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/javadoc" /> <option name="OPTION_SCOPE" value="protected" /> <option name="OPTION_HIERARCHY" value="true" /> *************** *** 86,90 **** <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" /> <option name="OPTION_DEPRECATED_LIST" value="true" /> ! <option name="OTHER_OPTIONS" value="" /> <option name="HEAP_SIZE" /> <option name="OPEN_IN_BROWSER" value="true" /> --- 88,92 ---- <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" /> <option name="OPTION_DEPRECATED_LIST" value="true" /> ! <option name="OTHER_OPTIONS" /> <option name="HEAP_SIZE" /> <option name="OPEN_IN_BROWSER" value="true" /> Index: StrutsDialogs.iws =================================================================== RCS file: /cvsroot/struts/dialogs/StrutsDialogs.iws,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StrutsDialogs.iws 11 Jul 2005 07:16:48 -0000 1.1 --- StrutsDialogs.iws 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 3,66 **** <component name="FileEditorManager"> <history> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/DialogAction.java" line="433" column="25" vertical-scroll-proportion="0.7387964" horizontal-scroll-proportion="0.23777173" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/collab/MyForwardAction.java" line="26" column="0" vertical-scroll-proportion="0.42444152" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/samples/crudaction/CRUDFormSample.java" line="37" column="39" vertical-scroll-proportion="0.5808147" horizontal-scroll-proportion="0.3709239" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/crud/CRUDForm.java" line="64" column="37" vertical-scroll-proportion="0.8173456" horizontal-scroll-proportion="0.3519022" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/crud/ICRUDForm.java" line="41" column="31" vertical-scroll-proportion="0.36793694" horizontal-scroll-proportion="0.29483697" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/WEB-INF/web.xml" line="28" column="17" vertical-scroll-proportion="0.62549275" horizontal-scroll-proportion="0.16168478" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/collab/TabControlActionInput.java" line="36" column="0" vertical-scroll-proportion="0.6478318" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/collab/TabControlActionView.java" line="31" column="0" vertical-scroll-proportion="0.5224072" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/collab/MasterPageAction.java" line="40" column="0" vertical-scroll-proportion="0.8169014" horizontal-scroll-proportion="0.0"> <folding> <element signature="imports" expanded="true" /> </folding> </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/war/WEB-INF/struts-config.xml" line="231" column="26" vertical-scroll-proportion="0.19846351" horizontal-scroll-proportion="0.2133646" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/collab/TabControlAction.java" line="40" column="49" vertical-scroll-proportion="0.58514726" horizontal-scroll-proportion="0.4021102"> <folding> <element signature="imports" expanded="true" /> </folding> </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/war/tabs.jsp" line="15" column="43" vertical-scroll-proportion="0.31882203" horizontal-scroll-proportion="0.35287222" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/crudaction-list.jsp" line="35" column="7" vertical-scroll-proportion="0.51379764" horizontal-scroll-proportion="0.057444315" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/samples/crudaction/CRUDListActionSample.java" line="19" column="28" vertical-scroll-proportion="0.15637319" horizontal-scroll-proportion="0.22977726" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mainpage.jsp" line="11" column="14" vertical-scroll-proportion="0.2457293" horizontal-scroll-proportion="0.11488863" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/crudaction-lite-list.jsp" line="3" column="0" vertical-scroll-proportion="-0.5755585" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/dialogaction.xml" line="0" column="0" vertical-scroll-proportion="0.0" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/crudaction.xml" line="14" column="95" vertical-scroll-proportion="0.31274638" horizontal-scroll-proportion="0.7796014" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/dialogaction-logincomponentsample.xml" line="20" column="0" vertical-scroll-proportion="0.44678056" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/index.xml" line="95" column="8" vertical-scroll-proportion="0.5611038" horizontal-scroll-proportion="0.06565064" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/IWizardManager.java" line="26" column="17" vertical-scroll-proportion="0.35742444" horizontal-scroll-proportion="0.13950762" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardAction.java" line="78" column="0" vertical-scroll-proportion="-1.6911958" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardConstants.java" line="56" column="0" vertical-scroll-proportion="0.892247" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardForm.java" line="33" column="33" vertical-scroll-proportion="-1.8291721" horizontal-scroll-proportion="0.2708089" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/wizardaction.xml" line="13" column="7" vertical-scroll-proportion="0.28383705" horizontal-scroll-proportion="0.057444315" /> </history> <open-files> ! <source-position-entry url="file://$PROJECT_DIR$/war/crudaction-lite-list.jsp" line="3" column="0" vertical-scroll-proportion="-0.5755585" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/index.xml" line="95" column="8" vertical-scroll-proportion="0.5611038" horizontal-scroll-proportion="0.06565064" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/dialogaction.xml" line="0" column="0" vertical-scroll-proportion="0.0" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/wizardaction.xml" line="13" column="7" vertical-scroll-proportion="0.28383705" horizontal-scroll-proportion="0.057444315" selected="true" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardForm.java" line="33" column="33" vertical-scroll-proportion="-1.8291721" horizontal-scroll-proportion="0.2708089" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/IWizardManager.java" line="26" column="17" vertical-scroll-proportion="0.35742444" horizontal-scroll-proportion="0.13950762" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/dialogaction-logincomponentsample.xml" line="20" column="0" vertical-scroll-proportion="0.44678056" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs/crudaction.xml" line="14" column="95" vertical-scroll-proportion="0.31274638" horizontal-scroll-proportion="0.7796014" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardAction.java" line="78" column="0" vertical-scroll-proportion="-1.6911958" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard/WizardConstants.java" line="56" column="0" vertical-scroll-proportion="0.892247" horizontal-scroll-proportion="0.0" /> </open-files> </component> <component name="ToolWindowManager"> ! <frame x="-4" y="-4" width="1288" height="975" extended-state="0" /> ! <editor active="true" /> <layout> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" /> ! <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="2" /> <window_info id="Hierarchy" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.24839228" order="3" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="7" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="0" /> ! <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.2570281" order="0" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="3" /> ! <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.24738955" order="1" /> ! <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25730994" order="1" /> <window_info id="Messages" active="false" anchor="bottom" auto_hide="true" internal_type="sliding" type="sliding" visible="false" weight="0.33" order="8" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="6" /> --- 3,82 ---- <component name="FileEditorManager"> <history> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/homeclassic.jsp" line="4" column="0" vertical-scroll-proportion="0.09018568" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/logoff.jsp" line="6" column="16" vertical-scroll-proportion="0.13527851" horizontal-scroll-proportion="0.1322314" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/home.jsp" line="4" column="0" vertical-scroll-proportion="0.09264305" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/error.jsp" line="23" column="0" vertical-scroll-proportion="0.53269756" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/memory/MemoryDatabasePlugIn.java" line="49" column="20" vertical-scroll-proportion="1.1348774" horizontal-scroll-proportion="0.16528925" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/memory/MemorySubscription.java" line="32" column="19" vertical-scroll-proportion="0.7411444" horizontal-scroll-proportion="0.1570248" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/memory/MemoryUserDatabase.java" line="0" column="0" vertical-scroll-proportion="0.0" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/ExpiredPasswordException.java" line="29" column="13" vertical-scroll-proportion="0.67166215" horizontal-scroll-proportion="0.10743801" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/Constants.java" line="4" column="0" vertical-scroll-proportion="0.09018568" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/actions/DialogAction.java" line="429" column="0" vertical-scroll-proportion="0.6352785" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/HomeAction.java" line="179" column="0" vertical-scroll-proportion="0.23569483" horizontal-scroll-proportion="0.0" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/business/User.java" line="157" column="22" vertical-scroll-proportion="0.8188011" horizontal-scroll-proportion="0.18181819" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/memory/MemoryUser.java" line="273" column="22" vertical-scroll-proportion="0.33242506" horizontal-scroll-proportion="0.18181819" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/subscriptions.jsp" line="61" column="49" vertical-scroll-proportion="0.71147543" horizontal-scroll-proportion="0.40495867" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/actions/crud/CRUDForm.java" line="73" column="16" vertical-scroll-proportion="1.5803279" horizontal-scroll-proportion="0.1322314" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/SubscriptionAction.java" line="40" column="13" vertical-scroll-proportion="0.6747312" horizontal-scroll-proportion="0.10743801"> <folding> <element signature="imports" expanded="true" /> </folding> </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/LogonAction.java" line="265" column="0" vertical-scroll-proportion="1.25" horizontal-scroll-proportion="0.0"> <folding> <element signature="imports" expanded="true" /> </folding> </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/SubscriptionForm.java" line="45" column="13" vertical-scroll-proportion="0.6747312" horizontal-scroll-proportion="0.10743801"> ! <folding> ! <element signature="imports" expanded="true" /> ! </folding> ! </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/RegistrationForm.java" line="23" column="13" vertical-scroll-proportion="0.45698926" horizontal-scroll-proportion="0.10743801" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/embedded/embedded_0002dchild_0002dlogin_jsp.java" line="11" column="13" vertical-scroll-proportion="0.3655914" horizontal-scroll-proportion="0.10743801" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/WEB-INF/struts-config.xml" line="11" column="44" vertical-scroll-proportion="0.50268817" horizontal-scroll-proportion="0.36363637" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/crud/CRUDFormSample.java" line="109" column="47" vertical-scroll-proportion="1.1451613" horizontal-scroll-proportion="0.38842976" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/subscription.jsp" line="3" column="45" vertical-scroll-proportion="0.13709678" horizontal-scroll-proportion="0.37190083" /> ! <source-position-entry url="file://P:/Tomcat4-1-31/work/Standalone/localhost/sd/mailreaderpages/subscription_jsp.java" line="89" column="141" vertical-scroll-proportion="0.2715054" horizontal-scroll-proportion="0.9752066" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/actions/crud/ICRUDForm.java" line="58" column="69" vertical-scroll-proportion="1.0053763" horizontal-scroll-proportion="0.57024795" /> </history> <open-files> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/LogonAction.java" line="265" column="0" vertical-scroll-proportion="1.25" horizontal-scroll-proportion="0.0"> ! <folding> ! <element signature="imports" expanded="true" /> ! </folding> ! </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/SubscriptionAction.java" line="40" column="13" vertical-scroll-proportion="0.6747312" horizontal-scroll-proportion="0.10743801"> ! <folding> ! <element signature="imports" expanded="true" /> ! </folding> ! </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/SubscriptionForm.java" line="45" column="13" vertical-scroll-proportion="0.6747312" horizontal-scroll-proportion="0.10743801"> ! <folding> ! <element signature="imports" expanded="true" /> ! </folding> ! </source-position-entry> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/RegistrationForm.java" line="23" column="13" vertical-scroll-proportion="0.45698926" horizontal-scroll-proportion="0.10743801" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/embedded/embedded_0002dchild_0002dlogin_jsp.java" line="11" column="13" vertical-scroll-proportion="0.3655914" horizontal-scroll-proportion="0.10743801" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/WEB-INF/struts-config.xml" line="11" column="44" vertical-scroll-proportion="0.50268817" horizontal-scroll-proportion="0.36363637" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/crud/CRUDFormSample.java" line="109" column="47" vertical-scroll-proportion="1.1451613" horizontal-scroll-proportion="0.38842976" /> ! <source-position-entry url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/actions/crud/ICRUDForm.java" line="58" column="69" vertical-scroll-proportion="1.0053763" horizontal-scroll-proportion="0.57024795" selected="true" /> ! <source-position-entry url="file://$PROJECT_DIR$/war/mailreaderpages/subscription.jsp" line="3" column="45" vertical-scroll-proportion="0.13709678" horizontal-scroll-proportion="0.37190083" /> ! <source-position-entry url="file://P:/Tomcat4-1-31/work/Standalone/localhost/sd/mailreaderpages/subscription_jsp.java" line="89" column="141" vertical-scroll-proportion="0.2715054" horizontal-scroll-proportion="0.9752066" /> </open-files> </component> <component name="ToolWindowManager"> ! <frame x="-4" y="-4" width="1288" height="948" extended-state="7" /> ! <editor active="false" /> <layout> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" /> ! <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.4311594" order="2" /> <window_info id="Hierarchy" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.24839228" order="3" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="7" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="0" /> ! <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.261254" order="0" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="3" /> ! <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.24517685" order="1" /> ! <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.5120773" order="1" /> <window_info id="Messages" active="false" anchor="bottom" auto_hide="true" internal_type="sliding" type="sliding" visible="false" weight="0.33" order="8" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="6" /> *************** *** 160,164 **** </component> <component name="DaemonCodeAnalyzer"> ! <disable_hints /> </component> <component name="StructureViewFactory"> --- 176,182 ---- </component> <component name="DaemonCodeAnalyzer"> ! <disable_hints> ! <file url="file://$PROJECT_DIR$/src/net/jspcontrols/mailreader/RegistrationForm.java" /> ! </disable_hints> </component> <component name="StructureViewFactory"> *************** *** 265,280 **** <navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="true" autoscrollToSource="false" splitterProportion="0.7222222" /> <view id="ProjectPane"> ! <expanded_node type="directory" url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions/wizard" /> <expanded_node type="directory" url="file://$PROJECT_DIR$/src" /> ! <expanded_node type="directory" url="file://C:/strutsapps/struts-site/src/documentation/content" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/sf/dialogs/actions" /> ! <expanded_node type="directory" url="file://C:/strutsapps/struts-site/src/documentation" /> <expanded_node type="directory" url="file://$PROJECT_DIR$" /> <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net" /> ! <expanded_node type="directory" url="file://C:/strutsapps/struts-site/src/documentation/content/xdocs/strutsdialogs" /> ! <expanded_node type="directory" url="file://C:/strutsapps/struts-site/src" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/sf/dialogs" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/sf" /> </view> <view id="SourcepathPane" /> --- 283,294 ---- <navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="true" autoscrollToSource="false" splitterProportion="0.7222222" /> <view id="ProjectPane"> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/embedded" /> <expanded_node type="directory" url="file://$PROJECT_DIR$/src" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples/crud" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs/samples" /> <expanded_node type="directory" url="file://$PROJECT_DIR$" /> + <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/jspcontrols" /> <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net" /> ! <expanded_node type="directory" url="file://$PROJECT_DIR$/src/net/jspcontrols/dialogs" /> </view> <view id="SourcepathPane" /> |
From: <jm...@us...> - 2005-09-23 06:38:12
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/src/net/jspcontrols/dialogs/actions Modified Files: DialogAction.java DialogConstants.java DialogRuleSet.java SelectAction.java Log Message: Added MailReader Demo; Added component RuleSet Index: DialogAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DialogAction.java 4 Aug 2005 07:39:43 -0000 1.2 --- DialogAction.java 23 Sep 2005 06:37:56 -0000 1.3 *************** *** 231,234 **** --- 231,242 ---- /** + * Returns suffix, used for action mapping. Default suffix is ".do" + * Needed to properly setup location for dialog reloading. + */ + protected String getActionSuffix() { + return ".do"; + } + + /** * Returns true if request is considered "input" request. By convention * dialog input is sent via POST, result page is loaded via GET. *************** *** 288,291 **** --- 296,329 ---- /** + * Returns the method name, given a prefix and a request object. + * This is a helper method, which should not normally be redefined + * by a subclass. + * + * @param mapping The ActionMapping used to select this instance + * @param form The optional ActionForm bean for this request (if any) + * @param request The HTTP request we are processing + * @param response The HTTP response we are creating + * @param parameter The <code>ActionMapping</code> parameter's name + * Contains prefix of submit button names, or several prefixes + * separated by comma or semicolon. + * + * @return The handler method name. + */ + protected String getMethodName(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response, + String parameter) + throws Exception { + + // If event prefix is not provided in action mapping parameter, + // use default dialog prefix + if (parameter == null || parameter.length() == 0) { + parameter = DialogConstants.DIALOG_EVENT_KEY; + } + return super.getMethodName(mapping, form, request, response, parameter); + } + + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). *************** *** 330,344 **** } ! // Handler methods usually return valid ActionForward object. ! // Null is used to signify that On the other hand, null If mapping with DialogConstants.DIALOG_RELOAD_KEY is not defined, ! // build ActionForward object and redirect to self. if (actionForward == null ) { ! log.info("Action " + mapping.getPath() + " returned null as forward object"); return null; } else if (actionForward == EventForward.DIALOG_RELOAD) { ! // Use reload path if defined in <dialog input=... /> ! if (mapping instanceof DialogMapping && mapping.getInput() != null) { return new EventForward(mapping.getInput()); --- 368,383 ---- } ! // If mapping with DialogConstants.DIALOG_RELOAD_KEY is not defined, ! // build ActionForward object and redirect to self. Works if ! // actions use default ".do" suffix. if (actionForward == null ) { ! log.debug("Action did not return a forward object"); return null; } else if (actionForward == EventForward.DIALOG_RELOAD) { ! // Use reload path if defined in <component input=... /> ! if (mapping instanceof DialogMapping && ! mapping.getInput() != null) { return new EventForward(mapping.getInput()); *************** *** 403,404 **** --- 442,450 ---- } } + + //System.out.println("Dialog reload mapping: " + reloadPath); + //System.out.println("request," + + // " request.getServletPath(): " + request.getServletPath() + + // "\n, request.getRequestURI(): " + request.getRequestURI() + + // "\n, request.getPathInfo(): " + request.getPathInfo() + + // "\n, request.getQueryString(): " + request.getQueryString()); Index: DialogConstants.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogConstants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DialogConstants.java 11 Jul 2005 07:13:06 -0000 1.1 --- DialogConstants.java 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 60,62 **** --- 60,73 ---- */ String DIALOG_DONE_KEY = "DIALOG-DONE"; + + /** + * The default mapping for failed dialog + */ + String DIALOG_FAILURE = "DIALOG-FAILURE"; + + /** + * The default mapping for succeeded dialog + */ + String DIALOG_SUCCESS = "DIALOG-SUCCESS"; + } Index: DialogRuleSet.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/DialogRuleSet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DialogRuleSet.java 4 Aug 2005 07:39:44 -0000 1.1 --- DialogRuleSet.java 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 27,94 **** digester.addObjectCreate ! ("struts-config/action-mappings/dialog", "net.jspcontrols.dialogs.actions.DialogMapping"); digester.addSetProperties ! ("struts-config/action-mappings/dialog"); digester.addSetNext ! ("struts-config/action-mappings/dialog", "addActionConfig", "org.apache.struts.config.ActionConfig"); digester.addSetProperty ! ("struts-config/action-mappings/dialog/set-property", "property", "value"); digester.addObjectCreate ! ("struts-config/action-mappings/dialog/exception", "org.apache.struts.config.ExceptionConfig", "className"); digester.addSetProperties ! ("struts-config/action-mappings/dialog/exception"); digester.addSetNext ! ("struts-config/action-mappings/dialog/exception", "addExceptionConfig", "org.apache.struts.config.ExceptionConfig"); digester.addSetProperty ! ("struts-config/action-mappings/dialog/exception/set-property", "property", "value"); // digester.addFactoryCreate ! // ("struts-config/action-mappings/dialog/event", // new DialogForwardFactory()); digester.addObjectCreate ! ("struts-config/action-mappings/dialog/event", "net.jspcontrols.dialogs.actions.EventForward"); digester.addSetProperties ! ("struts-config/action-mappings/dialog/event"); digester.addSetNext ! ("struts-config/action-mappings/dialog/event", "addForwardConfig", "net.jspcontrols.dialogs.actions.EventForward"); digester.addSetProperty ! ("struts-config/action-mappings/action/event/set-property", "property", "value"); digester.addObjectCreate ! ("struts-config/action-mappings/dialog/render", "net.jspcontrols.dialogs.actions.RenderForward"); digester.addSetProperties ! ("struts-config/action-mappings/dialog/render"); digester.addSetNext ! ("struts-config/action-mappings/dialog/render", "addForwardConfig", "net.jspcontrols.dialogs.actions.RenderForward"); digester.addSetProperty ! ("struts-config/action-mappings/action/render/set-property", "property", "value"); --- 27,94 ---- digester.addObjectCreate ! ("struts-config/action-mappings/component", "net.jspcontrols.dialogs.actions.DialogMapping"); digester.addSetProperties ! ("struts-config/action-mappings/component"); digester.addSetNext ! ("struts-config/action-mappings/component", "addActionConfig", "org.apache.struts.config.ActionConfig"); digester.addSetProperty ! ("struts-config/action-mappings/component/set-property", "property", "value"); digester.addObjectCreate ! ("struts-config/action-mappings/component/exception", "org.apache.struts.config.ExceptionConfig", "className"); digester.addSetProperties ! ("struts-config/action-mappings/component/exception"); digester.addSetNext ! ("struts-config/action-mappings/component/exception", "addExceptionConfig", "org.apache.struts.config.ExceptionConfig"); digester.addSetProperty ! ("struts-config/action-mappings/component/exception/set-property", "property", "value"); // digester.addFactoryCreate ! // ("struts-config/action-mappings/component/event", // new DialogForwardFactory()); digester.addObjectCreate ! ("struts-config/action-mappings/component/event", "net.jspcontrols.dialogs.actions.EventForward"); digester.addSetProperties ! ("struts-config/action-mappings/component/event"); digester.addSetNext ! ("struts-config/action-mappings/component/event", "addForwardConfig", "net.jspcontrols.dialogs.actions.EventForward"); digester.addSetProperty ! ("struts-config/action-mappings/component/event/set-property", "property", "value"); digester.addObjectCreate ! ("struts-config/action-mappings/component/render", "net.jspcontrols.dialogs.actions.RenderForward"); digester.addSetProperties ! ("struts-config/action-mappings/component/render"); digester.addSetNext ! ("struts-config/action-mappings/component/render", "addForwardConfig", "net.jspcontrols.dialogs.actions.RenderForward"); digester.addSetProperty ! ("struts-config/action-mappings/component/render/set-property", "property", "value"); Index: SelectAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/SelectAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SelectAction.java 4 Aug 2005 07:39:44 -0000 1.2 --- SelectAction.java 23 Sep 2005 06:37:56 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForward; + import org.apache.struts.Globals; import javax.servlet.http.HttpServletResponse; *************** *** 179,182 **** --- 180,191 ---- /** + * Returns the cancel key.Override this method if you want to use prefix + * different from "DIALOG-EVENT-CANCEL" + */ + public String getCancelKey() { + return getInitKey() + "-CANCEL"; + } + + /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). *************** *** 235,239 **** * not used by <code>SelectAction</code> * ! * @return The handler method name. */ protected String getMethodName(ActionMapping mapping, --- 244,250 ---- * not used by <code>SelectAction</code> * ! * @return The handler method name if event recognized, or null if event ! * is notrecognized. For unrecognized event DispatchAction will ! * call "unspecified" handler. */ protected String getMethodName(ActionMapping mapping, *************** *** 246,249 **** --- 257,264 ---- // "parameter" is not required now; can use standard prefix or // redefine it with getInitKey() method + + + + String buttonPrefix = parameter != null ? parameter : getInitKey(); *************** *** 278,311 **** } ! // Event not recognized, DispatchAction will call "unspecified" method. ! if (keyName == null) { ! return null; ! } ! // Build param name to method map if it is not built yet buildLookupMap(); ! // Pull out a method name for request parameter Object mappedObj = keyMethodMap.get(keyName); - if (mappedObj == null || !(mappedObj instanceof String)) { ! // Uncomment this, if this action is included in ! // official Struts bundle; make sure that ! // LocationStrings.properties contains ! // dispatch.keyMethodMap.notstring key ! // String message = messages.getMessage( ! // "dispatch.keyMethodMap.notstring", ! // mapping.getPath(), keyName); ! // Delete this if action is included in Struts bundle ! String message = "Dispatch action " + mapping.getPath() + ! " returned null or non-string method name" + ! " for request key " + keyName; ! throw new ServletException(message); } ! // Method found ! return (String) mappedObj; } --- 293,336 ---- } ! // Event not recognized ! if (keyName == null) return null; ! // Build map of param name to method, if it is not has been built yet buildLookupMap(); ! // Look up method name for request parameter Object mappedObj = keyMethodMap.get(keyName); ! // Method recognized, return method name ! if (mappedObj != null && mappedObj instanceof String) { ! return (String) mappedObj; ! } ! // Check for dialog cancel event. If yes, use standard ! // cancelled() method and patch isCancelled() to return true. ! // If standard RequestProcessor is used, then form bean is ! // already populated at this point. To prevent form bean from ! // populating use standard <html:cancel/> button ! if (keyName.equals(getCancelKey())) { ! request.setAttribute(Globals.CANCEL_KEY, Boolean.TRUE); ! return "cancelled"; } ! // Uncomment this, if this action is included in ! // official Struts bundle; make sure that ! // LocationStrings.properties contains ! // dispatch.keyMethodMap.notstring key ! // ! // String message = messages.getMessage( ! // "dispatch.keyMethodMap.notstring", ! // mapping.getPath(), keyName); ! ! // Delete this inline message if action is included in Struts bundle ! String message = "Dispatch action " + mapping.getPath() + ! " returned null or non-string method name" + ! " for request key " + keyName; ! ! throw new ServletException(message); } |
From: <jm...@us...> - 2005-09-23 06:38:12
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/crud In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/src/net/jspcontrols/dialogs/samples/crud Modified Files: CRUDFormSample.java Log Message: Added MailReader Demo; Added component RuleSet Index: CRUDFormSample.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/samples/crud/CRUDFormSample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CRUDFormSample.java 4 Aug 2005 07:45:18 -0000 1.1 --- CRUDFormSample.java 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 36,40 **** * @author Michael Jouravlev */ ! public class CRUDFormSample extends CRUDForm implements ICRUDForm { /** --- 36,40 ---- * @author Michael Jouravlev */ ! public class CRUDFormSample extends CRUDForm /*implements ICRUDForm */ { /** *************** *** 108,112 **** // New item is ready to be edited ! changeCrudUIMode(ICRUDForm.CRUD_UI_MODE_CREATE); // No errors creating new item --- 108,112 ---- // New item is ready to be edited ! changeCrudUIMode(ICRUDForm.CRUD_UI_MODE_EDIT); // No errors creating new item *************** *** 119,123 **** */ public ActionMessages crudDuplicate() { ! return initLoadedItem(true, "New Item", ICRUDForm.CRUD_UI_MODE_CREATE); } --- 119,123 ---- */ public ActionMessages crudDuplicate() { ! return initLoadedItem(true, "New Item", ICRUDForm.CRUD_UI_MODE_EDIT); } *************** *** 171,174 **** --- 171,189 ---- /** + * Resets content of existing form. This method usually returns null. + * @return non-empty ActionMessages object if could not reset form. + */ + public ActionMessages crudReset() { + // Reset edited data + if (ICRUDForm.CRUD_UI_MODE_EDIT.equals(getCrudUIMode())) { + intValue = null; + stringValue = null; + } + + // No errors creating new item + return null; + } + + /** * Closes preview from of existing item. * @return always null *************** *** 197,203 **** // Try to persist item ! if (ICRUDForm.CRUD_UI_MODE_EDITABLE.equals(getCrudUIMode()) || ! ICRUDForm.CRUD_UI_MODE_EDIT.equals(getCrudUIMode()) || ! ICRUDForm.CRUD_UI_MODE_CREATE.equals(getCrudUIMode())) { // Test business rules: fail persist if num value is too low if (Integer.parseInt(intValue) < 150) { --- 212,216 ---- // Try to persist item ! if (ICRUDForm.CRUD_UI_MODE_EDIT.equals(getCrudUIMode())) { // Test business rules: fail persist if num value is too low if (Integer.parseInt(intValue) < 150) { |
From: <jm...@us...> - 2005-09-23 06:38:12
|
Update of /cvsroot/struts/dialogs/war/sample-logincomponent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/war/sample-logincomponent Modified Files: logincomponent-login.jsp logincomponent-logout.jsp userpage.jsp Log Message: Added MailReader Demo; Added component RuleSet Index: logincomponent-login.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-logincomponent/logincomponent-login.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** logincomponent-login.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- logincomponent-login.jsp 23 Sep 2005 06:37:57 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: logincomponent-logout.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-logincomponent/logincomponent-logout.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** logincomponent-logout.jsp 4 Aug 2005 07:39:48 -0000 1.1 --- logincomponent-logout.jsp 23 Sep 2005 06:37:57 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: userpage.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-logincomponent/userpage.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** userpage.jsp 4 Aug 2005 07:39:48 -0000 1.1 --- userpage.jsp 23 Sep 2005 06:37:57 -0000 1.2 *************** *** 1,10 **** <!-- ! Easy Wizard 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" %> <% --- 1,11 ---- <!-- ! Struts Dialogs Example Author: Michael Jouravlev, 2004-2005 --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <% |
From: <jm...@us...> - 2005-09-23 06:38:12
|
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/crud In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/src/net/jspcontrols/dialogs/actions/crud Modified Files: CRUDAction.java CRUDConstants.java CRUDForm.java ICRUDForm.java Log Message: Added MailReader Demo; Added component RuleSet Index: CRUDAction.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/crud/CRUDAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CRUDAction.java 4 Aug 2005 07:39:44 -0000 1.2 --- CRUDAction.java 23 Sep 2005 06:37:56 -0000 1.3 *************** *** 103,131 **** Map map = new HashMap(); - // - // Events external to CRUDaction; initialize business data - // - - // Create new item map.put(getInitKey()+"-CREATE", "onCreate"); - // Create new item from existing one map.put(getInitKey()+"-DUPLICATE", "onDuplicate"); - // Update existing item map.put(getInitKey()+"-UPDATE", "onEdit"); - // View existing item map.put(getInitKey()+"-VIEW", "onPreview"); ! // ! // Events, which are triggered within CRUDAction for current item ! // ! ! // Delete current item ! map.put("DIALOG-EVENT-DELETE", "onDelete"); ! // Cancel viewing or editing of current item ! map.put("DIALOG-EVENT-CANCEL", "onCancel"); ! // Persist changes of current item ! map.put("DIALOG-EVENT-SAVE", "onSave"); ! // Close preview mode of existing item ! map.put("DIALOG-EVENT-CLOSE", "onClose"); return map; --- 103,116 ---- Map map = new HashMap(); map.put(getInitKey()+"-CREATE", "onCreate"); map.put(getInitKey()+"-DUPLICATE", "onDuplicate"); map.put(getInitKey()+"-UPDATE", "onEdit"); map.put(getInitKey()+"-VIEW", "onPreview"); ! map.put(getInitKey()+"-DELETE", "onDelete"); ! map.put(getInitKey()+"-CANCEL", "onCancel"); ! map.put(getInitKey()+"-RESET", "onReset"); ! map.put(getInitKey()+"-SAVE", "onSave"); ! map.put(getInitKey()+"-CLOSE", "onClose"); return map; *************** *** 306,309 **** --- 291,318 ---- /** + * Resets form content. This method calls associated action form + * to perform needed cleanup. No messages are generated for this event. + * @return ActionForward object, identifying the target location. + * Created using CRUDConstants.MAPPING_ON_RESET mapping. + * @see CRUDConstants#MAPPING_ON_RESET_SUCCESS + * @see CRUDConstants#MAPPING_ON_RESET_FAILURE + */ + public ActionForward onReset (ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + ICRUDForm crudForm = (ICRUDForm) form; + ActionMessages messages = crudForm.crudReset(); + + if ((messages == null) || messages.isEmpty()) { + return mapping.findForward(CRUDConstants.MAPPING_ON_RESET_SUCCESS); + } else { + HttpSession session = request.getSession(); + session.setAttribute(Globals.ERROR_KEY, messages); + return mapping.findForward(CRUDConstants.MAPPING_ON_RESET_FAILURE); + } + } + + /** * Closes business item preview page. This method calls associated * action form to perform needed cleanup. No messages are generated *************** *** 410,416 **** --- 419,432 ---- HttpServletRequest request, HttpServletResponse response) throws Exception { + if (form == null) { + throw new IllegalArgumentException("Form bean is not defined"); + } // CRUDAction works with form beans, implementing ICRUDForm ICRUDForm crudForm = (ICRUDForm) form; String uiMode = crudForm.getCrudUIMode(); + if (uiMode == null) { + throw new IllegalStateException( + "UI Mode is not set in form " + form.getClass().getName()); + } return mapping.findForward(uiMode); } Index: CRUDConstants.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/crud/CRUDConstants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CRUDConstants.java 11 Jul 2005 07:13:12 -0000 1.1 --- CRUDConstants.java 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 69,72 **** --- 69,80 ---- String MAPPING_ON_CANCEL = "ON-CANCEL"; /** + * Resets content of existing form + */ + String MAPPING_ON_RESET_SUCCESS = "ON-RESET-SUCCESS"; + /** + * Failed to reset content of existing form + */ + String MAPPING_ON_RESET_FAILURE = "ON-RESET-FAILURE"; + /** * Closed preview of existing BO */ Index: CRUDForm.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/crud/CRUDForm.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CRUDForm.java 4 Aug 2005 07:39:44 -0000 1.2 --- CRUDForm.java 23 Sep 2005 06:37:56 -0000 1.3 *************** *** 56,63 **** } - public String getCRUDUIMode() { - return this.uiMode; - } - /** * Constructs CRUD form. UI Mode must be set to CRUD_UI_MODE_INACTIVE, --- 56,59 ---- Index: ICRUDForm.java =================================================================== RCS file: /cvsroot/struts/dialogs/src/net/jspcontrols/dialogs/actions/crud/ICRUDForm.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ICRUDForm.java 4 Aug 2005 07:39:44 -0000 1.2 --- ICRUDForm.java 23 Sep 2005 06:37:56 -0000 1.3 *************** *** 51,61 **** * <li>Save (store -> CRUD-ON-STORE-SUCCESS/CRUD-ON-STORE-ERROR) * </ul> */ - public static final String CRUD_UI_MODE_EDITABLE = "CRUD-UI-MODE-EDITABLE"; - - public static final String CRUD_UI_MODE_EDIT = "CRUD-UI-MODE-EDIT"; ! public static final String CRUD_UI_MODE_CREATE = "CRUD-UI-MODE-CREATE"; /** --- 51,87 ---- * <li>Save (store -> CRUD-ON-STORE-SUCCESS/CRUD-ON-STORE-ERROR) * </ul> + * For finer control of edit state see <code>CRUD_UI_MODE_UPDATE</code> + * and <code>CRUD_UI_MODE_NEW</code>. Whenever one of these two states + * is set, this state must be true as well. + * @see ICRUDForm#CRUD_UI_MODE_UPDATE + * @see ICRUDForm#CRUD_UI_MODE_NEW */ public static final String CRUD_UI_MODE_EDIT = "CRUD-UI-MODE-EDIT"; ! /** ! * Creating and editing of a new item. Corresponding JSP should allow ! * to save data. Operations allowed in this mode: ! * <ul> ! * <li>Cancel (cancel -> CRUD-ON-CANCEL) ! * <li>Save (store -> CRUD-ON-STORE-SUCCESS/CRUD-ON-STORE-ERROR) ! * </ul> ! * @see ICRUDForm#CRUD_UI_MODE_UPDATE ! * @see ICRUDForm#CRUD_UI_MODE_EDIT ! */ ! public static final String CRUD_UI_MODE_NEW = "CRUD-UI-MODE-NEW"; ! ! /** ! * Editing an existing item. Business data must have been loaded from ! * persistent storage. Corresponding JSP should allow to change and save ! * data. Operations allowed in this mode: ! * <ul> ! * <li>Delete (delete -> CRUD-ON-DELETE-SUCCESS/CRUD-ON-DELETE-ERROR) ! * <li>Cancel (cancel -> CRUD-ON-CANCEL) ! * <li>Save (store -> CRUD-ON-STORE-SUCCESS/CRUD-ON-STORE-ERROR) ! * </ul> ! * @see ICRUDForm#CRUD_UI_MODE_EDIT ! * @see ICRUDForm#CRUD_UI_MODE_NEW ! */ ! public static final String CRUD_UI_MODE_UPDATE = "CRUD-UI-MODE-UPDATE"; /** *************** *** 85,88 **** --- 111,115 ---- * @param mode UI mode for this action form * @see ICRUDForm#CRUD_UI_MODE_INACTIVE + * @see ICRUDForm#CRUD_UI_MODE_EDIT * @see ICRUDForm#CRUD_UI_MODE_READONLY */ *************** *** 92,95 **** --- 119,123 ---- * Returns current UI mode for this action form. * @see ICRUDForm#CRUD_UI_MODE_INACTIVE + * @see ICRUDForm#CRUD_UI_MODE_EDIT * @see ICRUDForm#CRUD_UI_MODE_READONLY */ *************** *** 140,143 **** --- 168,177 ---- /** + * Resets content of existing form. This method usually returns null. + * @return non-empty ActionMessages object if could not reset form. + */ + ActionMessages crudReset(); + + /** * Closes preview from of existing item. This method usually returns null. * @return non-empty ActionMessages object if could not close view. |
Update of /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader/memory In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/src/net/jspcontrols/mailreader/memory Added Files: MemoryDatabasePlugIn.java MemorySubscription.java MemoryUser.java MemoryUserDatabase.java UserDatabase.java Log Message: Added MailReader Demo; Added component RuleSet --- NEW FILE: MemoryDatabasePlugIn.java --- /* * $Header: /cvsroot/struts/dialogs/src/net/jspcontrols/mailreader/memory/MemoryDatabasePlugIn.java,v 1.1 2005/09/23 06:37:57 jmikus Exp $ * $Revision: 1.1 $ * $Date: 2005/09/23 06:37:57 $ * * Copyright 2000-2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.jspcontrols.mailreader.memory; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import javax.servlet.ServletException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.ActionServlet; import org.apache.struts.action.PlugIn; import org.apache.struts.config.ModuleConfig; import net.jspcontrols.mailreader.Constants; /** * <p><strong>MemoryDatabasePlugIn</strong> initializes and finalizes the * persistent storage of User and Subscription information for the Struts * Demonstration Application, using an in-memory database backed by an * XML file.</p> * * <p><strong>IMPLEMENTATION WARNING</strong> - If this web application is run * from a WAR file, or in another environment where reading and writing of the * web application resource is impossible, the initial contents will be copied * to a file in the web application temporary directory provided by the * container. This is for demonstration purposes only - you should * <strong>NOT</strong> assume that files written here will survive a restart * of your servlet container.</p> * * @version $Revision: 1.1 $ $Date: 2005/09/23 06:37:57 $ */ public final class MemoryDatabasePlugIn implements PlugIn { // ----------------------------------------------------- Instance Variables /** * The {@link MemoryUserDatabase} object we construct and make available. */ private MemoryUserDatabase database = null; /** * Logging output for this plug in instance. */ private Log log = LogFactory.getLog(this.getClass()); /** * The {@link ActionServlet} owning this application. */ private ActionServlet servlet = null; // ------------------------------------------------------------- Properties /** * The web application resource path of our persistent database * storage file. */ private String pathname = "/WEB-INF/database.xml"; public String getPathname() { return (this.pathname); } public void setPathname(String pathname) { this.pathname = pathname; } // --------------------------------------------------------- PlugIn Methods /** * Gracefully shut down this database, releasing any resources * that were allocated at initialization. */ public void destroy() { log.info("Finalizing memory database plug in"); if (database != null) { try { database.close(); } catch (Exception e) { log.error("Closing memory database", e); } } servlet.getServletContext().removeAttribute(Constants.DATABASE_KEY); database = null; servlet = null; database = null; } /** * Initialize and load our initial database from persistent storage. * * @param servlet The ActionServlet for this web application * @param config The ApplicationConfig for our owning module * * @exception ServletException if we cannot configure ourselves correctly */ public void init(ActionServlet servlet, ModuleConfig config) throws ServletException { log.info("Initializing memory database plug in from '" + pathname + "'"); // Remember our associated configuration and servlet this.servlet = servlet; // Construct a new database and make it available database = new MemoryUserDatabase(); try { String path = calculatePath(); if (log.isDebugEnabled()) { log.debug(" Loading database from '" + path + "'"); } database.setPathname(path); database.open(); } catch (Exception e) { log.error("Opening memory database", e); throw new ServletException("Cannot load database from '" + pathname + "'", e); } // Make the initialized database available servlet.getServletContext().setAttribute(Constants.DATABASE_KEY, database); } // --------------------------------------------------------- Public Methods // ------------------------------------------------------ Protected Methods // -------------------------------------------------------- Private Methods /** * Calculate and return an absolute pathname to the XML file to contain * our persistent storage information. * * @exception Exception if an input/output error occurs */ private String calculatePath() throws Exception { // Can we access the database via file I/O? String path = servlet.getServletContext().getRealPath(pathname); if (path != null) { return (path); } // Does a copy of this file already exist in our temporary directory File dir = (File) servlet.getServletContext().getAttribute ("javax.servlet.context.tempdir"); File file = new File(dir, "struts-example-database.xml"); if (file.exists()) { return (file.getAbsolutePath()); } // Copy the static resource to a temporary file and return its path InputStream is = servlet.getServletContext().getResourceAsStream(pathname); BufferedInputStream bis = new BufferedInputStream(is, 1024); FileOutputStream os = new FileOutputStream(file); BufferedOutputStream bos = new BufferedOutputStream(os, 1024); byte buffer[] = new byte[1024]; while (true) { int n = bis.read(buffer); if (n <= 0) { break; } bos.write(buffer, 0, n); } bos.close(); bis.close(); return (file.getAbsolutePath()); } } --- NEW FILE: MemorySubscription.java --- /* * $Id: MemorySubscription.java,v 1.1 2005/09/23 06:37:57 jmikus Exp $ * * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.jspcontrols.mailreader.memory; import net.jspcontrols.mailreader.business.Subscription; import net.jspcontrols.mailreader.business.User; /** * <p>Concrete implementation of {@link net.jspcontrols.mailreader.business.Subscription} for an in-memory * database backed by an XML data file.</p> * * @version $Rev: 54929 $ $Date: 2005/09/23 06:37:57 $ * @since Struts 1.1 */ public final class MemorySubscription implements Subscription, Cloneable { // ----------------------------------------------------------- Constructors /** * <p>Construct a new Subscription associated with the specified * {@link net.jspcontrols.mailreader.business.User}. * * @param user The user with which we are associated * @param host The mail host for this subscription */ public MemorySubscription(MemoryUser user, String host) { super(); this.user = user; this.host = host; } // ----------------------------------------------------- Instance Variables /** * The mail host for this subscription. */ private String host = null; /** * The {@link net.jspcontrols.mailreader.business.User} with which we are associated. */ private MemoryUser user = null; // ------------------------------------------------------------- Properties /** * Should we auto-connect at startup time? */ private boolean autoConnect = false; public boolean getAutoConnect() { return (this.autoConnect); } public void setAutoConnect(boolean autoConnect) { this.autoConnect = autoConnect; } /** * The mail host for this subscription. */ public String getHost() { return (this.host); } public void setHost(String host) { this.host = host; } /** * The password (in clear text) for this subscription. */ private String password = null; public String getPassword() { return (this.password); } public void setPassword(String password) { this.password = password; } /** * The subscription type ("imap" or "pop3"). */ private String type = "imap"; public String getType() { return (this.type); } public void setType(String type) { this.type = type; } /** * The User owning this Subscription. */ public User getUser() { return (this.user); } /** * The username for this subscription. */ private String username = null; public String getUsername() { return (this.username); } public void setUsername(String username) { this.username = username; } // --------------------------------------------------------- Public Methods /** * Return a String representation of this object. */ public String toString() { StringBuffer sb = new StringBuffer("<subscription host=\""); sb.append(host); sb.append("\" autoConnect=\""); sb.append(autoConnect); sb.append("\""); if (password != null) { sb.append(" password=\""); sb.append(password); sb.append("\""); } if (type != null) { sb.append(" type=\""); sb.append(type); sb.append("\""); } if (username != null) { sb.append(" username=\""); sb.append(username); sb.append("\""); } sb.append(">"); return (sb.toString()); } public Object clone() throws CloneNotSupportedException { return (Subscription) super.clone(); } } --- NEW FILE: MemoryUser.java --- /* * $Id: MemoryUser.java,v 1.1 2005/09/23 06:37:57 jmikus Exp $ * * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.jspcontrols.mailreader.memory; import net.jspcontrols.mailreader.business.User; import net.jspcontrols.mailreader.business.Subscription; import java.util.HashMap; import java.util.Collection; /** * <p>Concrete implementation of {@link net.jspcontrols.mailreader.business.User} for an in-memory * database backed by an XML data file.</p> * * @version $Rev: 54929 $ $Date: 2005/09/23 06:37:57 $ * @since Struts 1.1 */ public final class MemoryUser implements User, Cloneable { // ----------------------------------------------------------- Constructors /** * <p>Construct a new User associated with the specified * {@link net.jspcontrols.mailreader.memory.UserDatabase}. * * @param database The user database with which we are associated * @param username The username of this user */ public MemoryUser(MemoryUserDatabase database, String username) { super(); this.database = database; this.username = username; } // ----------------------------------------------------- Instance Variables /** * The {@link net.jspcontrols.mailreader.memory.UserDatabase} with which we are associated. */ private MemoryUserDatabase database = null; /** * The {@link net.jspcontrols.mailreader.business.Subscription}s for this User, keyed by hostname. */ private HashMap subscriptions = new HashMap(); /** * The username for this user. */ private String username = null; // ------------------------------------------------------------- Properties /** * The {@link net.jspcontrols.mailreader.memory.UserDatabase} with which we are associated. */ public UserDatabase getDatabase() { return (this.database); } /** * The email address from which messages are sent. */ private String fromAddress = null; public String getFromAddress() { return (this.fromAddress); } public void setFromAddress(String fromAddress) { this.fromAddress = fromAddress; } /** * The full name of this user, included in from addresses. */ private String fullName = null; public String getFullName() { return (this.fullName); } public void setFullName(String fullName) { this.fullName = fullName; } /** * The password (in clear text). */ private String password = null; public String getPassword() { return (this.password); } public void setPassword(String password) { this.password = password; } /** * The EMAIL address to which replies should be sent. */ private String replyToAddress = null; public String getReplyToAddress() { return (this.replyToAddress); } public void setReplyToAddress(String replyToAddress) { this.replyToAddress = replyToAddress; } /** * Find and return all {@link net.jspcontrols.mailreader.business.Subscription}s associated with this user. * If there are none, a zero-length array is returned. */ public Subscription[] getSubscriptions() { synchronized (subscriptions) { Subscription results[] = new Subscription[subscriptions.size()]; return ((Subscription[]) subscriptions.values().toArray(results)); } } /** * The username (must be unique). */ public String getUsername() { return (this.username); } // --------------------------------------------------------- Public Methods /** * Create and return a new {@link net.jspcontrols.mailreader.business.Subscription} associated with this * User, for the specified host name. * * @param host Host name for which to create a subscription * * @exception IllegalArgumentException if the host name is not unique * for this user */ public Subscription createSubscription(String host) { synchronized (subscriptions) { if (subscriptions.get(host) != null) { throw new IllegalArgumentException("Duplicate host '" + host + "' for user '" + username + "'"); } MemorySubscription subscription = new MemorySubscription(this, host); synchronized (subscriptions) { subscriptions.put(host, subscription); } return (subscription); } } /** * Find and return the {@link net.jspcontrols.mailreader.business.Subscription} associated with the specified * host. If none is found, return <code>null</code>. * * @param host Host name to look up */ public Subscription findSubscription(String host) { synchronized (subscriptions) { return ((Subscription) subscriptions.get(host)); } } /** * Remove the specified {@link net.jspcontrols.mailreader.business.Subscription} from being associated * with this User. * * @param subscription Subscription to be removed * * @exception IllegalArgumentException if the specified subscription is not * associated with this User */ public void removeSubscription(Subscription subscription) { if (!(this == subscription.getUser())) { throw new IllegalArgumentException ("Subscription not associated with this user"); } synchronized (subscriptions) { subscriptions.remove(subscription.getHost()); } } /** * Return a String representation of this object. */ public String toString() { StringBuffer sb = new StringBuffer("<user username=\""); sb.append(username); sb.append("\""); if (fromAddress != null) { sb.append(" fromAddress=\""); sb.append(fromAddress); sb.append("\""); } if (fullName != null) { sb.append(" fullName=\""); sb.append(fullName); sb.append("\""); } if (password != null) { sb.append(" password=\""); sb.append(password); sb.append("\""); } if (replyToAddress != null) { sb.append(" replyToAddress=\""); sb.append(replyToAddress); sb.append("\""); } sb.append(">"); return (sb.toString()); } /** * Find and return all {@link net.jspcontrols.mailreader.business.Subscription}s associated with this user. * If there are none, a zero-length array is returned. */ public Collection getSubscriptionCollection() { return subscriptions.values(); } /** * Creates empty subscription object */ public Subscription createDetachedSubscription() { return new MemorySubscription(this, null); } /** * Obtains copy of subscription object */ public Subscription getDetachedSubscription(String host) { Subscription dbSubscription = findSubscription(host); if (dbSubscription != null) { try { return (Subscription) ((MemorySubscription)dbSubscription).clone(); } catch (CloneNotSupportedException e) { // No-op, will return null } } return null; } /** * Create and return a new {@link net.jspcontrols.mailreader.business.Subscription} associated with this * User, for the specified host name. * * @param subscription subscription to store * * @exception IllegalArgumentException if the host name is not unique * for this user */ public Subscription storeDetachedSubscription(Subscription subscription, boolean isNew) { String host = subscription.getHost(); synchronized (subscriptions) { if (isNew && subscriptions.get(host) != null) { throw new IllegalArgumentException("Duplicate host '" + host + "' for user '" + username + "'"); } // Add new subscription or update existing with the same host name subscriptions.put(host, subscription); return (subscription); } } /** * Setus username */ public void setUsername(String username) { this.username = username; } public Object clone() throws CloneNotSupportedException { return (User) super.clone(); } } --- NEW FILE: MemoryUserDatabase.java --- /* * $Id: MemoryUserDatabase.java,v 1.1 2005/09/23 06:37:57 jmikus Exp $ * * Copyright 2000-2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.jspcontrols.mailreader.memory; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.HashMap; import org.apache.commons.digester.Digester; import org.apache.commons.digester.ObjectCreationFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.xml.sax.Attributes; import net.jspcontrols.mailreader.business.User; import net.jspcontrols.mailreader.ExpiredPasswordException; import net.jspcontrols.mailreader.business.Subscription; /** * <p>Concrete implementation of {@link net.jspcontrols.mailreader.memory.UserDatabase} for an in-memory * database backed by an XML data file.</p> * * @version $Rev: 54929 $ $Date: 2005/09/23 06:37:57 $ * @since Struts 1.1 */ public class MemoryUserDatabase implements UserDatabase { // ----------------------------------------------------------- Constructors // ----------------------------------------------------- Instance Variables /** * Logging output for this user database instance. */ private Log log = LogFactory.getLog(this.getClass()); /** * The {@link net.jspcontrols.mailreader.business.User}s associated with this UserDatabase, keyed by username. */ private HashMap users = new HashMap(); // ------------------------------------------------------------- Properties /** * Absolute pathname to the persistent file we use for loading and storing * persistent data. */ private String pathname = null; private String pathnameOld = null; private String pathnameNew = null; public String getPathname() { return (this.pathname); } public void setPathname(String pathname) { this.pathname = pathname; pathnameOld = pathname + ".old"; pathnameNew = pathname + ".new"; } // --------------------------------------------------------- Public Methods // See interface for Javadoc public void close() throws Exception { save(); } // See interface for Javadoc public User createUser(String username) { synchronized (users) { if (users.get(username) != null) { throw new IllegalArgumentException("Duplicate user '" + username + "'"); } if (log.isTraceEnabled()) { log.trace("Creating user '" + username + "'"); } User user = createDetachedUser(username); synchronized (users) { users.put(username, user); } return (user); } } // See interface for Javadoc public User createDetachedUser(String username) { MemoryUser user = new MemoryUser(this, username); return (user); } // See interface for Javadoc public User storeUser(User user, boolean isNew) { String username = user.getUsername(); synchronized (users) { if (isNew && users.get(username) != null) { throw new IllegalArgumentException("Duplicate user '" + username + "'"); } if (log.isTraceEnabled()) { log.trace("Creating/updating user '" + username + "'"); } users.put(username, user); return (user); } } // See interface for Javadoc public User findUser(String username) throws ExpiredPasswordException { synchronized (users) { return ((User) users.get(username)); } } // See interface for Javadoc public User[] findUsers() { synchronized (users) { User results[] = new User[users.size()]; return ((User[]) users.values().toArray(results)); } } // See interface for Javadoc public void open() throws Exception { FileInputStream fis = null; BufferedInputStream bis = null; try { // Acquire an input stream to our database file if (log.isDebugEnabled()) { log.debug("Loading database from '" + pathname + "'"); } fis = new FileInputStream(pathname); bis = new BufferedInputStream(fis); // Construct a digester to use for parsing Digester digester = new Digester(); digester.push(this); digester.setValidating(false); digester.addFactoryCreate ("database/user", new MemoryUserCreationFactory(this)); digester.addFactoryCreate ("database/user/subscription", new MemorySubscriptionCreationFactory()); // Parse the input stream to initialize our database digester.parse(bis); bis.close(); bis = null; fis = null; } catch (Exception e) { log.error("Loading database from '" + pathname + "':", e); throw e; } finally { if (bis != null) { try { bis.close(); } catch (Throwable t) { ; } bis = null; fis = null; } } } // See interface for Javadoc public void removeUser(User user) { if (!(this == user.getDatabase())) { throw new IllegalArgumentException ("User not associated with this database"); } if (log.isTraceEnabled()) { log.trace("Removing user '" + user.getUsername() + "'"); } synchronized (users) { users.remove(user.getUsername()); } } // See interface for Javadoc public void save() throws Exception { if (log.isDebugEnabled()) { log.debug("Saving database to '" + pathname + "'"); } File fileNew = new File(pathnameNew); PrintWriter writer = null; try { // Configure our PrintWriter FileOutputStream fos = new FileOutputStream(fileNew); OutputStreamWriter osw = new OutputStreamWriter(fos); writer = new PrintWriter(osw); // Print the file prolog writer.println("<?xml version='1.0'?>"); writer.println("<database>"); // Print entries for each defined user and associated subscriptions User users[] = findUsers(); for (int i = 0; i < users.length; i++) { writer.print(" "); writer.println(users[i]); Subscription subscriptions[] = users[i].getSubscriptions(); for (int j = 0; j < subscriptions.length; j++) { writer.print(" "); writer.println(subscriptions[j]); writer.print(" "); writer.println("</subscription>"); } writer.print(" "); writer.println("</user>"); } // Print the file epilog writer.println("</database>"); // Check for errors that occurred while printing if (writer.checkError()) { writer.close(); fileNew.delete(); throw new IOException ("Saving database to '" + pathname + "'"); } writer.close(); writer = null; } catch (IOException e) { if (writer != null) { writer.close(); } fileNew.delete(); throw e; } // Perform the required renames to permanently save this file File fileOrig = new File(pathname); File fileOld = new File(pathnameOld); if (fileOrig.exists()) { fileOld.delete(); if (!fileOrig.renameTo(fileOld)) { throw new IOException ("Renaming '" + pathname + "' to '" + pathnameOld + "'"); } } if (!fileNew.renameTo(fileOrig)) { if (fileOld.exists()) { fileOld.renameTo(fileOrig); } throw new IOException ("Renaming '" + pathnameNew + "' to '" + pathname + "'"); } fileOld.delete(); } } /** * Digester object creation factory for subscription instances. */ class MemorySubscriptionCreationFactory implements ObjectCreationFactory { private Digester digester = null; public Digester getDigester() { return (this.digester); } public void setDigester(Digester digester) { this.digester = digester; } public Object createObject(Attributes attributes) { String host = attributes.getValue("host"); User user = (User) digester.peek(); Subscription subscription = user.createSubscription(host); String autoConnect = attributes.getValue("autoConnect"); if (autoConnect == null) { autoConnect = "false"; } if ("true".equalsIgnoreCase(autoConnect) || "yes".equalsIgnoreCase(autoConnect)) { subscription.setAutoConnect(true); } else { subscription.setAutoConnect(false); } subscription.setPassword(attributes.getValue("password")); subscription.setType(attributes.getValue("type")); subscription.setUsername(attributes.getValue("username")); return (subscription); } } /** * Digester object creation factory for user instances. */ class MemoryUserCreationFactory implements ObjectCreationFactory { public MemoryUserCreationFactory(MemoryUserDatabase database) { this.database = database; } private MemoryUserDatabase database = null; private Digester digester = null; public Digester getDigester() { return (this.digester); } public void setDigester(Digester digester) { this.digester = digester; } public Object createObject(Attributes attributes) { String username = attributes.getValue("username"); User user = database.createUser(username); user.setFromAddress(attributes.getValue("fromAddress")); user.setFullName(attributes.getValue("fullName")); user.setPassword(attributes.getValue("password")); user.setReplyToAddress(attributes.getValue("replyToAddress")); return (user); } } --- NEW FILE: UserDatabase.java --- /* * $Id: UserDatabase.java,v 1.1 2005/09/23 06:37:57 jmikus Exp $ * * Copyright 2000-2004 Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.jspcontrols.mailreader.memory; import net.jspcontrols.mailreader.business.User; import net.jspcontrols.mailreader.ExpiredPasswordException; /** * <p>A <strong>Data Access Object</strong> (DAO) interface describing * the available operations for retrieving and storing {@link net.jspcontrols.mailreader.business.User}s * (and their associated {@link net.jspcontrols.mailreader.business.Subscription}s) in some persistence layer * whose characteristics are not specified here. One or more implementations * will be created to perform the actual I/O that is required.</p> * * @version $Rev: 54929 $ $Date: 2005/09/23 06:37:57 $ * @since Struts 1.1 */ public interface UserDatabase { // --------------------------------------------------------- Public Methods /** * <p>Create and return a new {@link net.jspcontrols.mailreader.business.User} defined in this user database. * </p> * * @param username Username of the new user * * @exception java.lang.IllegalArgumentException if the specified username * is not unique */ public User createUser(String username); /** * <p>Create a detached copy of a user * </p> * * @param username Username of the new user * * @exception java.lang.IllegalArgumentException if the specified username * is not unique */ public User createDetachedUser(String username); /** * <p>Store new/updated user * </p> * * @param user user instance to store * * @exception java.lang.IllegalArgumentException if the specified username * is not unique */ public User storeUser(User user, boolean isNew); /** * <p>Finalize access to the underlying persistence layer.</p> * * @exception java.lang.Exception if a database access error occurs */ public void close() throws Exception; /** * <p>Return the existing {@link net.jspcontrols.mailreader.business.User} with the specified username, * if any; otherwise return <code>null</code>.</p> * * @param username Username of the user to retrieve * @throws net.jspcontrols.mailreader.ExpiredPasswordException if user password has expired * and must be changed */ public User findUser(String username) throws ExpiredPasswordException; /** * <p>Return the set of {@link net.jspcontrols.mailreader.business.User}s defined in this user database.</p> */ public User[] findUsers(); /** * <p>Initiate access to the underlying persistence layer.</p> * * @exception java.lang.Exception if a database access error occurs */ public void open() throws Exception; /** * Remove the specified {@link net.jspcontrols.mailreader.business.User} from this database. * * @param user User to be removed * * @exception java.lang.IllegalArgumentException if the specified user is not * associated with this database */ public void removeUser(User user); /** * <p>Save any pending changes to the underlying persistence layer.</p> * * @exception java.lang.Exception if a database access error occurs */ public void save() throws Exception; } |
From: <jm...@us...> - 2005-09-23 06:38:11
|
Update of /cvsroot/struts/dialogs/war/sample-crud In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/war/sample-crud Modified 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: Added MailReader Demo; Added component RuleSet Index: crudaction-edit.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-edit.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-edit.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-edit.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: crudaction-error.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-error.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-error.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-error.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: crudaction-list.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-list.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-list.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-list.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 1,11 **** <!-- ! 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"> --- 1,11 ---- <!-- ! Struts Dialogs Example ! Author: Michael Jouravlev, 2004-2005 ! --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html locale="true"> Index: crudaction-lite-edit.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-lite-edit.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-lite-edit.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-lite-edit.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: crudaction-lite-list.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-lite-list.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-lite-list.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-lite-list.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 3,14 **** 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"> --- 3,14 ---- net.jspcontrols.dialogs.samples.crud.business.BusinessObj" %> <!-- ! Struts Dialogs Example ! Author: Michael Jouravlev, 2004-2005 ! --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html locale="true"> Index: crudaction-lite-noedit.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-lite-noedit.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-lite-noedit.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-lite-noedit.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: crudaction-noedit.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-noedit.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-noedit.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-noedit.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> Index: crudaction-notactive.jsp =================================================================== RCS file: /cvsroot/struts/dialogs/war/sample-crud/crudaction-notactive.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crudaction-notactive.jsp 4 Aug 2005 07:39:47 -0000 1.1 --- crudaction-notactive.jsp 23 Sep 2005 06:37:56 -0000 1.2 *************** *** 5,11 **** <%@ 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> --- 5,11 ---- <%@ page contentType="text/html;charset=UTF-8" language="java" %> ! <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> ! <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> ! <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> |
Update of /cvsroot/struts/dialogs/war/mailreaderpages In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17798/war/mailreaderpages Added Files: changes.txt error.jsp home.jsp homeclassic.jsp logoff.jsp logon.jsp registration.jsp subscription.jsp subscriptions.jsp Log Message: Added MailReader Demo; Added component RuleSet --- NEW FILE: changes.txt --- Changed objects comparing to original MailReader ------------------------------------------------ Subscription: * added setter for host User: * added setter for username * added Collection getSubscriptionCollection MemoryUserDatabase: * added User createDetachedUser(String username) * added User storeUser(User user, boolean isNew) MemoryDatabasePlugIn.java * Not changed MemorySubscription: * made Cloneable and added method clone to create detached subscriptions; is nested in SubscriptionForm * added setter for host; used in subscription.jsp to set property host of nested subscription bean MemoryUser: * made Cloneable and added method clone to create detached user accounts; is nested in RegistrationForm * added setter for username; used in registration.jsp to set property username of nested registration bean * added Collection getSubscriptionCollection * added Subscription createDetachedSubscription() to create new subscription * added Subscription getDetachedSubscription(String host) to create a copy of persistent subscription * added Subscription storeDetachedSubscription(Subscription subscription, boolean isNew) to persist new or updated detached subscription MemoryUserDatabase: * added User createDetachedUser(String username) to create detached user account * added User storeUser(User user, boolean isNew) to persist new or updated user account HomeAction: * Combines features of BaseAction, WelcomeAction, LocaleAction and main menu action LogonAction: * Combines features of LogonAction and LogoffAction SubscriptionAction: * Combines features of EditSubscriptionAction and SaveSubscriptionAction RegistrationAction: * Combines features of EditRegistrationAction and SaveRegistrationAction --- NEW FILE: error.jsp --- <%-- Errors.jsp - Display unexpected errors, such as a JSP exception or missing resources --%> <%-- Copyright 2000-2004 Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page import="org.apache.struts.Globals" %> <%@ page import="org.apache.struts.webapp.example.Constants" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:html> <head> <title>Unexpected Error</title> <html:base/> </head> <h3>An unexpected error has occured</h3> <logic:present name="<%=net.jspcontrols.mailreader.Constants.ERROR_KEY%>"> <ul> <logic:iterate id="error" name="<%=net.jspcontrols.mailreader.Constants.ERROR_KEY%>"> <li><bean:write name="error" /></li> </logic:iterate> </ul> </logic:present> <logic:present name="<%=Globals.EXCEPTION_KEY%>"> <p><bean:write name="<%=Globals.EXCEPTION_KEY%>" property="message" /></p> </logic:present> </body> </html:html> --- NEW FILE: home.jsp --- <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="index.title"/></title> </head> <body> <h3><bean:message key="index.heading"/></h3> <!-- Signup and login options for not logged-in user --> <logic:notPresent name="user" scope="session"> <ul> <li><html:link action="/Home?DIALOG-EVENT-SIGNUP"><bean:message key="index.registration"/></html:link></li> <li><html:link action="/Home?DIALOG-EVENT-LOGON"><bean:message key="index.logon"/></html:link></li> </ul> </logic:notPresent> <!-- Account modification and subscription list for logged-in user --> <logic:present name="user" scope="session"> <ul> <li><html:link action="/Home?DIALOG-EVENT-ACCUPDATE"><bean:message key="index.updateaccount"/></html:link></li> <li><html:link action="/Home?DIALOG-EVENT-SUBSCRIPTIONS"><bean:message key="index.managesubscriptions"/></html:link></li> <li><html:link action="/Logon"><bean:message key="index.showuserinfo"/></html:link></li> <li><html:link action="/Logon?DIALOG-EVENT-LOGOFF"><bean:message key="index.logoff"/></html:link></li> </ul> </logic:present> <!-- Language selection --> <h3><bean:message key="index.langopts"/></h3> <ul> <li><html:link action="/Home?DIALOG-EVENT-LOCALE&language=en"><bean:message key="index.langenglish"/></html:link></li> <li><html:link action="/Home?DIALOG-EVENT-LOCALE&language=ru" useLocalEncoding="true"><bean:message key="index.langrussian"/></html:link></li> </ul> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> <p><html:link action="/Tour"><bean:message key="index.tour"/></html:link></p> </body> </html> --- NEW FILE: homeclassic.jsp --- <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="index.title"/></title> </head> <body> <h3><bean:message key="index.heading"/></h3> <!-- Signup and login options for not logged-in user --> <logic:notPresent name="user" scope="session"> <ul> <li><html:link action="HomeClassic?DIALOG-EVENT-SIGNUP"><bean:message key="index.registration"/></html:link></li> <li><html:link action="HomeClassic?DIALOG-EVENT-LOGON"><bean:message key="index.logon"/></html:link></li> </ul> </logic:notPresent> <!-- Account modification and subscription list for logged-in user --> <logic:present name="user" scope="session"> <ul> <li><html:link action="HomeClassic?DIALOG-EVENT-ACCUPDATE"><bean:message key="index.updateaccount"/></html:link></li> <li><html:link action="HomeClassic?DIALOG-EVENT-SUBSCRIPTIONS"><bean:message key="index.managesubscriptions"/></html:link></li> <li><html:link action="/Logon"><bean:message key="index.showuserinfo"/></html:link></li> <li><html:link action="/Logon?DIALOG-EVENT-LOGOFF"><bean:message key="index.logoff"/></html:link></li> </ul> </logic:present> <!-- Language selection --> <h3><bean:message key="index.langopts"/></h3> <ul> <li><html:link action="HomeClassic?DIALOG-EVENT-LOCALE&language=en"><bean:message key="index.langenglish"/></html:link></li> <li><html:link action="HomeClassic?DIALOG-EVENT-LOCALE&language=ru" useLocalEncoding="true"><bean:message key="index.langrussian"/></html:link></li> </ul> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> <p><html:link action="/Tour"><bean:message key="index.tour"/></html:link></p> </body> </html> --- NEW FILE: logoff.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Logon. State: Logged In. --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="logon.title"/></title> </head> <body> <h3><bean:message key="logoff.heading"/></h3> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <html:form action="/Logon"> <table> <!-- User information --> <tr> <td class="itemdescr" align="left">Username</td> <td><bean:write name="user" property="username"/></td> </tr> <tr> <td class="itemdescr" align="left">Full name</td> <td><bean:write name="user" property="fullName"/></td> </tr> <!-- Logoff and cancel buttons--> <tr> <td class="itemdescr"></td> <td class="itemdescr" align="left"> <html:submit property="DIALOG-EVENT-LOGOFF"> <bean:message key="button.logoff"/> </html:submit> <html:cancel> <bean:message key="button.cancel"/> </html:cancel> </td> </tr> </table> </html:form> <!-- Struts Dialogs logo --> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> </body> </html> --- NEW FILE: logon.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Logon. State: Not Logged In. --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="logon.title"/></title> </head> <body> <h3><bean:message key="logon.heading"/></h3> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <html:form action="/Logon" focus="username"> <table> <!-- username and password --> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.username"/>: </td> <td align="left"> <html:text property="username" size="16" maxlength="18"/> </td> </tr> <tr> <td class="itemdescr"align="right"> <bean:message key="prompt.password" bundle="alternate"/> </td> <td align="left"> <html:password property="password" size="16" maxlength="18" redisplay="false"/> </td> </tr> <!-- Submit and Cancel buttons --> <tr> <td class="itemdescr"/> <td class="itemdescr" align="left"> <html:submit property="DIALOG-EVENT-LOGON"> <bean:message key="button.confirm"/> </html:submit> <html:cancel> <bean:message key="button.cancel"/> </html:cancel> </td> </tr> </table> </html:form> <!-- Struts Dialogs logo --> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> </body> </html> --- NEW FILE: registration.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Registration State: (Logged In) || (Not Logged In) --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <!-- Patch title depending on whether we are creating or updating a user --> <title> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-UPDATE"> <bean:message key="registration.title.edit"/> </logic:equal> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-NEW" > <bean:message key="registration.title.create"/> </logic:equal> </title> </head> <body> <!-- Patch header depending on whether we are creating or updating a user --> <h3> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-UPDATE"> <bean:message key="registration.heading.edit"/> </logic:equal> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-NEW" > <bean:message key="registration.heading.create"/> </logic:equal> </h3> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <html:form action="/Registration" focus="username"> <table border="0" width="100%"> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.username"/>: </td> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-UPDATE" > <td><bean:write name="RegistrationForm" property="nestedUser.username"/></td> </logic:equal> <logic:equal name="RegistrationForm" property="crudUIMode" value="CRUD-UI-MODE-NEW" > <td><html:text name="RegistrationForm" property="nestedUser.username" size="15" tabindex="1"/></td> </logic:equal> </tr> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.password"/>: </td> <td align="left"> <html:password property="nestedUser.password" size="16" maxlength="16"/> </td> </tr> <!-- Note that password2 (repeated password) is not part of the nested user object --> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.password2"/>: </td> <td align="left"> <html:password property="password2" size="16" maxlength="16"/> </td> </tr> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.fullName"/>: </td> <td align="left"> <html:text property="nestedUser.fullName" size="50"/> </td> </tr> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.fromAddress"/>: </td> <td align="left"> <html:text property="nestedUser.fromAddress" size="50"/> </td> </tr> <tr> <td class="itemdescr" align="right"> <bean:message key="prompt.replyToAddress"/>: </td> <td align="left"> <html:text property="nestedUser.replyToAddress" size="50"/> </td> </tr> <!-- Save and Cancel buttons --> <tr> <td class="itemdescr" /> <td class="itemdescr" align="left"> <html:submit property="DIALOG-EVENT-SAVE"> <bean:message key="button.save"/> </html:submit> <html:submit property="DIALOG-EVENT-CANCEL"> <bean:message key="button.cancel"/> </html:submit> </td> </tr> </table> </html:form> <!-- Struts Dialogs logo --> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> </body> </html:html> --- NEW FILE: subscription.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Subscription. State: (Logged In) && (CRUD_UI_MODE_NEW || CRUD_UI_MODE_EDIT) --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="subscription.title"/></title> </head> <body> <logic:equal name="SubscriptionForm" property="crudUIMode" value="CRUD-UI-MODE-UPDATE" > <h3><bean:message key="subscription.title.edit"/></h3> </logic:equal> <logic:equal name="SubscriptionForm" property="crudUIMode" value="CRUD-UI-MODE-NEW" > <h3><bean:message key="subscription.title.create"/></h3> </logic:equal> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <html:form action="/Subscriptions.do"> <table width="250"> <!-- Current user information --> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.username"/></td> <td><bean:write name="user" property="username"/></td> </tr> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.mailHostname"/></td> <logic:equal name="SubscriptionForm" property="crudUIMode" value="CRUD-UI-MODE-UPDATE" > <td><bean:write name="SubscriptionForm" property="subscription.host"/></td> </logic:equal> <logic:equal name="SubscriptionForm" property="crudUIMode" value="CRUD-UI-MODE-NEW" > <td><html:text name="SubscriptionForm" property="subscription.host" tabindex="1"/></td> </logic:equal> </tr> <!-- E-mail account information --> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.mailUsername"/></td> <td><html:text name="SubscriptionForm" property="subscription.username" tabindex="2"/></td> </tr> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.mailPassword"/></td> <td><html:text name="SubscriptionForm" property="subscription.password" tabindex="3"/></td> </tr> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.mailServerType"/></td> <td> <html:select name="SubscriptionForm" property="subscription.type" tabindex="4"> <html:options collection="serverTypes" property="value" labelProperty="label"/> </html:select> </td> </tr> <tr> <td class="itemdescr" align="left"><bean:message key="prompt.autoConnect"/></td> <td><html:checkbox name="SubscriptionForm" property="subscription.autoConnect" tabindex="5"/></td> </tr> <!-- Save and Cancel buttons --> <tr> <td class="itemdescr" /> <td class="itemdescr" align="left"> <html:submit property="DIALOG-EVENT-SAVE"> <bean:message key="button.save"/> </html:submit> <html:cancel> <bean:message key="button.cancel"/> </html:cancel> </td> </tr> </table> </html:form> <!-- Struts Dialogs logo --> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> </body> </html:html> --- NEW FILE: subscriptions.jsp --- <!-- Struts Dialogs MailReader, 2005. Web resource: Subscriptions. State: Logged In && CRUD_UI_MODE_INACTIVE --> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <!-- The nice thing about using EL is that expressions can be used within Struts-EL tags. Without EL one would have to use, say, bean:write, which cannot be nested in other tag except as in the tag body. To nest expressions inside tags, one would have to use JSP scriptlets (which are calculated before tags?) --> <%@ taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %> <%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %> <%@ taglib uri="http://struts.apache.org/tags-logic-el" prefix="logic-el" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <html:xhtml/> <html> <head> <!-- Direct access to /mailreaderpages/* is prohibited in web.xml, use separate directory for CSS --> <link rel="stylesheet" type="text/css" href="mailreader-css/base.css" /> <title><bean:message key="subscriptions.title"/></title> </head> <body> <!-- Subscriptions for user: John Q. User --> <h3> <bean:message key="subscriptions.headingfor"/> <c:out value="${user.fullName}"/> </h3> <!-- Standard Struts error handling --> <logic:messagesPresent> <br/> <html:errors/> </logic:messagesPresent> <table width="100%"> <thead> <tr> <th><bean:message key="heading.host"/></th> <th><bean:message key="heading.user"/></th> <th><bean:message key="heading.type"/></th> <th><bean:message key="heading.autoConnect"/></th> <th><bean:message key="heading.action"/></th> </tr> </thead> <!-- Avoid NPE by checking for current user --> <logic:present name="user" scope="session"> <!-- Show subscription list --> <logic-el:iterate id="subscription" collection="${SubscriptionForm.subscriptions}" offset="${SubscriptionForm.offset}" length="${SubscriptionForm.pagesize}" type="net.jspcontrols.mailreader.business.Subscription"> <tr> <!-- Subscription data --> <td><c:out value="${subscription.host}"/></td> <td><c:out value="${subscription.username}"/></td> <td><c:out value="${subscription.type}"/></td> <td><c:out value="${subscription.autoConnect}"/></td> <!-- Operations on each subscription: updade and delete --> <td> <html-el:link href="Subscriptions.do?DIALOG-EVENT-UPDATE&host=${subscription.host}"> <bean:message key="registration.editSubscription"/> </html-el:link> | <html-el:link href="Subscriptions.do?DIALOG-EVENT-DELETE&host=${subscription.host}"> <bean:message key="registration.deleteSubscription"/> </html-el:link> </td> </tr> </logic-el:iterate> </logic:present> </table> <!-- Paging buttons and Create Subscription button --> <html:form action="/Subscriptions.do"> <html:submit property="DIALOG-EVENT-CREATE"> <bean:message key="registration.addSubscription"/> </html:submit> <html-el:submit property="DIALOG-EVENT-PREVPAGE" disabled="${SubscriptionForm.firstpage}"> <bean:message key="subscriptions.prevpage"/> </html-el:submit> <html-el:submit property="DIALOG-EVENT-NEXTPAGE" disabled="${SubscriptionForm.lastpage}"> <bean:message key="subscriptions.nextpage"/> </html-el:submit> <html:submit property="DIALOG-EVENT-BACKHOME"> <bean:message key="button.cancel"/> </html:submit> </html:form> <!-- Struts Dialogs logo --> <br/> <hr/> <p><html:img bundle="alternate" pageKey="strutsdialogs.logo.path" altKey="strutsdialogs.logo.alt"/></p> </body> </html:html> |