html:select element's data in session
Dear all, To show a drop down list I'm using html:select tag and storing a collection object in the session to fill this list up. Everything works fine. My only question is that when would this list would be removed from the session? Would Struts framework remove it or it would be there forever until session expires? Thanks in anticipation for help. Regards, ATTA
When ActionFrom object is cleared from the session
Dear all, When does STRUTS framework removes ActionForm object from the session, if at all? Any help or pointers to help on this topic is appreciated. Regards, ATTA
Re: Session Cleanup
Thanks, David. Putting commonly used collection in the application scope is a nice idea; both for storage space and performance reasons. Now how do I store my form beans in request instead of session? Is it the scope attribute of the action mapping that determines it? And what are performance implications of this change? Regards, ATTA - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 11:50 AM Subject: Re: Session Cleanup I believe struts leaves form beans in the session forever. They won't really grow in size though because they get reset on each use. You could also store them in the request if you're really worried about it. If I store collections in the session, I'll often remove them at the end of a transaction. So, when the user saves a form I remove the collection. In general, I try to keep common collections in the ServletContext. David From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: struts users mailing list [EMAIL PROTECTED] Subject: Session Cleanup Date: Thu, 17 Oct 2002 10:20:24 -0700 When does struts framework remove ActionFrom objects from the session, if at all. I'm worried if I'd be making my session object too large. Moreover, what are the best practices for storing html:select collections in the session? How and when to remove these collections from the session? Regards, ATTA _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Multiple parameter to html:link
Hi, How do I include multiple parameters in the html:link tag? currently I got it working for one parameter like: html:link href=logout paramId=companyId paramName=company paramProperty=valuebean:write name=company property=label//html:link now, what if I want to add another parameter to this list? thanks. ATTA
Re: Session Cleanup
So how do you know which ones are not used anymore? - Original Message - From: Hoang, Hai [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:49 PM Subject: RE: Session Cleanup I often stored my form beans in a session scope. I've a routine that looping through the session and destroy the unused forms. The tricky part is how to determine with forms are no longer in used. Anyone out there using this technique? -Original Message- From: Craig R. McClanahan [mailto:craigmcc;apache.org] Sent: Thursday, October 17, 2002 3:37 PM To: Struts Users Mailing List Subject: Re: Session Cleanup On Thu, 17 Oct 2002, atta ur-rehman wrote: Date: Thu, 17 Oct 2002 13:36:41 -0700 From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Thanks, David. Putting commonly used collection in the application scope is a nice idea; both for storage space and performance reasons. Now how do I store my form beans in request instead of session? Is it the scope attribute of the action mapping that determines it? Yes. And what are performance implications of this change? The set of attributes in the request or session object supplied by the servlet container is usually a HashMap, so performance of storing the form bean in either is equivalent. However, your app will benefit from the fact that the form bean is automatically released at the end of the request, so the overall memory occupancy of your app will likely be lower, but the CPU time consumption might be higher (due to increased garbage collection). For most apps, this tradeoff is very much worth it because having excess CPU capacity is more common than having excess memory to store the form beans in session scope in between requests. Regards, ATTA Craig -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Introducing the all new and improved continental.com. With a totally new personalized design, it's the best place to go. Before you go. Continental Airlines. Work Hard. Fly Right. http://www.continental.com -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Session Cleanup
Thanks Craig. That explains. I think we can afford few more cpu cycles instead of memory. Now is there a way to store collections in the request scope instead of session scope? by collections I mean, collections used to populate html:select controls? ATTA - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:36 PM Subject: Re: Session Cleanup On Thu, 17 Oct 2002, atta ur-rehman wrote: Date: Thu, 17 Oct 2002 13:36:41 -0700 From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Thanks, David. Putting commonly used collection in the application scope is a nice idea; both for storage space and performance reasons. Now how do I store my form beans in request instead of session? Is it the scope attribute of the action mapping that determines it? Yes. And what are performance implications of this change? The set of attributes in the request or session object supplied by the servlet container is usually a HashMap, so performance of storing the form bean in either is equivalent. However, your app will benefit from the fact that the form bean is automatically released at the end of the request, so the overall memory occupancy of your app will likely be lower, but the CPU time consumption might be higher (due to increased garbage collection). For most apps, this tradeoff is very much worth it because having excess CPU capacity is more common than having excess memory to store the form beans in session scope in between requests. Regards, ATTA Craig -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Session Cleanup
Thanks David, that certainly help. And excuse me for my naivety! Thanks once more. Regards, ATTA - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 5:44 PM Subject: Re: Session Cleanup Well, in the ServletRequest interface there are 2 methods getAttribute and setAttribute (you'll find identical methods in HttpSession and ServletContext). This is how you put objects into various scopes. So, in one of your Actions you would say: request.setAttribute(someName, myCollection); The jsp you forward to can get the myCollection object by saying: in JSTL: ${requestScope.someName} in jsp expression %= request.getAttribute(someName) % Does that help? Dave From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Date: Thu, 17 Oct 2002 14:43:48 -0700 Ok, David, I read the doc! now what? - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:58 PM Subject: Re: Session Cleanup Try looking through the servlet javadoc here: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/ Look at HttpServletRequest and HttpSession David From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Date: Thu, 17 Oct 2002 13:55:55 -0700 Thanks Craig. That explains. I think we can afford few more cpu cycles instead of memory. Now is there a way to store collections in the request scope instead of session scope? by collections I mean, collections used to populate html:select controls? ATTA - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:36 PM Subject: Re: Session Cleanup On Thu, 17 Oct 2002, atta ur-rehman wrote: Date: Thu, 17 Oct 2002 13:36:41 -0700 From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Thanks, David. Putting commonly used collection in the application scope is a nice idea; both for storage space and performance reasons. Now how do I store my form beans in request instead of session? Is it the scope attribute of the action mapping that determines it? Yes. And what are performance implications of this change? The set of attributes in the request or session object supplied by the servlet container is usually a HashMap, so performance of storing the form bean in either is equivalent. However, your app will benefit from the fact that the form bean is automatically released at the end of the request, so the overall memory occupancy of your app will likely be lower, but the CPU time consumption might be higher (due to increased garbage collection). For most apps, this tradeoff is very much worth it because having excess CPU capacity is more common than having excess memory to store the form beans in session scope in between requests. Regards, ATTA Craig -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Session Cleanup
Ok, David, I read the doc! now what? - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:58 PM Subject: Re: Session Cleanup Try looking through the servlet javadoc here: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/ Look at HttpServletRequest and HttpSession David From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Date: Thu, 17 Oct 2002 13:55:55 -0700 Thanks Craig. That explains. I think we can afford few more cpu cycles instead of memory. Now is there a way to store collections in the request scope instead of session scope? by collections I mean, collections used to populate html:select controls? ATTA - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 1:36 PM Subject: Re: Session Cleanup On Thu, 17 Oct 2002, atta ur-rehman wrote: Date: Thu, 17 Oct 2002 13:36:41 -0700 From: atta ur-rehman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Session Cleanup Thanks, David. Putting commonly used collection in the application scope is a nice idea; both for storage space and performance reasons. Now how do I store my form beans in request instead of session? Is it the scope attribute of the action mapping that determines it? Yes. And what are performance implications of this change? The set of attributes in the request or session object supplied by the servlet container is usually a HashMap, so performance of storing the form bean in either is equivalent. However, your app will benefit from the fact that the form bean is automatically released at the end of the request, so the overall memory occupancy of your app will likely be lower, but the CPU time consumption might be higher (due to increased garbage collection). For most apps, this tradeoff is very much worth it because having excess CPU capacity is more common than having excess memory to store the form beans in session scope in between requests. Regards, ATTA Craig -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Session Cleanup
When does struts framework remove ActionFrom objects from the session, if at all. I'm worried if I'd be making my session object too large. Moreover, what are the best practices for storing html:select collections in the session? How and when to remove these collections from the session? Regards, ATTA
IllegalStateException while using jsp:forward
Dear all, While conditionally forwarding to another jsp page my Struts/Tiles page throws this exception: java.lang.IllegalStateException: reset() failed - data has already been sent to client I don't understand what's going on. Any help would be greatly appreciated. Regards, ATTA
Error Page and Struts+Tiles
Dear all, It seems that errorPage page directive doesn't work if we have struts and tiles. Is it so? If yes, how do a get equivalent functionality. I always get an InvlaidStateException that says that server can't take me to error page 'cas some data has already been sent to client. TIA, ATTA
Re: Error Page and Struts+Tiles
Could you please explain it in a little more detail? I'm stuck! Regards, ATTA - Original Message - From: Gemes Tibor [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 11:31 PM Subject: Re: Error Page and Struts+Tiles 2002. november 14. 03:12 dátummal atta ur-rehman ezt írtad: Dear all, It seems that errorPage page directive doesn't work if we have struts and tiles. Is it so? If yes, how do a get equivalent functionality. I always get an InvlaidStateException that says that server can't take me to error page 'cas some data has already been sent to client. I think that you should use different errorpage depending on you have error on the tiles layout or a tile you want to insert into the layout. If an error occures in the layout itself the error page has to generate the whole html/html story however an error occuring in a tile should produce an error message in that very place, and let the layout to collect the other parts of the document. hth, Tib -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Howto handle this behavior in Struts+Tiles
Dear all, Here is my layout.jsp file: %@ page errorPage=ErrorPage.jsp % tiles:insert attribute=menu/ tiles:insert attribute=body/ tiles:insert attribute=footer/ The menu tile is a JSP page that could throw an exception. Now whenever an exception is thrown on the menu tile I want to goto JSP Error Page. What I get instead is this exception: [Exception in:/main-menu.jsp] reset() failed - data has already been sent to client java.lang.IllegalStateException: reset() failed - data has already been sent to client. Could you please help me with this one? What do I need to fix this problem. By the way menu.jsp contains %@ page errorPage=ErrorPage.jsp % directive. And currently if there is an exception on layout.jsp Error Page does show up with appropriate error message. TIA, ATTA
Re: Howto handle this behavior in Struts+Tiles
Thanks, Danny, for the detailed response. We're running Struts 1.0.x. Does it support ExceptionHandler paradigm? If so could you please point towards some starting points. Thanks again. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: Mebed, Waheed [EMAIL PROTECTED] Sent: Monday, November 18, 2002 10:36 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, Usually exception that being thrown by the VIEW(JSP) are rendering related exception. This could be tags/Scriptlet that access resource, JavaBeans, fails. Meaning the Resource is not there. And when these thing happen with composite view thing became A bit tricky. First of all, within the container, the layout, of the composite view You don't where exception might be thrown. Second, the page directive for 'errorPage' Can only be set at the outter most container, the layou, and not within any of its Contained JSP. Since, you never know when response has been committed to the client Browser. And if response has already committed to the clien browser, any attemp to Forward to a different resource is an IllegalStateException. A quick solution to your Problem is to only have the page directive for your JSP is in the outer most container, The layout. My approach to handling the front-end exception in Struts1+ is having a sub-module for Handling exception with a set of custom or generic ExceptionHandler, with action mapping That will capture the exception, do exception profiling or anything neccessarry, and use Struts declarative exception handling to map it to a user friendly View for displaying Specific error pages. This has to work with the Web application error mapping in the Web.xml deployment descriptor, to map different error-code and exception to the right Action mapping in your exception sub-module that will handle the exception. I think This is a much cleaner way to haddle exception since it promote encapsulation of exception Handling into one central place, the sub-module, that can be manage easily and consistent Through out the entire application. Plus, exception handler can be reused in different Web application with the entire enterprise. Hope this would help, -danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 9:52 AM To: struts users mailing list Subject: Howto handle this behavior in Struts+Tiles Dear all, Here is my layout.jsp file: %@ page errorPage=ErrorPage.jsp % tiles:insert attribute=menu/ tiles:insert attribute=body/ tiles:insert attribute=footer/ The menu tile is a JSP page that could throw an exception. Now whenever an exception is thrown on the menu tile I want to goto JSP Error Page. What I get instead is this exception: [Exception in:/main-menu.jsp] reset() failed - data has already been sent to client java.lang.IllegalStateException: reset() failed - data has already been sent to client. Could you please help me with this one? What do I need to fix this problem. By the way menu.jsp contains %@ page errorPage=ErrorPage.jsp % directive. And currently if there is an exception on layout.jsp Error Page does show up with appropriate error message. TIA, ATTA -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Howto handle this behavior in Struts+Tiles
Hi, This definitely is helpful. As I'm not very experiences in Struts, does your point 3 refers to error-page exception-typejava.lang.Exception/exception-type location/ErrorPage.jsp/location /error-page construct in web.xml or is it something different? If its the same thing, how do I know if my JSP container supports this feature or not. I'm asking this because we are running ServletExec 3.1 that is compliant to Servlet 2.2 only. Thanks. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:15 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, 1.0 doesn't support declarative exception handling, but it doesn't prevent you from Doing so...:) Anyway, what I would do is: 1) Implement an abstract Action have and Abstract method execute(...) throw Exception. 2) Implement the perform(...) method That will call you're the abstract excecute(...) method, and catch all or any specific Exception and return the associated forward to the specific View(JSP) as needed. 3) Map all/any error-code and exception mapping in your web.xml to an Action that Extended from your abstract exception. This exception can be generic or specific to A particular mapping, it will profile the exception and re-throw or create a new exception And throw it, so that the perform method will catch this exception and route it to the Targeted VIEW. Hope this would help, --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 10:57 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thanks, Danny, for the detailed response. We're running Struts 1.0.x. Does it support ExceptionHandler paradigm? If so could you please point towards some starting points. Thanks again. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: Mebed, Waheed [EMAIL PROTECTED] Sent: Monday, November 18, 2002 10:36 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, Usually exception that being thrown by the VIEW(JSP) are rendering related exception. This could be tags/Scriptlet that access resource, JavaBeans, fails. Meaning the Resource is not there. And when these thing happen with composite view thing became A bit tricky. First of all, within the container, the layout, of the composite view You don't where exception might be thrown. Second, the page directive for 'errorPage' Can only be set at the outter most container, the layou, and not within any of its Contained JSP. Since, you never know when response has been committed to the client Browser. And if response has already committed to the clien browser, any attemp to Forward to a different resource is an IllegalStateException. A quick solution to your Problem is to only have the page directive for your JSP is in the outer most container, The layout. My approach to handling the front-end exception in Struts1+ is having a sub-module for Handling exception with a set of custom or generic ExceptionHandler, with action mapping That will capture the exception, do exception profiling or anything neccessarry, and use Struts declarative exception handling to map it to a user friendly View for displaying Specific error pages. This has to work with the Web application error mapping in the Web.xml deployment descriptor, to map different error-code and exception to the right Action mapping in your exception sub-module that will handle the exception. I think This is a much cleaner way to haddle exception since it promote encapsulation of exception Handling into one central place, the sub-module, that can be manage easily and consistent Through out the entire application. Plus, exception handler can be reused in different Web application with the entire enterprise. Hope this would help, -danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 9:52 AM To: struts users mailing list Subject: Howto handle this behavior in Struts+Tiles Dear all, Here is my layout.jsp file: %@ page errorPage=ErrorPage.jsp % tiles:insert attribute=menu/ tiles:insert attribute=body/ tiles:insert attribute=footer/ The menu tile is a JSP page that could throw an exception. Now whenever an exception is thrown on the menu tile I want to goto JSP Error Page. What I get instead is this exception: [Exception in:/main-menu.jsp] reset() failed - data has already been sent to client java.lang.IllegalStateException: reset() failed - data has already been sent to client. Could you please help me with this one? What do I need to fix this problem. By the way menu.jsp contains
Re: Howto handle this behavior in Struts+Tiles
okay, let me give it a try and I'll get back to you! thanks. by the way, do you if this feature is available thru servlet 2.2 specs? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:54 AM Subject: RE: Howto handle this behavior in Struts+Tiles You are almost close ... :) Yes my point 3 is that mapping in the web.xml. But Instead of going to the JSP, location/ErrorPage.jsp/location, you would want To go to location/errors/catchError.do/location, which map it to a Action that You extended from your abstract action class. This action would do all the necessary Stuff with your Exception if there is one or create a new exception and throw it. --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 11:42 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Hi, This definitely is helpful. As I'm not very experiences in Struts, does your point 3 refers to error-page exception-typejava.lang.Exception/exception-type location/ErrorPage.jsp/location /error-page construct in web.xml or is it something different? If its the same thing, how do I know if my JSP container supports this feature or not. I'm asking this because we are running ServletExec 3.1 that is compliant to Servlet 2.2 only. Thanks. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:15 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, 1.0 doesn't support declarative exception handling, but it doesn't prevent you from Doing so...:) Anyway, what I would do is: 1) Implement an abstract Action have and Abstract method execute(...) throw Exception. 2) Implement the perform(...) method That will call you're the abstract excecute(...) method, and catch all or any specific Exception and return the associated forward to the specific View(JSP) as needed. 3) Map all/any error-code and exception mapping in your web.xml to an Action that Extended from your abstract exception. This exception can be generic or specific to A particular mapping, it will profile the exception and re-throw or create a new exception And throw it, so that the perform method will catch this exception and route it to the Targeted VIEW. Hope this would help, --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 10:57 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thanks, Danny, for the detailed response. We're running Struts 1.0.x. Does it support ExceptionHandler paradigm? If so could you please point towards some starting points. Thanks again. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: Mebed, Waheed [EMAIL PROTECTED] Sent: Monday, November 18, 2002 10:36 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, Usually exception that being thrown by the VIEW(JSP) are rendering related exception. This could be tags/Scriptlet that access resource, JavaBeans, fails. Meaning the Resource is not there. And when these thing happen with composite view thing became A bit tricky. First of all, within the container, the layout, of the composite view You don't where exception might be thrown. Second, the page directive for 'errorPage' Can only be set at the outter most container, the layou, and not within any of its Contained JSP. Since, you never know when response has been committed to the client Browser. And if response has already committed to the clien browser, any attemp to Forward to a different resource is an IllegalStateException. A quick solution to your Problem is to only have the page directive for your JSP is in the outer most container, The layout. My approach to handling the front-end exception in Struts1+ is having a sub-module for Handling exception with a set of custom or generic ExceptionHandler, with action mapping That will capture the exception, do exception profiling or anything neccessarry, and use Struts declarative exception handling to map it to a user friendly View for displaying Specific error pages. This has to work with the Web application error mapping in the Web.xml deployment descriptor, to map different error-code and exception to the right Action mapping in your exception sub-module that will handle the exception. I think This is a much cleaner way to haddle exception since it promote encapsulation of exception Handling into one central place, the sub-module, that can
Re: Howto handle this behavior in Struts+Tiles
Hi Danny, I'm confused already!!! here is the abstract action class with an abstract execute method: --- import javax.servlet.http.*; import org.apache.struts.action.*; public abstract class AbstractErrorHandlerAction extends Action { public abstract void execute(ActionMapping mapping, ActionForm form, HttpServletRequest request , HttpServletResponse response) throws Exception; } --- now should all my actions extend this class? or its only the action handler action that would extend this class? moreover, I don't see throws clause in the perform(...) method of Action class? So, am I completely lost? I hope you won't mind my simplistic questions!!! ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 1:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles I thinks so ... Good luck...:) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 1:05 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles okay, let me give it a try and I'll get back to you! thanks. by the way, do you if this feature is available thru servlet 2.2 specs? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:54 AM Subject: RE: Howto handle this behavior in Struts+Tiles You are almost close ... :) Yes my point 3 is that mapping in the web.xml. But Instead of going to the JSP, location/ErrorPage.jsp/location, you would want To go to location/errors/catchError.do/location, which map it to a Action that You extended from your abstract action class. This action would do all the necessary Stuff with your Exception if there is one or create a new exception and throw it. --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 11:42 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Hi, This definitely is helpful. As I'm not very experiences in Struts, does your point 3 refers to error-page exception-typejava.lang.Exception/exception-type location/ErrorPage.jsp/location /error-page construct in web.xml or is it something different? If its the same thing, how do I know if my JSP container supports this feature or not. I'm asking this because we are running ServletExec 3.1 that is compliant to Servlet 2.2 only. Thanks. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:15 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, 1.0 doesn't support declarative exception handling, but it doesn't prevent you from Doing so...:) Anyway, what I would do is: 1) Implement an abstract Action have and Abstract method execute(...) throw Exception. 2) Implement the perform(...) method That will call you're the abstract excecute(...) method, and catch all or any specific Exception and return the associated forward to the specific View(JSP) as needed. 3) Map all/any error-code and exception mapping in your web.xml to an Action that Extended from your abstract exception. This exception can be generic or specific to A particular mapping, it will profile the exception and re-throw or create a new exception And throw it, so that the perform method will catch this exception and route it to the Targeted VIEW. Hope this would help, --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 10:57 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thanks, Danny, for the detailed response. We're running Struts 1.0.x. Does it support ExceptionHandler paradigm? If so could you please point towards some starting points. Thanks again. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: Mebed, Waheed [EMAIL PROTECTED] Sent: Monday, November 18, 2002 10:36 AM Subject: RE: Howto handle this behavior in Struts+Tiles Hello, Usually exception that being thrown by the VIEW(JSP) are rendering related exception. This could be tags/Scriptlet that access resource, JavaBeans, fails. Meaning the Resource is not there. And when these thing happen with composite view thing became A bit tricky. First of all, within the container
Re: Howto handle this behavior in Struts+Tiles
we want to have and execute(...) method in a abstract class so that we could through exceptions other than the ones perform(...) could throw? is it correct? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles Okay, If you want to handle where to go next in one place then create the abstract class and have All the exception handling extends from it. All the handler action need to do is to do profiling Of the exception, and the abstract class's perform(...) will catch the exceptions handle it or Just forward it to the associated VIEW. This works too, if you want all of your action Extends from this abstract action, if this is the case you want, which I would prefer, then You might want your abstract class to handle the exception, meaning you want the abstract class To catch it, profile/log the exception and then forwad to the VIEW. If this is the case then Your exception handler action doesn't have to do anything but throw the correct exception so the Abstract action class will catch it and handle it for you. If you are looking at this clearly, what we want to do is to create a template of execution at The base of all your application exceptions to handle different kind of exceptions. And since We can only do this if exception being throw inside of the execution context of a dispatched Action class, exceptions that might happen in the VIEW, the original problem that init our Conversation, will not get handled. And so if we want it to be control in one place then what Should we do? Ahah.. We use the web.xml exception mapping to do the work. Meaning, we use The web.xml exception mapping to map all the exceptions that happen outside of the Action's Execution context back into an Action mapping with in turns will re throw it so that the Exception is now within the Action's execution context. There is many different way to do This, and it all depends on the need of your application. This just an idea or should I say Concept of how to handle exceptions and errors within a web application. If you implement this with Struts and Tiles, then is no need for using the conventional JSP's Page directive to handle error. There is a few reasons why I don't like this is error handling Logic are coupling with JSPs every where and it is hard to manage and reuse. Where as if you Follow my approach, you can pretty much go to one or two place to see how all the error being Handled, and if you decided to reuse it all that is need to do is to modify your strusts-config.xml, Web.xml and Wala... You have it up runing. Let me know if anything else I can help you with ... :) --danny Ps. Don't know how advance this technique is, but I do hope that Chuck Struts book, and Ted/Credic/..'s Struts book mention about best practice of handling erro and exception within web application. -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 1:22 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Hi Danny, I'm confused already!!! here is the abstract action class with an abstract execute method: -- - import javax.servlet.http.*; import org.apache.struts.action.*; public abstract class AbstractErrorHandlerAction extends Action { public abstract void execute(ActionMapping mapping, ActionForm form, HttpServletRequest request , HttpServletResponse response) throws Exception; } -- - now should all my actions extend this class? or its only the action handler action that would extend this class? moreover, I don't see throws clause in the perform(...) method of Action class? So, am I completely lost? I hope you won't mind my simplistic questions!!! ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 1:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles I thinks so ... Good luck...:) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 1:05 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles okay, let me give it a try and I'll get back to you! thanks. by the way, do you if this feature is available thru servlet 2.2 specs? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 11:54 AM Subject: RE: Howto handle this behavior in Struts+Tiles You are almost close ... :) Yes my point 3
Re: Howto handle this behavior in Struts+Tiles
well, Danny, here I am. back to square one! what I have achieved so far is that I've made changes in the web.xml and in my action so that whenever Action class throws an exception web.xml settings redirect user to an error page. this cool. but the real reason I asked this question is still there. how do I handle a exception that is thrown out of scriptlet from a JSP page that is one tile in the layout? did I miss something along the way? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:37 PM Subject: RE: Howto handle this behavior in Struts+Tiles No problem... I've learn from others the same way... --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:37 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thankyou very much, Danny, for your help and patience! Regards, ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:30 PM Subject: RE: Howto handle this behavior in Struts+Tiles You got it ... :) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:30 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles we want to have and execute(...) method in a abstract class so that we could through exceptions other than the ones perform(...) could throw? is it correct? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles Okay, If you want to handle where to go next in one place then create the abstract class and have All the exception handling extends from it. All the handler action need to do is to do profiling Of the exception, and the abstract class's perform(...) will catch the exceptions handle it or Just forward it to the associated VIEW. This works too, if you want all of your action Extends from this abstract action, if this is the case you want, which I would prefer, then You might want your abstract class to handle the exception, meaning you want the abstract class To catch it, profile/log the exception and then forwad to the VIEW. If this is the case then Your exception handler action doesn't have to do anything but throw the correct exception so the Abstract action class will catch it and handle it for you. If you are looking at this clearly, what we want to do is to create a template of execution at The base of all your application exceptions to handle different kind of exceptions. And since We can only do this if exception being throw inside of the execution context of a dispatched Action class, exceptions that might happen in the VIEW, the original problem that init our Conversation, will not get handled. And so if we want it to be control in one place then what Should we do? Ahah.. We use the web.xml exception mapping to do the work. Meaning, we use The web.xml exception mapping to map all the exceptions that happen outside of the Action's Execution context back into an Action mapping with in turns will re throw it so that the Exception is now within the Action's execution context. There is many different way to do This, and it all depends on the need of your application. This just an idea or should I say Concept of how to handle exceptions and errors within a web application. If you implement this with Struts and Tiles, then is no need for using the conventional JSP's Page directive to handle error. There is a few reasons why I don't like this is error handling Logic are coupling with JSPs every where and it is hard to manage and reuse. Where as if you Follow my approach, you can pretty much go to one or two place to see how all the error being Handled, and if you decided to reuse it all that is need to do is to modify your strusts-config.xml, Web.xml and Wala... You have it up runing. Let me know if anything else I can help you with ... :) --danny Ps. Don't know how advance this technique is, but I do hope that Chuck Struts book, and Ted/Credic/..'s Struts book mention about best practice of handling erro and exception within web application. -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 1:22 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Hi Danny, I'm confused already!!! here is the abstract action class
Re: Howto handle this behavior in Struts+Tiles
Yes, the JSP page throws ServletException but the application doesn't catch it and the stack trace is shown in the browser window! - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 4:10 PM Subject: RE: Howto handle this behavior in Struts+Tiles First of all forwarding is more efficient the redirect. If exception being throw inside your JPS/Tile, if not cached it will be wraped by A JspException, or ServletException I don't remember. And these exception if Not declared by JSP to handle it anywhere, the container will handle it and this is Where your web.xml took place. So you can declare additional mapping in your web.xml To take care of these JspException just as you did for other in your Struts apps. --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 4:02 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles well, Danny, here I am. back to square one! what I have achieved so far is that I've made changes in the web.xml and in my action so that whenever Action class throws an exception web.xml settings redirect user to an error page. this cool. but the real reason I asked this question is still there. how do I handle a exception that is thrown out of scriptlet from a JSP page that is one tile in the layout? did I miss something along the way? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:37 PM Subject: RE: Howto handle this behavior in Struts+Tiles No problem... I've learn from others the same way... --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:37 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thankyou very much, Danny, for your help and patience! Regards, ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:30 PM Subject: RE: Howto handle this behavior in Struts+Tiles You got it ... :) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:30 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles we want to have and execute(...) method in a abstract class so that we could through exceptions other than the ones perform(...) could throw? is it correct? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles Okay, If you want to handle where to go next in one place then create the abstract class and have All the exception handling extends from it. All the handler action need to do is to do profiling Of the exception, and the abstract class's perform(...) will catch the exceptions handle it or Just forward it to the associated VIEW. This works too, if you want all of your action Extends from this abstract action, if this is the case you want, which I would prefer, then You might want your abstract class to handle the exception, meaning you want the abstract class To catch it, profile/log the exception and then forwad to the VIEW. If this is the case then Your exception handler action doesn't have to do anything but throw the correct exception so the Abstract action class will catch it and handle it for you. If you are looking at this clearly, what we want to do is to create a template of execution at The base of all your application exceptions to handle different kind of exceptions. And since We can only do this if exception being throw inside of the execution context of a dispatched Action class, exceptions that might happen in the VIEW, the original problem that init our Conversation, will not get handled. And so if we want it to be control in one place then what Should we do? Ahah.. We use the web.xml exception mapping to do the work. Meaning, we use The web.xml exception mapping to map all the exceptions that happen outside of the Action's Execution context back into an Action mapping with in turns will re throw it so that the Exception is now within the Action's execution context. There is many different way to do This, and it all depends on the need of your application. This just an idea or should I say Concept of how to handle exceptions and errors within a web
Re: Howto handle this behavior in Struts+Tiles
Hello again, Danny! I had to abort it abruptly yesterday. Now let me try it again today and see if we have some how fix the primary problem of Exceptions thrown from JSP scriptlet. Otherwise, I think we have achieved quite good results yesterday. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 5:02 PM Subject: RE: Howto handle this behavior in Struts+Tiles There is a page directive call isError=true or something. And there can only Be one of this page within the entire apps Create this page and have it Forward to the right action mapping that handle error...:) Sorry all these are coming out of my head as I can remember it correctly or not...:) danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 4:27 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Yes, the JSP page throws ServletException but the application doesn't catch it and the stack trace is shown in the browser window! - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 4:10 PM Subject: RE: Howto handle this behavior in Struts+Tiles First of all forwarding is more efficient the redirect. If exception being throw inside your JPS/Tile, if not cached it will be wraped by A JspException, or ServletException I don't remember. And these exception if Not declared by JSP to handle it anywhere, the container will handle it and this is Where your web.xml took place. So you can declare additional mapping in your web.xml To take care of these JspException just as you did for other in your Struts apps. --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 4:02 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles well, Danny, here I am. back to square one! what I have achieved so far is that I've made changes in the web.xml and in my action so that whenever Action class throws an exception web.xml settings redirect user to an error page. this cool. but the real reason I asked this question is still there. how do I handle a exception that is thrown out of scriptlet from a JSP page that is one tile in the layout? did I miss something along the way? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:37 PM Subject: RE: Howto handle this behavior in Struts+Tiles No problem... I've learn from others the same way... --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:37 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thankyou very much, Danny, for your help and patience! Regards, ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:30 PM Subject: RE: Howto handle this behavior in Struts+Tiles You got it ... :) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:30 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles we want to have and execute(...) method in a abstract class so that we could through exceptions other than the ones perform(...) could throw? is it correct? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:05 PM Subject: RE: Howto handle this behavior in Struts+Tiles Okay, If you want to handle where to go next in one place then create the abstract class and have All the exception handling extends from it. All the handler action need to do is to do profiling Of the exception, and the abstract class's perform(...) will catch the exceptions handle it or Just forward it to the associated VIEW. This works too, if you want all of your action Extends from this abstract action, if this is the case you want, which I would prefer, then You might want your abstract class to handle the exception, meaning you want the abstract class To catch it, profile/log the exception and then forwad to the VIEW. If this is the case then Your exception handler action doesn't have to do anything but throw the correct exception so the Abstract action class
Re: Howto handle this behavior in Struts+Tiles
Hi there, nice to hear from you! well, no matter what did I do, I could not have my container to redirect me to the error page if I throw and exception in a JSP!!! So for the time being I don't know how to fix it! I downloaded JSP specs today. It says that container is only responsible for forwarding to errorPage in case of an unhandled exception. and you know I'm not using errorPage directive for this JSP. So its kind of stuck; though, it was good to have Action exceptions to goto common page! Any ideas??? Thanks anyway, ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 19, 2002 5:54 PM Subject: RE: Howto handle this behavior in Struts+Tiles Let me know the result :) -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 9:20 AM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Hello again, Danny! I had to abort it abruptly yesterday. Now let me try it again today and see if we have some how fix the primary problem of Exceptions thrown from JSP scriptlet. Otherwise, I think we have achieved quite good results yesterday. ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 5:02 PM Subject: RE: Howto handle this behavior in Struts+Tiles There is a page directive call isError=true or something. And there can only Be one of this page within the entire apps Create this page and have it Forward to the right action mapping that handle error...:) Sorry all these are coming out of my head as I can remember it correctly or not...:) danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 4:27 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Yes, the JSP page throws ServletException but the application doesn't catch it and the stack trace is shown in the browser window! - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 4:10 PM Subject: RE: Howto handle this behavior in Struts+Tiles First of all forwarding is more efficient the redirect. If exception being throw inside your JPS/Tile, if not cached it will be wraped by A JspException, or ServletException I don't remember. And these exception if Not declared by JSP to handle it anywhere, the container will handle it and this is Where your web.xml took place. So you can declare additional mapping in your web.xml To take care of these JspException just as you did for other in your Struts apps. --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 4:02 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles well, Danny, here I am. back to square one! what I have achieved so far is that I've made changes in the web.xml and in my action so that whenever Action class throws an exception web.xml settings redirect user to an error page. this cool. but the real reason I asked this question is still there. how do I handle a exception that is thrown out of scriptlet from a JSP page that is one tile in the layout? did I miss something along the way? ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:37 PM Subject: RE: Howto handle this behavior in Struts+Tiles No problem... I've learn from others the same way... --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:37 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles Thankyou very much, Danny, for your help and patience! Regards, ATTA - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, November 18, 2002 2:30 PM Subject: RE: Howto handle this behavior in Struts+Tiles You got it ... :) --danny -Original Message- From: atta ur-rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 2:30 PM To: Struts Users Mailing List Subject: Re: Howto handle this behavior in Struts+Tiles we want to have and execute(...) method in a abstract class so that we could through exceptions other than the ones perform(...) could throw? is it correct? ATTA - Original Message
validate() method is ActionForm
Dear all, Struts 1.0.2. Are form properties updated before the validate() method is called? Regards, ATTA
html:file tag and exception in validate method
Dear all, One of our JSP has html:file tag in it. Whenever validate method of the associated ActionFrom returns any errors, the JSP container throws ClassCastException. java.lang.ClassCastException at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.java:171) at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.java:114) at org.apache.struts.tiles.ActionComponentServlet.processForward(ActionComponentServlet.java:277) at org.apache.struts.tiles.ActionComponentServlet.processValidate(ActionComponentServlet.java:211) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Disabling the validate method or returning null from it works just fine! TIA for any help. BTW, we have STRUTS 1.0.2. Regards, ATTA
Re: html:file tag and exception in validate method
Any comments, anybody? - Original Message - From: atta ur rehman [EMAIL PROTECTED] To: struts users mailing list [EMAIL PROTECTED] Sent: Friday, February 21, 2003 9:33 AM Subject: html:file tag and exception in validate method Dear all, One of our JSP has html:file tag in it. Whenever validate method of the associated ActionFrom returns any errors, the JSP container throws ClassCastException. java.lang.ClassCastException at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j ava:171) at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j ava:114) at org.apache.struts.tiles.ActionComponentServlet.processForward(ActionComponen tServlet.java:277) at org.apache.struts.tiles.ActionComponentServlet.processValidate(ActionCompone ntServlet.java:211) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Disabling the validate method or returning null from it works just fine! TIA for any help. BTW, we have STRUTS 1.0.2. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[REPOST] html:file tag and exception in validate method
- Original Message - From: atta ur rehman [EMAIL PROTECTED] To: struts users mailing list [EMAIL PROTECTED] Sent: Friday, February 21, 2003 9:33 AM Subject: html:file tag and exception in validate method Dear all, One of our JSP has html:file tag in it. Whenever validate method of the associated ActionFrom returns any errors, the JSP container throws ClassCastException. java.lang.ClassCastException at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j ava:171) at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j ava:114) at org.apache.struts.tiles.ActionComponentServlet.processForward(ActionComponen tServlet.java:277) at org.apache.struts.tiles.ActionComponentServlet.processValidate(ActionCompone ntServlet.java:211) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1565) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) Disabling the validate method or returning null from it works just fine! TIA for any help. BTW, we have STRUTS 1.0.2. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] any ways to know which control was changed in Action class?
A hidden field, maybe as a form proerty, that your javascript would set to appropriate value before the submit() call. ATTA - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 27, 2003 3:11 PM Subject: [Q] any ways to know which control was changed in Action class? Hello, the JSP has several drop downs, each one has onchange=submit() how I can know which one was changed in my Action class? tnx Best Regards. Michael. - 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]
Where does the servlet.log(String) output go?
Dear all, This may seems a stupid question but I've been banging my head for last two hours to no avail! My Action class has a servlet.log() method call to write out a log message. Everything runs fine but I can't see the log message anywhere. As a matter of fact, I don't know which file it would go into. The debug init parameter of ActionServlet is set to 2 in my app descriptor. TIA, ATTA
Re: Question about ActionErrors html:errors
Well, I think your resource file is missing header and footer properties. try to add errors.header= errors.footer= at the top of your resource file. hope it helps. ATTA - Original Message - From: Ali Khan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 31, 2003 2:18 PM Subject: Question about ActionErrors html:errors Hi, have made an simple struts-application. I got one problem. That is when my actionerrors are shown generated with html:errors /, it shows null in start and in the end of the error-messages. Don't understand why the null's occur ? It shows like this: null Definition not filled Paymenttype not filled null - Here is my code: --- In ActionForm: public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if(paymenttype == null || .equals(paymenttype)){ errors.add(paymenttype,new ActionError(errors.typename)); } if(definition == null || .equals(definition)){ errors.add(definition,new ActionError(errors.comment)); } return errors; } --- In ApplicationResources.properties: errors.typename=bDefinition not filled/bbr errors.comment=bPaymenttype not filled/bbr - In web.xml: ... ... init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param ... . All help appreciated. Thanx. - 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] aliases [SQL SELECT column aliases]
hello Antoine, what it is that you want to 'detect'? Regards, ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 10:39 AM Subject: aliases Hiya I have a little database question about alias... Most of bd(drivers) support the use of AS, but generally you can ommit it and it work. But some bd must have the AS specified and some dont accept the AS (only space). How i can detect that, using java.sql.* p.s.: sorry for my bad english regards Antoine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] aliases [SQL SELECT column aliases]
The only way to know wehter or not you could use AS for column aliases would be to refer to the SELECT statement documentation of your underlying database server. The JDBC driver has got nothing to do with it. ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:02 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] I wanna detect if i must use the AS or not to define my alias for example, using AS with jdbc-idb crash.. for example, not using AS with jdbc-odbc crash so sometime i have to use AS keyword in SQL and sometime not.. -Message d'origine- De : atta ur rehman [mailto:[EMAIL PROTECTED]] Envoyé : 10 février, 2003 14:05 À : Struts Users Mailing List Objet : Re: [OT] aliases [SQL SELECT column aliases] hello Antoine, what it is that you want to 'detect'? Regards, ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 10:39 AM Subject: aliases Hiya I have a little database question about alias... Most of bd(drivers) support the use of AS, but generally you can ommit it and it work. But some bd must have the AS specified and some dont accept the AS (only space). How i can detect that, using java.sql.* p.s.: sorry for my bad english regards Antoine - 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] aliases [SQL SELECT column aliases]
A safer bet tough, IMHO, would be not to use 'AS' at all. As most of database servers would support space delimited column aliases. ATTA - Original Message - From: Durham David Cntr 805CSS/SCBE [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:09 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] It seems strange that a database server would not support AS. Be sure that you are not trying to use any reserved words. The documentation for your database server should tell you what words are reserved. -Dave -Original Message- From: atta ur rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 1:12 PM To: Struts Users Mailing List Subject: Re: [OT] aliases [SQL SELECT column aliases] The only way to know wehter or not you could use AS for column aliases would be to refer to the SELECT statement documentation of your underlying database server. The JDBC driver has got nothing to do with it. ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:02 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] I wanna detect if i must use the AS or not to define my alias for example, using AS with jdbc-idb crash.. for example, not using AS with jdbc-odbc crash so sometime i have to use AS keyword in SQL and sometime not.. -Message d'origine- De : atta ur rehman [mailto:[EMAIL PROTECTED]] Envoyé : 10 février, 2003 14:05 À : Struts Users Mailing List Objet : Re: [OT] aliases [SQL SELECT column aliases] hello Antoine, what it is that you want to 'detect'? Regards, ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 10:39 AM Subject: aliases Hiya I have a little database question about alias... Most of bd(drivers) support the use of AS, but generally you can ommit it and it work. But some bd must have the AS specified and some dont accept the AS (only space). How i can detect that, using java.sql.* p.s.: sorry for my bad english regards Antoine - 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] aliases [SQL SELECT column aliases]
how about supportsANSI92IntermediateSQL(), supportsANSI92FullSQL or other support methods? I'm hoping that aliases conventions are speced out in ANSI SQL standards. ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:35 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] Ya, finally it seem to be the only solution... thx for all comments -Message d'origine- De : Thomas CORNET [mailto:[EMAIL PROTECTED]] Envoyé : 10 février, 2003 14:33 À : Struts Users Mailing List Objet : RE: [OT] aliases [SQL SELECT column aliases] Well, if this can not be detectable, you should make a test at the start of your application. Try to make a test statment with some 'AS' inside, and catch the SQLException. If it is catched, make a flag to true, otherwise make the flag to false. Thus, inside your application, accessing this flag, you'll be able to know how to build your queries. I know it may not be 'good' programming, but if it is a solution which works... Thomas At 20:15 10/02/2003, you wrote: well some bd must have the AS to work properly... I would like to dynamicly detect it.. Event with DatabaseMetadata its not possible ? -Message d'origine- De : atta ur rehman [mailto:[EMAIL PROTECTED]] Envoyé : 10 février, 2003 14:18 À : Struts Users Mailing List Objet : Re: [OT] aliases [SQL SELECT column aliases] A safer bet tough, IMHO, would be not to use 'AS' at all. As most of database servers would support space delimited column aliases. ATTA - Original Message - From: Durham David Cntr 805CSS/SCBE [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:09 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] It seems strange that a database server would not support AS. Be sure that you are not trying to use any reserved words. The documentation for your database server should tell you what words are reserved. -Dave -Original Message- From: atta ur rehman [mailto:[EMAIL PROTECTED]] Sent: Monday, February 10, 2003 1:12 PM To: Struts Users Mailing List Subject: Re: [OT] aliases [SQL SELECT column aliases] The only way to know wehter or not you could use AS for column aliases would be to refer to the SELECT statement documentation of your underlying database server. The JDBC driver has got nothing to do with it. ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 11:02 AM Subject: RE: [OT] aliases [SQL SELECT column aliases] I wanna detect if i must use the AS or not to define my alias for example, using AS with jdbc-idb crash.. for example, not using AS with jdbc-odbc crash so sometime i have to use AS keyword in SQL and sometime not.. -Message d'origine- De : atta ur rehman [mailto:[EMAIL PROTECTED]] Envoyé : 10 février, 2003 14:05 À : Struts Users Mailing List Objet : Re: [OT] aliases [SQL SELECT column aliases] hello Antoine, what it is that you want to 'detect'? Regards, ATTA - Original Message - From: Gilbert, Antoine [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, February 10, 2003 10:39 AM Subject: aliases Hiya I have a little database question about alias... Most of bd(drivers) support the use of AS, but generally you can ommit it and it work. But some bd must have the AS specified and some dont accept the AS (only space). How i can detect that, using java.sql.* p.s.: sorry for my bad english regards Antoine - 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: posting an updated collection back to Action
For your orderDetail textbox you could have setOrderDetail(String[]) and String[] getOrderDetail() getter/setter in your ActionForm class. Hope this helps. ATTA - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 10, 2003 3:45 PM Subject: posting an updated collection back to Action Hi, I have a list of line items displayed in a JSP where some of the attributes can be edited. I would like to capture the updated data by the user to return it to my Action class so I can modify my model accordingly. Here is my JSP code: form action=updateOrder.do method=post input type=hidden name=action value=updateOrder logic:iterate id=orderDetail type=OrderDetailModel collection=%= orderDetailList % tdhtml:text name=orderDetail property=quantityShipped//td /logic:iterate input type=submit valueUpdate Order /form I know my ActionForm class has to have a property called orderDetailList. But the question is, how will the correct index be updated since my list can contain many OrderDetailModel's? Should I add a method in my ActionForm class like getOrderDetailList.get (index)? Help!!! - 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]
A column consisting of html:select widgets
Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A column consisting of html:select widgets
Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - 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: A column consisting of html:select widgets
okay, here goes my JSP code: REPATE FOR ALL THE BLOCKS html:select property=blockDataSource style=WIDTH: 110px; font-size: 8pt onchange=blockDataSourceChanged(); html:options collection=blockDataSourceList property=value labelProperty=label/ /html:select END REPEAT The blockDataSourceList is an ArrayList of LabelValueBean class and is in the session scope. On the page load, I'm setting Form.setBlockDataSource(String[]) to appropriate string array represneting the saved value for the row. My dropdowns always show the first option selected. Thanks for the help. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:30 AM Subject: RE: A column consisting of html:select widgets Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - 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 e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - 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: A column consisting of html:select widgets
Thanks Vijay. That's is an excellent idea to separate the view and submittal logic. But i'm not yet sure if struts can automatically select the appropriate selection in a dropdown based on the arry of strings from the form object. ATTA - Original Message - From: Vijay Balakrishnan [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:00 PM Subject: RE: A column consisting of html:select widgets Have you tried using a separate ViewAction for the display and a SubmitAction for the submittal.The ViewAction could populate the data from the DB and set multiple selected values depending on the values in the DB. Vijay -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:27 AM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - 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: A column consisting of html:select widgets
Thanks. I'll give it a try. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:17 PM Subject: RE: A column consisting of html:select widgets Okay I see what you are trying to do. Here is a suggestion from the top of my head: Create a new action class which uses the same form as the Action in question (populateDataSourceAction or something...). Use this class to load the data from the DB into the blockDataSource field in the form. Put the form in the request space like this in the Action: aRequest.setAttribute(anActionMapping.getName(), myActionForm) then forward it to the JSP page. Do not do any funky javascript stuff (onLoad etc etc) It should work without it!! --Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:52 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets okay, here goes my JSP code: REPATE FOR ALL THE BLOCKS html:select property=blockDataSource style=WIDTH: 110px; font-size: 8pt onchange=blockDataSourceChanged(); html:options collection=blockDataSourceList property=value labelProperty=label/ /html:select END REPEAT The blockDataSourceList is an ArrayList of LabelValueBean class and is in the session scope. On the page load, I'm setting Form.setBlockDataSource(String[]) to appropriate string array represneting the saved value for the row. My dropdowns always show the first option selected. Thanks for the help. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:30 AM Subject: RE: A column consisting of html:select widgets Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show the correct option selected! I've also tried to search from the mail archive to no avail. Any help or pointers would be greatly appreciated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
A column consisting of html:select widgets
All, Please have a look at attached Action, Form and JSP files and tell me what i'm doing wrong to fix this problem. I have to show a column of dropdowns with the same options, where the selected option would depend on each row's selection. So far I've been relying the String[] getter/setters in the Form class. And this is not working. All my dropdowns are set to the same value in the column! To emulate what i'm doing, I've just put a collection in the session then iterate it in the JSP page while trying to show the correct option of each dropdown that I've set in the Action class or the values after submission of the form. I'd really appericiate any clues on this one! Regards, ATTA - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:28 PM Subject: Re: A column consisting of html:select widgets Thanks. I'll give it a try. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:17 PM Subject: RE: A column consisting of html:select widgets Okay I see what you are trying to do. Here is a suggestion from the top of my head: Create a new action class which uses the same form as the Action in question (populateDataSourceAction or something...). Use this class to load the data from the DB into the blockDataSource field in the form. Put the form in the request space like this in the Action: aRequest.setAttribute(anActionMapping.getName(), myActionForm) then forward it to the JSP page. Do not do any funky javascript stuff (onLoad etc etc) It should work without it!! --Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:52 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets okay, here goes my JSP code: REPATE FOR ALL THE BLOCKS html:select property=blockDataSource style=WIDTH: 110px; font-size: 8pt onchange=blockDataSourceChanged(); html:options collection=blockDataSourceList property=value labelProperty=label/ /html:select END REPEAT The blockDataSourceList is an ArrayList of LabelValueBean class and is in the session scope. On the page load, I'm setting Form.setBlockDataSource(String[]) to appropriate string array represneting the saved value for the row. My dropdowns always show the first option selected. Thanks for the help. ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 11:30 AM Subject: RE: A column consisting of html:select widgets Atta, Can you post the relevant code both JSP and Java objects for us to look at and point you in the right direction? Thanks, Amit -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 1:27 PM To: Struts Users Mailing List Subject: Re: A column consisting of html:select widgets Thanks Amit. And that's exactly what i'm doing! Still i fails to show the correct option for the dropdowns. Are you sure its available in struts 1.0? moreover, is my approach to define String[] getter/setter is correct? ATTA - Original Message - From: Amit Kirdatt [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 21, 2003 10:58 AM Subject: RE: A column consisting of html:select widgets Atta, In your JSP page do the following html:select property=item html:options collection=myOptions property=value labelProperty=label/ /html:select Where the collection myOptions is a List of beans. Those beans have two fields value and label Hope that helps! -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 12:46 PM To: Struts Users Mailing List Subject: A column consisting of html:select widgets Dear All, I'm using struts 1.0.2. I have a requirement where i need to show a column consisting of dropdown lists. Every row of the table for the column shows a dropdown with the same list of options. I've used String[] getCategory() and setCategory(String[]) getter/setter in thr ActionForm. On the form submission i get the correct selected values for all the rows. Now my questions is how do I set the values of these dropdown from he database when the page is shown for the very first time. I've tried setCategory(String[]) setter, but the dropdowns don't show
Re: [OT]Java equivalent to ASP function
hello charlene, for ascii code of character you could simple use java cast operation: char c = 'A' byte b = (byte) c; now b should be set to 65. the ascii value of capital 'a'. for converting a number to hex you can use Integer.toHexString(int) static method. at the same time you can use Integer.valueOf(String, int) to convert hex number string back to int. hope this helps. ATTA - Original Message - From: Yan, Charlene [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 12:26 PM Subject: [OT]Java equivalent to ASP function All, I need to rewrite some ASP codes in Java. What are the Java equivalent to Asc(String) and Hex(Number) in VB? I appreciate any insight from you! Thanks. Charlene - 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]
Anyone, Please! A table with column of dropdowns
Dear All, I've been trying to for last three days to do this. Basically I've an HTML table one of its column gives user to select Block Type. Block Type is a list of reference values that are shown in an html:select element. Now to handle this situation I've created String[] getter/setter for block type on the Form object. When i submit the form with different block types selected in different rows the selected values are correctly populated to the Form's block type property. The only problem, when page is shown after submission, all the dropdowns have same value selected in them! I'd really appriciate any help on this subject. How, if at all, struts handles this situation. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Anyone, Please! A table with column of dropdowns
Sure, I can. And thanks for replying! I've attached the JSP and Form class. And yes, i thought that i might need indexed properties and did add the index property getter/setter to the Form. but i cannot seem to submit the form with indexed property getter/setter. and by the way, we're using struts 1.0.2. Regards, ATTA -- JSP --- html:form action=/public/test.do table border=1 tr class=tableheader tdName/td tdCategory/td /tr % List records = (List) session.getAttribute(records); % % for (int i = 0; i records.size(); i++) { % tr td %= records.get(i).toString() % /td td html:select property=category html:options collection=optionList property=value labelProperty=label/ /html:select /td /tr % } % /table br html:submit / /html:form --- END OF JSP --- FORM public class TestForm extends ActionForm { private String[] key = null; private String[] category = null; Vector v = null; public String[] getKey() { List l; Iterator i; return this.key; } public void setKey(String[] key) { this.key = key; } public String[] getCategory() { return this.category; } public void setCategory(String[] category) { this.category = category; } public void reset(ActionMapping arg0, HttpServletRequest arg1) { this.category = null; } } --- END OF FORM - Original Message - From: Wendy Smoak [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 10:07 AM Subject: RE: Anyone, Please! A table with column of dropdowns ATTA wrote: Basically I've an HTML table one of its column gives user to select Block Type. Block Type is a list of reference values that are shown in an html:select element. Now to handle this situation I've created String[] getter/setter for block type on the Form object. When i submit the form with different block types selected in different rows the selected values are correctly populated to the Form's block type property. The only problem, when page is shown after submission, all the dropdowns have same value selected in them! Can you post the JSP that renders the many select lists? It sounds like you need indexed properties to populate several select lists with the same name. Otherwise, Struts might think that a String[] goes with a single select list that allows multiple items to be selected. -- 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: Anyone, Please! A table with column of dropdowns
yes, that's a good question. i guess the same way struts passes all the correct selections to the Form object on submission ;) while we are on the subject, could you please refer me some further readings on Indexed Properties and how it could help me in this case? Thanks for your time. ATTA - Original Message - From: Wendy Smoak [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 10:29 AM Subject: RE: Anyone, Please! A table with column of dropdowns ATTA wrote: and by the way, we're using struts 1.0.2. I don't know if indexed properties work with 1.0, but I think that's what you need to use. Otherwise, how do you expect Struts to know which of the multiple values in your String[] goes with each of the select lists? -- 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: Anyone, Please! A table with column of dropdowns
so far i've found these two link related: http://www.husted.com/struts/tips/006.html http://jakarta.apache.org/struts/faqs/indexedprops.html and i'm still lost! i'm kind of confused on this. i would see this as a very frequent occuring 'problem' in data-driven web apps and by the response of my mails on this forum (for last 4 days now), it seems that either its not a problem or there's an obvious, startight-forward way that everyone knows but noone's willing to share!!! anyhow, thanks once more for your time. ATTA - Original Message - From: Wendy Smoak [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 11:33 AM Subject: RE: Anyone, Please! A table with column of dropdowns yes, that's a good question. i guess the same way struts passes all the correct selections to the Form object on submission ;) By magic. ;) But in this case, who knows what order the request parameters came in, who knows what order they are stored in the String[], so it's fairly impossible to correctly pre-select the values. (Actually most browsers seem to submit request parameters in the same order they appear on the form, but I wouldn't want to rely on that.) while we are on the subject, could you please refer me some further readings on Indexed Properties and how it could help me in this case? I've never used them, (and I'm not totally sure they'll solve this problem,) so Google to the rescue... http://www.google.com/search?q=struts+indexed+properties -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reasons to move to Struts 1.1
Dear all, We have using Struts 1.0.2 for about last couple of years. Now that Struts 1.1 is out. Are there any reasons for us to start thinking moving to 1.1? Any help or pointer to help will be greatly appreicated. Regards, ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reasons to move to Struts 1.1
Thanks, David. With these keywords, I sure should be able to dig deeper. Regards, ATTA - Original Message - From: David Graham [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 28, 2003 9:31 AM Subject: Re: Reasons to move to Struts 1.1 Struts 1.1 has tons of new features including validator, tiles, dynabeans, and map backed forms. David --- atta-ur rehman [EMAIL PROTECTED] wrote: Dear all, We have using Struts 1.0.2 for about last couple of years. Now that Struts 1.1 is out. Are there any reasons for us to start thinking moving to 1.1? Any help or pointer to help will be greatly appreicated. Regards, ATTA - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Indexed Properties
Thanks. It was helpful. But it still leaves me thinking if Indexed Properties are meant ONLY for DynaActionForm type of forms? I'm still unable to use them by using an array in my conventional ActionForm. ATTA - Original Message - From: Paananen, Tero [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 28, 2003 10:12 AM Subject: RE: Indexed Properties I've been reading an indexed properties article at: http://jakarta.apache.org/struts/faqs/indexedprops.html Also read http://www.developer.com/java/other/article.php/2233591 Very helpful. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - 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: Indexed Properties
Thanks very much Nick! It was indeed helpful. I was missing getter/setter for individual list items! now my form has following methods: private String[] fruit = {Apple, Orange, Banana}; public List getFruits() { return Arrays.asList(this.fruit); } public void setFruits(List l) { this.fruit = (String[]) l.toArray(); } public String getFruit(int index) { if (this.fruit == null) return null; return this.fruit[index]; } public void setFruit(int index, String f) { this.fruit[index] = f; } my JSP has following has this html:iterator: logic:iterate name=theForm property=fruits id=oneF type=java.lang.String tr td align=center hi! /td td html:text property=fruit name=oneF indexed=true / /td /tr /logic:iterate and exception i get is this: javax.servlet.jsp.JspException: No getter method for property fruit of bean oneF at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968) i think it has to do with the fact that my individual fruit is a string object rather than being a bean in itself if some getter method(s)? can you see what's going wrong! Thanks again. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 28, 2003 11:58 AM Subject: Re: Indexed Properties Atta, You can use indexed properties in your ActionForm class. The key is having all of the correct methods in your form class. 1) Getter and setter: You need a get/Set method for the collection that you refer to in your jsp. for example: public Collection getLocations() public void setLocations(Collection locs) 2) Getter and setter for one instance in the collection. The name that you use must match the name you define in your jsp as a single instance from the collection (specified as the id). For example: logic:iterate name=locations id=oneLocation type=com.myco.toolkits.beans.Location td html:text name=oneLocation property=locationName indexed =true/ /td td html:text name=oneLocation property=locationAddress indexed=true/ /td /logic:iterate Your form should in this case have the following get/set methods: public com.myco.toolkits.beans.Location getOneLocation(int index) public void setOneLocation(int index, com.myco.toolkits.beans.Location oneLocation) Your code may never use either of the oneLocation methods, but they are important for Struts. When your page is submitted, your two indexed properties will be submitted as oneLocation[ix].locationName oneLocation[ix].locationAddress where ix is the index of the row (0-10 for example). As Struts proceses the indexed items, Struts will use the getOneLocation method to get the Collection instance for the provided index. This method must resize the collection as needed and then return the object for the provided index. For example, if your collection has no objects and the getter receives an index of 2, the method should load the first three (0, 1, 2) collection locations with an initialized object and return the third object. Struts will then populate the appropriate property in that object. As an aside, I tend to use the ArrayList object as my collection type when working with indexed properties, but I know that the Vector works equally well. A simple array will work fine, but the logic to expand the size is a little more involved. Let me know if this helps. Nick - 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: Indexed Properties
Thanks, for the reply. Okay, here is the background. I'm trying to learn the user of Indexed Properties. Why I'm doing that? Well, I have a form that lists, let's say for the sake of simplicity, Block Name and Block Type columns. Block Name is a readonly text field while the Block Type is a dropdown list box with a set of reference values coming from the database. User can have n blocks on the page and he can change the block type of any block on the page. user cannot define a new block on this page. In my form I've got String[] getter/setters for blockName and blockType properties. In my action, I set both these arrays reading from the database. Block Names show allright, but the block type dropdown, that is using html:select tag, shows same type for all the blocks irrespective of the type of the block read from database. Now a few days back i asked a question on this forum regarding how to have my dropdowns display the right block type as set in the blockType String[] property of the form. Someone, I think it was Wendy Smoak, and i've seen quite a lot of helpful mails from him, mentioned that Indexed Properties might be the way go. Althogh, he also mentioned that he hasn't used them. I solved the problem by using value property of html:select tag. the doc says that value property denotes the value of the listbox that would be used to select an item in the list. so far so good. now the kind of guy i'm, i thought why not try it thrue index properties and learn something new ;) so i set out to learn indexed properties. read some articles and still i'm not sure what i'm missing. Hope this gives you the background and thanks once more for taking some out to hlep me. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 28, 2003 1:09 PM Subject: Re: Indexed Properties Atta, The complaint you are getting is because the property fruit is not a property of the oneF bean. That the oneF object is not a bean with properties will give you problems. Depending on your goal, you need to do something different. What are you trying to do? I'm off work in a minute, but I'll check messages at home later this evening and see if I can help at all. Nick atta-ur rehman [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] com cc: Subject: Re: Indexed Properties 07/28/2003 03:44 PM Please respond to Struts Users Mailing List Thanks very much Nick! It was indeed helpful. I was missing getter/setter for individual list items! now my form has following methods: private String[] fruit = {Apple, Orange, Banana}; public List getFruits() { return Arrays.asList(this.fruit); } public void setFruits(List l) { this.fruit = (String[]) l.toArray(); } public String getFruit(int index) { if (this.fruit == null) return null; return this.fruit[index]; } public void setFruit(int index, String f) { this.fruit[index] = f; } my JSP has following has this html:iterator: logic:iterate name=theForm property=fruits id=oneF type=java.lang.String tr td align=center hi! /td td html:text property=fruit name=oneF indexed=true / /td /tr /logic:iterate and exception i get is this: javax.servlet.jsp.JspException: No getter method for property fruit of bean oneF at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968) i think it has to do with the fact that my individual fruit is a string object rather than being a bean in itself if some getter method(s)? can you see what's going wrong! Thanks again. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 28, 2003 11:58 AM Subject: Re: Indexed Properties Atta, You can use indexed properties in your ActionForm class. The key is having all of the correct methods in your form class. 1) Getter and setter: You need a get/Set method for the collection that you refer to in your jsp. for example: public Collection getLocations() public void setLocations(Collection locs) 2) Getter and setter for one instance in the collection. The name that you use must match the name you define in your jsp as a single instance from the collection (specified as the id). For example: logic:iterate name=locations id=oneLocation type=com.myco.toolkits.beans.Location td html:text name=oneLocation property=locationName indexed =true/ /td td html:text name=oneLocation property=locationAddress indexed=true
Re: Indexed Properties
Yes, I currently have two independent String arrays for blockName and blockType. Putting them, and all the other block related properties, is what seems to be the right thing to do! So you have confirmed. here is what i have understood from your text: 1) my form would have blocks property that would be a collection of Block beans 2) iterating each block in the blocks collection i can sure display each block with indexed=true directive for text boxes and dropdowns. 3) now for the submission part i'd need to have setBlockType(int, string) and getBlockType(int) and same for the rest of properties. The name of property in the Block Form and name of the property in the Block Bean must match. 4) and it should work? I've had my head stuck in my computer whole day today and i'm barely able to write this email :) Tommorrow morning i'd come back and confirm it by running it. meanwhile I'd appreciate if you could confirm these 4 points i've noted above! Thankyou very much for your help. It really did help. Regards, ATTA - Original Message - From: Nick [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 28, 2003 5:08 PM Subject: RE: Indexed Properties Hi Atta, No problem with the assistance. Just hope that I can be helpful :-) In the cases where I use indexed properties, the property is part of a larger object. It sounds to me like you have two arrays in your form class: one for blockName and one for blockType. I would suggest creating a bean with the two properties, and then have a collection of those objects in your form. Building on my previous example, you'd have something like this: logic:iterate name=blocks id=oneBlock type=com.myco.beans.Block td html:text name=oneBlock property=blockName indexed =true/ /td td html:select name=oneBlock property=blockType indexed=true size=1 html:options name=myForm property=blockTypes/ /html:select. /td /logic:iterate This example assumes your collection of blockTypes is part of your form, but it could be a collection that was in request/session/application scope. You would create form entries for the collection like you implemented in our previous emails. I have almost this exact code in a few places and it works well. Hope this helps. Nick -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:37 PM To: Struts Users Mailing List Subject: Re: Indexed Properties Thanks, for the reply. Okay, here is the background. I'm trying to learn the user of Indexed Properties. Why I'm doing that? Well, I have a form that lists, let's say for the sake of simplicity, Block Name and Block Type columns. Block Name is a readonly text field while the Block Type is a dropdown list box with a set of reference values coming from the database. User can have n blocks on the page and he can change the block type of any block on the page. user cannot define a new block on this page. In my form I've got String[] getter/setters for blockName and blockType properties. In my action, I set both these arrays reading from the database. Block Names show allright, but the block type dropdown, that is using html:select tag, shows same type for all the blocks irrespective of the type of the block read from database. Now a few days back i asked a question on this forum regarding how to have my dropdowns display the right block type as set in the blockType String[] property of the form. Someone, I think it was Wendy Smoak, and i've seen quite a lot of helpful mails from him, mentioned that Indexed Properties might be the way go. Althogh, he also mentioned that he hasn't used them. I solved the problem by using value property of html:select tag. the doc says that value property denotes the value of the listbox that would be used to select an item in the list. so far so good. now the kind of guy i'm, i thought why not try it thrue index properties and learn something new ;) so i set out to learn indexed properties. read some articles and still i'm not sure what i'm missing. Hope this gives you the background and thanks once more for taking some out to hlep me. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 28, 2003 1:09 PM Subject: Re: Indexed Properties Atta, The complaint you are getting is because the property fruit is not a property of the oneF bean. That the oneF object is not a bean with properties will give you problems. Depending on your goal, you need to do something different. What are you trying to do? I'm off work in a minute, but I'll check messages at home later this evening and see if I can help at all. Nick atta-ur rehman [EMAIL
Re: Indexed Properties
Hello again Nick. Well i've come a step forward in that i've been able to successfully show the jsp page using index=true for all the rows and submit the form without any errors too: logic:iterate name=theForm property=blocks id=block type=test.Block tr td align=center html:text property=id name=block indexed=true / /td td html:text property=name name=block indexed=true / /td td html:select property=category name=block indexed=true html:options collection=optionList property=value labelProperty=label/ /html:select /td /tr /logic:iterate works like a charm! What i'm still missing what is updated when i submit the form? where can i get updated values from? my ActionForm has list attirbute called blocks each element in the list is a Block bean object. The Block bean has getter/setters for id, name and category. In ActionForm I also included setCategory(int) and getCategory(int, string) which doesn't seem to be called at all! something obvious that i'm missing? Thanks. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 2:57 AM Subject: Re: Indexed Properties Atta, It sounds to me like you have it. As long as your names match up, it should work fine. Ajay has given a full code example that looks good. Nick atta-ur rehman [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] com cc: Subject: Re: Indexed Properties 07/28/2003 08:44 PM Please respond to Struts Users Mailing List Yes, I currently have two independent String arrays for blockName and blockType. Putting them, and all the other block related properties, is what seems to be the right thing to do! So you have confirmed. here is what i have understood from your text: 1) my form would have blocks property that would be a collection of Block beans 2) iterating each block in the blocks collection i can sure display each block with indexed=true directive for text boxes and dropdowns. 3) now for the submission part i'd need to have setBlockType(int, string) and getBlockType(int) and same for the rest of properties. The name of property in the Block Form and name of the property in the Block Bean must match. 4) and it should work? I've had my head stuck in my computer whole day today and i'm barely able to write this email :) Tommorrow morning i'd come back and confirm it by running it. meanwhile I'd appreciate if you could confirm these 4 points i've noted above! Thankyou very much for your help. It really did help. Regards, ATTA - Original Message - From: Nick [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, July 28, 2003 5:08 PM Subject: RE: Indexed Properties Hi Atta, No problem with the assistance. Just hope that I can be helpful :-) In the cases where I use indexed properties, the property is part of a larger object. It sounds to me like you have two arrays in your form class: one for blockName and one for blockType. I would suggest creating a bean with the two properties, and then have a collection of those objects in your form. Building on my previous example, you'd have something like this: logic:iterate name=blocks id=oneBlock type=com.myco.beans.Block td html:text name=oneBlock property=blockName indexed =true/ /td td html:select name=oneBlock property=blockType indexed=true size=1 html:options name=myForm property=blockTypes/ /html:select. /td /logic:iterate This example assumes your collection of blockTypes is part of your form, but it could be a collection that was in request/session/application scope. You would create form entries for the collection like you implemented in our previous emails. I have almost this exact code in a few places and it works well. Hope this helps. Nick -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 3:37 PM To: Struts Users Mailing List Subject: Re: Indexed Properties Thanks, for the reply. Okay, here is the background. I'm trying to learn the user of Indexed Properties. Why I'm doing that? Well, I have a form that lists, let's say for the sake of simplicity, Block Name and Block Type columns. Block Name is a readonly text field while the Block Type is a dropdown list box with a set of reference values coming from the database. User can have n blocks on the page and he can change the block type of any block on the page. user cannot
Re: Indexed Properties
Thanks. you see my problem is i don't know how to get the updated values when the form is submitted? my beans collection is updated, my indexed getter/setter are not called? so where are the new values or even the same values when i submit without changing anything at all on the form? this is my Action code that i'm using to get values: TestForm tf = (TestForm) form; HttpSession session = request.getSession(); if (tf != null tf.getBlocks() != null) { List list = tf.getBlocks(); Block block; for (int i = 0; i list.size(); i++) { block = (Block) list.get(i); System.out.println(TestAction.execute Block: + block.getId() + , + block.getName() + , + block.getCategory()); } } // if (tf != null tf.getBlocks() != null) but this code always prints the values that i set the first time page was shown! ATTA - Original Message - From: Paananen, Tero [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 10:04 AM Subject: RE: Indexed Properties What i'm still missing what is updated when i submit the form? where can i get updated values from? my ActionForm has list attirbute called blocks each element in the list is a Block bean object. The Block bean has getter/setters for id, name and category. Two strategies: 1. Update everything every time you submit regardless of whether the information changed or not 2. Keep the previous values around and compare the values submitted to the previous ones. Then only update the beans that changed. You could do this in a number of ways. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - 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: Indexed Properties
so you are saying that ideally the the beans collection in my ActionForm should be updated on form submission? - Original Message - From: Paananen, Tero [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 10:30 AM Subject: RE: Indexed Properties but this code always prints the values that i set the first time page was shown! Beats me...the code looked fine to me. Maybe something wrong with your action mappings and form bean configurations? Or the JSP the values are changed on. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - 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: Indexed Properties
Okay. my form-bean definition looks like: form-bean name=testForm type=test.TestForm/ while the action is: action path=/test type=test.TestAction name=testForm scope=session validate=false input=/test.jsp forward name=failure path=/mainMenu.jsp/ forward name=success path=/test.jsp/ /action my form class extends ActionForm. any ideas? ATTA - Original Message - From: Paananen, Tero [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 10:43 AM Subject: RE: Indexed Properties so you are saying that ideally the the beans collection in my ActionForm should be updated on form submission? The attribute values in the beans held in the collection should change on form submission, yes. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - 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: Indexed Properties
Bingo! The deceptive ActionForm.getBlock(int):Block was not there. Just added it and wow! This is opened up a whole paradigm for me. I can see how easy and manageable code becomes not to mention its reduced size! Its just what i've been looking for, for quite sometime! Learning new things pays, after all ;) My sincere thanks for your help and patience! It took some time, but was worth it! ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 11:19 AM Subject: Re: Indexed Properties Hi Atta Just to clatify: 1) You have a form that contains a blocks property which is a collection of test.Block objects. 2) The test.Block object has the following properties(get/set methods for each): id, name, and category 3) As we discussesed in our earlier emails, you have the get/set methods for the blocks property in your form. 4) You also have a singular getBlock method that takes an int (index) and returns the Block object from the collection for the given index. A couple possible causes for the error: - Item 4) is not implemented correctly. You need the method shown below. Note that since your form is in the session, you shouldn't need the sizing logic. public Block getBlock(int index) { while (index = this.blocks.size()) { this.blocks.add(new Block()); } return (Block) this.blocks.get(index); } - When looking at your page, look at the source and confirm that your indexed properties are named correctly. You should see block[0].id, block[0].name, block[0].category. If none of this helps, I'm not sure where else to look. It sounds like everything else is lining up... Nick atta-ur rehman [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] com cc: Subject: Re: Indexed Properties 07/29/2003 12:57 PM Please respond to Struts Users Mailing List Hello again Nick. Well i've come a step forward in that i've been able to successfully show the jsp page using index=true for all the rows and submit the form without any errors too: logic:iterate name=theForm property=blocks id=block type=test.Block tr td align=center html:text property=id name=block indexed=true / /td td html:text property=name name=block indexed=true / /td td html:select property=category name=block indexed=true html:options collection=optionList property=value labelProperty=label/ /html:select /td /tr /logic:iterate works like a charm! What i'm still missing what is updated when i submit the form? where can i get updated values from? my ActionForm has list attirbute called blocks each element in the list is a Block bean object. The Block bean has getter/setters for id, name and category. In ActionForm I also included setCategory(int) and getCategory(int, string) which doesn't seem to be called at all! something obvious that i'm missing? Thanks. ATTA - Original Message - From: Nicholas L Mohler [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 2:57 AM Subject: Re: Indexed Properties Atta, It sounds to me like you have it. As long as your names match up, it should work fine. Ajay has given a full code example that looks good. Nick atta-ur rehman [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED] com cc: Subject: Re: Indexed Properties 07/28/2003 08:44 PM Please respond to Struts Users Mailing List Yes, I currently have two independent String arrays for blockName and blockType. Putting them, and all the other block related properties, is what seems to be the right thing to do! So you have confirmed. here is what i have understood from your text: 1) my form would have blocks property that would be a collection of Block beans 2) iterating each block in the blocks collection i can sure display each block with indexed=true directive for text boxes and dropdowns. 3) now for the submission part i'd need to have setBlockType(int, string) and getBlockType(int) and same for the rest of properties. The name of property in the Block Form and name of the property in the Block Bean must match. 4) and it should work? I've had my head stuck in my computer whole day today and i'm barely able to write
Re: Displaying is easy, capturing is not..
Hello Mona, is ABC is bean that has six properties that you need to show? and then you have a collection of ABC objects in a List or Vector? if so, you can use the indexed properties to capture all the changes done on the page. and yes, usually one submit button is enough for six hundred values!!! ATTA - Original Message - From: Alawadhi, Mona [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:32 AM Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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: Concept clear for Indexed properties
hello sridhar, if you've been able to display the page with all your IpAddress bean in the collection, you're quite colse. Now on your form add a IpAddress getIpAddress(int index) this method should retun the appropraite IpAddress object at the given index of the your collection. that's it! now when you submit your page, the collection on your form should be updated with the new values. i'm assuming your form is in session scope. hope this helps. ATTA - Original Message - From: Sridhar Kotagiri [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, August 08, 2003 9:10 AM Subject: Concept clear for Indexed properties Hi, I want to make my concept clear 1)I have an ActionForm which contains an ArrayList this stores collection of beans which are called IpAddress 2)Now I write the setter and getter methods for ArrayList in the ActionForm 3)The Actual part Do I need to write the getter And setter methods with indexed property in the ActionForm for IpAddress or ArrayList when Im using the first one Im able to diplay the jsp page but when I submit it its throwng BeanUtils.populate() exception If Im using the second one Im unable to display the jsp page it throws no getter methods for arrayList Im sure that in the first case the getter method with indexed property for IpAddress is being called. Thanks! Sridhar -Original Message- From: Sridhar Kotagiri Sent: Friday, August 08, 2003 11:36 AM To: Struts Users Mailing List Subject: RE: BeanUtils.Populate exception(Indexed Properties) I'm totally confused you say that I need to write these methods public void setAlist(int index,IpAddress ip) { alist.add(alist.set(index,ip)); } public IpAddress getAlist(int index) { return (IpAddress) alist.get(index); } instead of public void setIpAddress(int index,IpAddress ip) { alist.add(alist.set(index,ip)); } public IpAddress getIpAddress(int index) { return (IpAddress) alist.get(index); } int the ActionForm Thanks! Sridhar -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 11:03 AM To: 'Struts Users Mailing List' Subject: RE: BeanUtils.Populate exception(Indexed Properties) 4)Now Im able to diplay in the jsp page but when I submit this page its throwing javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java :1098) exception. See the response I made a couple of hours ago on this same issue. I just came through one of these. The problem in my case, and probably in yours, is that when Struts tries to populate your form bean on submission, it calls the indexed getter for alist. It expects to get a bean of type com.register.struts.account.IpAddress . In my case, I had created an array of the proper type and length, and was returning an element of this array. But my reset method did not assign anything to the elements of the array, so I was returning nulls. Struts reacted to the null by throwing the No bean specified error. - 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] Tree Stucture in STRUTS
hi all, excuse me if this sounds off topic! can somebody please point to some references on how to incorporate a dynamically built tree-like structure in a struts app? can struts-menu be used for this purpose? any other suggestions? thanks. ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Tree Stucture in STRUTS
Thanks, Ashok. I just downloaded the example app added struts stuff to it and got: java.lang.NoClassDefFoundError: org/apache/struts/taglib/logic/EmptyTag at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:502) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at com.newatlanta.servletexec.ApplClassLoader.loadArchiveClass(ApplClassLoader. java:363) at com.newatlanta.servletexec.ApplClassLoader.loadLibFolderClass(ApplClassLoade r.java:290) at com.newatlanta.servletexec.ApplClassLoader.loadClass(ApplClassLoader.java:44 6) at java.lang.ClassLoader.loadClass(ClassLoader.java:255) at com.newatlanta.servletexec.JSP10DirectiveTag.parseTag(JSP10DirectiveTag.java :1412) at com.newatlanta.servletexec.JSP10DirectiveTag.processTLD(JSP10DirectiveTag.ja va:1001) at com.newatlanta.servletexec.JSP10DirectiveTag.processTagLibDirective(JSP10Dir ectiveTag.java:755) at com.newatlanta.servletexec.JSP10DirectiveTag.parse(JSP10DirectiveTag.java:18 0) at com.newatlanta.servletexec.JSP10Servlet.parseFile(JSP10Servlet.java:1380) at com.newatlanta.servletexec.JSP10Servlet.createFile(JSP10Servlet.java:1861) at com.newatlanta.servletexec.JSP10Servlet.getNewServlet(JSP10Servlet.java:1075 ) at com.newatlanta.servletexec.JSP10Servlet.getServlet(JSP10Servlet.java:915) at com.newatlanta.servletexec.JSP10Servlet.getServlet(JSP10Servlet.java:858) at com.newatlanta.servletexec.JSP10Servlet.service(JSP10Servlet.java:754) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.newatlanta.servletexec.ServletExec.CallServletService(ServletExec.java:1 679) at com.newatlanta.servletexec.SERequestDispatcher.forwardServlet(SERequestDispa tcher.java:274) at com.newatlanta.servletexec.SERequestDispatcher.forward(SERequestDispatcher.j ava:191) at com.newatlanta.servletexec.ApplicationInfo.processApplRequest(ApplicationInf o.java:1390) at com.newatlanta.servletexec.ServerHostInfo.processApplRequest(ServerHostInfo. java:1243) at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1235) at com.newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java:1113) any thoughts!ATTA- Original Message - From: Ashok Madhavan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 4:25 PM Subject: Re: [OT] Tree Stucture in STRUTS hi, see this url http://www.keyboardmonkey.com/pilotlight/index.jsp Aaron Bates, the Tree-Man has a wonderful site which explains how to build a nice tree using nested tags. Thanks a lot Aaron. you have saved my life more than once. regards Ashok --- atta-ur rehman [EMAIL PROTECTED] wrote: hi all, excuse me if this sounds off topic! can somebody please point to some references on how to incorporate a dynamically built tree-like structure in a struts app? can struts-menu be used for this purpose? any other suggestions? thanks. ATTA - 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: [Poll] action mappings
hi james, could you please explain, for a struts newbie, what do you mean by quote I'm using DispatchAction with 2 abstract base actions between my actions and the dispatch action. The first one has helper methods for functionality not requiring authentication, and the second one (which extends the first) does require authentication. /quote Thanks in advance! ATTA - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 9:17 AM Subject: Re: [Poll] action mappings #1 with a twist. I'm using DispatchAction with 2 abstract base actions between my actions and the dispatch action. The first one has helper methods for functionality not requiring authentication, and the second one (which extends the first) does require authentication. By overriding the execute in the second one, it allows me additional base functionality (helper methods) and seamless session management in one place. I've attached a crude example of what I mean. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 770.822.3359 AIM:jmitchtx - Original Message - From: Mainguy, Mike [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 11:05 AM Subject: [Poll] action mappings I have yet another opinion poll for struts-user... What are folks currently doing for action mappings in relation to CRUD operations? Are you: #1 creating a unique Action mapping for each atomic operation (potentially mapped to the same action class) /createUser.do - UserAction.java /readUser.do - UserAction.java /updateUser.do - UserAction.java /deleteUser.do - UserAction.java #2 creating a unique Action mapping for each atmoic operation with each action having a unique class /createUser.do - CreateUserAction.java /readUser.do - ReadUserAction.java /updateUser.do - UpdateUserAction.java /deleteUser.do - DeleteUserAction.java #3 creating an aggregate action class with a unique action mapping with multiple operations and using form/request variable to accomplish CUD /editUser.do - UserAction.java (?OP=Update, ?OP=Create, ?OP=Delete) /displayUser.do- UserAction.java #4 creating an aggregate action class with a unique action mapping with multiple operations /editUser.do - EditUserAction.java /displayUser.do- DisplayUserAction.java Some other way (or a combination) ... 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] - 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: [Poll] action mappings
Yes. I did. Frankly, I've failed to understand the role of both ManagedResourceBaseAction and AuthenticatedManagedResourceBaseAction actions! Are both these action extended from DispatchAction? and CreateUserAction extended from one of these managed resources action? or I'm completely lost? I'd appreicate if you could explain it for me. ATTA - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 10:06 AM Subject: Re: [Poll] action mappings Did you look at the attached text file? -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 770.822.3359 AIM:jmitchtx - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 12:59 PM Subject: Re: [Poll] action mappings hi james, could you please explain, for a struts newbie, what do you mean by quote I'm using DispatchAction with 2 abstract base actions between my actions and the dispatch action. The first one has helper methods for functionality not requiring authentication, and the second one (which extends the first) does require authentication. /quote Thanks in advance! ATTA - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 9:17 AM Subject: Re: [Poll] action mappings #1 with a twist. I'm using DispatchAction with 2 abstract base actions between my actions and the dispatch action. The first one has helper methods for functionality not requiring authentication, and the second one (which extends the first) does require authentication. By overriding the execute in the second one, it allows me additional base functionality (helper methods) and seamless session management in one place. I've attached a crude example of what I mean. -- James Mitchell Software Engineer / Struts Evangelist http://www.struts-atlanta.org 770.822.3359 AIM:jmitchtx - Original Message - From: Mainguy, Mike [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 11:05 AM Subject: [Poll] action mappings I have yet another opinion poll for struts-user... What are folks currently doing for action mappings in relation to CRUD operations? Are you: #1 creating a unique Action mapping for each atomic operation (potentially mapped to the same action class) /createUser.do - UserAction.java /readUser.do - UserAction.java /updateUser.do - UserAction.java /deleteUser.do - UserAction.java #2 creating a unique Action mapping for each atmoic operation with each action having a unique class /createUser.do - CreateUserAction.java /readUser.do - ReadUserAction.java /updateUser.do - UpdateUserAction.java /deleteUser.do - DeleteUserAction.java #3 creating an aggregate action class with a unique action mapping with multiple operations and using form/request variable to accomplish CUD /editUser.do - UserAction.java (?OP=Update, ?OP=Create, ?OP=Delete) /displayUser.do- UserAction.java #4 creating an aggregate action class with a unique action mapping with multiple operations /editUser.do - EditUserAction.java /displayUser.do- DisplayUserAction.java Some other way (or a combination) ... 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] -- -- - 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
Re: URGENT... HELP NEEDED...
Okay. its not a struts questions and probably should be sent to a JavaScript forum. but i spirit of Struts; here is what i would call a very crude method of doing it. i hope it would give you a starting point. javascript function doIt() { var today = new Date(); var fridays = new Array(); for (i = 1; i = 365; i++) { d = new Date(today - (8640 * i)); if (d.getDay() == 5) { fridays.splice(fridays.length, 0, d); } } for (i = 0; i fridays.length; i++) { // show it in a text field on this page! document.forms[0].t1.value = document.forms[0].t1.value + fridays[i].toString(); } } /javascript the Date object in javascript, when constructed without any arguments is initialized with today's date. that's exactly what 'today' variable is for. now, Date object could also be initialized with milliseconds and it also support addition and substraction. there are 8640 ms in a day. and we go back 365 days from today! the getDay() method on Date object returns 0 for Sunday, 1 for Monday and so on. so we get only Fridays when getDay() == 5! crude as i said. i'd get the first friday and increment 'i' by 7 instead of 1. Oh, and by the way, Array.splice() makes javascript Array object as dynamic and ArrayList in java! hope this would help. ATTA - Original Message - From: Joseph William [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 02, 2003 11:48 AM Subject: URGENT... HELP NEEDED... Hi All... This has got nothing to do with Struts... It is javascript function I am developing... I need to generate all Friday dates for the past one year from the current date... Has anyone got such code??? I tried to search the net but wasn't able to find anything very precise... It would be of great help if anyone can help me here... Appreciate your guidance... Thanks! -Joseph - Do you Yahoo!? The New Yahoo! Shopping - with improved product search - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] Struts Message Resource Doc
Nick, It is a consice article on message resource usage. Thanks. In our scenario, for the sake of maintainablity given the number of entries in the resource files, we have separate resource files for Labels and Messages. Sometimes you have to show a message like: First Name is required. where First Name resides in locale specific resource file while {0} is required. resides in the local specific messages resource file. Now assume that this message would be returned by the validate() method of an ActionForm. How would you suggest to do that? It maybe a nice addition to the article. Regards, ATTA - Original Message - From: Nick Heudecker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, October 20, 2003 10:27 AM Subject: [ANNOUNCE] Struts Message Resource Doc Afternoon all, I've written a short article detailing usage of the message resources functionality with Struts. It seems like a lot of people are having problems with it, so I'm hoping that this will shed some light on this topic. You can find it at: http://www.systemmobile.com/articles/strutsMessageResources.html Feedback is appreciated. -- Nick Heudecker SystemMobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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]
Re: 2 message resource files andmessages in Action class problem
hi, what do you mean by when i try to dispay it? are you using html:errors tag or some other mechanism? in your JSP page have you tried: html:errors bundle=approval / ATTA - Original Message - From: Ashish Kulkarni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 31, 2003 10:32 AM Subject: 2 message resource files andmessages in Action class problem Hi, I have 2 message resource file defines in my struts-config file, it works perfect in jsp where i can use bundle keyword on bean:message .. tag, but it does not work in my action class where i want to set messages from message resource So bean:message key=approval.001 bundle=approvals/ works fine in jsp while errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(approval.001)); saveErrors(request, errors); does not work in Action class and i get error bean not found in scope on jsp when i try to display the message Ashish __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - 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: 2 message resource files andmessages in Action class problem
i'll add two tags in the jsp page! html:errors / html:errors bundle=approval / ATTA - Original Message - From: Ashish Kulkarni [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 31, 2003 11:21 AM Subject: Re: 2 message resource files andmessages in Action class problem Hi yes if i do that it works fine, but my problem is the following some error messages come from maps.properties file, which is default and some come from approval.properties file, so is there a way to make a single tag work for both Ashish --- atta-ur rehman [EMAIL PROTECTED] wrote: hi, what do you mean by when i try to dispay it? are you using html:errors tag or some other mechanism? in your JSP page have you tried: html:errors bundle=approval / ATTA - Original Message - From: Ashish Kulkarni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 31, 2003 10:32 AM Subject: 2 message resource files andmessages in Action class problem Hi, I have 2 message resource file defines in my struts-config file, it works perfect in jsp where i can use bundle keyword on bean:message .. tag, but it does not work in my action class where i want to set messages from message resource So bean:message key=approval.001 bundle=approvals/ works fine in jsp while errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(approval.001)); saveErrors(request, errors); does not work in Action class and i get error bean not found in scope on jsp when i try to display the message Ashish __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - 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!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - 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 and filters
sure, it will! - Original Message - From: jeff [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 1:37 PM Subject: struts and filters will struts work with filters ? i am using filters now, and want to start using struts. thanks, jeff - 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: How to Turn off Struts logging?
http://www.mail-archive.com/[EMAIL PROTECTED]/ - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 1:59 PM Subject: RE: How to Turn off Struts logging? Can someone point me to the archives? Thanks Yee, Richard K,,DMDCWEST [EMAIL PROTECTED] 11/12/2003 04:46 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: How to Turn off Struts logging? Set the debug parameter in the web.xml file to 0. Search the archives, this question has been asked many times already. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 1:44 PM To: Struts Users Mailing List Subject: How to Turn off Struts logging? Help make it stop. Can struts logging be turned off? If so how? Can it be integrated with Log4j so the logging level can be set by a properties file? - 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: checkbox value from getter in collection of value object
Hello Shahfazal, As i understand from the 'applicantId' getter, you want to use these checkboxes as a selecting indicator. If so, create a String[] getter/setter in your ActionForm, let say: setSelectedApplicants(String[] ids) String[] getSelectedApplicants() now in your jsp you can write: html:multibox property=selectedApplicants bean:write name=appList property=applicantid !-- this is what i get from your logic iterate, basically, you need to get applicantId from your bean -- /html:multibox this should produce HTML like input type=checkbox name=selectedApplicants value=11 input type=checkbox name=selectedApplicants value=12 now when you submit page, and inspect ActionForm.getSelectedApplicants() string array, you should get the IDs of selected checkboxes. Hope this helps! ATTA On Dec 26, 2003, at 1:07 PM, shahfazal wrote: Hi all i already posted twice about this but i guess my email program had trouble formatting my mail or somethign but anyway long thing short i have a collection of ApplicationVO value objects, i need to display them in rows on a jsp. so i iterate thru the collection of the value objects, and at the beginning of the row i need a check box with a value of one of the properties of the value object how do i go about it? i know the multibox can do this but i'm having trouble binding the property to the value of this multibox .. can anyone help me? my code : logic:iterate id=appList name=incompleteFolderForm property=applications html:multibox property=??/html:multibox !-- i need the checkbox to have the value of the 'applicantId' getter property of my value object bean:write name=appList property=firstName/ bean:write name=appList property=lastName/ /logic:iterate can anyone help me?? i'm kinda desperate to find a solution ...would be really great if anyone could help me out Regards.. Shahfazal Mohammed Research A$$i$tant Center for Business and Information Technologies http://www.cbit.louisiana.edu 337.482.0626 work 337.322.1946 cell 337.233.1092 home - 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] RE: Memory usage
+1 ATTA - Original Message - From: Christian Bollmeyer [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, February 26, 2004 11:53 AM Subject: Re: [OT] RE: Memory usage On Thursday 26 February 2004 20:12, Dhaliwal, Pritpal (HQP) wrote: Now. Still remember when you wrote your first crappy lines you proudly called a 'program'? *That* exactly is what we all started from, considering me: nearly 23 years ago on a little ZX81 box, doing my first steps in Assembler. YMMV. And how I was proud. A long time has passed since then, and I have seens lots of crappy code in- between, but whenever I get proud again about what I've done or achieved since then, one millisecond before I remember how lousy I started once and keep my mouth shut in humility, just in time. This, obviously, is still a lesson you have to learn, but I can tell you: one of many things that separates the good from the possibly-not-so-good is a certain difference in attitude. So it would have sufficed to politely mention that there are tools for testing code efficiency (nowadays) and that this forum may not be the best place to ask for answers. All the rest is rather irrelevant, including your insulting assumptions about code you never saw or the people behind it. You think you're good or better? I tell you: from this mail alone I can tell you have still a long way to go to be regarded as a member of the 'Black Team', and in your obviously long professional career, you certainly have read 'Peopleware' once and know what I'm talking about here. HTH, -- Chris. And never say HTH if you intentionally provide a snake when someone asks you for a fish. Viru Bhai, No, You code is not good or optimized. You have problems follwing instructions. Your question is not related to struts and you didn't put OT in the subject. Even if you put OT in subject, It would still be a bad question because that's not what this list is discussing. Primary reason I believe your code is not good and optimized is because you don't have enough knowledge about how to prove it. Most likely your code is as good as the question you asked. You probably want to look at profilers and code coverage tools do you proving. If I was you, I would seriously read a Java book. Maybe a Java optimization book too. Hope This Helps, Pritpal Dhaliwal P.s. Is it Friday yet? -Original Message- From: virupaksha [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 2:46 AM To: Struts Users Mailing List Subject: Memory usage Dear All, I have a requirement, where i need to stop garbage collection, is there any way to implement? Because, I need to judge our code is good and optimized, I need some ray of hope Thanks in advance, Viru - 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: Life, the Universe and Everything (was: RE: [OT] RE: Memory usage)
+1 ATTA On Mar 1, 2004, at 8:19 PM, Vic Cekvenich wrote: -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] 4. I had the same frustrations that you have. I made the decision that the best way to restore the balance of good in the universe, was to try to become the kind of tech lead that I would have wanted when I was a newbie/humble grunt. +1 .V - 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: sent specific html:hidden field depending which html:link was used
Hello Jan, One way I see it could be done is to move the hidden element out of both of the links and in parameterize your JavaScript:sendFormNeuanlage() method for 'bestaetigen' and 'aktualisieren' and let this javascript method set the value of the hidden field. function sendFormNeuanlage(what) { document.forms[0].CMD.value=what; } html:hidden property=CMD/ html:link href=JavaScript:sendFormNeuanlage('aktualisieren'); img src=/images/bAngebotAktualisieren.gif width=140 height=14 alt=aktualisieren hspace=14 border=0 /html:link html:link href=JavaScript:sendFormNeuanlage('bestaetigen' ); styleId=bestaetigen img src=/images/bAbsenden.gif width=84 height=14 alt=absenden border=0 /html:link hope this helps. ATTA - Original Message - From: Zmitko, Jan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 12, 2004 10:39 AM Subject: sent specific html:hidden field depending which html:link was used Hello, i´ve a problem, that I`ve two links and each link has an html:hidden field. I´want to sent only the hidden Field which is included in the clicked link. Is this possible? My code shows as follows: html:link href=JavaScript:sendFormNeuanlage(); html:hidden property=CMD value=aktualisieren/ img src=/images/bAngebotAktualisieren.gif width=140 height=14 alt=aktualisieren hspace=14 border=0 /html:link html:link href=JavaScript:sendFormNeuanlage(); styleId=bestaetigen html:hidden property=CMD value=bestaetigen name=bestaetigen/ img src=/images/bAbsenden.gif width=84 height=14 alt=absenden border=0 /html:link Thanks for any ideas, Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define Compile time exception on Orion
Hello Kazim, A quick test on my JSP page with Strtus 1.1 in place just works fine: % String[] names = {joe, cindy}; session.setAttribute(names, names); % bean:define id=n name=names scope=session type=java.lang.String[] / logic:iterate name=n id=name bean:write name=name/ /logic:iterate what's the error message you're getting? ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:16 PM Subject: bean:define Compile time exception on Orion On Orion, the bean:define / tag gives compile time error when it declares an array e.g. : bean:define id=a name=a type=b.C[] / Here C is a class in package b. Is there anything wrong with the syntax ? - 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: Users logs off
Well, Kazim, with this description you can hardly expect to get any help at all! What's logoff process? What's it doing? What's the exception? Is the underlying code for logoff process a state secret? ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:17 PM Subject: Users logs off We are using Opensymphony Sitemesh for presentation layer templating with Struts as MVC framework. The application is running perfectly well on Tomcat and Orion, but on Oracle 9i, for some strange reason, when an exception occurs, the User is logged off from the website. Any suggestions are most welcome ! - 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: Users logs off
Well, if session is not being invalidated then what's the purpose of getting user logged off? Please look harder! It may not be obvious, but if you're not getting attribute from session on the exception page that means either your session has been expired, invalidated or all of its attributes have been removed before you made it to this page. ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 12, 2004 3:03 PM Subject: RE: Users logs off Sorry, my mistake, I should have been more descriptive in my problem. When an exception, e.g. java.sql.SQLException, NullPointerException occurs : 9i redirects user to Exception Page. On that page, when I check the session for its attributes, it doesnt find attributes. I dont know how the user logs off, there is no log off process, no session invalidation being done anywhere. -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Saturday, March 13, 2004 3:33 AM To: Struts Users Mailing List Subject: Re: Users logs off Well, Kazim, with this description you can hardly expect to get any help at all! What's logoff process? What's it doing? What's the exception? Is the underlying code for logoff process a state secret? ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:17 PM Subject: Users logs off We are using Opensymphony Sitemesh for presentation layer templating with Struts as MVC framework. The application is running perfectly well on Tomcat and Orion, but on Oracle 9i, for some strange reason, when an exception occurs, the User is logged off from the website. Any suggestions are most welcome ! - 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: Testing a GLOBAL_ERROR
You might want to try logic:messagesPresent tag instead. ATTA - Original Message - From: Joao Batistella [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:59 PM Subject: Testing a GLOBAL_ERROR I'm trying to test if I got an Global Error with the following code in my JSP: logic:present name=org.apache.struts.action.ERROR property=org.apache.struts.action.GLOBAL_ERROR test /logic:present Is this correct? This does not print the test and I'm sure I have a Global Error? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Way tho highlight error form field
hi there, only way i know for achieving this is to extend struts' tags and either override the getStyleClass() method or add a new property getErrorStyleClass(). if you search archives on this list, http://www.mail-archive.com/[EMAIL PROTECTED]/msg96068.html Niall suggested a few days back about his ErrorTextTag or TextErrorTag that basically overrides the getStyleClass() method. That in my opinion is the easiest way to go about this change. he also did point In one of my recent projects, I had to add errorStyleClass property to about 4 struts tags, and it is not pretty! I think BaseHandlerTag in struts need some real refactoring! hope this helps. ATTA - Original Message - From: Joao Batistella [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, March 18, 2004 4:25 AM Subject: RE: Way tho highlight error form field But, how about server side errors that I can't not validate in Javascript? I tought about something like this: html:text property=test styleClass=normal_class styleClassOnError=error_class/ So, if I return an ActionError about the property test, the style class to use would be error_class, otherwise, normal_class. I know this doesn't exist in Struts but is there something that can do something like this? Thanks -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 18 de março de 2004 10:06 To: Struts Users Mailing List Subject: Re: Way tho highlight error form field You could modify the client-side validation stuff to do this rather than just alerting. An easy way of layering this on is to define a compulsory array of fields and then loop through the form on validation. changing the borderColor style attribute when you have a match between the element name and your array. compulsary = [name,email]; function validate(form) { for(i = 0;i compulsary.length;i++) { field = compulsary[i]; value = form.elements[field].value; if(value == ) { form.elements[field].style.borderColor = #ff; } } } Then you can think about having your compulsary array populated in the same way as the struts validator client-side stuff. In fact you could use the array then it defines. On 18 Mar 2004, at 10:49, Joao Batistella wrote: Hello! Is there a way in Struts to highlight the HTML form field that has an error? I mean, changing the style class of the form field, for example. Is there some feature in Struts that can help me? Thanks, JP - 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: Documentation Struts-config
How about: jakarta.apache.org/struts/dtds/struts-config_1_1.dtd - Original Message - From: Bill Siggelkow [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 10:13 AM Subject: Re: Documentation Struts-config I think you will find that the struts-config_1_1.dtd file in the /lib folder of the Struts distribution is well documented and provides descriptions of all attributes. Franck DARRAS wrote: Hi every body Do you know a documentation about all fields of the struts-config DTD (Struts version 1.1) file (with example if possible). For example : Action-mapping [...] prefixCDATA #IMPLIED suffixCDATA #IMPLIED unknown boolean #IMPLIED [...] I accept all links (book, documentation on-line..., web link). I'm already using the jakarta user guide (http://jakarta.apache.org/struts/userGuide/) Thanks for your response - 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]
redirect=true and Tiles; does it work?
Dear all, I've been struggling with this problem for about two days now; I hope somebody here would be able to help me. In one of my actions I've implemented Struts token functionality to keep user from using browser Refresh button. Every thing works as promised except for when invalid token message is shown and you press the Refresh button, browser pops up a message saying that there is POSTDATA in the request do you want to sumbit; clicking yes again calls the source action and user again ends up the invalid token message. now my question is how can I get rid of this post data and browser's confirmation message? I thought setting rediect=true to forward should to the trick; but it doesn't! Last night while going thru the archives, I figured that this does work when you forward to /someAction.do or /somePage.jsp but doesn't work for Tiles definitions!!! Any help would be greatly appreciated. here are my global forward and action mappings in the struts config file: global-forwards forward name=invalidToken path=showInvalidTokenMessage.do redirect=true / /global-forwards action path=test class=test.TokenedAction name=testForm forward name=success path=greetingsTile redirect=true / /action Its from within the test.TokenAction that I forward to global forward invalidToken. Again, thanks in anticipation for any help. ATTA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirect=true and Tiles; does it work?
Any takers? ATTA - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 10:17 AM Subject: redirect=true and Tiles; does it work? Dear all, I've been struggling with this problem for about two days now; I hope somebody here would be able to help me. In one of my actions I've implemented Struts token functionality to keep user from using browser Refresh button. Every thing works as promised except for when invalid token message is shown and you press the Refresh button, browser pops up a message saying that there is POSTDATA in the request do you want to sumbit; clicking yes again calls the source action and user again ends up the invalid token message. now my question is how can I get rid of this post data and browser's confirmation message? I thought setting rediect=true to forward should to the trick; but it doesn't! Last night while going thru the archives, I figured that this does work when you forward to /someAction.do or /somePage.jsp but doesn't work for Tiles definitions!!! Any help would be greatly appreciated. here are my global forward and action mappings in the struts config file: global-forwards forward name=invalidToken path=showInvalidTokenMessage.do redirect=true / /global-forwards action path=test class=test.TokenedAction name=testForm forward name=success path=greetingsTile redirect=true / /action Its from within the test.TokenAction that I forward to global forward invalidToken. Again, thanks in anticipation for any help. ATTA - 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: redirect=true and Tiles; does it work?
Oh, thanks, Hubert. In the mentioned last night archive brwosing I remember seeing your post on the topic; I think we can make it happen!!! I should have copied these lines from config file instead of using my head: global-forwards forward name=invalidToken path=/showInvalidTokenMessage.do redirect=true/ /global-forwards action path=/showInvalidTokenMessage type=org.apache.struts.actions.ForwardAction parameter=invalidTokenMessageTile/ action path=/processTest type=com.open.webapp.test.TestProcessAction name=testForm input=testTile scope=request forward name=success path=greetingsTile redirect=true/ /action TestProcessAction just forwards to success forward. But before it does that it check for the valid token and in the case of an invalid token it just forwards (redirects) to the invalidToken global forward. On invalid token message press refresh again calls the test action with the browser confirmation. Does it make better sense now? Thanks for your help. ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 2:13 PM Subject: Re: redirect=true and Tiles; does it work? --- atta-ur rehman [EMAIL PROTECTED] wrote: Any takers? I'll give it a shot. ATTA - Original Message - From: atta-ur rehman [EMAIL PROTECTED] global-forwards forward name=invalidToken path=showInvalidTokenMessage.do redirect=true / /global-forwards I believe the path should begin with /. This should mean you have an action path=/showInvalidTokenMessage somewhere in the same module. action path=test class=test.TokenedAction name=testForm forward name=success path=greetingsTile redirect=true / /action Are you using this success forward as well? You're redirecting to a tile definition? Not sure how that would work. Its from within the test.TokenAction that I forward to global forward invalidToken. Again, thanks in anticipation for any help. ATTA Hubert __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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: redirect=true and Tiles; does it work?
http://localhost:8080/test/processTest.do and if and press Refresh here the url changes to: http://localhost:8080/test/showInvalidTokenMessage.do ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:07 PM Subject: Re: redirect=true and Tiles; does it work? --- atta-ur rehman [EMAIL PROTECTED] wrote: TestProcessAction just forwards to success forward. But before it does that it check for the valid token and in the case of an invalid token it just forwards (redirects) to the invalidToken global forward. On invalid token message press refresh again calls the test action with the browser confirmation. After the redirect and before pressing refresh, what's the URL shown on the browser? __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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: redirect=true and Tiles; does it work?
See inline, please. - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:56 PM Subject: Re: redirect=true and Tiles; does it work? Is this correct? 1. User submits the form to /processTest.do TRUE. 2. The action for /processTest.do, TestProcessAction, sees that the token is invalid and returns an ActionForward that redirects to /showInvalidTokenMessage.do Actually to mapping.findForward(invalidToken) which is global forward to /showInvalidTokenMessage.do. So I assume the answer is TRUE; though i'm not sure. 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE. 4. The user sees the invalidTokenMessageTile tile and clicks on refresh And you're saying that with http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar, the user clicks on refresh and causes TestProcessAction to execute again? TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between these messages I thought I should give IE try and on IE 6.0.2800 the action is not called neither do I see the confrimation message of posting again! Boils down to Browser? --- atta-ur rehman [EMAIL PROTECTED] wrote: http://localhost:8080/test/processTest.do and if and press Refresh here the url changes to: http://localhost:8080/test/showInvalidTokenMessage.do ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:07 PM Subject: Re: redirect=true and Tiles; does it work? --- atta-ur rehman [EMAIL PROTECTED] wrote: TestProcessAction just forwards to success forward. But before it does that it check for the valid token and in the case of an invalid token it just forwards (redirects) to the invalidToken global forward. On invalid token message press refresh again calls the test action with the browser confirmation. After the redirect and before pressing refresh, what's the URL shown on the browser? __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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: redirect=true and Tiles; does it work?
I'm sorry, I spoke too soon: 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE in Mozilla FireBird 0.7. In IE 6.0 I still see /processTest.do! - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 4:11 PM Subject: Re: redirect=true and Tiles; does it work? See inline, please. - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:56 PM Subject: Re: redirect=true and Tiles; does it work? Is this correct? 1. User submits the form to /processTest.do TRUE. 2. The action for /processTest.do, TestProcessAction, sees that the token is invalid and returns an ActionForward that redirects to /showInvalidTokenMessage.do Actually to mapping.findForward(invalidToken) which is global forward to /showInvalidTokenMessage.do. So I assume the answer is TRUE; though i'm not sure. 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE. 4. The user sees the invalidTokenMessageTile tile and clicks on refresh And you're saying that with http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar, the user clicks on refresh and causes TestProcessAction to execute again? TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between these messages I thought I should give IE try and on IE 6.0.2800 the action is not called neither do I see the confrimation message of posting again! Boils down to Browser? --- atta-ur rehman [EMAIL PROTECTED] wrote: http://localhost:8080/test/processTest.do and if and press Refresh here the url changes to: http://localhost:8080/test/showInvalidTokenMessage.do ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:07 PM Subject: Re: redirect=true and Tiles; does it work? --- atta-ur rehman [EMAIL PROTECTED] wrote: TestProcessAction just forwards to success forward. But before it does that it check for the valid token and in the case of an invalid token it just forwards (redirects) to the invalidToken global forward. On invalid token message press refresh again calls the test action with the browser confirmation. After the redirect and before pressing refresh, what's the URL shown on the browser? __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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: redirect=true and Tiles; does it work?
I can confirm the stated behavior for both Mozilla FireFox 0.8 and Netscape 7.1 too. - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 4:15 PM Subject: Re: redirect=true and Tiles; does it work? I'm sorry, I spoke too soon: 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE in Mozilla FireBird 0.7. In IE 6.0 I still see /processTest.do! - Original Message - From: atta-ur rehman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 4:11 PM Subject: Re: redirect=true and Tiles; does it work? See inline, please. - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:56 PM Subject: Re: redirect=true and Tiles; does it work? Is this correct? 1. User submits the form to /processTest.do TRUE. 2. The action for /processTest.do, TestProcessAction, sees that the token is invalid and returns an ActionForward that redirects to /showInvalidTokenMessage.do Actually to mapping.findForward(invalidToken) which is global forward to /showInvalidTokenMessage.do. So I assume the answer is TRUE; though i'm not sure. 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE. 4. The user sees the invalidTokenMessageTile tile and clicks on refresh And you're saying that with http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar, the user clicks on refresh and causes TestProcessAction to execute again? TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between these messages I thought I should give IE try and on IE 6.0.2800 the action is not called neither do I see the confrimation message of posting again! Boils down to Browser? --- atta-ur rehman [EMAIL PROTECTED] wrote: http://localhost:8080/test/processTest.do and if and press Refresh here the url changes to: http://localhost:8080/test/showInvalidTokenMessage.do ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:07 PM Subject: Re: redirect=true and Tiles; does it work? --- atta-ur rehman [EMAIL PROTECTED] wrote: TestProcessAction just forwards to success forward. But before it does that it check for the valid token and in the case of an invalid token it just forwards (redirects) to the invalidToken global forward. On invalid token message press refresh again calls the test action with the browser confirmation. After the redirect and before pressing refresh, what's the URL shown on the browser? __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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: redirect=true and Tiles; does it work?
I'm confused too! for invalid token message, IE show /processTest.do in the address bar. but when i click the refresh button, a quick look at the status bar show that its calling /showInvalidTokenMessage.do! Yet, refresh after refresh, IE still shows /processTest.do in the address bar. FireBird, FireFox and Netscape 7.1 show /showInvalidTokenMessage.do in the address bar but also popup the dialog to confir repost! I'm only afraid to have screwed up something real bad here :) ATTA - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 4:13 PM Subject: Re: redirect=true and Tiles; does it work? And you're saying that with http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar, the user clicks on refresh and causes TestProcessAction to execute again? TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between these messages I thought I should give IE try and on IE 6.0.2800 the action is not called neither do I see the confrimation message of posting again! Boils down to Browser? That's the way I see it. My interpretation of how it should work is the browser should refresh the last request, and the server already told the browser to request /showInvalidTokenMessage.do and in fact that's what's on the address bar. If my interpretation is incorrect, somebody please let me know. If this is a browser bug, maybe it's time to upgrade to Firefox 0.8. confused/, Hubert --- atta-ur rehman [EMAIL PROTECTED] wrote: See inline, please. - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 3:56 PM Subject: Re: redirect=true and Tiles; does it work? Is this correct? 1. User submits the form to /processTest.do TRUE. 2. The action for /processTest.do, TestProcessAction, sees that the token is invalid and returns an ActionForward that redirects to /showInvalidTokenMessage.do Actually to mapping.findForward(invalidToken) which is global forward to /showInvalidTokenMessage.do. So I assume the answer is TRUE; though i'm not sure. 3. /showInvalidTokenMessage.do forwards to the invalidTokenMessageTile tile, at which time the browser shows http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar TRUE. 4. The user sees the invalidTokenMessageTile tile and clicks on refresh And you're saying that with http://localhost:8080/test/showInvalidTokenMessage.do; on the address bar, the user clicks on refresh and causes TestProcessAction to execute again? TRUE in Mozilla FireBird 0.7!!! And that's my default browser. In between these messages I thought I should give IE try and on IE 6.0.2800 the action is not called neither do I see the confrimation message of posting again! Boils down to Browser? __ Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. http://taxes.yahoo.com/filing.html - 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]