Re: Unable to Download Struts2
Is there someplace else where i can download this? Thanks! Matt Wendy Smoak wrote: On 10/24/06, Matthew J. Vincent <[EMAIL PROTECTED]> wrote: I get a connection timeout everytime I try to download: http://people.apache.org/builds/struts/2.0.1/struts-2.0.1-all.zip Anyone else getting this? Yes, that server was part of some infrastructure work that started on Saturday. The original estimate was Monday, but it's taking longer than expected. There is a monitoring page, though there is no further information about people.apache.org on it: http://monitoring.apache.org/status/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unable to Download Struts2
Hi all, I get a connection timeout everytime I try to download: http://people.apache.org/builds/struts/2.0.1/struts-2.0.1-all.zip Anyone else getting this? Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best Practice - Correct usage???
Hello all, I have an application to edit some data stored in the database. I have 2 situations. 1. When a user clicks New or Edit Mouse, the user is brought to a form that either displays an empty form or one that is pre-populated. This is done with the following mapping: path="/WEB-INF/jsp/mouse.jsp"/> path="/WEB-INF/jsp/mouse.jsp"/> path="/WEB-INF/jsp/mouse.jsp"/> This works fine, but upon successful insert why couldn't I just forward it back to the "setupSuccess" portion? Like the following: path="/WEB-INF/jsp/mouse.jsp"/> path="/mouseAction.do"/> path="/WEB-INF/jsp/mouse.jsp"/> Do I have to do something different in my Action class? It is running in an infinite loop and eventually running out of memory. 2. When a user updates a mouse, I want them to be directed to a summary screen of the mouse which has the following mapping: would I change my action mapping to the following path="/WEB-INF/jsp/mouse.jsp"/> path="/mouseAction.do"/> path="/mouseSummary.do"/> But how does one pass in the variables that mouse summary needs to know like the id of the mouse? Am I making any sense to anyone? Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't figure out how to do "if then else" with Struts logic tags
Not sure if this is a solution for you or not, but you could also put your JSPs under WEB-INF directory so that they cannot be directly accessed by a user. They would instead have to go through an Action first. Filters may be your best bet (and yes, that is the URL to look at). As far as JST syntax, you could use something like: Hope that helps! Matt [EMAIL PROTECTED] wrote: Dave, I totally agree with you about doing this kind of checking in an action class and I AM doing it there. However, the problem is that I still need a way to prevent a user from going to the jsp w/o first logging in. Let's say the user logged in during a previous session and bookmarked the jsp. They can get back to it w/o having to login. I know that once they submit the form the action class will catch that they're not logged in and send them back to login page. But I'd rather catch it before then. I hate to have the user fill in a bunch of information, submit form and THEN get redirected to login. I'll look into JSTL. Are you saying it has "if-then-else" type of processing? Could you point me in the right direction for that and for the "check if object exists in session" issue? Also, I haven't used filters before. We just upgraded from Struts 1.0.2 so I'm pretty ignorant of all the features of newest version of Struts. Is this some kind of Struts filter or what is described here? http://java.sun.com/products/servlet/Filters.html Thanks again for your reply. [EMAIL PROTECTED] wrote: Is it possible to do "if then else" type of processing using Struts Logic tags? I don't see anything in the Struts Logic tags documentation at this link http://struts.apache.org/struts-doc-1.2.7 /userGuide/struts-logic.html Use JSTL; you'll be better off in the long run anyway, and there's essentially zero learning curve. 1) I want to put in some logic in all my jsps to check if a user has authenticated. Don't do this in the JSP; do this in either a filter, base Action class, etc. Try to use JSP pages for presentation only to keep concerns separated. One of the problems is that I also need to check if the user session object is null because a user could have tried to go directly to an "internal" (after login page) page using a bookmark. How can I check for the presence of an object in the session? Again, if you're doing this outside of a JSP (highly recommended) it's trivial. Otherwise you could always use a JSTL tag to check for a value in the appropriate session scope attribute key. Als0-Dave David - The information contained in this message is intended only for the personal and confidential use of the recipient(s) named above. 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 document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately, and delete the original message. - 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: Display Struts Configuration
This is nice for config before the application is running, I want to know during runtime. Thanks! Matt [EMAIL PROTECTED] wrote: Maybe this is what you are referring to? http://marc.theaimsgroup.com/?l=struts-user&m=114406604109454&w=2 http://www.jamesholmes.com/struts/console/ http://exadel.com/web/portal/products/ExadelStudio http://www.m7.com/ -Dennis "Matthew J. Vincent" <[EMAIL PROTECTED]> 04/13/2006 10:38 AM Please respond to "Struts Users Mailing List" To Struts Users Mailing List cc Subject Re: Display Struts Configuration This is helpful, but not *exactly* what I am looking for. What I am looking for is used for debugging purposes during runtime. Anyone? Thanks again Don. Matt Don Brown wrote: I don't know if this is what you are looking for, but I've found it useful in the past: http://struts.sourceforge.net/strutsdoc/index.html Basically, it is Javadoc for Struts, Tiles, and stxx configuration. Struts Action 2 (and WebWork) has: - SiteGraph http://www.opensymphony.com/webwork/wikidocs/SiteGraph.html - Config Browser http://www.opensymphony.com/webwork/wikidocs/Config%20Browser.html If you have any other ideas of tools that would be useful, let us know. Don On 4/13/06, Matthew J. Vincent <[EMAIL PROTECTED]> wrote: Hello all, Last week I saw a blog which showed how to display information at the beginning of your JSP about Struts such as which action the request was mapped to, the form being used, and associated information like the request headers. I should have bookmarked it, but I didn't. I have checked my history, googled for it, etc., but cannot find it again. Does anyone know what I am talking about and/or can they post a link for this information? Or does anyone have something similar? Thanks for your help. Matt - 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: Display Struts Configuration
Wendy - This is excellent and very close to what I am looking for. The only thing missing from this is the *Struts* specific information such as which action the request was mapped to, the form being used, etc. Is there anyone who has this information or an idea of how to retrieve it? Thanks! Matt Wendy Smoak wrote: On 4/13/06, Matthew J. Vincent <[EMAIL PROTECTED]> wrote: This is helpful, but not *exactly* what I am looking for. What I am looking for is used for debugging purposes during runtime. Anyone? I keep 'debug.jsp' around, and include it at the bottom of my main (Tiles) layout during development. It uses JSTL and the implicit objects to print out everything in request/session/application scope. http://wiki.wsmoak.net/cgi-bin/wiki.pl?DebugJSP HTH, -- Wendy - 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: Display Struts Configuration
This is helpful, but not *exactly* what I am looking for. What I am looking for is used for debugging purposes during runtime. Anyone? Thanks again Don. Matt Don Brown wrote: I don't know if this is what you are looking for, but I've found it useful in the past: http://struts.sourceforge.net/strutsdoc/index.html Basically, it is Javadoc for Struts, Tiles, and stxx configuration. Struts Action 2 (and WebWork) has: - SiteGraph http://www.opensymphony.com/webwork/wikidocs/SiteGraph.html - Config Browser http://www.opensymphony.com/webwork/wikidocs/Config%20Browser.html If you have any other ideas of tools that would be useful, let us know. Don On 4/13/06, Matthew J. Vincent <[EMAIL PROTECTED]> wrote: Hello all, Last week I saw a blog which showed how to display information at the beginning of your JSP about Struts such as which action the request was mapped to, the form being used, and associated information like the request headers. I should have bookmarked it, but I didn't. I have checked my history, googled for it, etc., but cannot find it again. Does anyone know what I am talking about and/or can they post a link for this information? Or does anyone have something similar? Thanks for your help. Matt - 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]
Display Struts Configuration
Hello all, Last week I saw a blog which showed how to display information at the beginning of your JSP about Struts such as which action the request was mapped to, the form being used, and associated information like the request headers. I should have bookmarked it, but I didn't. I have checked my history, googled for it, etc., but cannot find it again. Does anyone know what I am talking about and/or can they post a link for this information? Or does anyone have something similar? Thanks for your help. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm.validate() Help
Hello all, I just downloaded the latest stable build of Struts 1.2. What is a "best practice" approach of handling validation in the ActionForm's validate method since ActionError was deprecated? Also, how should one display the messages in the JSP? Currently I use: ${message} Howver this does not display anything when I use the following code in my ActionForm because errors is obviously not populated with any data: public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (/*some error occurs*/){ ActionMessages messages = new ActionMessages(); ActionMessage message = new ActionMessage("errors.valueRequired"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); request.setAttribute("warnings", messages); } return errors; } However in an Action the following code will work correctly and display in the HTML rendered by the JSP code from above: ActionMessages messages = new ActionMessages(); ActionMessage message = new ActionMessage("errors.notfound"); messages.add(ActionMessages.GLOBAL_MESSAGE, message); saveMessages(request, messages); Do I have to check for the existence of both messages and errors in the JSP? Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] DAO ... where to draw the line?
LAST . I promise! Thanks! Hi all, Thanks for the info. Here's another issue. What if I have an employee search screen that wants to show only some of the information of an employee (not all). What do you do then? 1. Instanatiate an Employee object and only fill in the relative information? Keep in mind that this could be just employee name and location on the search results screen and then when the user chooses which employee to view I need to get all of the employee information. 2. Instantiate an Employee object and fill out all the information even though you won't be needing most of it on the search results screen? 3. Create 2 DTOs, one called Employee and one called EmployeeSearch DTO. The EmployeeSearch DTO only stores what needs to be shown on the search results screen and the EmployeeDTO holds all the information for what needs to be shown on the detail screen? 4. Something else... Another pattern, etc? Thanks! Matt Navjot Singh wrote: hi matthew, I wont say that you go with one or other of your approaches. It depends upon type of assosciation that 2 entities may share. They may have aggregation or composition relationship. Depending on that your DAO implementation will decide that you need to get ONLY id or the composite objects. Let me explain. Say you have class named ORDER ad ORDER_DETAILS. (consists-of relationship) Order without order details is nothing. So you may get the OrderDetails object as well when you get Order. Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) EMPLOYEE *may* still exists with or without department. So you may get only id of department and later fetch the department. Think in employee table, you have relationship (reports-to). If you specify this relation as composition, you may go on fetching the objects all the way up to the organization chart ;-) Do i make sense? Navjot Singh -Original Message----- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 8:21 AM To: Struts Users Mailing List Subject: [OT] DAO ... where to draw the line? [OFF TOPIC] I know this is a struts forum, but as struts developers using DAOs, where do your DAO implementation draw the line? For example: Let''s say I have three tables: Employee (contains employee_id, employee_name, and dept_id) Department (contains dept_id, dept_name, loc_id) Location (contains loc_id, location_name) How deep do your classes go to replicate the data? Do you do this... public class Employee { private int id; private String name; private int deptId; // just the id // .. implementation details } or do you do this public class Employee { private int id; private String name; private Department dept; // all of the data // .. implementation details } and so on and so on. Class Department has the same type of problem. Does it hold just the id for location or a variable class Location? Should DAOs just fill in the id (keys) so it is up to the application using the DAOs to get the Employee class, then the Department class, and the the Location class like: Employee emp = EmployeDAO.getEmployee(1); Department dept = DepartmentDAO.getDepartment(emp.getDeptId()); Location loc = LocationDAO.getLocation(dept.getLocId()); System.out.println(emp.getEmpName() + " works in " + loc.getLocationName()); or Employee emp = EmployeDAO.getEmployee(1); System.out.println(emp.getEmpName() + " works in " + emp.getDept().getLoc().getLocationName()); Now this is just a simple example, but where do you draw the line? It's possible to go on and on and on and cycle back to employee... Any thoughts, links, tips, best practices, whatvere would be helpful! Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] DAO ... where to draw the line?
Matthew J. Vincent wrote: Hi all, Thanks for the info. Here's another issue. What if I have an employee search screen that wants to show only some of the information of an employee (not all). What do you do then? 1. Instanatiate an Employee object and only fill in the relative information? Keep in mind that this could be just employee name and location on the search results screen and then when the user chooses which employee to view I need to get all of the employee information. 2. Instantiate an Employee object and fill out all the information even though you won't be needing most of it on the search results screen? 3. Create 2 DTOs, one called Employee and one called EmployeeSearch DTO. The EmployeeSearch DTO only stores what needs to be shown on the search results screen and the EmployeeDTO holds all the information for what needs to be shown on the detail screen? 4. Something else... Thanks! Matt Navjot Singh wrote: hi matthew, I wont say that you go with one or other of your approaches. It depends upon type of assosciation that 2 entities may share. They may have aggregation or composition relationship. Depending on that your DAO implementation will decide that you need to get ONLY id or the composite objects. Let me explain. Say you have class named ORDER ad ORDER_DETAILS. (consists-of relationship) Order without order details is nothing. So you may get the OrderDetails object as well when you get Order. Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) EMPLOYEE *may* still exists with or without department. So you may get only id of department and later fetch the department. Think in employee table, you have relationship (reports-to). If you specify this relation as composition, you may go on fetching the objects all the way up to the organization chart ;-) Do i make sense? Navjot Singh -Original Message----- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 8:21 AM To: Struts Users Mailing List Subject: [OT] DAO ... where to draw the line? [OFF TOPIC] I know this is a struts forum, but as struts developers using DAOs, where do your DAO implementation draw the line? For example: Let''s say I have three tables: Employee (contains employee_id, employee_name, and dept_id) Department (contains dept_id, dept_name, loc_id) Location (contains loc_id, location_name) How deep do your classes go to replicate the data? Do you do this... public class Employee { private int id; private String name; private int deptId; // just the id // .. implementation details } or do you do this public class Employee { private int id; private String name; private Department dept; // all of the data // .. implementation details } and so on and so on. Class Department has the same type of problem. Does it hold just the id for location or a variable class Location? Should DAOs just fill in the id (keys) so it is up to the application using the DAOs to get the Employee class, then the Department class, and the the Location class like: Employee emp = EmployeDAO.getEmployee(1); Department dept = DepartmentDAO.getDepartment(emp.getDeptId()); Location loc = LocationDAO.getLocation(dept.getLocId()); System.out.println(emp.getEmpName() + " works in " + loc.getLocationName()); or Employee emp = EmployeDAO.getEmployee(1); System.out.println(emp.getEmpName() + " works in " + emp.getDept().getLoc().getLocationName()); Now this is just a simple example, but where do you draw the line? It's possible to go on and on and on and cycle back to employee... Any thoughts, links, tips, best practices, whatvere would be helpful! Thanks! Matt - 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: [OT] DAO ... where to draw the line?
Hi all, Thanks for the info. Here's another issue. What if I have an employee search screen that wants to show only some of the information of an employee (not all). What do you do then? 1. Instanatiate an Employee object and only fill in the relative information? Keep in mind that this could be just employee name and location on the search results screen and then when the user chooses which employee to view I need to get all of the employee information. 2. Instantiate an Employee object and fill out all the information even though you won't be needing most of it on the search results screen? 3. Create 2 DTOs, one called Employee and one called EmployeeSearch DTO. The EmployeeSearch DTO only stores what needs to be shown on the search results screen and the EmployeeDTO holds all the information for what needs to be shown on the detail screen? 4. Something else... Thanks! Matt Navjot Singh wrote: hi matthew, I wont say that you go with one or other of your approaches. It depends upon type of assosciation that 2 entities may share. They may have aggregation or composition relationship. Depending on that your DAO implementation will decide that you need to get ONLY id or the composite objects. Let me explain. Say you have class named ORDER ad ORDER_DETAILS. (consists-of relationship) Order without order details is nothing. So you may get the OrderDetails object as well when you get Order. Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) EMPLOYEE *may* still exists with or without department. So you may get only id of department and later fetch the department. Think in employee table, you have relationship (reports-to). If you specify this relation as composition, you may go on fetching the objects all the way up to the organization chart ;-) Do i make sense? Navjot Singh -Original Message----- From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 8:21 AM To: Struts Users Mailing List Subject: [OT] DAO ... where to draw the line? [OFF TOPIC] I know this is a struts forum, but as struts developers using DAOs, where do your DAO implementation draw the line? For example: Let''s say I have three tables: Employee (contains employee_id, employee_name, and dept_id) Department (contains dept_id, dept_name, loc_id) Location (contains loc_id, location_name) How deep do your classes go to replicate the data? Do you do this... public class Employee { private int id; private String name; private int deptId; // just the id // .. implementation details } or do you do this public class Employee { private int id; private String name; private Department dept; // all of the data // .. implementation details } and so on and so on. Class Department has the same type of problem. Does it hold just the id for location or a variable class Location? Should DAOs just fill in the id (keys) so it is up to the application using the DAOs to get the Employee class, then the Department class, and the the Location class like: Employee emp = EmployeDAO.getEmployee(1); Department dept = DepartmentDAO.getDepartment(emp.getDeptId()); Location loc = LocationDAO.getLocation(dept.getLocId()); System.out.println(emp.getEmpName() + " works in " + loc.getLocationName()); or Employee emp = EmployeDAO.getEmployee(1); System.out.println(emp.getEmpName() + " works in " + emp.getDept().getLoc().getLocationName()); Now this is just a simple example, but where do you draw the line? It's possible to go on and on and on and cycle back to employee... Any thoughts, links, tips, best practices, whatvere would be helpful! Thanks! Matt - 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]
[OT] DAO ... where to draw the line?
[OFF TOPIC] I know this is a struts forum, but as struts developers using DAOs, where do your DAO implementation draw the line? For example: Let''s say I have three tables: Employee (contains employee_id, employee_name, and dept_id) Department (contains dept_id, dept_name, loc_id) Location (contains loc_id, location_name) How deep do your classes go to replicate the data? Do you do this... public class Employee { private int id; private String name; private int deptId; // just the id // .. implementation details } or do you do this public class Employee { private int id; private String name; private Department dept; // all of the data // .. implementation details } and so on and so on. Class Department has the same type of problem. Does it hold just the id for location or a variable class Location? Should DAOs just fill in the id (keys) so it is up to the application using the DAOs to get the Employee class, then the Department class, and the the Location class like: Employee emp = EmployeDAO.getEmployee(1); Department dept = DepartmentDAO.getDepartment(emp.getDeptId()); Location loc = LocationDAO.getLocation(dept.getLocId()); System.out.println(emp.getEmpName() + " works in " + loc.getLocationName()); or Employee emp = EmployeDAO.getEmployee(1); System.out.println(emp.getEmpName() + " works in " + emp.getDept().getLoc().getLocationName()); Now this is just a simple example, but where do you draw the line? It's possible to go on and on and on and cycle back to employee... Any thoughts, links, tips, best practices, whatvere would be helpful! Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Should every Action have an associated form?
Thanks everyone! Much appreciated. Matt Michael McGrady wrote: I have lots of actions without forms. They are useful when you don't have forms. LOL Seriously, that is the reason. Michael At 07:51 PM 8/10/2004, you wrote: Hey everyone! I hope to not get flamed, but it's getting late here and I'm tired of looking through the archives. Should every Action have an associated ActionForm? Is it a bad idea to read a parameter directly from the request in the Action? I have a page where I need to show details for a particular item in our database. People will be directed to this page via a url http://127.0.0.1/foo/bar.do?id=123. If I need an ActonForm, what's the best way to set this up in the struts-config.xml? Thoughts? Thanks in advance! Matt - 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]
Should every Action have an associated form?
Hey everyone! I hope to not get flamed, but it's getting late here and I'm tired of looking through the archives. Should every Action have an associated ActionForm? Is it a bad idea to read a parameter directly from the request in the Action? I have a page where I need to show details for a particular item in our database. People will be directed to this page via a url http://127.0.0.1/foo/bar.do?id=123. If I need an ActonForm, what's the best way to set this up in the struts-config.xml? Thoughts? Thanks in advance! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]