RE: [OT] Design Question
Hi, In my previous company I had exactly what you are talking about, Access and fields are restricted by country (and we had also different Names for fields depending on the country - not internationalization, just Different name). Solution adopted was to have only ONE database in which you store permissions by country.. When your struts app has to display the data in the page, we look up Database to see which fields you can display Hope this helps Regards Marco PS this of course involves writing a gui tool that writes in the Database the permissions and modifies it. If you are using Hibernate Than that will save you a lot of time (you can reuse the framework For both the GUI tool and the struts app) Good luck! -Original Message- From: Claudio Sanchez [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 00:52 To: [EMAIL PROTECTED] Subject: [OT] Design Question Hi all, This is off-topic, but i hope that somebody helps me. I have an application that use struts, spring and hibernate. The security is based on roles using CMS (JdbcRealm over Tomcat 4.1.29) The goal of this application is to manage contracts. Authorized users creates contracts with supplier's data, start date, end date, etc. Then the application send alarm e-mails to users, for example when a contrat expire, etc. For now everithing works fine. But I have a requirements to people the other countrys use the application. Obviously people of a country can't manage or view the information the other countrys (contracts, users, departments, currencies, etc). The easiest implementation is to have an instance of the application and database for each country. But I dont like this. I'd like to have only one instance to the application. Another idea is separate only the database for country. For example ArgentineanDB and MexicanDB. So when a user access to the application, he(o she) enter his(or her) country and the application use the appropriate database. But i found a problem with this. ¿How to manage security? because now i have the user and role tables in ArgentineanDB and MexicanDB. ¿Is possible change dynamically (depending of the user's country) the user and role table use for the CMS? I think that is not possible. ¿Is there a way to resolve this requirements without change the actual user-role schema? I'd like to hear another options Thanks in advance, Claudio Sanchez (apologize for my english) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Object Design Question
On 12/03/2004 21:26, Avinash Gangadharan [EMAIL PROTECTED] wrote: People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. If you're talking about SQL, can't you issue one or two SQL queries (with subselects, inner or outer joins) or write a stored procedure to retrieve all the info? (I am used to work with MySQL so my advanced SQL is a bit rusty) Continuing with simple SQL queries only... You could do this in a 2 step mode: - retrieve all persons who have addresses and employees (1 query per person) - for the remaining people (1-2 queries per person) - get the addresses (select... where person.ssn = address.ssn and id ...) (1 query per person) - get the employees (similar to the previous case) (1 query per person) (anyway you get 3 full table search) If you had to had 2 flags on the Person - hasAddresses and hasEmployees - you could make the queries more simple - fetch for (1-1), (1-0) and (0-0) - but maybe it would be more difficult to maintain. If you are talking about a persistence layer (like OJB - see ojb-user mailing list) some of them have lazy loading: it only loads the Person collection of Addresses only if you use them. This will certainly be simpler... And if you have object cache it could even things up (maybe you could issue a great number SQL queries but if the objects were already in cache then there would be no need for any SQL query). The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. I don¹t see any problem on the design itself (well maybe... it seems you have the social security number has the primary key... pks are not supposed to have any real meaning - what would happen if all of the social security numbers were to be changed? It would generate a huge number of cascade updates. Do whatever you like maybe I am raising a false issue here). Hope it helps, Pedro Salgado Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Design Question
Hi all, This is off-topic, but i hope that somebody helps me. I have an application that use struts, spring and hibernate. The security is based on roles using CMS (JdbcRealm over Tomcat 4.1.29) The goal of this application is to manage contracts. Authorized users creates contracts with supplier's data, start date, end date, etc. Then the application send alarm e-mails to users, for example when a contrat expire, etc. For now everithing works fine. But I have a requirements to people the other countrys use the application. Obviously people of a country can't manage or view the information the other countrys (contracts, users, departments, currencies, etc). The easiest implementation is to have an instance of the application and database for each country. But I dont like this. I'd like to have only one instance to the application. Another idea is separate only the database for country. For example ArgentineanDB and MexicanDB. So when a user access to the application, he(o she) enter his(or her) country and the application use the appropriate database. But i found a problem with this. ¿How to manage security? because now i have the user and role tables in ArgentineanDB and MexicanDB. ¿Is possible change dynamically (depending of the user's country) the user and role table use for the CMS? I think that is not possible. ¿Is there a way to resolve this requirements without change the actual user-role schema? I'd like to hear another options Thanks in advance, Claudio Sanchez (apologize for my english) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Object Design Question
People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Object Design Question
Avinash: ...Adding to what Jacob says below: if you are writing your own, this is a good link to study: http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html Regards, Geeta Hookom, Jacob wrote: It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
+1. Join the tables in a query and write an algorithm to parse the results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
That's the way I have it now, a view object querying the datastore and forming the business objects. The view issues a query for the parent and then calls the views of the children to give their list of objects for that parent and then constituting the parent completely. I agree getting them back together and then parsing them out would be better but sure not a clean OO way of getting data. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:01 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question +1. Join the tables in a query and write an algorithm to parse the +results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Object Design Question
OO is not alwasy the best way; and there are trade offs for every implementation. As Jacob mentioned... It's always on a case by case basis. robert -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 4:46 PM To: 'Struts Users Mailing List' Subject: RE: [OT] Object Design Question That's the way I have it now, a view object querying the datastore and forming the business objects. The view issues a query for the parent and then calls the views of the children to give their list of objects for that parent and then constituting the parent completely. I agree getting them back together and then parsing them out would be better but sure not a clean OO way of getting data. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:01 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question +1. Join the tables in a query and write an algorithm to parse the +results into the view you need. One connection, one query, let the database do the work. Not very OO, but very efficient. robert -Original Message- From: Hookom, Jacob [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:37 PM To: Struts Users Mailing List Subject: RE: [OT] Object Design Question It's always on a case by case basis. When and how much do you need at a given time? Hibernate/JDO/OJB/etc can handle these things for you via a config to specify lazy relationships. When you are talking about web application with read data (data purely pushed to the view like a list of persons with addresses), then the best way IMHO is to write a special view object and query for this case. List View Objects Select By Id Grab Business Object By Id -Original Message- From: Avinash Gangadharan [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 2:26 PM To: '[EMAIL PROTECTED]' Subject: [OT] Object Design Question People, I have a design question. It is regarding the retrieval of parent and child objects in the best possible manner. For eg. Let's say there is a Person object with properties such as ssn, lastName and firstname. It also has a list child objects ( Address ) of addresses and a list of previous employees ( Employee ). The Person, Address and Employee objects are separate tables in the DB linked thru ssn. Now what do you guys think is the most efficient way of retrieving a complete Person. The simplest way is ofcourse issue 3 queries one for person, other for the list of address and the third for previous employees. But this does not scale well with increasing size of the table data. For 100 rows of Person 201 queries are issued. 1 which gets 100 persons, 100 each for there subequent address and previous employees. Similarly for a 1000, 2001 queries. Complex queries may be a solution which relies on filtering the resultset but is there a more simple and intelligent approach. Is there a problem with the inherent design itself or is this a common problem. Thanks and Regards Avinash - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Design Question
I am designing an input screen that will have multiple select tags for inputting a number of rows into a db table. I plan to do a Cartesian product of the input properties in my Action and then feed each row to my db persistence framework (Ibatis) for insertion into the db. My question is what is the best way to go about populating the drop-down lists on the input screen and then passing the input selections to the Action? I can create a dummy action that will populate an array for each respective select tag and then forward the form bean to the input screen. I could also use Providers to populate the drop-down lists which eliminates the population Action but still leaves me with an aggregate DTO that I am passing to my action. Any ideas would be appreciated? thnx in advance, Jeremy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles Dynamic Menu: Design Question
Struts v1.1 We are currently using Struts and Tiles and have a dynamic navigation menu with 2-3 nested levels for each top-level menu item (over 100 total menu items). Currently, we are generating links with the action mapping and then appending menu parameters to the url to determine what level in the menu hierarchy the user is requesting. The parameters that are passed in the URL are then read in scriptlet code in the navigation menu tile to display the appropriate menu item. Struts Action mappings are pointed to Tiles definitions. The problems with this approach include: 1) All URLs are defined in the ApplicationResources.properties file (e.g., menu.itemA=actionMapping.do?top=topMenuItemsub1=subMenu1sub2=subMenu2). 2) 3-4 parameters passed in the URL for every request to determine navigational hierarchy. 3) A great deal of scriptlet code in the navigation menu tile. I have searched the archive list, Google, and looked at Struts Menu at sf.net and nothing seems to jump out at me. This is my first J2EE project and first Struts/Tiles project, so I may have missed (not comprehended) some things when searching. In my relative inexperience, it would seem that the menu items would be better defined in XML (instead of ApplicationResources), although the link label would need to still be in ApplicationResources for i18n, perhaps just a single key could be passed in the URL, and replace scriptlet code with a tag (custom?). Can any one offer me some insights or point me to some resources that can help me? Thanks much! Zach - The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. The information may also constitute a legally privileged confidential communication. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you
Re: Tiles Dynamic Menu: Design Question
Zach, did you miss http://sourceforge.net/projects/struts-menu/ ? I don't remember its details - it may do some of those things you don't like. I don't see why you are keeping menu urls in the ApplicationResources. At least you could make a new resource bundle and load it yourself with the same resource bundle package, e.g. ApplicationLinks. Alternatively you could code up a hashmap in your ApplicationScope, from a file, xml, a db etc. Or even just define all menu URLs as seperate actionforwards in struts-config. You could also seperate that off in a different file from the struts-config.xml by having a sub-app for the menu. The tile does not have to be pure JSP. You can define a tile to go through an action first. Adam On 02/10/2004 05:13 PM [EMAIL PROTECTED] wrote: Struts v1.1 We are currently using Struts and Tiles and have a dynamic navigation menu with 2-3 nested levels for each top-level menu item (over 100 total menu items). Currently, we are generating links with the action mapping and then appending menu parameters to the url to determine what level in the menu hierarchy the user is requesting. The parameters that are passed in the URL are then read in scriptlet code in the navigation menu tile to display the appropriate menu item. Struts Action mappings are pointed to Tiles definitions. The problems with this approach include: 1) All URLs are defined in the ApplicationResources.properties file (e.g., menu.itemA=actionMapping.do?top=topMenuItemsub1=subMenu1sub2=subMenu2). 2) 3-4 parameters passed in the URL for every request to determine navigational hierarchy. 3) A great deal of scriptlet code in the navigation menu tile. I have searched the archive list, Google, and looked at Struts Menu at sf.net and nothing seems to jump out at me. This is my first J2EE project and first Struts/Tiles project, so I may have missed (not comprehended) some things when searching. In my relative inexperience, it would seem that the menu items would be better defined in XML (instead of ApplicationResources), although the link label would need to still be in ApplicationResources for i18n, perhaps just a single key could be passed in the URL, and replace scriptlet code with a tag (custom?). Can any one offer me some insights or point me to some resources that can help me? Thanks much! Zach - The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. The information may also constitute a legally privileged confidential communication. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles Dynamic Menu: Design Question
Struts v1.1 We are currently using Struts and Tiles and have a dynamic navigation menu with 2-3 nested levels for each top-level menu item (over 100 total menu items). Currently, we are generating links with the action mapping and then appending parameters to determine what level in the menu hierarchy the user is requesting. The parameters are passed in the URL which are then read in scriptlet code in the navigation menu tile to display the appropriate menu item. Action mappings are pointed to Tiles definitions. The problems with this approach inlcude: 1) All URLs are defined in the ApplicationResources.properties file (e.g., menu.itemA=mapping.do?top=topMenuItemsub1=subMenu1sub2=subMenu2). 2) 3-4 parameters passed in the URL for every request to determine navigational level. 3) A great deal of scriptlet code in the navigation menu tile. I have searched the archive list, Google, and looked at Struts Menu at sf.net and nothing seems to jump out at me. This is my first J2EE project and first Struts/Tiles project, so I may have missed (not comprehended) some things when searching. In my relative inexperience, it would seem that the menu items would be better defined in XML (instead of ApplicationResources), although the link label would need to still be in ApplicationResources, perhaps just a single key could be passed in the URL, and replace scriptlet code with a tag (custom?). Can any one offer me some insights or point me to some resources that help me? Thanks much! Zach Curtis TSYS Technology Center [EMAIL PROTECTED] 208-424-2145 - The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. The information may also constitute a legally privileged confidential communication. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you
RE: Design question regarding struts security features
You should be able to do this with standard J2EE security provided by your web container. If you store your user credentials in a database, then you may want to look at SecurityFilter: http://sourceforge.net/projects/securityfilter/ It allows you to leverage standard J2EE security features but provides more flexible authentication. robert -Original Message- From: Patrick Scheuerer [mailto:[EMAIL PROTECTED] Sent: Sunday, December 28, 2003 6:37 PM To: Struts Users List Subject: Design question regarding struts security features Hello everybody, I'm in the process of developing my first Struts application, so forgive me if this question is insulting everybody's intellect. The application I'm working on is a support portal where you can download technical document, drivers etc. The tricky part is, that certain documents should be only accessible to users with a certain role. My idea so far is to put a user object in the session and to evaluate the role (and therefore the access level) of the user for all views that are displaying data which might be restricted. I guess the easiest way would be using a jsp tag like security:checkAccessLevel / which would retrieve the user object from the session (if it exists) and the then filter the data accordingly. Is there such security taglib around? Has anybody worked on a similar scenario? What is the best approach to solve this problem? Is there a best practice for it? Any tips, hints, code snippets are welcome. Thank you very much. Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design question regarding struts security features
Hi Are you only filtering data based on role ? If you are talking about role-based access of views then we are doing something like that 1. You can use Container Manager Authentication and restrict access to URL patterns to only valid users. 2. You can use the vendor-specify XML file to specify roles and groups. (e.g) principals.xml in OC4J 3. You can use a vendor-specific API like the 'DataSourceUserManager' in OC4J to write custom code that can access your tables and do away with hard-coded principals.xml I think you can also use the role attribute in struts-config.xml and restrict access actions. Tiles has a role attribute too ? though we are not using that. Mohan -Original Message- From: Patrick Scheuerer [mailto:[EMAIL PROTECTED] Sent: Monday, December 29, 2003 5:07 AM To: Struts Users List Subject: Design question regarding struts security features Hello everybody, I'm in the process of developing my first Struts application, so forgive me if this question is insulting everybody's intellect. The application I'm working on is a support portal where you can download technical document, drivers etc. The tricky part is, that certain documents should be only accessible to users with a certain role. My idea so far is to put a user object in the session and to evaluate the role (and therefore the access level) of the user for all views that are displaying data which might be restricted. I guess the easiest way would be using a jsp tag like security:checkAccessLevel / which would retrieve the user object from the session (if it exists) and the then filter the data accordingly. Is there such security taglib around? Has anybody worked on a similar scenario? What is the best approach to solve this problem? Is there a best practice for it? Any tips, hints, code snippets are welcome. Thank you very much. Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question regarding struts security features
Mohan Radhakrishnan wrote: I think you can also use the role attribute in struts-config.xml and restrict access actions. Tiles has a role attribute too ? though we are not using that. I came across the role tag of tiles as well, but I guess it's suitable only if you want to restrict some area of the user interface (let's say a special panel for administrators). Where can I find more information about the role attribute in struts-config.xml? I couldn't find anything in the Struts User's Guide... Thanks, Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design question regarding struts security features
Hello everybody, I'm in the process of developing my first Struts application, so forgive me if this question is insulting everybody's intellect. The application I'm working on is a support portal where you can download technical document, drivers etc. The tricky part is, that certain documents should be only accessible to users with a certain role. My idea so far is to put a user object in the session and to evaluate the role (and therefore the access level) of the user for all views that are displaying data which might be restricted. I guess the easiest way would be using a jsp tag like security:checkAccessLevel / which would retrieve the user object from the session (if it exists) and the then filter the data accordingly. Is there such security taglib around? Has anybody worked on a similar scenario? What is the best approach to solve this problem? Is there a best practice for it? Any tips, hints, code snippets are welcome. Thank you very much. Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
design question
I have 3 FormObjects. I have a newuser.jsp page containing the form userForm, in this form i put a javascript button with an onclick event, window.open with a popup (adresuser.jsp), with the form adresUserForm. Finally i have on the userForm another javascript button with a popup to specialinfo.jsp. This page contains the specialInfoForm. After closing these popups i want to have one action ( submitting the userForm ). How can i get the values from the 2 other formObjects ? Is there anybody that has a similar problem ... Thanks !
Re: design question
hi Drik once the user have filled up the other 2 forms in the pop window u can make object of those two forms into your final action and can get the values like Form1 form=new Form1(); Form2 form2=new Form2(); from1.getUserAddress(); from1.getCity(); Hope this works Regards Gurpreet Dhanoa - Original Message - From: dirk [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 24, 2003 2:54 PM Subject: design question I have 3 FormObjects. I have a newuser.jsp page containing the form userForm, in this form i put a javascript button with an onclick event, window.open with a popup (adresuser.jsp), with the form adresUserForm. Finally i have on the userForm another javascript button with a popup to specialinfo.jsp. This page contains the specialInfoForm. After closing these popups i want to have one action ( submitting the userForm ). How can i get the values from the 2 other formObjects ? Is there anybody that has a similar problem ... Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: design question
If the forms are in different windows then instantiating new forms I dont think will work. If you want a non javascript way of doing things then you'll want to scope the master form to the session, and then keep populating to from your subforms . However you do this I imagine that scoping the master form to session is the way forward and retrieving and populating it in the actions processing your secondary forms. action path=/master name=masterForm scope=session... action path=/gimp/submit name=gimpForm scope=request type=com.sparrow.struts.GimpAction.. You could make one form property of the master form of type gimpform or store this as a map. html:form action=/gimp/submit.do public GimpAction ... GimpForm gimpForm = (GimpForm) form; MasterForm masterForm = (MasterForm) session.getAttribute(masterForm); masterForm.setGimp(gimpForm); or if you're using a map to store the properties of gimp in your masterForm Map gimpMap = BeanUtils.describe(gimpForm); masterForm.setGimp(gimpMap); Hope this helps Mark On 24 Dec 2003, at 09:50, Gurpreet Dhanoa wrote: hi Drik once the user have filled up the other 2 forms in the pop window u can make object of those two forms into your final action and can get the values like Form1 form=new Form1(); Form2 form2=new Form2(); from1.getUserAddress(); from1.getCity(); Hope this works Regards Gurpreet Dhanoa - Original Message - From: dirk [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 24, 2003 2:54 PM Subject: design question I have 3 FormObjects. I have a newuser.jsp page containing the form userForm, in this form i put a javascript button with an onclick event, window.open with a popup (adresuser.jsp), with the form adresUserForm. Finally i have on the userForm another javascript button with a popup to specialinfo.jsp. This page contains the specialInfoForm. After closing these popups i want to have one action ( submitting the userForm ). How can i get the values from the 2 other formObjects ? Is there anybody that has a similar problem ... Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
simple design question
I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: simple design question
Then a simple answer, one solution would be, use a single form, two actions, and use action (path) based validation. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: simple design question I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: simple design question
This sounds like what I need! Can you explain a little more.. :) Thanks in advance, nathan On Nov 13, 2003, at 10:10 AM, Saul Q Yuan wrote: Then a simple answer, one solution would be, use a single form, two actions, and use action (path) based validation. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: simple design question I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: simple design question
Ok, then, 1. Let's say you declare your form as MyForm, which is of type DynaValidatorActionForm in Struts-config.xml. 2. And you declare your actions as /myAction1 and /myAction2 respectively. 3. Then in validation.xml, declare your validation as: form name=/myAction1 field ... arg0 ... / /field /form form name=/myAction2 field ... arg0 ... / /field /form 4. Add necessary codes in your jsp files to support client side JS validation. a. html:form action=/myAction1.do onsubmit=return validateMyForm(this); b. html:javascript formName=/myAction1 method=validateMyForm dynamicJavascript=true staticJavascript=false / script language=Javascript1.1 src=staticJavascript.jsp/script same for the other jsp page. Hope this helps Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:23 PM To: Struts Users Mailing List Subject: Re: simple design question This sounds like what I need! Can you explain a little more.. :) Thanks in advance, nathan On Nov 13, 2003, at 10:10 AM, Saul Q Yuan wrote: Then a simple answer, one solution would be, use a single form, two actions, and use action (path) based validation. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: simple design question I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: simple design question
Sweet Now are you telling me that the two html form can be on the same page? What about pre-loading the select boxes with information? On Nov 13, 2003, at 10:43 AM, Saul Q Yuan wrote: Ok, then, 1. Let's say you declare your form as MyForm, which is of type DynaValidatorActionForm in Struts-config.xml. 2. And you declare your actions as /myAction1 and /myAction2 respectively. 3. Then in validation.xml, declare your validation as: form name=/myAction1 field ... arg0 ... / /field /form form name=/myAction2 field ... arg0 ... / /field /form 4. Add necessary codes in your jsp files to support client side JS validation. a. html:form action=/myAction1.do onsubmit=return validateMyForm(this); b. html:javascript formName=/myAction1 method=validateMyForm dynamicJavascript=true staticJavascript=false / script language=Javascript1.1 src=staticJavascript.jsp/script same for the other jsp page. Hope this helps Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:23 PM To: Struts Users Mailing List Subject: Re: simple design question This sounds like what I need! Can you explain a little more.. :) Thanks in advance, nathan On Nov 13, 2003, at 10:10 AM, Saul Q Yuan wrote: Then a simple answer, one solution would be, use a single form, two actions, and use action (path) based validation. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: simple design question I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: simple design question
It should work if the two html forms are on the same page, if that's what you want. Populating your selection box is another question, you probably need to prepare the data as collections in your action and send that to the request. There are tons of threads in the archive on this, so I'm not getting into the details. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 3:05 PM To: Struts Users Mailing List Subject: Re: simple design question Sweet Now are you telling me that the two html form can be on the same page? What about pre-loading the select boxes with information? On Nov 13, 2003, at 10:43 AM, Saul Q Yuan wrote: Ok, then, 1. Let's say you declare your form as MyForm, which is of type DynaValidatorActionForm in Struts-config.xml. 2. And you declare your actions as /myAction1 and /myAction2 respectively. 3. Then in validation.xml, declare your validation as: form name=/myAction1 field ... arg0 ... / /field /form form name=/myAction2 field ... arg0 ... / /field /form 4. Add necessary codes in your jsp files to support client side JS validation. a. html:form action=/myAction1.do onsubmit=return validateMyForm(this); b. html:javascript formName=/myAction1 method=validateMyForm dynamicJavascript=true staticJavascript=false / script language=Javascript1.1 src=staticJavascript.jsp/script same for the other jsp page. Hope this helps Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:23 PM To: Struts Users Mailing List Subject: Re: simple design question This sounds like what I need! Can you explain a little more.. :) Thanks in advance, nathan On Nov 13, 2003, at 10:10 AM, Saul Q Yuan wrote: Then a simple answer, one solution would be, use a single form, two actions, and use action (path) based validation. Saul -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:02 PM To: [EMAIL PROTECTED] Subject: simple design question I have a simple design question.. I have to forms. first form is one simple select box that needs to have the values populated from a db. This form needs to have validation and the submit to the second form. The second form need to populate a select box based on the value from the first form. This form also need to be validated and then forward on to the display jsp. How many form beans and actions will I need? I would like to use dynavalidatorforms as well. Current setup is an action that places an arraylist into an attribute of the request then forward to the first form. I dont know how to get the first form to auto validate and forward to the second form. nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multibox + iterate + design question
Dear all I have a design question: there are three columns in a database table: category_id, category_description, is_main_category I want to iterate all the records in this table in a jsp page using one check box for each record. category_id is the checkbox's value, category_description is the label. If the is_main_category is true, then I want to display the label in bold font. What's the good approach to this scenario? Thanks in advance. -bruce
design question
hi! i have the following scenario. server0 - has a jsp page, that allows user to enter the goods they want etc, say foo.jsp server1-jsp payment page, say bar.jsp and action class CommAction on clicking done on foo.jsp, this should establish a connection with CommAction class on server1, perform some identity exchange, based on the exchange, route to bar.jsp i came up with [server0] foo.jsp -FooForm -FooAction [server1] bar.jsp -BarForm -BarAction i have java classes to establish a secure communication between two parties. what i want to do now is, have some way of FooAction (on successful return from the underlying comm establishing class) to direct the person to BarAction along with the information they submitted orginally. in other words how can i conditionally submit a form to another action class on some other server. I ofcourse want the form to be submitted to the local action class, that first checks it, then resubmits to a remote action class, the remote action class then forwards the user to a page on its own remote server. sorry if the above sounds too cryptic. any help would be greatly welcome thanks cheers ajay _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: design question
hi all! would anyone in the spirit of diwali like to help me on this one. how do i direct a form submission to a remote action class, after having fthe form submitted to a local action class first. ie, communicate between two action classes, one of which is on a remote machine. I am looking at sending a URL object with the form data from the local to the remote class, but then depending upon the remote class's response i want to forward the user to a page on the remote machine. Its like a payment system, you select your good at an e-comm website, then click pay. This then transfers you to a payment page located on a payment gateway site. Before the transfer i will have a security session establishment. This is being handled by two Java classes, one on each end. so when the user clicks pay, the following two things happen: - establish secure session - send form data across. I have the first figured out, how do i implement the second? please help. If you have an alternative way of doing it, tell me. any ideas, thoughts would be very much helpful cheers Ajay From: ajay brar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: design question Date: Wed, 22 Oct 2003 17:37:38 +1000 hi! i have the following scenario. server0 - has a jsp page, that allows user to enter the goods they want etc, say foo.jsp server1-jsp payment page, say bar.jsp and action class CommAction on clicking done on foo.jsp, this should establish a connection with CommAction class on server1, perform some identity exchange, based on the exchange, route to bar.jsp i came up with [server0] foo.jsp -FooForm -FooAction [server1] bar.jsp -BarForm -BarAction i have java classes to establish a secure communication between two parties. what i want to do now is, have some way of FooAction (on successful return from the underlying comm establishing class) to direct the person to BarAction along with the information they submitted orginally. in other words how can i conditionally submit a form to another action class on some other server. I ofcourse want the form to be submitted to the local action class, that first checks it, then resubmits to a remote action class, the remote action class then forwards the user to a page on its own remote server. sorry if the above sounds too cryptic. any help would be greatly welcome thanks cheers ajay _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: design question
AFAIK u can do the same using the serialization ( by making ur form implement the serializable interface) or u can also do one case like create the other action class as a seperate module and do switch action which might work out also might help u to switch back in the previous application. I am no expert on security but this might work look what other people might say. ur security depends on how u call ur remote class -Original Message- From: ajay brar [mailto:[EMAIL PROTECTED] Sent: 22 October 2003 16:12 To: [EMAIL PROTECTED] Subject: Re: design question hi all! would anyone in the spirit of diwali like to help me on this one. how do i direct a form submission to a remote action class, after having fthe form submitted to a local action class first. ie, communicate between two action classes, one of which is on a remote machine. I am looking at sending a URL object with the form data from the local to the remote class, but then depending upon the remote class's response i want to forward the user to a page on the remote machine. Its like a payment system, you select your good at an e-comm website, then click pay. This then transfers you to a payment page located on a payment gateway site. Before the transfer i will have a security session establishment. This is being handled by two Java classes, one on each end. so when the user clicks pay, the following two things happen: - establish secure session - send form data across. I have the first figured out, how do i implement the second? please help. If you have an alternative way of doing it, tell me. any ideas, thoughts would be very much helpful cheers Ajay From: ajay brar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: design question Date: Wed, 22 Oct 2003 17:37:38 +1000 hi! i have the following scenario. server0 - has a jsp page, that allows user to enter the goods they want etc, say foo.jsp server1-jsp payment page, say bar.jsp and action class CommAction on clicking done on foo.jsp, this should establish a connection with CommAction class on server1, perform some identity exchange, based on the exchange, route to bar.jsp i came up with [server0] foo.jsp -FooForm -FooAction [server1] bar.jsp -BarForm -BarAction i have java classes to establish a secure communication between two parties. what i want to do now is, have some way of FooAction (on successful return from the underlying comm establishing class) to direct the person to BarAction along with the information they submitted orginally. in other words how can i conditionally submit a form to another action class on some other server. I ofcourse want the form to be submitted to the local action class, that first checks it, then resubmits to a remote action class, the remote action class then forwards the user to a page on its own remote server. sorry if the above sounds too cryptic. any help would be greatly welcome thanks cheers ajay _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: design question
hi! thanks for the reply. How do i do the switch action you talked about. cheers ajay From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: design question Date: Wed, 22 Oct 2003 16:49:32 +0100 AFAIK u can do the same using the serialization ( by making ur form implement the serializable interface) or u can also do one case like create the other action class as a seperate module and do switch action which might work out also might help u to switch back in the previous application. I am no expert on security but this might work look what other people might say. ur security depends on how u call ur remote class -Original Message- From: ajay brar [mailto:[EMAIL PROTECTED] Sent: 22 October 2003 16:12 To: [EMAIL PROTECTED] Subject: Re: design question hi all! would anyone in the spirit of diwali like to help me on this one. how do i direct a form submission to a remote action class, after having fthe form submitted to a local action class first. ie, communicate between two action classes, one of which is on a remote machine. I am looking at sending a URL object with the form data from the local to the remote class, but then depending upon the remote class's response i want to forward the user to a page on the remote machine. Its like a payment system, you select your good at an e-comm website, then click pay. This then transfers you to a payment page located on a payment gateway site. Before the transfer i will have a security session establishment. This is being handled by two Java classes, one on each end. so when the user clicks pay, the following two things happen: - establish secure session - send form data across. I have the first figured out, how do i implement the second? please help. If you have an alternative way of doing it, tell me. any ideas, thoughts would be very much helpful cheers Ajay From: ajay brar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: design question Date: Wed, 22 Oct 2003 17:37:38 +1000 hi! i have the following scenario. server0 - has a jsp page, that allows user to enter the goods they want etc, say foo.jsp server1-jsp payment page, say bar.jsp and action class CommAction on clicking done on foo.jsp, this should establish a connection with CommAction class on server1, perform some identity exchange, based on the exchange, route to bar.jsp i came up with [server0] foo.jsp -FooForm -FooAction [server1] bar.jsp -BarForm -BarAction i have java classes to establish a secure communication between two parties. what i want to do now is, have some way of FooAction (on successful return from the underlying comm establishing class) to direct the person to BarAction along with the information they submitted orginally. in other words how can i conditionally submit a form to another action class on some other server. I ofcourse want the form to be submitted to the local action class, that first checks it, then resubmits to a remote action class, the remote action class then forwards the user to a page on its own remote server. sorry if the above sounds too cryptic. any help would be greatly welcome thanks cheers ajay _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubs.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Design question - using XML for the view.
Hi, I have a number of XML files that define the data (including basic validation) that needs to be collected from different user groups (one group of users will independently fill in the same form). The data can be string, date and numeric etc. All of the XML files conform to the same XML schema. Using XSL the files can be transformed into HTML forms and, I guess, the validation transformed into JavaScript for client side validation. The data once entered into the forms by the users is captured on the server and transformed back into XML. (Further validation may be performed off-line. A user may then be asked to correct the data). Over time there will different XML files that define the HTML forms and each time we would not want to have to create new Java classes if possible. I would like to use Struts but is it a suitable framework to use to build such an application ie will I always need to create xxxForm.java etc? If yes any pointers please. If not any suggestions please? John
design question
Hi, Please help about app design in struts. What I want to do is like tomcat manager tool to allow user stop or start certain services. For instance: I'll have a serviceview.jsp to populate all the services from servicesHashTable. In jsp page, I'll have service description which will display current condition for a specific service and two links(stop, start) to allow next events. I know I can use logic:iterate id=element name=servicesViewHashTable Desc bean:write name=element property=desc/ Start bean:write name=element property=start/ /logic:iterate to bring each service. The problem is: I want to make start is a link associate with an action, come back to refresh the serviceview.jsp and of course, service description will change from stop to start for example. The link will be similar like this: html:link action=servicesAction paramId=method paramValue=bean:write name=element property=start/... How to make it work in the configuration? What else I'll need? Thanks in advance. --Zoe CONFIDENTIALITY NOTICE: The information in this e-mail is privileged and confidential. Any use, copying or dissemination of any portion of this e-mail by or to anyone other than the intended recipient(s) is unauthorized. If you have received this e-mail in error, please reply to sender and delete it from your system immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm Design Question
Hello, I am having trouble wrapping my mind around with how I should design an ActionForm giving the following situation. My form looks like this: Child 1 [Select of all possible parents] Child 2 [Select of all possible parents] Child 3 [Select of all possible parents] ... Each child can have exactly one parent. Each child has a distinct id number. Each parent has a distinct id number. The number of children will vary as will the number of parents. When the form is posted I need to be able to retrieve the child id and the associatated parent id. Thanks for any advice... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question...
Sorry if this is a little off-topic but it has to do with Struts because I am using struts for my web app. I have been reading about the View Helper pattern off the sun website and have two ways of thinking about implementing this pattern. First is the way that I currently have setup: Use an action to call a method on the Delegate. The Delegate create a JavaBean (Value Bean) that has the data that I need for the particular page that I am trying to view. The Action then sets that view in the session scope (tried request scope, but it didn't work) and then forwards to a jsp. The jsp then uses the java bean from the session scope to fill in data for the webpage. Now for the other way that I was thinking of: In the jsp page that I am trying to view, first create a new instance of the JavaBean by calling jsp:useBean tag. Then, use the JSTL tags to set parameters that could be passed in from the url. The JavaBean then does the calling of the Delegate to get the information that it requires (potentially in several method calls). In the jsp, using jsp tags I call the getProperty to get the information needed to fill in the data for the website. In other words, the getProperty invoke the JavaBean to call the Delegate to get the information that is needed. The way I see it, there is a trade-off between the two ways of doing this. The first way does not allow (easily) for the adding of request parameters to the url to change the view. The second way, though, could potentially involve many expensive RMI calles to the EJB Container, which is where I am getting the data for the web pages. I would appreciate any of your thoughts as to how best to proceed. Thanks in advance for all your suggestions! Keith Pemberton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts workflow extension] design question
[EMAIL PROTECTED] wrote: Thanks Matthias, I will have a close look at the demo and test applications.I need some generic way to add the workflow extention to my existing working screens so that the user will be kept informed of the workflow violations and given a choice to leave the workflow or stay in the workflow.So I am looking at some way to write a generic action which will allow the user to terminate or continue in the workflow. Any how, I will first look at the applications included with download bundle.I hope that i will not be required to extend the workFlowProcessorLogic. You really should not. If there is some required functionality missing to accomplish this, I am certainly interested in incorporating this. Thus, please let me know, if you are not able to meet your reqirements with the current version of the extension. But I still have my original doubt.Why does the WorkflowRequestProcessorLogic class not have a public constructor?Should it not be extendable?Or it was a design decision due to some reasons.Because I think keeping in line with the struts philosophy, you could give a couple of extension points in your framework.And the way it is designed, I dont see a reason why it will not become a defacto extention for workflow problems. It was just an oversight not to provide a public constructor. Will keep this in my todo list and fix it in the next release. --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [struts workflow extension] design question
Hi Matthias, Thanks for the response. Right now I my requirements are mostly satisfied by the workflow extention.But as pointed out in another recent mail, the ability to specify just one workflow violation forward per workflow is a bit constraining.Can you not provide atleast 2 workflow violation forwards per workflow? This will allow the user the configure different page forwards in case of previous state condition violation and nest state condition violation.Because I have exactly same requirements for some of my pages.Following is the scenario. Order Entry workflow: 1.page 1 :user selects order parameters and presses ok button. 2.page 2 :order review screen.User can review the order details and then say ok or cancel. 3.page 3. User gets the confirmed order details if he says ok. Now the requirement is as follows. 1.If the user is in the middle of order entry workflow(say page 2:order review screen) and from there he leaves the workflow by clicking some link on menu item.In this case he should be allowed to leave the workflow but just a proper warning should be displayed on the next page (The page he selected from Menu). 2.The user tries to jump directly in the middle of workflow.(By using bookmark or by typing the URL of say page 2:order review screen)In this case he should be thrown back to page 1 of workflow(Order entry screen with proper warning.) Now as you can see, case 1 is next state violation and case 2 is previous state violation and I want to handle those differently.Also as I want to add a warning in those cases, a post processing hook to the workflow request processor/or workflowProcessorLogic will be very helpful so that I can add such functionality by extending the workflowProcessorLogic or workflow request processor. Also about extending the WorkFlowLogic class,most of the other classes have package constructors or their methods are package level /private visibility.So if you can also look into this , it will benefit a lot of users like me who want to extend the functionality of the WorkFlow extension. All said, I must congratulate you on this very well designed extension.Because after some studies, we found that it meets most of our requirements. Any suggestions about achieving above mentioned functionality without extending the framework will be really useful. Regards, Shirish. -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 9:47 AM To: Struts Users Mailing List Subject: Re: [struts workflow extension] design question [EMAIL PROTECTED] wrote: Thanks Matthias, I will have a close look at the demo and test applications.I need some generic way to add the workflow extention to my existing working screens so that the user will be kept informed of the workflow violations and given a choice to leave the workflow or stay in the workflow.So I am looking at some way to write a generic action which will allow the user to terminate or continue in the workflow. Any how, I will first look at the applications included with download bundle.I hope that i will not be required to extend the workFlowProcessorLogic. You really should not. If there is some required functionality missing to accomplish this, I am certainly interested in incorporating this. Thus, please let me know, if you are not able to meet your reqirements with the current version of the extension. But I still have my original doubt.Why does the WorkflowRequestProcessorLogic class not have a public constructor?Should it not be extendable?Or it was a design decision due to some reasons.Because I think keeping in line with the struts philosophy, you could give a couple of extension points in your framework.And the way it is designed, I dont see a reason why it will not become a defacto extention for workflow problems. It was just an oversight not to provide a public constructor. Will keep this in my todo list and fix it in the next release. --- Matthias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts workflow extension] design question
Shirish, first of all: Thank you. I certainly like to hear that the Struts Workflow Extension meets your requirements and you like the approach I have taken. Regarding the general need to distinguish nextState and prevState violations: There is an action contained in the package that can easily be used to handle exactly the cases you are talking about: ForwardNextStateViolationAction. Here is, what it is meant for: Use this class in the action that handles workflow violations. It chooses the forward noNextStateViolation, if there was no nextState violation encountered (i. e. it must have been a prevState violation). If a nextState violation was encountered it forwards to the path that caused this workflow violation (this can be an arbitrary action choosen from your menu). If you want to put a message in request/session scope when this happens, just write a slightly modified action which is pretty similar to ForwardNextStateViolationAction that additionally takes care of saving the message. Have a look at the action's code: It uses the method WorkflowUtils.getNextStateViolationAction that provides the required information. I chose to take this approach for the following two advantages: 1. the number of global forwards stays smaller, as there is only one global forward definition per workflow + in many situations you don't even care whether it was a prevState or nextState violation 2. if you need to distinguish whether you are dealing with a prevState or nextState violation and can retrieve the action path that caused the workflow violation, do whatever you like and forward the user to this path he requested Concerning your other request for extendability: Yes, I will take care of that. Even though it is sometimes good to have extendability restricted, because people tend to reimplement their own solutions while there are already the right mechanisms available. ;-) Hope this additional info helps. --- Matthias [EMAIL PROTECTED] wrote: Hi Matthias, Thanks for the response. Right now I my requirements are mostly satisfied by the workflow extention.But as pointed out in another recent mail, the ability to specify just one workflow violation forward per workflow is a bit constraining.Can you not provide atleast 2 workflow violation forwards per workflow? This will allow the user the configure different page forwards in case of previous state condition violation and nest state condition violation.Because I have exactly same requirements for some of my pages.Following is the scenario. Order Entry workflow: 1.page 1 :user selects order parameters and presses ok button. 2.page 2 :order review screen.User can review the order details and then say ok or cancel. 3.page 3. User gets the confirmed order details if he says ok. Now the requirement is as follows. 1.If the user is in the middle of order entry workflow(say page 2:order review screen) and from there he leaves the workflow by clicking some link on menu item.In this case he should be allowed to leave the workflow but just a proper warning should be displayed on the next page (The page he selected from Menu). 2.The user tries to jump directly in the middle of workflow.(By using bookmark or by typing the URL of say page 2:order review screen)In this case he should be thrown back to page 1 of workflow(Order entry screen with proper warning.) Now as you can see, case 1 is next state violation and case 2 is previous state violation and I want to handle those differently.Also as I want to add a warning in those cases, a post processing hook to the workflow request processor/or workflowProcessorLogic will be very helpful so that I can add such functionality by extending the workflowProcessorLogic or workflow request processor. Also about extending the WorkFlowLogic class,most of the other classes have package constructors or their methods are package level /private visibility.So if you can also look into this , it will benefit a lot of users like me who want to extend the functionality of the WorkFlow extension. All said, I must congratulate you on this very well designed extension.Because after some studies, we found that it meets most of our requirements. Any suggestions about achieving above mentioned functionality without extending the framework will be really useful. Regards, Shirish. -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 9:47 AM To: Struts Users Mailing List Subject: Re: [struts workflow extension] design question [EMAIL PROTECTED] wrote: Thanks Matthias, I will have a close look at the demo and test applications.I need some generic way to add the workflow extention to my existing working screens so that the user will be kept informed of the workflow violations and given a choice to leave the workflow or stay in the workflow.So I am looking at some way to write a generic action which will allow the user to terminate or continue
RE: [struts workflow extension] design question
Thanks Matthias, I will have a close look at the demo and test applications.I need some generic way to add the workflow extention to my existing working screens so that the user will be kept informed of the workflow violations and given a choice to leave the workflow or stay in the workflow.So I am looking at some way to write a generic action which will allow the user to terminate or continue in the workflow. Any how, I will first look at the applications included with download bundle.I hope that i will not be required to extend the workFlowProcessorLogic. But I still have my original doubt.Why does the WorkflowRequestProcessorLogic class not have a public constructor?Should it not be extendable?Or it was a design decision due to some reasons.Because I think keeping in line with the struts philosophy, you could give a couple of extension points in your framework.And the way it is designed, I dont see a reason why it will not become a defacto extention for workflow problems. Any thoughts/ideas from other existing users of this extension. Regards, Shirish. -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 5:26 PM To: Struts Users Mailing List Subject: Re: [struts workflow extension] design question Shirish, why do you want to change the workflow extension for doing this? Maybe you want to have a look at the demo application. If I am getting you right, I suppose I am doing exactly what you want to do: Just let the action that handles the workflow violation put the application specific warning in the session. With this mechanism you cannot only make this warning application specific but even specific to the workflow that is violated. --- Matthias [EMAIL PROTECTED] wrote: Hi , I need to extend the functionality of struts workflow extension provided by Mr. Matthias Bauer( http://www.livinglogic.de/Struts/index.html ). I want to add some Warning messages when the workflow exception occurs.For the same, I need to Extend the WorkflowRequestProcessorLogic class and override the processCheckWorkflows method so that the ApplicationSpecific Warning can be added in the session. The method is protected but the class has no public constructor which is preventing me from extending the same. Can anybody from the committers of the project team me why is this so?Was it a conscious design decision? TIA. Shirish -Original Message- From: Adolfo Miguelez [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:08 PM To: [EMAIL PROTECTED] Subject: Re: Value assignment to html:hidden field... What about this? bean:define id=date name=BussinessDate scope=session/ html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ Adolfo. From: Abhijeet Mahalkar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Value assignment to html:hidden field... Date: Thu, 25 Sep 2003 15:09:16 +0530 how can we assign the JSP value to the hidden field code is as follows String date = session.getValue(BussinessDate); this date variable i want to assign to following field... html:hidden property=txtBusidate width=15 size=25 maxlength=25 / will this work ? html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ please suggest abbey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Design Question
Hey all, After reading the [Poll] action mappings thread, I now have a couple of design questions. I've got a lot of actions right now and I'd like to group related functionality into one action. I'm thinking of extending the DispatchAction and creating functions to search/view/create/update/delete/load my objects. I'd like to create separate action mappings for each function. My question is, can I hardcode my dispatch parameter in the action mapping or do I have to send it in ever request from the page? Thanks in advance, Graham Graham Lounder - Java Developer CARIS Spatial Components Division [EMAIL PROTECTED] Phone: (506) 458-8533 Fax:(506) 459-3849 NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Design Question
You know, this is an enhancement I've been thinking about. You could certainly add it as a parameter in the action mapping. action path=/EmpTblDisplay type=ProjectAction name=EmpTblFormBean scope=request input=EmpTblDisplayTile validate=false parameter=Read forward name=display path=EmpTblDisplayTile/ /action And then you're all set... Of course, then you don't really need a dispatch action, you need to create your own version that reads this parameter instead of the request parameters. But I'm wondering if there isn't a better way. -Original Message- From: Graham Lounder [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 8:13 AM To: [EMAIL PROTECTED] Subject: Action Design Question Hey all, After reading the [Poll] action mappings thread, I now have a couple of design questions. I've got a lot of actions right now and I'd like to group related functionality into one action. I'm thinking of extending the DispatchAction and creating functions to search/view/create/update/delete/load my objects. I'd like to create separate action mappings for each function. My question is, can I hardcode my dispatch parameter in the action mapping or do I have to send it in ever request from the page? Thanks in advance, Graham Graham Lounder - Java Developer CARIS Spatial Components Division [EMAIL PROTECTED] Phone: (506) 458-8533 Fax:(506) 459-3849 NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Design Question
Graham Lounder wrote: Hey all, After reading the [Poll] action mappings thread, I now have a couple of design questions. I've got a lot of actions right now and I'd like to group related functionality into one action. I'm thinking of extending the DispatchAction and creating functions to search/view/create/update/delete/load my objects. I would strongly advise against this. Keeping each action simple is the way to go. 2 1/2 years ago I had created the first struts web application for the company I was working for at the time. I went away on a 3 week honeymoon and when I came back the programer that was covering had consolidated the list/create/delete/search/view/load/update into one action. Previously it had been load, view/update/create, list/delete, search in three different actions. 2 years later those Actions are nightmares to maintain since they contain multiple switch/if whose flow of control is very hard to trace. Every time we add a new type of object some new programmer will copy the combined action and now there are 30 very hard to maintain Actions. To make it worse the portal code has been forked so the same code is replicated across many projects. Everyone hates working on those Actions, not just me. So I would recommend grouping them as load, view/update/create, list/delete, search. The grouping is : load is kept seperate, take a look at the validator example in the nightly build, the editJsType, jsType actions. to see the pattern used to keep from replicating the load code when an error happens and a action calls its input. operations that operate on a single object can be grouped together(except load), operations that work on lists of objects can be combined(except the load for a list). search , possibly can be combined with the view/update/create. It's true that some of the logic will be duplicated, but that logic never changes. -Rob I'd like to create separate action mappings for each function. My question is, can I hardcode my dispatch parameter in the action mapping or do I have to send it in ever request from the page? Thanks in advance, Graham Graham Lounder - Java Developer CARIS Spatial Components Division [EMAIL PROTECTED] Phone: (506) 458-8533 Fax:(506) 459-3849 NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Design Question
I don't know if this was the 'right' thing to do, but I extended DispatchAction, overrode the execute method to use the hardcoded value rather than looking up a request parameter, and pass that along to dispatchMethod. My actions then inherit from this modified class. You can safely cut out the lines with ServletContext if you don't care about logging invalid parameters. Here's the source /** Overrides the execute method of DispatchAction so that rather than use the parameter to determine which request parameter contains the action to execute, it uses the parameter property directly @param mapping ActionMapping @param form Form associated with action @param HttpServletRequest Current request object @param HttpServletResponse Current response stream **/ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String parameter = mapping.getParameter(); if (parameter == null) { String error = Could not locate the requested forward; ServletContext context = getServlet().getServletContext(); ServletContextWriter output = new ServletContextWriter(context); output.write(error); output.flush(); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, error); return null; } return dispatchMethod(mapping, form, request, response, parameter); } -- Nathan Rogers Library Technology Group 312F Memorial Library 728 State Street 261-1409 Graham Lounder wrote: Hey all, After reading the [Poll] action mappings thread, I now have a couple of design questions. I've got a lot of actions right now and I'd like to group related functionality into one action. I'm thinking of extending the DispatchAction and creating functions to search/view/create/update/delete/load my objects. I'd like to create separate action mappings for each function. My question is, can I hardcode my dispatch parameter in the action mapping or do I have to send it in ever request from the page? Thanks in advance, Graham Graham Lounder - Java Developer CARIS Spatial Components Division [EMAIL PROTECTED] Phone: (506) 458-8533 Fax:(506) 459-3849 NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Design Question
In the latest nightly builds there is a 'MappingDispatchAction' that does this for you (takes the parameter directly). Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Nathan Rogers [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 11:00 AM To: Struts Users Mailing List Subject: Re: Action Design Question I don't know if this was the 'right' thing to do, but I extended DispatchAction, overrode the execute method to use the hardcoded value rather than looking up a request parameter, and pass that along to dispatchMethod. My actions then inherit from this modified class. You can safely cut out the lines with ServletContext if you don't care about logging invalid parameters. Here's the source /** Overrides the execute method of DispatchAction so that rather than use the parameter to determine which request parameter contains the action to execute, it uses the parameter property directly @param mapping ActionMapping @param form Form associated with action @param HttpServletRequest Current request object @param HttpServletResponse Current response stream **/ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String parameter = mapping.getParameter(); if (parameter == null) { String error = Could not locate the requested forward; ServletContext context = getServlet().getServletContext(); ServletContextWriter output = new ServletContextWriter(context); output.write(error); output.flush(); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERRO R, error); return null; } return dispatchMethod(mapping, form, request, response, parameter); } -- Nathan Rogers Library Technology Group 312F Memorial Library 728 State Street 261-1409 Graham Lounder wrote: Hey all, After reading the [Poll] action mappings thread, I now have a couple of design questions. I've got a lot of actions right now and I'd like to group related functionality into one action. I'm thinking of extending the DispatchAction and creating functions to search/view/create/update/delete/load my objects. I'd like to create separate action mappings for each function. My question is, can I hardcode my dispatch parameter in the action mapping or do I have to send it in ever request from the page? Thanks in advance, Graham == == Graham Lounder - Java Developer CARIS Spatial Components Division [EMAIL PROTECTED] Phone: (506) 458-8533 Fax:(506) 459-3849 == == NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[struts workflow extension] design question
Hi , I need to extend the functionality of struts workflow extension provided by Mr. Matthias Bauer( http://www.livinglogic.de/Struts/index.html ). I want to add some Warning messages when the workflow exception occurs.For the same, I need to Extend the WorkflowRequestProcessorLogic class and override the processCheckWorkflows method so that the ApplicationSpecific Warning can be added in the session. The method is protected but the class has no public constructor which is preventing me from extending the same. Can anybody from the committers of the project team me why is this so?Was it a conscious design decision? TIA. Shirish -Original Message- From: Adolfo Miguelez [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:08 PM To: [EMAIL PROTECTED] Subject: Re: Value assignment to html:hidden field... What about this? bean:define id=date name=BussinessDate scope=session/ html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ Adolfo. From: Abhijeet Mahalkar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Value assignment to html:hidden field... Date: Thu, 25 Sep 2003 15:09:16 +0530 how can we assign the JSP value to the hidden field code is as follows String date = session.getValue(BussinessDate); this date variable i want to assign to following field... html:hidden property=txtBusidate width=15 size=25 maxlength=25 / will this work ? html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ please suggest abbey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts workflow extension] design question
Shirish, why do you want to change the workflow extension for doing this? Maybe you want to have a look at the demo application. If I am getting you right, I suppose I am doing exactly what you want to do: Just let the action that handles the workflow violation put the application specific warning in the session. With this mechanism you cannot only make this warning application specific but even specific to the workflow that is violated. --- Matthias [EMAIL PROTECTED] wrote: Hi , I need to extend the functionality of struts workflow extension provided by Mr. Matthias Bauer( http://www.livinglogic.de/Struts/index.html ). I want to add some Warning messages when the workflow exception occurs.For the same, I need to Extend the WorkflowRequestProcessorLogic class and override the processCheckWorkflows method so that the ApplicationSpecific Warning can be added in the session. The method is protected but the class has no public constructor which is preventing me from extending the same. Can anybody from the committers of the project team me why is this so?Was it a conscious design decision? TIA. Shirish -Original Message- From: Adolfo Miguelez [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 12:08 PM To: [EMAIL PROTECTED] Subject: Re: Value assignment to html:hidden field... What about this? bean:define id=date name=BussinessDate scope=session/ html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ Adolfo. From: Abhijeet Mahalkar [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Value assignment to html:hidden field... Date: Thu, 25 Sep 2003 15:09:16 +0530 how can we assign the JSP value to the hidden field code is as follows String date = session.getValue(BussinessDate); this date variable i want to assign to following field... html:hidden property=txtBusidate width=15 size=25 maxlength=25 / will this work ? html:hidden value = %=date % property=txtBusidate width=15 size=25 maxlength=25/ please suggest abbey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Form Design Question
That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting on an Action needing one form for input and one form for output. If I totally ignore it, the second page will render, but what if I need my html form in the second JSP(JSPB) to be prepopulated with the results of the processing in ActionA? Scenario: I have jspA that is rendered with ActionFormA. Now user submits that data to ActionA. ActionA recieves an ActionFormA as its input form in execute. Now ActionA needs to forward to jspB which expectes an ActionFormB, what is the cleanest way to handle this in struts(see code below). Do struts users run across this case often or do I need to rethink my Action/Form design? --m Robert Taylor wrote: This was discussed earlier this week. Some solutions are addressed here: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg81101.html robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 6:10 PM To: struts-user Subject: Action Form Design Question I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Form Design Question
On 09/21/2003 09:02:43 PM Robert Taylor wrote: H. Well, yes, you could call this chaining to some degree. But I think its necessary chaining or even (dare I say it?) good chaining :) IMHO the following is a good design pattern: SetupPageAAction == PageA == ProcessPageAAction == SetupPageBAction == PageB == ProcessPageBAction Agreed. I use this throughout my application and it works well. The only coupling here is that SetupPageBAction needs to know that the data needed to populate the form used for PageB is found in some scope (request, session, or application) under a name. The only reason to do this is to prevent from having to manually create the form needed for PageB in ProcessPageAction. Yes, there is some loose coupling but the cohesion is tighter within actions and as we discussed before, we allow Struts to do it is allowed to manage the action form life cycle. So, the bottom line is that somewhere you have to prepare PageB for display. Should you do it in ProcessPageAction or should you place the data in request scope and pass it along to an action dedicated to preparing PageB? Setting up PageB from SetupPageBAction (instead of within ProcessPageAAction) allows you to reuse the Setup/Page/Process for B from elsewhere in your application, not just after PageA has completed. I tend to keep these Setup/Page/Process units distinct for my pages so that they can be called from various places in the web app ... menu options, page links, and page forwards ... as is often a requirement for my application. Susan Bradeen I think when you here others speak of chaing as bad, they mean using actions as business components and trying to use (or reuse) them in a sequence. This type of logic or use of objects should be reserved for the business tier and not the presentation tier. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Sunday, September 21, 2003 5:43 PM To: Struts Users Mailing List Subject: Re: Action Form Design Question Thanks Robert! I agree on letting struts do it's job where available, that's why I thought my code snippet below was a little goofy. My only question about your suggestions is in solution 2 you mention having a second action. You're not suggesting action chaining are you? If not, how do you hook into second action the struts way? Or would this be one place where action chaining is accepted? Thanks again! --m Robert Taylor wrote: I would say the solution depends on the process. If the process of going from pageA to pageB to ... pageN, is a wizard style process then you might think of placing all your data in the same form and putting the form in session scope. If you don't want to put your form in session scope AND the data you capture along the way can be stored in hidden fields, then you could also use a single form placed in request scope. If the process is somewhat disjoint and you have separate forms, then is the data to be rendered in pageB unique to the user? Is it static data? If so, place that data in ServletContext and make it available to all users and you don't need a set up action for pageB. If the data IS unique to the user AND you have separate forms then in this situation, I would still let Struts perform the form creation. -Soluation 1: Place the data retrieved from processing pageA in request scope and forward to the page and tell the particular html component to look for the data in the request under some defined name. -Solution 2: Insert and additional preparation action in between the action processing pageA and pageB; call it ShowPageB or something of the sort. ShowPageB action would access the data out of request scope and populate the form defined for pageB and forward to pageB. There are so many ways to approach this solution. It's subjective to the complexity of the process. I wouldn't stress over the fact of having to place data in the request scope temporarily. What I would stress is let Struts do its job where possible - like creating action forms. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 11:09 AM To: Struts Users Mailing List Subject: Re: Action Form Design Question // /// //I've been having issues with posting to this list, so I apologize if this is a repost. // /// That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting
Struts reusable jsp design question?
Warning I am new to Struts, so I appoligize if this has been addressed before, however I have not found a discussion on this. I want to create a jsp that is reusable from several jsps, for this discussion I will call it Resuable.jsp. Here is the problem I am trying to solve. CallerOne.jsp requires 3 pieces of data(key1, key2, key3), so I have CallerOnePreparePageAction that prepares the data for the jsp. CallerOne.jsp calls ResuablePreparePageAction passing in the data needed by Reusable.jsp. Reusable.jsp call ReusableAction to perform its task. If successful ReusableAction needs to return to who ever called it and needs to pass back the required pieces of data needed by the caller, in this case (key1, key2, key3). I want this to work if CallerTwo.jsp that requires, 4 different pieces of information calls Reusable.jsp as well. Some ideas: I could require that the return action, and a list of return fields be specified, but that would seem to require building hidden fields on the Reusable.jsp and building a dynamic forward in ReusableAction. I could put the caller's form bean in session scope, and pass in the return action, but what about multiple browser windows being opened on the caller? Is there a Struts best practices approach to this problem? thanks in advance, Bob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts reusable jsp design question?
Have you looked at Tiles? -Original Message- From: Bob Jensen [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2003 3:49 PM To: [EMAIL PROTECTED] Subject: Struts reusable jsp design question? Warning I am new to Struts, so I appoligize if this has been addressed before, however I have not found a discussion on this. I want to create a jsp that is reusable from several jsps, for this discussion I will call it Resuable.jsp. Here is the problem I am trying to solve. CallerOne.jsp requires 3 pieces of data(key1, key2, key3), so I have CallerOnePreparePageAction that prepares the data for the jsp. CallerOne.jsp calls ResuablePreparePageAction passing in the data needed by Reusable.jsp. Reusable.jsp call ReusableAction to perform its task. If successful ReusableAction needs to return to who ever called it and needs to pass back the required pieces of data needed by the caller, in this case (key1, key2, key3). I want this to work if CallerTwo.jsp that requires, 4 different pieces of information calls Reusable.jsp as well. Some ideas: I could require that the return action, and a list of return fields be specified, but that would seem to require building hidden fields on the Reusable.jsp and building a dynamic forward in ReusableAction. I could put the caller's form bean in session scope, and pass in the return action, but what about multiple browser windows being opened on the caller? Is there a Struts best practices approach to this problem? thanks in advance, Bob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wizard pages in Struts design question
I read the HowTo write a wizard on the Struts web-site but I wasn't really happy with the solution, and I am looking for a better one. I came up with another way and I would appreciate your comments. The design consists of: - The 'form' is a session scope form - WizardAction class (a DispatchAction based) with following methods: * init () - starting the wizard and redirect to the first page * finish () - (or save()) finish the wizard and save the information in the form using some business logic delegate. - Each Page or step in the wizard is a separate Action class, extending a WizrardBaseAction (a DispatchAction based) which contains some shared methods. For example: Page1Action extends WizardBaseAction { // initializes the page (done only on first encounter) ActionForward init (mapping,...) throws Exception; ActionForward back (mapping,...) throws Exception; ActionForward next (mapping,...) throws Exception; ActionForward finish (mapping,...) throws Exception; } - Each page/step has a separate action-mapping item in the configuration with local forwards for : 'back' (if not the first page), 'next', 'finish' (if allowed from that page). I apologize for not sketching the whole idea down to the last bit but I hope you get the picture. Only problem is that this design touches the question of chaining actions verses forward redirection (not just dispatching). For example the Page1Action.next() does the following: 1. validate the page 2. perform whatever processing required 3. return the next action to forward to (redirect or chain with all its illness..) In my opinion (humble one of course :) having such a separation keeping each step in its own class is better and clearer design than having them all in the same Action class. Isn't there a way to prevent the reset + pre-population of the form done while chaining actions? Furthermore, is it so bad to redirect between actions? Thanks in advance, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Form Design Question
I would say the solution depends on the process. If the process of going from pageA to pageB to ... pageN, is a wizard style process then you might think of placing all your data in the same form and putting the form in session scope. If you don't want to put your form in session scope AND the data you capture along the way can be stored in hidden fields, then you could also use a single form placed in request scope. If the process is somewhat disjoint and you have separate forms, then is the data to be rendered in pageB unique to the user? Is it static data? If so, place that data in ServletContext and make it available to all users and you don't need a set up action for pageB. If the data IS unique to the user AND you have separate forms then in this situation, I would still let Struts perform the form creation. -Soluation 1: Place the data retrieved from processing pageA in request scope and forward to the page and tell the particular html component to look for the data in the request under some defined name. -Solution 2: Insert and additional preparation action in between the action processing pageA and pageB; call it ShowPageB or something of the sort. ShowPageB action would access the data out of request scope and populate the form defined for pageB and forward to pageB. There are so many ways to approach this solution. It's subjective to the complexity of the process. I wouldn't stress over the fact of having to place data in the request scope temporarily. What I would stress is let Struts do its job where possible - like creating action forms. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 11:09 AM To: Struts Users Mailing List Subject: Re: Action Form Design Question // /// //I've been having issues with posting to this list, so I apologize if this is a repost. // /// That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting on an Action needing one form for input and one form for output. If I totally ignore it, the second page will render, but what if I need my html form in the second JSP(JSPB) to be prepopulated with the results of the processing in ActionA? Scenario: I have jspA that is rendered with ActionFormA. Now user submits that data to ActionA. ActionA recieves an ActionFormA as its input form in execute. Now ActionA needs to forward to jspB which expectes an ActionFormB, what is the cleanest way to handle this in struts(see code below). Do struts users run across this case often or do I need to rethink my Action/Form design? --m Robert Taylor wrote: This was discussed earlier this week. Some solutions are addressed here: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg8 1101.html robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 6:10 PM To: struts-user Subject: Action Form Design Question I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e
Re: Wizard pages in Struts design question
To prevent repopulation of an ActionForm's properties, you just need to provide a property that observes that status of another property that indicates whether the form is readonly or not. So, instead of just doing this.property = property you have if (mutable) this.property = property Or do something more sophisticated, like have it look at the page number and then decide whether to set itself or not. Though, IMHO, the behavior for a step is so complicated that you want to put it in its own action, it should probably be outside of Struts all together, and part of the business logic layer. (This is why chaining is frowned upon. It's a red flag that indicates business logic is creeping into your Action classes. When the business logic is sufficiently fine-grained, you should just be able to whatever you need to do from whatever Action you happen to be in. As work progresses on Commons Chain, I think this will provide a solution many people will prefer to chaining Struts Action). I haven't had a chance to abstract it into a standard class, but here's a wizard Action that I'm working with now. It submits back to the same class, but uses a dispatch action so that if a step needs more behavior it can be encapsulated that way. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/apps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java The steps are laid out as ActionForwards to the instant ActionMapping, making it very easy to rewrite. -Ted. Erez Efrati wrote: I read the HowTo write a wizard on the Struts web-site but I wasn't really happy with the solution, and I am looking for a better one. I came up with another way and I would appreciate your comments. The design consists of: - The 'form' is a session scope form - WizardAction class (a DispatchAction based) with following methods: * init () - starting the wizard and redirect to the first page * finish () - (or save()) finish the wizard and save the information in the form using some business logic delegate. - Each Page or step in the wizard is a separate Action class, extending a WizrardBaseAction (a DispatchAction based) which contains some shared methods. For example: Page1Action extends WizardBaseAction { // initializes the page (done only on first encounter) ActionForward init (mapping,...) throws Exception; ActionForward back (mapping,...) throws Exception; ActionForward next (mapping,...) throws Exception; ActionForward finish (mapping,...) throws Exception; } - Each page/step has a separate action-mapping item in the configuration with local forwards for : 'back' (if not the first page), 'next', 'finish' (if allowed from that page). I apologize for not sketching the whole idea down to the last bit but I hope you get the picture. Only problem is that this design touches the question of chaining actions verses forward redirection (not just dispatching). For example the Page1Action.next() does the following: 1. validate the page 2. perform whatever processing required 3. return the next action to forward to (redirect or chain with all its illness..) In my opinion (humble one of course :) having such a separation keeping each step in its own class is better and clearer design than having them all in the same Action class. Isn't there a way to prevent the reset + pre-population of the form done while chaining actions? Furthermore, is it so bad to redirect between actions? Thanks in advance, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Get Ready, We're Moving Out!! - http://www.clark04.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Form Design Question
Thanks Robert! I agree on letting struts do it's job where available, that's why I thought my code snippet below was a little goofy. My only question about your suggestions is in solution 2 you mention having a second action. You're not suggesting action chaining are you? If not, how do you hook into second action the struts way? Or would this be one place where action chaining is accepted? Thanks again! --m Robert Taylor wrote: I would say the solution depends on the process. If the process of going from pageA to pageB to ... pageN, is a wizard style process then you might think of placing all your data in the same form and putting the form in session scope. If you don't want to put your form in session scope AND the data you capture along the way can be stored in hidden fields, then you could also use a single form placed in request scope. If the process is somewhat disjoint and you have separate forms, then is the data to be rendered in pageB unique to the user? Is it static data? If so, place that data in ServletContext and make it available to all users and you don't need a set up action for pageB. If the data IS unique to the user AND you have separate forms then in this situation, I would still let Struts perform the form creation. -Soluation 1: Place the data retrieved from processing pageA in request scope and forward to the page and tell the particular html component to look for the data in the request under some defined name. -Solution 2: Insert and additional preparation action in between the action processing pageA and pageB; call it ShowPageB or something of the sort. ShowPageB action would access the data out of request scope and populate the form defined for pageB and forward to pageB. There are so many ways to approach this solution. It's subjective to the complexity of the process. I wouldn't stress over the fact of having to place data in the request scope temporarily. What I would stress is let Struts do its job where possible - like creating action forms. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 11:09 AM To: Struts Users Mailing List Subject: Re: Action Form Design Question // /// //I've been having issues with posting to this list, so I apologize if this is a repost. // /// That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting on an Action needing one form for input and one form for output. If I totally ignore it, the second page will render, but what if I need my html form in the second JSP(JSPB) to be prepopulated with the results of the processing in ActionA? Scenario: I have jspA that is rendered with ActionFormA. Now user submits that data to ActionA. ActionA recieves an ActionFormA as its input form in execute. Now ActionA needs to forward to jspB which expectes an ActionFormB, what is the cleanest way to handle this in struts(see code below). Do struts users run across this case often or do I need to rethink my Action/Form design? --m Robert Taylor wrote: This was discussed earlier this week. Some solutions are addressed here: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg8 1101.html robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 6:10 PM To: struts-user Subject: Action Form Design Question I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success
RE: Wizard pages in Struts design question
Ted, From reading your WizardAction code it seems that in a way it maintains an internal mechanism of redirection between the submitting of the current step and preparation of the next step sub-actions, while keeping Struts out of it. So in the end - not exposing the internal redirection avoids the famous Struts action chaining issue. Erez -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, September 21, 2003 5:00 PM To: Struts Users Mailing List Subject: Re: Wizard pages in Struts design question To prevent repopulation of an ActionForm's properties, you just need to provide a property that observes that status of another property that indicates whether the form is readonly or not. So, instead of just doing this.property = property you have if (mutable) this.property = property Or do something more sophisticated, like have it look at the page number and then decide whether to set itself or not. Though, IMHO, the behavior for a step is so complicated that you want to put it in its own action, it should probably be outside of Struts all together, and part of the business logic layer. (This is why chaining is frowned upon. It's a red flag that indicates business logic is creeping into your Action classes. When the business logic is sufficiently fine-grained, you should just be able to whatever you need to do from whatever Action you happen to be in. As work progresses on Commons Chain, I think this will provide a solution many people will prefer to chaining Struts Action). I haven't had a chance to abstract it into a standard class, but here's a wizard Action that I'm working with now. It submits back to the same class, but uses a dispatch action so that if a step needs more behavior it can be encapsulated that way. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java The steps are laid out as ActionForwards to the instant ActionMapping, making it very easy to rewrite. -Ted. Erez Efrati wrote: I read the HowTo write a wizard on the Struts web-site but I wasn't really happy with the solution, and I am looking for a better one. I came up with another way and I would appreciate your comments. The design consists of: - The 'form' is a session scope form - WizardAction class (a DispatchAction based) with following methods: * init () - starting the wizard and redirect to the first page * finish () - (or save()) finish the wizard and save the information in the form using some business logic delegate. - Each Page or step in the wizard is a separate Action class, extending a WizrardBaseAction (a DispatchAction based) which contains some sharedmethods. For example: Page1Action extends WizardBaseAction { // initializes the page (done only on first encounter) ActionForward init (mapping,...) throws Exception; ActionForward back (mapping,...) throws Exception; ActionForward next (mapping,...) throws Exception;ActionForward finish (mapping,...) throws Exception; } - Each page/step has a separate action-mapping item in the configuration with local forwards for : 'back' (if not the first page), 'next', 'finish' (if allowed from that page). I apologize for not sketching the whole idea down to the last bit but I hope you get the picture. Only problem is that this design touches the question of chaining actions verses forward redirection (not just dispatching). For example the Page1Action.next() does the following: 1. validate the page 2. perform whatever processing required 3. return the next action to forward to (redirect or chain with all its illness..) In my opinion (humble one of course :) having such a separation keeping each step in its own class is better and clearer design than having them all in the same Action class. Isn't there a way to prevent the reset + pre-population of the form done while chaining actions? Furthermore, is it so bad to redirect between actions? Thanks in advance, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Get Ready, We're Moving Out!! - http://www.clark04.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED
RE: Wizard pages in Struts design question
About your suggestion of avoiding repopulating... I guess this cannot be done using DynaActionForms, or am missing something? I agree that the step code should be part of the logic but still the action should activate it somehow, by calling it. I can't see how chaining actions has to be an indication of logic code creeping into the action code - It see how it can indicate but IMMO it's not always the case. In the wizard example, I can't see why not having each step in its own Struts action. Clicking next on the page1, activates the submit on that step action, which may call some business logic delegate to perform whatever is necessary, and then directing to the next step dispatching its init method. After page2 step init() method is done, it directs to something like 'viewForm' and next step is displayed populated as required. Erez -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Sunday, September 21, 2003 5:00 PM To: Struts Users Mailing List Subject: Re: Wizard pages in Struts design question To prevent repopulation of an ActionForm's properties, you just need to provide a property that observes that status of another property that indicates whether the form is readonly or not. So, instead of just doing this.property = property you have if (mutable) this.property = property Or do something more sophisticated, like have it look at the page number and then decide whether to set itself or not. Though, IMHO, the behavior for a step is so complicated that you want to put it in its own action, it should probably be outside of Struts all together, and part of the business logic layer. (This is why chaining is frowned upon. It's a red flag that indicates business logic is creeping into your Action classes. When the business logic is sufficiently fine-grained, you should just be able to whatever you need to do from whatever Action you happen to be in. As work progresses on Commons Chain, I think this will provide a solution many people will prefer to chaining Struts Action). I haven't had a chance to abstract it into a standard class, but here's a wizard Action that I'm working with now. It submits back to the same class, but uses a dispatch action so that if a step needs more behavior it can be encapsulated that way. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java The steps are laid out as ActionForwards to the instant ActionMapping, making it very easy to rewrite. -Ted. Erez Efrati wrote: I read the HowTo write a wizard on the Struts web-site but I wasn't really happy with the solution, and I am looking for a better one. I came up with another way and I would appreciate your comments. The design consists of: - The 'form' is a session scope form - WizardAction class (a DispatchAction based) with following methods: * init () - starting the wizard and redirect to the first page * finish () - (or save()) finish the wizard and save the information in the form using some business logic delegate. - Each Page or step in the wizard is a separate Action class, extending a WizrardBaseAction (a DispatchAction based) which contains some sharedmethods. For example: Page1Action extends WizardBaseAction { // initializes the page (done only on first encounter) ActionForward init (mapping,...) throws Exception; ActionForward back (mapping,...) throws Exception; ActionForward next (mapping,...) throws Exception;ActionForward finish (mapping,...) throws Exception; } - Each page/step has a separate action-mapping item in the configuration with local forwards for : 'back' (if not the first page), 'next', 'finish' (if allowed from that page). I apologize for not sketching the whole idea down to the last bit but I hope you get the picture. Only problem is that this design touches the question of chaining actions verses forward redirection (not just dispatching). For example the Page1Action.next() does the following: 1. validate the page 2. perform whatever processing required 3. return the next action to forward to (redirect or chain with all its illness..) In my opinion (humble one of course :) having such a separation keeping each step in its own class is better and clearer design than having them all in the same Action class. Isn't there a way to prevent the reset + pre-population of the form done while chaining actions? Furthermore, is it so bad to redirect between actions? Thanks in advance, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action
RE: Action Form Design Question
H. Well, yes, you could call this chaining to some degree. But I think its necessary chaining or even (dare I say it?) good chaining :) IMHO the following is a good design pattern: SetupPageAAction == PageA == ProcessPageAAction == SetupPageBAction == PageB == ProcessPageBAction The only coupling here is that SetupPageBAction needs to know that the data needed to populate the form used for PageB is found in some scope (request, session, or application) under a name. The only reason to do this is to prevent from having to manually create the form needed for PageB in ProcessPageAction. Yes, there is some loose coupling but the cohesion is tighter within actions and as we discussed before, we allow Struts to do it is allowed to manage the action form life cycle. So, the bottom line is that somewhere you have to prepare PageB for display. Should you do it in ProcessPageAction or should you place the data in request scope and pass it along to an action dedicated to preparing PageB? I think when you here others speak of chaing as bad, they mean using actions as business components and trying to use (or reuse) them in a sequence. This type of logic or use of objects should be reserved for the business tier and not the presentation tier. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Sunday, September 21, 2003 5:43 PM To: Struts Users Mailing List Subject: Re: Action Form Design Question Thanks Robert! I agree on letting struts do it's job where available, that's why I thought my code snippet below was a little goofy. My only question about your suggestions is in solution 2 you mention having a second action. You're not suggesting action chaining are you? If not, how do you hook into second action the struts way? Or would this be one place where action chaining is accepted? Thanks again! --m Robert Taylor wrote: I would say the solution depends on the process. If the process of going from pageA to pageB to ... pageN, is a wizard style process then you might think of placing all your data in the same form and putting the form in session scope. If you don't want to put your form in session scope AND the data you capture along the way can be stored in hidden fields, then you could also use a single form placed in request scope. If the process is somewhat disjoint and you have separate forms, then is the data to be rendered in pageB unique to the user? Is it static data? If so, place that data in ServletContext and make it available to all users and you don't need a set up action for pageB. If the data IS unique to the user AND you have separate forms then in this situation, I would still let Struts perform the form creation. -Soluation 1: Place the data retrieved from processing pageA in request scope and forward to the page and tell the particular html component to look for the data in the request under some defined name. -Solution 2: Insert and additional preparation action in between the action processing pageA and pageB; call it ShowPageB or something of the sort. ShowPageB action would access the data out of request scope and populate the form defined for pageB and forward to pageB. There are so many ways to approach this solution. It's subjective to the complexity of the process. I wouldn't stress over the fact of having to place data in the request scope temporarily. What I would stress is let Struts do its job where possible - like creating action forms. robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 11:09 AM To: Struts Users Mailing List Subject: Re: Action Form Design Question // /// //I've been having issues with posting to this list, so I apologize if this is a repost. // /// That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting on an Action needing one form for input and one form for output. If I totally ignore it, the second page will render, but what if I need my html form in the second JSP(JSPB) to be prepopulated with the results of the processing in ActionA? Scenario: I have jspA that is rendered with ActionFormA. Now user submits that data to ActionA. ActionA recieves an ActionFormA as its input form in execute. Now ActionA needs to forward to jspB which expectes an ActionFormB, what is the cleanest way to handle this in struts(see code below). Do struts users run across this case often or do I need to rethink my Action/Form design? --m Robert Taylor wrote
RE: Action Form Design Question
This was discussed earlier this week. Some solutions are addressed here: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg81101.html robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 6:10 PM To: struts-user Subject: Action Form Design Question I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Form Design Question
/ //I've been having issues with posting to this list, so I apologize if this is a repost. / That hits on some points, I did read that thread earlier this week(I'll even read it again), and I'm starting to agree on not shoving everything in the ActionForm, but I don't recall it hitting on an Action needing one form for input and one form for output. If I totally ignore it, the second page will render, but what if I need my html form in the second JSP(JSPB) to be prepopulated with the results of the processing in ActionA? Scenario: I have jspA that is rendered with ActionFormA. Now user submits that data to ActionA. ActionA recieves an ActionFormA as its input form in execute. Now ActionA needs to forward to jspB which expectes an ActionFormB, what is the cleanest way to handle this in struts(see code below). Do struts users run across this case often or do I need to rethink my Action/Form design? --m Robert Taylor wrote: This was discussed earlier this week. Some solutions are addressed here: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg81101.html robert -Original Message- From: Michael Thompson [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 6:10 PM To: struts-user Subject: Action Form Design Question I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Form Design Question
I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Form Design Question
Personally, I've tried to stay away from putting data in the ActionForm that isn't related to an actual form submission value. So if I have a drop down with a list of countries for the user to choose, the list of countries goes into the request attributes and the single choosen country value goes into the ActionForm. That way, you don't need to repopulate the Country List when the user submits their form, something you might have to do if you put the list into the ActionForm. This is just what has worked for me. I've definitely struggled with where to put data and I'm going to be curious to see other replies to your question. K.C. Michael Thompson wrote: I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Form Design Question
I populate a bean with the data in the Action class and store the bean in a request scope attribute. I like to keep the Form as clean and small as I can. I usually use the same form for multiple jsp's so I don't need the clutter of all of the collections of stuff in the Form. Just My Opinion! :-) -Original Message- From: K.C. Baltz [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 5:16 PM To: Struts Users Mailing List Subject: Re: Action Form Design Question Personally, I've tried to stay away from putting data in the ActionForm that isn't related to an actual form submission value. So if I have a drop down with a list of countries for the user to choose, the list of countries goes into the request attributes and the single choosen country value goes into the ActionForm. That way, you don't need to repopulate the Country List when the user submits their form, something you might have to do if you put the list into the ActionForm. This is just what has worked for me. I've definitely struggled with where to put data and I'm going to be curious to see other replies to your question. K.C. Michael Thompson wrote: I've hit a stumbling block and I'm not quite sure how to work around it. I've written struts apps in the past and I've taken the approach of putting everything in the ActionForm so that the jsp has a one stop shop for all it's display needs. So where I've hit an issue is when say I have jsp A that is rendered with form A. When user submits data to action A, the ActionForm pushed to execute is form A. What happens when I need to forward from action A to jsp B which is rendered with form B? I need to populate an ActionForm B to send to jsp B, but I don't have one. Is it normal to create a form of a different type in your Action? So essentially the code would look something like: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { FormA inputForm = (FormA)form; Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm); FormB outputForm = getInstanceOfFormB(mapping, request); //this would stash in request/session also populateFormBWithResults(outputForm, result); return mapping.findForward(success); } getInstanceOfFormB is a little hazy, but I did notice a method in RequestUtils that might help. Seems like this might be breaking some struts abstractions by knowing what form to create etc. Is this the correct way to approach this or should I think about a redesign of my forms and actions? Thanks in advance! --m - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
design question regarding multiple submit buttons
I'm building a small web application (which I expect to grow into something more) to allow co-workers to do some data entry. I'm more of a database guy, but would like to understand and learn the possibilities of utilizing web services. And, have a question about using multiple submit buttons. I am following the advice from http://husted.com/struts/tips/002.html and have 2 buttons ADD and DONE. The form allows a user to input an address (there are typically several) to the Action which updates the database, calls the reset method on the form, then redirects the user to the same form so they can input another address. When they have no more addresses to enter, they should hit DONE to move on to the next form. However, when DONE is selected, the form calls the validate method, which of course fails because the fields are empty. My question is regarding the design. Is this type of circular design ok, meaning it won't bite me later. If so, how should I implement it? Do I code in fake entries to the DONE button then ignore it in the action (is this possible)? Can I turn off validation for the DONE button? Do I add a new form to the jsp and add the DONE button to it? or, maybe I didn't set up the dispatch action correctly. I expect to use this same type of logic several times in the app, so I want to make sure I go about it the correct way. If someone could point me in the right direction, I would appreciate it. Thank you, David
RE: design question regarding multiple submit buttons
David wrote: When they have no more addresses to enter, they should hit DONE to move on to the next form. However, when DONE is selected, the form calls the validate method, which of course fails because the fields are empty. I think validation is on by default, so you may want to turn it off and call validate() manually when appropriate. (IE, from the 'add' method but not from the 'done' method.) Also take a look at LookupDispatchAction (Tip #3). -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: design question regarding multiple submit buttons
thanks for the advice, Wendy. its up and running :) -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 12:22 PM To: Struts Users Mailing List Subject: RE: design question regarding multiple submit buttons David wrote: When they have no more addresses to enter, they should hit DONE to move on to the next form. However, when DONE is selected, the form calls the validate method, which of course fails because the fields are empty. I think validation is on by default, so you may want to turn it off and call validate() manually when appropriate. (IE, from the 'add' method but not from the 'done' method.) Also take a look at LookupDispatchAction (Tip #3). -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question
I am working on a struts-based web application and I have an interesting design issue that I'd like to get some feedback on. I think this problem is actually quite generic and there must be some good ideas out there already that I could sponge off! Basically I have a struts form with a bunch of fields that will be presented to the user through the usual JSP-based view. The user will have the opportunity to makes edits and then submit to an action. What I would like to do is be able to identify which fields changed and then take certain actions based on these changes. Here is one rough ideas I have so far. Any thoughts on this plus additional ideas would be greatly appreciated. 1.) Extend ActionForm and customize the populate method so that it makes a copy of the old version of the form that is already stored in the session (since it will have session scope) 2.) Populate new form 3.) Compare two forms and store list of changes in new form 4.) Discard copy of old. Any thoughts, comments? TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question
oops. Forget what I said - didnt read it properly. You need to be able to tell which fields changed. The digest will merely tell you if any changed. Sorry. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 September 2003 23:01 To: Struts Users Mailing List Subject: RE: Design Question Actually you could just store a digest of the previous values, and then compare that with a digest of the new. -Original Message- From: sean schofield [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 September 2003 22:57 To: [EMAIL PROTECTED] Subject: Design Question I am working on a struts-based web application and I have an interesting design issue that I'd like to get some feedback on. I think this problem is actually quite generic and there must be some good ideas out there already that I could sponge off! Basically I have a struts form with a bunch of fields that will be presented to the user through the usual JSP-based view. The user will have the opportunity to makes edits and then submit to an action. What I would like to do is be able to identify which fields changed and then take certain actions based on these changes. Here is one rough ideas I have so far. Any thoughts on this plus additional ideas would be greatly appreciated. 1.) Extend ActionForm and customize the populate method so that it makes a copy of the old version of the form that is already stored in the session (since it will have session scope) 2.) Populate new form 3.) Compare two forms and store list of changes in new form 4.) Discard copy of old. Any thoughts, comments? TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question
You are correct that my problem requires more information that just something changed. But your solution may prove useful for a different problem ... Basically the user has the option of bringing up different forms without submitting their changes. I'd like to be able to present them with Are you sure you don't want to submit your changes? message but only if something actually changed. I could use onchange for each field and also keep track of the original values but the digest idea might be nice. Thanks for the timely response. I'd be happy to hear feedback on this idea plus my original problem from anybody. Regards, - sean -- Original Message -- From: Andrew Hill [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 17 Sep 2003 23:02:41 +0800 oops. Forget what I said - didnt read it properly. You need to be able to tell which fields changed. The digest will merely tell you if any changed. Sorry. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 September 2003 23:01 To: Struts Users Mailing List Subject: RE: Design Question Actually you could just store a digest of the previous values, and then compare that with a digest of the new. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design Question
You can probably write an aspect (using AspectJ) to do this fairly automatically -- i.e. create a pointcut for all *Form.set* methods, and then do your comparisons there. i.e. public aspect DiffAspect { pointcut setter() : call(public void *Form.set*(..)); before() : setter() { //... your comparison here... } } - Original Message - From: sean schofield [EMAIL PROTECTED] To: Struts [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 8:20 AM Subject: RE: Design Question You are correct that my problem requires more information that just something changed. But your solution may prove useful for a different problem ... Basically the user has the option of bringing up different forms without submitting their changes. I'd like to be able to present them with Are you sure you don't want to submit your changes? message but only if something actually changed. I could use onchange for each field and also keep track of the original values but the digest idea might be nice. Thanks for the timely response. I'd be happy to hear feedback on this idea plus my original problem from anybody. Regards, - sean -- Original Message -- From: Andrew Hill [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 17 Sep 2003 23:02:41 +0800 oops. Forget what I said - didnt read it properly. You need to be able to tell which fields changed. The digest will merely tell you if any changed. Sorry. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, 17 September 2003 23:01 To: Struts Users Mailing List Subject: RE: Design Question Actually you could just store a digest of the previous values, and then compare that with a digest of the new. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question
I have special field objects which with separate methods for jsp setting and database setting which also track changes. Then I can use reflection to the specific type and see if any of the objects in the database changed and are not confused by spurious instance variables. You can then create methods for checkpointing the data so if you have a complex set of updates you can know the status at any point. The main drawback and one I am still working on) is that for reflection to work with the field objects directly they need to be public. The Bean Utils will still work as long as your getters and setters follow the Java Bean spec. Edgar -Original Message- From: sean schofield [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 9:57 AM To: [EMAIL PROTECTED] Subject: Design Question I am working on a struts-based web application and I have an interesting design issue that I'd like to get some feedback on. I think this problem is actually quite generic and there must be some good ideas out there already that I could sponge off! Basically I have a struts form with a bunch of fields that will be presented to the user through the usual JSP-based view. The user will have the opportunity to makes edits and then submit to an action. What I would like to do is be able to identify which fields changed and then take certain actions based on these changes. Here is one rough ideas I have so far. Any thoughts on this plus additional ideas would be greatly appreciated. 1.) Extend ActionForm and customize the populate method so that it makes a copy of the old version of the form that is already stored in the session (since it will have session scope) 2.) Populate new form 3.) Compare two forms and store list of changes in new form 4.) Discard copy of old. Any thoughts, comments? TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: design question
If the values are not going to change during the life of the application, I would suggest using a plugin to set them at startup. See the MailReader Example application for some sample code. -Ted. deepaksawdekar wrote: I am displaying some dropdown boxes on my jsp. I have to take the values for them from ApplicationResource file. I have writen a separate file which will read the properties file and return me the values in array list. Now I have to set this arraylist to the property of my form bean, now the question is should i assign this arraylist in action class execute method or will it good option to assign this value in from bean constructor, since the value are not going to change dynamically. Please suggest me which is better option 1. set values in action execute method 2. set values in constructor of form bean. Thanks and Regards Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
design question
I am displaying some dropdown boxes on my jsp. I have to take the values for them from ApplicationResource file. I have writen a separate file which will read the properties file and return me the values in array list. Now I have to set this arraylist to the property of my form bean, now the question is should i assign this arraylist in action class execute method or will it good option to assign this value in from bean constructor, since the value are not going to change dynamically. Please suggest me which is better option 1. set values in action execute method 2. set values in constructor of form bean. Thanks and Regards Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question - Need to put assertions in Actions?
Say I have a form formFoo which manages some noun Foo. It has two different actions, newFoo and editFoo. Each has specific logic depending on whether or not Foo exists. I am experiencing a problem where users create Foo, but then (either by bookmark or the back button) users are returning to the newFoo action and edit Foo using the new action instead of the edit action. I have looked into the transaction token to eliminate the double submit problem, but I have not found a solution to this problem. So far, I have placed some assertions in the newFoo action which validates that foo does not already exist. If it does exist, it forwards control to editFoo. This brings about the design question. Putting this kind of assertion/redirection logic in each action class gets messy fast and makes each action class more of a controller than an action class. (Which is not where I want to go) Any suggestions on how to handle this type of problem? Regards, Joshua This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question - Need to put assertions in Actions?
Message-ID: [EMAIL PROTECTED] From: White, Joshua A (HTSC, CASD) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Design Question - Need to put assertions in Actions? Date: Fri, 5 Sep 2003 08:53:49 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Say I have a form formFoo which manages some noun Foo. It has two different actions, newFoo and editFoo. Each has specific logic depending on whether or not Foo exists. I am experiencing a problem where users create Foo, but then (either by bookmark or the back button) users are returning to the newFoo action and edit Foo using the new action instead of the edit action. What about to create a custom tag which, if the newfoo already exists, simply redirect the user to the editfoo form? In any case, take in account that the 'Back' button issue is a known problem among web applications, and that users should be aware of it. My 2 cents, Marco !-- ORIGINAL MESSAGE -- I have looked into the transaction token to eliminate the double submit problem, but I have not found a solution to this problem. So far, I have placed some assertions in the newFoo action which validates that foo does not already exist. If it does exist, it forwards control to editFoo. This brings about the design question. Putting this kind of assertion/redirection logic in each action class gets messy fast and makes each action class more of a controller than an action class. (Which is not where I want to go) Any suggestions on how to handle this type of problem? Regards, Joshua - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Repost Wrong Date, Design Question (Keeping filters in the jsp)
Sorry for the reposting, Hi to all, Suppose we have a tabular jsp, which shows data in the table. Also in this tabular jsp, we implement a searching mechanism applying some filters. Suppose that from that jsp we go with links or action in some others (depth 3-4), and i want to go back from the starting jsp, but i want to keep the existing filters when we go back. Is there a pattern for this , expect form putting the parameters in a hashtable passing it to session. Vangos
RE: Design question
| |Now my questions are : |1 I am doing write something wrong. It's better not to club two logically different business process handlers. I guess you want to reduce the number of Action Classes to be created. If yes, follow this way action path=/CreateUser type=navjot.CreateAction form=UserForm parameter=user action path=/CreateProject type=navjot.CreateAction form=ProjectForm parameter=proj In your action class.. String doWhat = mapping.getParameter(); if(proj.equals(doWhat)) proj.create(dto); else if(user.equals(doWhat)) user.create(dto); |2 Validation errors are to be send to called jsp. Like validation |error for create user has to be send to create user jsp, for that |i need to dynamically change the value of input in my action |mapping, how to do this. |3 Since the form beans are different for each jsp can i |dynamically change the formbean of the actionmapping |4 can you suggest some alternate method so that i can not have to |do copy past of my code in execute method of action class. If you follow my advice on 1, you need not to bother about that. HTH navjot Singh PS - may i know where are you located? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design question
Thanks a lot navjot. I will try this. Deepak . -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 11:20 AM To: Struts Users Mailing List Subject: RE: Design question | |Now my questions are : |1 I am doing write something wrong. It's better not to club two logically different business process handlers. I guess you want to reduce the number of Action Classes to be created. If yes, follow this way action path=/CreateUser type=navjot.CreateAction form=UserForm parameter=user action path=/CreateProject type=navjot.CreateAction form=ProjectForm parameter=proj In your action class.. String doWhat = mapping.getParameter(); if(proj.equals(doWhat)) proj.create(dto); else if(user.equals(doWhat)) user.create(dto); |2 Validation errors are to be send to called jsp. Like validation |error for create user has to be send to create user jsp, for that |i need to dynamically change the value of input in my action |mapping, how to do this. |3 Since the form beans are different for each jsp can i |dynamically change the formbean of the actionmapping |4 can you suggest some alternate method so that i can not have to |do copy past of my code in execute method of action class. If you follow my advice on 1, you need not to bother about that. HTH navjot Singh PS - may i know where are you located? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question (Keeping filters in the jsp)
Hi to all, Suppose we have a tabular jsp, which shows data in the table. Also in this tabular jsp, we implement a searching mechanism applying some filters. Suppose that from that jsp we go with links or action in some others (depth 3-4), and i want to go back from the starting jsp, but i want to keep the existing filters when we go back. Is there a pattern for this , expect form putting the parameters in a hashtable passing it to session. Vangos
RE: Design question...
hi, If are getting some collection to the JSP page and just wish to display a subset of them without changing anything on BL layer, Use Pager Taglib and get away with it easily. But there is a downside to it as you may have 1000 records and you just want to show 10. So, 990 records are burden on network for no use at all. But you can avoid this also. Pager taglib provides you with one parameter offset that can be passed onto the controller layer and then to your Session EJB. Session EJB will trim the 1000 records collection obtained to 10 records based on that offset value. Now when you pass the DTO back, it will contain maximum 10 records. Reducing network load and you get only those records that you want in presentation layer. HTH navjot singh |-Original Message- |From: Keith Pemberton [mailto:[EMAIL PROTECTED] |Sent: Sunday, August 24, 2003 7:09 PM |To: [EMAIL PROTECTED] |Subject: Design question... | | |I have a JSP page that contains entries from a database. I am getting |the items using a DTO that is passed from a session EJB. What I would |like to be able to do is to specify a parameter in the URL named |offset that when changed would display the next results from the |database. Couple of questions... Would it be considered presentation |logic to perform the action of getting the DTO from the session bean |within the JSP page? I really don't want to do it that way because I'm |trying to keep the layers as separate as possible. So, if I don't do it |that way, I will have to use Action classes and html:links that can pass |the parameter to action class? | |My real question is what is the best way of dealing with EJBs in the |presentation layer? I know that I have to get a DTO of the information |that I want, but usually the methods of the DTO take parameters that I |can't pass to the DTO in the JSP page. I have read over and over the |Oreilly Struts book but it still is confusing me. Thanks for any help! | |Keith Pemberton |-- |Keith Pemberton [EMAIL PROTECTED] | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design question
Hi, We are developing a application which will have number of create screens, as follows : Create Technology screen, Create Project screen, Create user screen. etc Each screen will have a asssociated formbean as follows. TechnologyForm for Create Technology screen ProjectForm for Create Project screen, UserForm for Create user screen etc. Each form will have the object of underlying dataobject, and each form will have a method getDataObject. e.g. Techonology form contains . . . . . private TechDBO tech; # TechDBO is underlying dataobject. . . . . TechDBO getDataObject(){ return this.tech; } . . . . execute method will have more or less same code as . . . dblayer.create(form.getDataObject()); . . . . So I am planning to club all the create in one action class and forward to appropriate jsp as per some parameter by in formbean. my struts-config.xml will be something like this. action path=/create type=CreateAction name= ??? input= ??? forward name=Tech path=successtech.jsp / forward name=user path=successuser.jsp / forward name=project path=successproject.jsp / Now my questions are : 1 I am doing write something wrong. 2 Validation errors are to be send to called jsp. Like validation error for create user has to be send to create user jsp, for that i need to dynamically change the value of input in my action mapping, how to do this. 3 Since the form beans are different for each jsp can i dynamically change the formbean of the actionmapping 4 can you suggest some alternate method so that i can not have to do copy past of my code in execute method of action class. TIA Deepak. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design question...
I have a JSP page that contains entries from a database. I am getting the items using a DTO that is passed from a session EJB. What I would like to be able to do is to specify a parameter in the URL named offset that when changed would display the next results from the database. Couple of questions... Would it be considered presentation logic to perform the action of getting the DTO from the session bean within the JSP page? I really don't want to do it that way because I'm trying to keep the layers as separate as possible. So, if I don't do it that way, I will have to use Action classes and html:links that can pass the parameter to action class? My real question is what is the best way of dealing with EJBs in the presentation layer? I know that I have to get a DTO of the information that I want, but usually the methods of the DTO take parameters that I can't pass to the DTO in the JSP page. I have read over and over the Oreilly Struts book but it still is confusing me. Thanks for any help! Keith Pemberton -- Keith Pemberton [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design question
There is a workflow extension for struts. I have read the docs, but did not use it. You can take a close look at it here http://www.livinglogic.de/Struts/ Alex. -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Sunday, August 10, 2003 7:18 PM To: Struts-Users Subject: Design question Hi; I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. For my new system (using struts), what's the suggested process: 1.. Something like that? Only to be real struts-like I would need to have it go to a page that immediately called an action to see if all data needed for that page was there yet. 2.. Keep a single url so they cannot go to any page other than the first, then the second, etc. In this case, going back in the browser and then clicking reload would take them back to the page they were on. 3.. Just do the standard struts action when they submit a page and in that action go back to the first page for which I have incomplete information. So they can bookmark and click the purchase submit but it would then take them back to the first page of the checkout process. So, what's standard out there? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question: Forms-and-Validation, which scope to use for dynamic beans?
In your action configuration set the 'input' URL to point to an action instead of your JSP and then build your lists in the action. Steve -Original Message- From: Gino LV. Ledesma [mailto:[EMAIL PROTECTED] Sent: August 10, 2003 10:28 PM To: Struts Users Mailing List Subject: Design Question: Forms-and-Validation, which scope to use for dynamic beans? Hello, I've been using the Struts framework for a couple of months now and have really fancied it. I try as much as possible to adhere to the MVC guidelines, but have run into a couple of problems I've not been able to solve. I have a form which is validated by Struts-validator. One of the form's properties is a pull-down menu which contains list of selectable items. These list of selectable items are generated dynamically (by being called from an EJB). The problem I have is when an error in the form occurs Struts brings back the form page, but the servlet container (Tomcat) then reports a no such bean error -- this bean containing the list of items that populate the pull-down menu. The bean is stored in a request-level scope by the controller servlet. Now when the form is submitted (new request), and an error is found, the form is displayed again. But because the bean was stored in a request-level scope, the bean is no longer found. What is the propery way of fixing this? Currently, I've implemented a tag which generates this list (it basically calls the EJB) and stores it in a page-level scope, so the servlet no longer bothers storing this in any scope. But doesn't doing this break the separate logic from the view rule? I don't want to store it in the session-level scope as well as the list _can_ be updated frequently. Granted, the session-scope seems to be the ideal solution, though. What are your thoughts on this? I'd appreciate help on the matter, as I'm weeding out non-conforming implementations in my code. :) Thanks for your help in advance. = __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question: Forms-and-Validation, which scope to use for dynamic beans?
Hello, I've been using the Struts framework for a couple of months now and have really fancied it. I try as much as possible to adhere to the MVC guidelines, but have run into a couple of problems I've not been able to solve. I have a form which is validated by Struts-validator. One of the form's properties is a pull-down menu which contains list of selectable items. These list of selectable items are generated dynamically (by being called from an EJB). The problem I have is when an error in the form occurs Struts brings back the form page, but the servlet container (Tomcat) then reports a no such bean error -- this bean containing the list of items that populate the pull-down menu. The bean is stored in a request-level scope by the controller servlet. Now when the form is submitted (new request), and an error is found, the form is displayed again. But because the bean was stored in a request-level scope, the bean is no longer found. What is the propery way of fixing this? Currently, I've implemented a tag which generates this list (it basically calls the EJB) and stores it in a page-level scope, so the servlet no longer bothers storing this in any scope. But doesn't doing this break the separate logic from the view rule? I don't want to store it in the session-level scope as well as the list _can_ be updated frequently. Granted, the session-scope seems to be the ideal solution, though. What are your thoughts on this? I'd appreciate help on the matter, as I'm weeding out non-conforming implementations in my code. :) Thanks for your help in advance. = __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Asking again - basic design question
I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. I believe you might want to look at the Validator, and in particular into the page attribute of the validator, as well as the ValidatorActionForm/DynaValidatorActionForm classes. With it, you can assign a page number to fields field, and the Validator will check the validity of those fields only when it is their turn. (If your field is page=2, the Validator will not check it on page 1, but will check it on page 2, 3, and so on.) I am not sure how that would interact with bookmarks, but, presumably, if somebody had bookmarked a page, and then returned to the bookmark without any of the needed variables (say, if the needed values were only in the session, which had since expired), it would fail all the way back to the beginning. However, I have never implemented a multipage form, so I cannot say that is exactly how it would work.Check the documentation, as well as list archives (one such one at http://marc.theaimsgroup.com/?l=struts-user ) -- there have been a few discussions on multipage forms. -Greg Ludington - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Asking again - basic design question
I guess the lack of responses is because there's not a standard as such for this. Many folks use actions for all links in their struts apps, as this way there's no exposure to the unpinning resources. I like doing this because there's always an opportunity to mess with stuff before any page is loaded. One way is to use the old define what you're trying to do in a paragraph, underline all the verbs. Use this to define your actions. As its an existing app I assume you've already go you OM in place, and the nouns in your paragraph will hopefully correspond to you objects in some way. Get you forms working and laid out, and try and avoid thinking in steps, think about save such-and-such and there fore you can reorganize your app by changing action forwards, rather than touching the java (I implicitly learnt that from Husted's examples e.g. mapping.findForward(success) or failure etc). I hope this is what you were looking for. Mark On Tuesday, August 12, 2003, at 02:35 AM, David Thielen wrote: Hi; I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. For my new system (using struts), what's the suggested process: 1.. Something like that? Only to be real struts-like I would need to have it go to a page that immediately called an action to see if all data needed for that page was there yet. 2.. Keep a single url so they cannot go to any page other than the first, then the second, etc. In this case, going back in the browser and then clicking reload would take them back to the page they were on. 3.. Just do the standard struts action when they submit a page and in that action go back to the first page for which I have incomplete information. So they can bookmark and click the purchase submit but it would then take them back to the first page of the checkout process. So, what's standard out there? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Asking again - basic design question
You are asking several questions. One of them is how to bookmark a page in Struts (which uses Actions. I would have a hard time explaining it until you were comfortable w/ Actions; else you would get confused). Your other answer is: Struts uses Action, in action you must decide what page to forward to. (Never, ever, ask for a page, always ask for an action). So the user asks for action. Action find out how much data there is, and forward to the right place, pre populating known information. hth, .V David Thielen wrote: Hi; I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. For my new system (using struts), what's the suggested process: 1.. Something like that? Only to be real struts-like I would need to have it go to a page that immediately called an action to see if all data needed for that page was there yet. 2.. Keep a single url so they cannot go to any page other than the first, then the second, etc. In this case, going back in the browser and then clicking reload would take them back to the page they were on. 3.. Just do the standard struts action when they submit a page and in that action go back to the first page for which I have incomplete information. So they can bookmark and click the purchase submit but it would then take them back to the first page of the checkout process. So, what's standard out there? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question: Forms-and-Validation, which scope to use for dynamic beans?
Thanks for the quick reply. Does this work if the action requires additional request parameters, however? Not that my particular servlet will require it, but some of them do. For example, say I have something like: /createObjectB.do?parentID=1 Where ObjectB has ObjectA for its parent (and is necessary for the creation to filter its attributes). Gino LV. Ledesma Ateneo de Manila University // Programmer's Excuse #4: It was working yesterday. --- Steve Raeburn [EMAIL PROTECTED] wrote: In your action configuration set the 'input' URL to point to an action instead of your JSP and then build your lists in the action. Steve -Original Message- From: Gino LV. Ledesma [mailto:[EMAIL PROTECTED] Sent: August 10, 2003 10:28 PM To: Struts Users Mailing List Subject: Design Question: Forms-and-Validation, which scope to use for dynamic beans? Hello, I've been using the Struts framework for a couple of months now and have really fancied it. I try as much as possible to adhere to the MVC guidelines, but have run into a couple of problems I've not been able to solve. I have a form which is validated by Struts-validator. One of the form's properties is a pull-down menu which contains list of selectable items. These list of selectable items are generated dynamically (by being called from an EJB). The problem I have is when an error in the form occurs Struts brings back the form page, but the servlet container (Tomcat) then reports a no such bean error -- this bean containing the list of items that populate the pull-down menu. The bean is stored in a request-level scope by the controller servlet. Now when the form is submitted (new request), and an error is found, the form is displayed again. But because the bean was stored in a request-level scope, the bean is no longer found. What is the propery way of fixing this? Currently, I've implemented a tag which generates this list (it basically calls the EJB) and stores it in a page-level scope, so the servlet no longer bothers storing this in any scope. But doesn't doing this break the separate logic from the view rule? I don't want to store it in the session-level scope as well as the list _can_ be updated frequently. Granted, the session-scope seems to be the ideal solution, though. What are your thoughts on this? I'd appreciate help on the matter, as I'm weeding out non-conforming implementations in my code. :) Thanks for your help in advance. = __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design question
Hi; I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. For my new system (using struts), what's the suggested process: 1.. Something like that? Only to be real struts-like I would need to have it go to a page that immediately called an action to see if all data needed for that page was there yet. 2.. Keep a single url so they cannot go to any page other than the first, then the second, etc. In this case, going back in the browser and then clicking reload would take them back to the page they were on. 3.. Just do the standard struts action when they submit a page and in that action go back to the first page for which I have incomplete information. So they can bookmark and click the purchase submit but it would then take them back to the first page of the checkout process. So, what's standard out there? thanks - dave
Asking again - basic design question
Hi; I am designing a store check-out process. The old software (pre-struts) had a check at the top of each page to make sure the information from the previous page had been entered. And if not, forwarded to that page. So if you bookmarked the last page and went there, you would get forwarded back page by page and still start on the first page. For my new system (using struts), what's the suggested process: 1.. Something like that? Only to be real struts-like I would need to have it go to a page that immediately called an action to see if all data needed for that page was there yet. 2.. Keep a single url so they cannot go to any page other than the first, then the second, etc. In this case, going back in the browser and then clicking reload would take them back to the page they were on. 3.. Just do the standard struts action when they submit a page and in that action go back to the first page for which I have incomplete information. So they can bookmark and click the purchase submit but it would then take them back to the first page of the checkout process. So, what's standard out there? thanks - dave
RE: ActionForm Design Question
| Question 1: Do I use conventional ActionForm? | Map-backed ActionForm? or DynaActionForm for this | project? | |If I were you, I would use the conventional ActionForm if |most of the properties are Strings. If your data is fixed on form, then it is good to have ActionForm. More, you may use DynaActionForm if you don't wish to write a ActionForm file ;-) | | Question 2: Which strategy should I use to transfer | values between tiers? Setting an immutable value | object? or transferring values by reflection | (BeanUtil)? or passing a Map? | |Then I would use the transerring mechanism in the BeanUtil package. If your app is simple enough, you can use Map. If you know your app is gonna expand like hell, invest time on BeanUtil. Navjot Singh | | I highly value your opinions and advices. Thanks. | | |Jing |Netspread Carrier |http://www.netspread.com | | | __ | Do you Yahoo!? | Yahoo! SiteBuilder - Free, easy-to-use web site design software | http://sitebuilder.yahoo.com | | - | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | | |- |To unsubscribe, e-mail: [EMAIL PROTECTED] |For additional commands, e-mail: [EMAIL PROTECTED] | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm Design Question
Hi, I am building a web site. The primary functions of this site are for authors to submit their research papers. The research papers will go through a screening process (screened by peers in the field). Visiors can view the published articles online. Authors and peers are the registered users of the web site. Therefore, there is not much data manipulation at the web site except that authors may be requested to revise their papers and re-submit. And both authors and peers have to fill out registration forms to become members of the web site. The content of the registration form is pretty standard: name, address, phone number, academic background information and achievements, etc. Most of them are Strings. A couple of checkboxes, three sets of radio buttons (to indicate preferences), and a primitive double. Of course, I have a text field for loading research papers. Question 1: Do I use conventional ActionForm? Map-backed ActionForm? or DynaActionForm for this project? Question 2: Which strategy should I use to transfer values between tiers? Setting an immutable value object? or transferring values by reflection (BeanUtil)? or passing a Map? I highly value your opinions and advices. Thanks. __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm Design Question
- Original Message - From: Caroline Jen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 01, 2003 10:42 AM Subject: ActionForm Design Question Hi, I am building a web site. The primary functions of this site are for authors to submit their research papers. The research papers will go through a screening process (screened by peers in the field). Visiors can view the published articles online. Authors and peers are the registered users of the web site. Therefore, there is not much data manipulation at the web site except that authors may be requested to revise their papers and re-submit. And both authors and peers have to fill out registration forms to become members of the web site. The content of the registration form is pretty standard: name, address, phone number, academic background information and achievements, etc. Most of them are Strings. A couple of checkboxes, three sets of radio buttons (to indicate preferences), and a primitive double. Of course, I have a text field for loading research papers. Question 1: Do I use conventional ActionForm? Map-backed ActionForm? or DynaActionForm for this project? If I were you, I would use the conventional ActionForm if most of the properties are Strings. Question 2: Which strategy should I use to transfer values between tiers? Setting an immutable value object? or transferring values by reflection (BeanUtil)? or passing a Map? Then I would use the transerring mechanism in the BeanUtil package. I highly value your opinions and advices. Thanks. Jing Netspread Carrier http://www.netspread.com __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question
Hello, I have some functionality in my web application that allows a user to select a record. This functionality is plugged into other types of functions, such as combine a record or select a component record. Steps to combine a record: 1. select a record 2. configure combining 3. combine Sets to selct a compont 1. select a record 2. set the record as a component. As you can see, the select a record functionality is common. To implement this I would like to create action classes specifically for the select a record interface. One of the request parameters would be the action to forward the result to. The GET request would look something like this: /action/selectRecord?recordSetName=namefinishedForwardAction=/action/combineRecord This would: 1. display search fields 2. search / display results 3. redirect to the finishedForwardActionPage (would it be better to put the record in the session for the finshedForwardAction or just pass the id as a parameter) Is this an acceptable implementation, or is there a better way? -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design Question
Why not just define the forward action in the selectRecord action mapping element in your struts-config.xml? shane Quoting Erik Price [EMAIL PROTECTED]: Travis Stevens wrote: As you can see, the select a record functionality is common. To implement this I would like to create action classes specifically for the select a record interface. One of the request parameters would be the action to forward the result to. The GET request would look something like this: /action/selectRecord? recordSetName=namefinishedForwardAction=/action/combineRecord This would: 1. display search fields 2. search / display results 3. redirect to the finishedForwardActionPage (would it be better to put the record in the session for the finshedForwardAction or just pass the id as a parameter) Is this an acceptable implementation, or is there a better way? I'm not saying that this is a better way, but it strikes me that selecting a record might not be something that you want to confine to Struts Actions -- for instance, someday down the road you might want to select a record from some other interface or even as a service from another application. You might wish to abstract this even further than the level of Action, and make (for instance) a [POJO] class, such as RecordSelector, that performs this activity. Then you can create Actions specific to your form interfaces, and when it is necessary to select a record, you can use this class to do the work (delegating the information from the Action to the class). This is known as the Command design pattern (in fact Struts Actions are themselves an implementation of the Command design pattern, but they are tightly coupled to the servlet framework). http://www.dofactory.com/Patterns/PatternCommand.aspx This may also spare you the process of supplying a parameter to indicate which Action this should ultimately be forwarded to, since you would just have the form submit to that Action and delegate the work to RecordSelector from inside of that Action. Just a suggestion. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This mail sent through Toaster-Horde (http://qmailtoaster.clikka.com/) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design Question
Because the foward action should be completely dinamic. The select action should know nothing concrete about any of the actions that use the functionality, otherwise one would have to edit the select action every time a new action is created that uses the select action. [EMAIL PROTECTED] wrote: Why not just define the forward action in the selectRecord action mapping element in your struts-config.xml? shane Quoting Erik Price [EMAIL PROTECTED]: Travis Stevens wrote: As you can see, the select a record functionality is common. To implement this I would like to create action classes specifically for the select a record interface. One of the request parameters would be the action to forward the result to. The GET request would look something like this: /action/selectRecord? recordSetName=namefinishedForwardAction=/action/combineRecord This would: 1. display search fields 2. search / display results 3. redirect to the finishedForwardActionPage (would it be better to put the record in the session for the finshedForwardAction or just pass the id as a parameter) Is this an acceptable implementation, or is there a better way? I'm not saying that this is a better way, but it strikes me that selecting a record might not be something that you want to confine to Struts Actions -- for instance, someday down the road you might want to select a record from some other interface or even as a service from another application. You might wish to abstract this even further than the level of Action, and make (for instance) a [POJO] class, such as RecordSelector, that performs this activity. Then you can create Actions specific to your form interfaces, and when it is necessary to select a record, you can use this class to do the work (delegating the information from the Action to the class). This is known as the Command design pattern (in fact Struts Actions are themselves an implementation of the Command design pattern, but they are tightly coupled to the servlet framework). http://www.dofactory.com/Patterns/PatternCommand.aspx This may also spare you the process of supplying a parameter to indicate which Action this should ultimately be forwarded to, since you would just have the form submit to that Action and delegate the work to RecordSelector from inside of that Action. Just a suggestion. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This mail sent through Toaster-Horde (http://qmailtoaster.clikka.com/) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Design Question - same action, many jsps/views
Hi all, I've come across a situation which I'm not sure how to handle with struts. I have an action which, depending on from which page it's called, should forward to different jsps pages. Currently, for each resultant jsp, I create a new action with the exact same logic code inside which forwards to the right jsp. I'm just not sure if this is the right way to do it, because it's replication of code. An alternative might be to switch on the input path of the request and forward to The right jsp, but I'm not sure if this is right either. This has to have come up before, so I'm looking for a best practice solution. What do you guys reckon? Thanks, Brian
RE: Design Question - same action, many jsps/views
Hello, one way to solve it is not to duplicate code in different Action classes, but have many ActionMapping entries in your struts-config.xml file. This way you keep the navigational part of your application away from Action classes, but still avoid code duplication in Actions. HTH, -- Laurent -Original Message- From: Brian McSweeney To: [EMAIL PROTECTED] Sent: 28-7-03 11:38 Subject: Design Question - same action, many jsps/views Hi all, I've come across a situation which I'm not sure how to handle with struts. I have an action which, depending on from which page it's called, should forward to different jsps pages. Currently, for each resultant jsp, I create a new action with the exact same logic code inside which forwards to the right jsp. I'm just not sure if this is the right way to do it, because it's replication of code. An alternative might be to switch on the input path of the request and forward to The right jsp, but I'm not sure if this is right either. This has to have come up before, so I'm looking for a best practice solution. What do you guys reckon? Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question - same action, many jsps/views
Hi Brian, Why not use different named forwards for the action and access each one from the action with a: { ... return (mapping.findForward(page1/page2/page3)); } In s-c: action path=/myAction type=FQ Class name=bean ... forward name=page1 path=/page1.jsp/ forward name=page2 path=/page2.jsp/ forward name=page3 path=/page3.jsp/ /action Hue. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 10:39 To: [EMAIL PROTECTED] Subject: Design Question - same action, many jsps/views Hi all, I've come across a situation which I'm not sure how to handle with struts. I have an action which, depending on from which page it's called, should forward to different jsps pages. Currently, for each resultant jsp, I create a new action with the exact same logic code inside which forwards to the right jsp. I'm just not sure if this is the right way to do it, because it's replication of code. An alternative might be to switch on the input path of the request and forward to The right jsp, but I'm not sure if this is right either. This has to have come up before, so I'm looking for a best practice solution. What do you guys reckon? Thanks, Brian --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design Question - same action, many jsps/views
Hi Hue, That's definitely one way to go, but the disadvantage that I see of using this way is that you presumably have to hard code into the action, some way of identifying where the request came from. Perhaps something like: String input = request.getRequestURI(); if(input.equalsIgnorCase(inputpath1) return (mapping.findForward(page1)); else if(input.equalsIgnorCase(inputpath2); return (mapping.findForward(page2)); else if(input.equalsIgnorCase(inputpath3); return (mapping.findForward(page3)); The previous new action mapping idea means you don't have to do this I think, which might make it a better solution. What do you think? I'm not sure though, and thanks very much for the help. Brian -Original Message- From: Hue Holleran [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 16:11 To: Struts Users Mailing List Subject: RE: Design Question - same action, many jsps/views Hi Brian, Why not use different named forwards for the action and access each one from the action with a: { ... return (mapping.findForward(page1/page2/page3)); } In s-c: action path=/myAction type=FQ Class name=bean ... forward name=page1 path=/page1.jsp/ forward name=page2 path=/page2.jsp/ forward name=page3 path=/page3.jsp/ /action Hue. -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 10:39 To: [EMAIL PROTECTED] Subject: Design Question - same action, many jsps/views Hi all, I've come across a situation which I'm not sure how to handle with struts. I have an action which, depending on from which page it's called, should forward to different jsps pages. Currently, for each resultant jsp, I create a new action with the exact same logic code inside which forwards to the right jsp. I'm just not sure if this is the right way to do it, because it's replication of code. An alternative might be to switch on the input path of the request and forward to The right jsp, but I'm not sure if this is right either. This has to have come up before, so I'm looking for a best practice solution. What do you guys reckon? Thanks, Brian --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24/07/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]