Re: Cannot find bean message in any scope
On 2/14/06, Chipo Hamayobe [EMAIL PROTECTED] wrote: Hi, I keep getting the error Cannot find bean message in any scope in most of my jsp pages. Its looking for a bean named message and can't find it - have you used this in the name property on any of your tags? For example bean: write name=message / Are you using the html:messages / tag at all, something like... html:messages id=message bean:write name=message/ /html:messages Maybe you didn't spell message in the id correctly? Anyway, something along those lines - check you tag attributes for message values. Niall Anybody know whats causing this and how to fix it. It doesn't really say which bean has an invalid message. thanks -- Chipo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:link problem - please give some examples
Hi, I have a URL set to my form bean. The property in my form bean is called objectLink. I have to set this link to my html:link action=objectLink The Link /html:link how is it possible thanks in advance sony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm String[]
Hello, I am working with a dyanmic form, that generates n checkboxes (for each row of my set). Using a String[] type in the action form, I´d been able to retrieve the data. Now, I´m trying to pre-populate these checkbox values correctly, via ActionForm reset method, but can´t figure out. Instanting a bogus vector and seting some values to it doens´t work... Can I do it without messing with my jsp?
Re: html:link problem - please give some examples
On 2/14/06, Sony Thomas [EMAIL PROTECTED] wrote: Hi, I have a URL set to my form bean. The property in my form bean is called objectLink. I have to set this link to my html:link action=objectLink The Link /html:link how is it possible Here are some ideas, assuming I've understood you correctly.. html:link page=${myForm.objectLink}.. html:link page=%= myForm.getObjectLink() % c:url var=link url=${myForm.objectLink} / a href=${link} % String link = response.encodeURL(myForm.getObjectLink()); % a href=%= link % thanks in advance sony - 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: ActionForm String[]
On 2/14/06, Marcio Ghiraldelli [EMAIL PROTECTED] wrote: Hello, I am working with a dyanmic form, that generates n checkboxes (for each row of my set). Using a String[] type in the action form, I´d been able to retrieve the data. Now, I´m trying to pre-populate these checkbox values correctly, via ActionForm reset method, but can´t figure out. Instanting a bogus vector and seting some values to it doens´t work... Can I do it without messing with my jsp? Do it in the action that initiates the form.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bean Population When Form Cancelled
I think so, look at this. http://www.learntechnology.net/validate-manually.do My implementation down here. /*** CODE *** /** * This method is used to execute validation rules br * The good-part, * br1. can chose to not validate if cancel is submitted . * br2. If validate exception is found the Form/Page can be reInitialized and shown properly again. * br * The bad-part, normaly the user sets validate=true in config but this * can no longer be done, can feel strange. br * This method is used with recommendation from -- br * see http://www.learntechnology.net/validate-manually.do * * @author robert.alexandersson * * Generic Struts stuff - cancel - validate */ public ActionForward validate(ActionMapping mapping, ActionForm form, HttpServletRequest request) { if (this.isDelete(request) || this.isCancel(request)) return null; ActionErrors errors = form.validate(mapping, request); if (errors != null !errors.isEmpty()) { saveErrors(request, logAndGetMessages(errors)); return (mapping.getInputForward()); } return null; } /** * Transform Errors to Messages according to the Deprecation warning in * ActionErrors and super.saveErrors * * @param errors * @return */ private ActionMessages logAndGetMessages(ActionErrors errors) { Iterator i = errors.properties(); ActionMessages messages = new ActionMessages(); while (i.hasNext()) { String property = (String) i.next(); Iterator j = errors.get(property); while (j.hasNext()) { ActionMessage err = (ActionMessage) j.next(); messages.add(property, err); } } return messages; } /*** END CODE *** Regards Robert -Original Message- From: Tom Ansley [mailto:[EMAIL PROTECTED] Sent: Saturday, February 11, 2006 6:48 AM To: Struts Users Mailing List Subject: Bean Population When Form Cancelled Hi all, I have a form that uses validator to check for simple validation like making sure that a cash amount is a double. I have the cancel button on the form set so that if it is pressed that validation does not take place. This is great except when you type a letter into the cash text box and then press cancel. The form gets returned along with the invalid cash amount, the BeanUtils attempts to populate the form and the whole thing falls over with an exception. Does somebody have a strategy for dealing with this situation? Is there a way of telling struts that if the cancel button is pressed that NO bean population should take place? All help appreciated. Cheers Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another struts design question
Greetings, I need to have an action return to a previous page depending upon which page originally requested the common page. Think of it as a settings page that can be accessed from multiple places. Like this: Entry 1 --- Common Page Entry 2 How can I tell the common page action to return to the correct requestor page? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
You could use the referer header to create an action forward based on that value. String referer = request.getHeader(Referer); URL url = new URL(referer); String path = url.getPath(); String contextPath = request.getContextPath(); path = path.replaceFirst(contextPath,); return new ActionForward(path,true); You may have to append any parameters to the path, but i'm sure you can work that out.. Mark On 2/14/06, Keith Sader [EMAIL PROTECTED] wrote: Greetings, I need to have an action return to a previous page depending upon which page originally requested the common page. Think of it as a settings page that can be accessed from multiple places. Like this: Entry 1 --- Common Page Entry 2 How can I tell the common page action to return to the correct requestor page? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - 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: Another struts design question
That could work, and it would scale to n input pages. Thanks Mark! On 2/14/06, Mark Lowe [EMAIL PROTECTED] wrote: You could use the referer header to create an action forward based on that value. String referer = request.getHeader(Referer); URL url = new URL(referer); String path = url.getPath(); String contextPath = request.getContextPath(); path = path.replaceFirst(contextPath,); return new ActionForward(path,true); You may have to append any parameters to the path, but i'm sure you can work that out.. -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Connection Pool in Action-Classes
starki78 wrote: It seems that the action is not absolutely thread safe. Can this be? Actions should never* have instance variables. You should not have a connection stored as an instance variable; it should be retrieved within a method to a method-local variable. If this is what you are doing I'm surprised you haven't had more issues. Think of an Action like a servlet: if you have instance variables and you write to them during a method and it's not synchronized you are probably making a mistake. * Of course, if you deal with synchronization issues, never mind. If it's a read-only variable it probably doesn't matter. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Connection Pool in Action-Classes
Thanks a lot for this hint we found it out Thanks Starky -- Initial Header --- From : Dave Newton [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : Date : Tue, 14 Feb 2006 09:45:33 -0500 Subject : Re: Problem with Connection Pool in Action-Classes starki78 wrote: It seems that the action is not absolutely thread safe. Can this be? Actions should never* have instance variables. You should not have a connection stored as an instance variable; it should be retrieved within a method to a method-local variable. If this is what you are doing I'm surprised you haven't had more issues. Think of an Action like a servlet: if you have instance variables and you write to them during a method and it's not synchronized you are probably making a mistake. * Of course, if you deal with synchronization issues, never mind. If it's a read-only variable it probably doesn't matter. Dave - 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: [SHALE] Using the Test Framework
OK, I'm going through the section in the PDF document (Shale Framework v.1.0.1-SNAPSHOT Project Documentation) on the Test Framework. In that section, the example appears to involve creating a test class (SelectTestCase) in the same WAR project as the application code. Is this true? If so, how can we cleanly omit the test case code and infrastructure during deployment? Is there posted example code on the Web of a completed test case so I can see where everything was placed? Thanks, - Brendan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, February 10, 2006 5:43 PM To: Struts Users Mailing List Subject: Re: [SHALE] Using the Test Framework On 2/10/06, Craig McClanahan [EMAIL PROTECTED] wrote: The only classes in shale-test.jar that depend on the rest of Shale is the convenience base classes in the org.apache.shale.test.base package. The mock object classes have no dependencies on Shale, so you're welcome to use them to support general JSF based development activities. Actually, I need to refine this a little. The base class AbstractViewControllerTestCase is the only one that assumes a Shale API (ViewController in this case). AbstractJsfTestCase assumes only the standard JSF, Servlet, and JSP APIs, making it tremendously useful for testing pretty much any part of a JSF application, because it wires together FacesContext and all the other pieces for you. Craig Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: memory usage
LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up. -- James Mitchell EdgeTech, Inc. http://edgetechservices.net/ 678.910.8017 Skype: jmitchtx On Feb 13, 2006, at 5:00 PM, [EMAIL PROTECTED] wrote: Let me know if this is not a very good question. I need to know roughly how much memory a struts application uses. What is the equation? framework objects + application actions and forms + ?? My java classes that represent my business logic won't be in memory until an action executes . . . correct? ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - 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: html:link problem - please give some examples
Hi Mark, Thanks a lot. One of your suggestions worked for me. Once again thank you very much. bye sony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: memory usage
James Mitchell wrote: LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up. That's a better answer than mine; I was just gonna say 15K and call it day. Dave You don't code your Struts in assembly?! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [shale] datatables request scope
From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] As Gary mentioned, you can use the MyFaces component to carry bean values from one request to another. I'm new to Shale, but I saw something about a Dialog framework. Is that also supposed to address this issue? The dialog manager will track state as its related to the execution of a dialog. Its focus is on defining a page process flow at a level that pages can be reused within various dialogs. You can define actions that can be invoked between view states that provide the glue code within the context of the executing process. Under the covers, it uses session scope for tracking dialog state. - Brendan Gary
RE: [SHALE] Using the Test Framework
From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] OK, I'm going through the section in the PDF document (Shale Framework v.1.0.1-SNAPSHOT Project Documentation) on the Test Framework. In that section, the example appears to involve creating a test class (SelectTestCase) in the same WAR project as the application code. Is this true? If so, how can we cleanly omit the test case code and infrastructure during deployment? Is there posted example code on the Web of a completed test case so I can see where everything was placed? The shale test framework provides mock objects for junit testing outside of a web container. The projects are generally organized with two root source directories. One for your application source and the other for automated testing. The shale framework nightly (http://svn.apache.org/builds/struts/nightly/struts-shale/) archive contains a test-framework folder that has a blank project structure including an ant build. Thanks, - Brendan Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, February 10, 2006 5:43 PM To: Struts Users Mailing List Subject: Re: [SHALE] Using the Test Framework On 2/10/06, Craig McClanahan wrote: The only classes in shale-test.jar that depend on the rest of Shale is the convenience base classes in the org.apache.shale.test.base package. The mock object classes have no dependencies on Shale, so you're welcome to use them to support general JSF based development activities. Actually, I need to refine this a little. The base class AbstractViewControllerTestCase is the only one that assumes a Shale API (ViewController in this case). AbstractJsfTestCase assumes only the standard JSF, Servlet, and JSP APIs, making it tremendously useful for testing pretty much any part of a JSF application, because it wires together FacesContext and all the other pieces for you. Craig Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [shale] datatables request scope
Ah, OK. Then the t:saveState component from MyFaces would be more appropriate for the problem being discussed. We've used this in several applications, with no problems. All of our beans (except maybe two of them, that contain more static values) are request scope, but they carry their values through multiple pages of a conversation. - Brendan -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 10:35 AM To: Struts Users Mailing List Subject: RE: [shale] datatables request scope From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] As Gary mentioned, you can use the MyFaces component to carry bean values from one request to another. I'm new to Shale, but I saw something about a Dialog framework. Is that also supposed to address this issue? The dialog manager will track state as its related to the execution of a dialog. Its focus is on defining a page process flow at a level that pages can be reused within various dialogs. You can define actions that can be invoked between view states that provide the glue code within the context of the executing process. Under the covers, it uses session scope for tracking dialog state. - Brendan Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SHALE] Using the Test Framework
OK. We're working with IBM's RSA IDE (which uses Eclipse underneath). I'm just trying to fit into my mind how to organize the two root source directories in that environment. We have a Web Project set up that contains the application code to be tested. Normally, we just export our application (including a J2EE Application project, which refers to Web Project(s), EJB project(s), and Java Utility project(s)) to an EAR file for deployment to the server, but we didn't want the test framework stuff to be part of that export. - Brendan -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 10:42 AM To: Struts Users Mailing List Subject: RE: [SHALE] Using the Test Framework From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] OK, I'm going through the section in the PDF document (Shale Framework v.1.0.1-SNAPSHOT Project Documentation) on the Test Framework. In that section, the example appears to involve creating a test class (SelectTestCase) in the same WAR project as the application code. Is this true? If so, how can we cleanly omit the test case code and infrastructure during deployment? Is there posted example code on the Web of a completed test case so I can see where everything was placed? The shale test framework provides mock objects for junit testing outside of a web container. The projects are generally organized with two root source directories. One for your application source and the other for automated testing. The shale framework nightly (http://svn.apache.org/builds/struts/nightly/struts-shale/) archive contains a test-framework folder that has a blank project structure including an ant build. Thanks, - Brendan Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, February 10, 2006 5:43 PM To: Struts Users Mailing List Subject: Re: [SHALE] Using the Test Framework On 2/10/06, Craig McClanahan wrote: The only classes in shale-test.jar that depend on the rest of Shale is the convenience base classes in the org.apache.shale.test.base package. The mock object classes have no dependencies on Shale, so you're welcome to use them to support general JSF based development activities. Actually, I need to refine this a little. The base class AbstractViewControllerTestCase is the only one that assumes a Shale API (ViewController in this case). AbstractJsfTestCase assumes only the standard JSF, Servlet, and JSP APIs, making it tremendously useful for testing pretty much any part of a JSF application, because it wires together FacesContext and all the other pieces for you. Craig Craig - 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: [Shale] Property in ViewController Backing Bean is null
Hi again, I tried the whole weekend, but I didn't get any results other than those mentioned in the email below. Shall I send some code to illustrate the problem or is it really so unusual, what I'm trying to do? Thanks a lot for any help! Peter Good morning Craig, thank you, I think I'm making a progress with your help. I set the immediate flag to true for my commandButton, and my method gets executed as I wanted it to do. In the edit method I set an attribute of the backing bean to its correct value (the person that should be edited in the form), and this attribute is set correctly (in the prerender method I see its correct values). But the form is not being filled with the values. I read the chapter about the lifecycle of a JSF page in the J2EE tutorial, but didn't find the information where to tweak the application to set the actual form values. In my opinion this should happen in the Update Model Values phase, and that this phase has to be executed, when no errors occurs at validating the request parameters. But it seems this is not the case. Could you please help me again and push me in the right direction? Thanks a lot, I will name my first child after you, if my wife doesn't complain. :) Have a nice weekend! Peter Craig McClanahan wrote: On 2/10/06, Peter Goetz [EMAIL PROTECTED] wrote: Hello Craig, thank you very much, I didn't know that the action method is not executed when a validation error occurs. That seems to be the problem, because all of my form input fields are required fields and the messages get filled. Is there a way to skip validation on some actions? I would like to validate the form when submitting it, but not when I select one item in a list to fill the form with. Or is it standard behaviour to extract such data tables to an extra form in the .jsp? Thank you very much, what I wrote so far in this group is really excellent! The standard approach to doing this is to mark the commands you want to work this way with immediate=true. This causes the corresponding action to fire immediately :-) ... during the Apply Request Values phase of the request processing lifecycle, which comes *before* Process Validations. The most common use case for this is a Cancel button ... you don't want to have your validations executed if you're cancelling the input. But the same principle applies to your scenario. Good night! Peter Craig Craig McClanahan wrote: One thing to double check is whether some validation rules are failing, which would cause the action method call to get bypassed. The simplest way to verify this is to add an h:messages component to your page, which will display any validation messages that exist, or nothing if there were no messages. It's also possible that an exception is getting eaten somewhere along the way ... check the log file of your servlet container as well for any stack traces. Craig On 2/10/06, Peter Goetz [EMAIL PROTECTED] wrote: Hi there! I'm new to Struts, to Shale and to this list, so excuse if I'm asking dumb questions. I have a simple .jsp (personmaintenance.jsp), backed by a backing bean (PersonMaintenance.class. In the jsp I have buttons with actions save, edit, delete, create, for which I defined the corresponding methods in the backing bean. The backing bean has two attributes, a person (for the form to edit) and a persons Collection for an overview table. When calling the jsp (personmaintenance.faces), everything is fine. The Collection gets filled from the database, the person attribute is null. Unfortunately if I hit one of the buttons edit or delete, the corresponding method is not being called. If the person attribute is filled from the start, everything works fine. Can somebody tell me what to do to get the methods executed when I hit the button and the argument is null? Or am I missing something elementary? Thanks a lot! Peter - 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: [SHALE] Using the Test Framework
From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] OK. We're working with IBM's RSA IDE (which uses Eclipse underneath). I'm just trying to fit into my mind how to organize the two root source directories in that environment. We have a Web Project set up that contains the application code to be tested. Normally, we just export our application (including a J2EE Application project, which refers to Web Project(s), EJB project(s), and Java Utility project(s)) to an EAR file for deployment to the server, but we didn't want the test framework stuff to be part of that export. A new feature to RSA (I guess new to eclipse 3.x) is the ability to create links outside of a project. This is pretty handy for linking in source folders that are not under a project. Pull up the properties for a web project and select Java Build Path and the Source tab, and then click on the add folder button. Select the project root folder and click create new folder (only works for the root folder). Use the advanced button to link in a source folder. This is also an option for folders but it doesn't seem to work for the WebContent using just eclipse (haven't tried it under RAD). You might try adding the test source folder to your web project and then just exclude it from the build path using the source tab. Then create a test project that has links to the source in the other project. To make this work on multiple workstations I think you would need to use a link variable instead of a path. I'm sure there are several other options. You might look at the Project Reference too. Gary - Brendan -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 10:42 AM To: Struts Users Mailing List Subject: RE: [SHALE] Using the Test Framework From: CONNER, BRENDAN (SBCSI) OK, I'm going through the section in the PDF document (Shale Framework v.1.0.1-SNAPSHOT Project Documentation) on the Test Framework. In that section, the example appears to involve creating a test class (SelectTestCase) in the same WAR project as the application code. Is this true? If so, how can we cleanly omit the test case code and infrastructure during deployment? Is there posted example code on the Web of a completed test case so I can see where everything was placed? The shale test framework provides mock objects for junit testing outside of a web container. The projects are generally organized with two root source directories. One for your application source and the other for automated testing. The shale framework nightly (http://svn.apache.org/builds/struts/nightly/struts-shale/) archive contains a test-framework folder that has a blank project structure including an ant build. Thanks, - Brendan Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, February 10, 2006 5:43 PM To: Struts Users Mailing List Subject: Re: [SHALE] Using the Test Framework On 2/10/06, Craig McClanahan wrote: The only classes in shale-test.jar that depend on the rest of Shale is the convenience base classes in the org.apache.shale.test.base package. The mock object classes have no dependencies on Shale, so you're welcome to use them to support general JSF based development activities. Actually, I need to refine this a little. The base class AbstractViewControllerTestCase is the only one that assumes a Shale API (ViewController in this case). AbstractJsfTestCase assumes only the standard JSF, Servlet, and JSP APIs, making it tremendously useful for testing pretty much any part of a JSF application, because it wires together FacesContext and all the other pieces for you. Craig Craig - 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: [SHALE] Using the Test Framework
Maybe I'm misunderstanding the problem that the Shale Test Framework is trying to solve. My JSF actions are doing JNDI lookups and calling Session Beans, based upon the values in JSF managed beans and maybe some JSFContext info. If it encounters errors, it queues the errors to be displayed. If the Shale test framework tests outside of a Web container, how are the JNDI lookups and EJB calls supposed to be handled? Thanks, - Brendan -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 10:42 AM To: Struts Users Mailing List Subject: RE: [SHALE] Using the Test Framework From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] OK, I'm going through the section in the PDF document (Shale Framework v.1.0.1-SNAPSHOT Project Documentation) on the Test Framework. In that section, the example appears to involve creating a test class (SelectTestCase) in the same WAR project as the application code. Is this true? If so, how can we cleanly omit the test case code and infrastructure during deployment? Is there posted example code on the Web of a completed test case so I can see where everything was placed? The shale test framework provides mock objects for junit testing outside of a web container. The projects are generally organized with two root source directories. One for your application source and the other for automated testing. The shale framework nightly (http://svn.apache.org/builds/struts/nightly/struts-shale/) archive contains a test-framework folder that has a blank project structure including an ant build. Thanks, - Brendan Gary -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, February 10, 2006 5:43 PM To: Struts Users Mailing List Subject: Re: [SHALE] Using the Test Framework On 2/10/06, Craig McClanahan wrote: The only classes in shale-test.jar that depend on the rest of Shale is the convenience base classes in the org.apache.shale.test.base package. The mock object classes have no dependencies on Shale, so you're welcome to use them to support general JSF based development activities. Actually, I need to refine this a little. The base class AbstractViewControllerTestCase is the only one that assumes a Shale API (ViewController in this case). AbstractJsfTestCase assumes only the standard JSF, Servlet, and JSP APIs, making it tremendously useful for testing pretty much any part of a JSF application, because it wires together FacesContext and all the other pieces for you. Craig Craig - 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: [Shale] Property in ViewController Backing Bean is null
From: Peter Goetz [EMAIL PROTECTED] Hi again, I tried the whole weekend, but I didn't get any results other than those mentioned in the email below. Shall I send some code to illustrate the problem or is it really so unusual, what I'm trying to do? Make sure that you have a navigation rule setup to handle the immediate command button. Try adding a rule that directs you to the target viewid (sounds like the page you are submitting from). If you don't have a navigation case, I think the veiw is just restored using the submitted values. navigation-rule from-view-id/somepage.jsp/from-view-id navigation-case from-outcomeedit/from-outcome to-view-id/somepage.jsp/to-view-id /navigation-case /navigation-rule Thanks a lot for any help! Peter Gary
RE: [SHALE] Using the Test Framework
From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] Maybe I'm misunderstanding the problem that the Shale Test Framework is trying to solve. My JSF actions are doing JNDI lookups and calling Session Beans, based upon the values in JSF managed beans and maybe some JSFContext info. If it encounters errors, it queues the errors to be displayed. If the Shale test framework tests outside of a Web container, how are the JNDI lookups and EJB calls supposed to be handled? No, You are correct. You could use it with junitee in a web container if you wanted to test EJB/managed bean collaboration. Thanks, - Brendan Gary
Re: memory usage
I'm not sure I understand your gasps at my question. To extend on the that's like buying a truck asking them how much it will weight when you fill it up -- I can calculate the memory usage of the parts that I implement on behalf of my application itself. Obviously no one can speak to the size of the memory usage of the applications specific objects that I create, things, I put in session, etc. However, this isn't my question. My question seems answerable enough. I just want to know how much memory the struts framework tend to take up by itself, OR, alternately, what are the areas of memory usage to examine to decide such a thing. Is this really not easily determined? What would make it so hard to determine? --- On Tue 02/14, Dave Newton [EMAIL PROTECTED] wrote: From: Dave Newton [mailto: [EMAIL PROTECTED] To: user@struts.apache.org Date: Tue, 14 Feb 2006 11:24:58 -0500 Subject: Re: memory usage James Mitchell wrote: LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up.That's a better answer than mine; I was just gonna say 15K and call itday.Dave You don't code your Struts in assembly?!-To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
As long as you are arriving at the settings page via an action, can't you just call the getInputForward() -- the method that the validate stuff calls to return to the starting page if there were errors; this seems like it would easily work. If you aren't arriving at the settings page via an action, you can go ahead and route this through a ForwardAction -- this is suggested in several books. Probably for reasons such as this. Hope this helps. --- On Tue 02/14, Keith Sader [EMAIL PROTECTED] wrote: From: Keith Sader [mailto: [EMAIL PROTECTED] To: user@struts.apache.org Date: Tue, 14 Feb 2006 08:04:15 -0600 Subject: Re: Another struts design question That could work, and it would scale to n input pages.Thanks Mark!On 2/14/06, Mark Lowe [EMAIL PROTECTED] wrote: You could use the referer header to create an action forward based on that value. String referer = request.getHeader(Referer); URL url = new URL(referer); String path = url.getPath(); String contextPath = request.getContextPath(); path = path.replaceFirst(contextPath,); return new ActionForward(path,true); You may have to append any parameters to the path, but i'm sure you can work that out..--Keith [EMAIL PROTECTED]://www.saderfamily.org/roller/page/ksaderhttp://www.jroller.com/page/certifieddanger-To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
[EMAIL PROTECTED] wrote: As long as you are arriving at the settings page via an action, can't you just call the getInputForward() -- the method that the validate stuff calls to return to the starting page if there were errors; this seems like it would easily work. If you aren't arriving at the settings page via an action, you can go ahead and route this through a ForwardAction -- this is suggested in several books. Probably for reasons such as this. The OP wanted to know how to return to a previous page programatically. I've only done this for security access (you do not have access to that page so send them to login or denial page). In the past I've simply added logic to my security filter to save the page in session and redirect back to it after they've logged in. These days I guess you could put that in a request processor or something. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: memory usage
The footprint is still driven by your specific implementation. The more session based form beans you use, the larger the footprint. How should we determine this? I guess you could run the struts-blank application, and measure that. Would that be accurate? Probably not. -- James Mitchell EdgeTech, Inc. http://edgetechservices.net/ 678.910.8017 Skype: jmitchtx On Feb 14, 2006, at 1:07 PM, [EMAIL PROTECTED] wrote: I'm not sure I understand your gasps at my question. To extend on the that's like buying a truck asking them how much it will weight when you fill it up -- I can calculate the memory usage of the parts that I implement on behalf of my application itself. Obviously no one can speak to the size of the memory usage of the applications specific objects that I create, things, I put in session, etc. However, this isn't my question. My question seems answerable enough. I just want to know how much memory the struts framework tend to take up by itself, OR, alternately, what are the areas of memory usage to examine to decide such a thing. Is this really not easily determined? What would make it so hard to determine? --- On Tue 02/14, Dave Newton [EMAIL PROTECTED] wrote: From: Dave Newton [mailto: [EMAIL PROTECTED] To: user@struts.apache.org Date: Tue, 14 Feb 2006 11:24:58 -0500 Subject: Re: memory usage James Mitchell wrote: LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up.That's a better answer than mine; I was just gonna say 15K and call itday.Dave You don't code your Struts in assembly?!--- --To unsubscribe, e-mail: user- [EMAIL PROTECTED] additional commands, e-mail: user- [EMAIL PROTECTED] ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - 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: memory usage
James Mitchell wrote: The footprint is still driven by your specific implementation. The more session based form beans you use, the larger the footprint. How should we determine this? I guess you could run the struts-blank application, and measure that. Would that be accurate? Probably not. Heck, it might even depend on the app server and JVM... Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
On 2/14/06, Mark Lowe [EMAIL PROTECTED] wrote: You could use the referer header to create an action forward based on that value. referer field is unreliable. Can fail depending on your mix or forwarding/redirecting/reloading a page. It is also often removed by proxies/firewalls. I would not recommend using referer field. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
On 2/14/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 2/14/06, Mark Lowe [EMAIL PROTECTED] wrote: You could use the referer header to create an action forward based on that value. referer field is unreliable. Can fail depending on your mix or forwarding/redirecting/reloading a page. It is also often removed by proxies/firewalls. I would not recommend using referer field. Fair enough, what do you suggest as an alternative? I've used this a few times for forwarding back to the referer and found any huge problems. I can see how if something removed the header that could cause problems, but cant see what would be achieved by a firewall or proxy messing around like this would achieve. The only other suggestion i would make if this were an issue is use separate action mappings for each point of entry.. Mark - 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: [SHALE] Using the Test Framework
OK, sorry for being a little dense about this, but, if, for example, my application code is referencing a FacesContext object, and my Test code initializes MockFacesContext, what is the mechanism that makes my application use the values that are in MockFacesContext? I understand that MockFacesContext is a subclass of FacesContext, but I don't understand how my application ends up using the values in the MockFacesContext instance instead that were initialized by the test case. - Brendan -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 11:55 AM To: Struts Users Mailing List Subject: RE: [SHALE] Using the Test Framework From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] Maybe I'm misunderstanding the problem that the Shale Test Framework is trying to solve. My JSF actions are doing JNDI lookups and calling Session Beans, based upon the values in JSF managed beans and maybe some JSFContext info. If it encounters errors, it queues the errors to be displayed. If the Shale test framework tests outside of a Web container, how are the JNDI lookups and EJB calls supposed to be handled? No, You are correct. You could use it with junitee in a web container if you wanted to test EJB/managed bean collaboration. Thanks, - Brendan Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Property in ViewController Backing Bean is null
I think you may running into a simular problem that I ran into. I have the following scenario: page 1 has the user choose from a list of options. On page 2, the form saves the selected option of page 1 in a hidden field in its form. In addition the selected value from page 1 is used to populate a pull down on page 2. So the user hits the submit button on page 2 to save the changes and KA-BLAMMO, I get a NPE. What was happening was the JSF was attempting to Validate the pulldown values in the Validation phase. This was before any of the hidden fields were set. So because the hidden fields weren't set, the retrieve of the pulldown was failing. I saw 1 of 2 solutions: 1) Turn off the validation of the pulldown. Because, hey... why would I need to validate a pulldown? - it isn't like a user can mistype something. OR 2) somehow get the hidden fields to be set before any retrieval of the pulldown is made. The JSF mailing list from Sun gave no help for turning off the validator for the pulldown. So I had to do the following, for which I give myself a big Capital H for HACK. In the contructor of the backing bean, I grabbed the request parameters myself and called the setters from there for the values that were needed to get through the validation of the pulldown. Perhaps someone here can help turn off the need to retrieve the pulldown values in the validation phase. I hope this will help your situation, as well. Cheers, Jason On 2/14/06, Gary VanMatre [EMAIL PROTECTED] wrote: From: Peter Goetz [EMAIL PROTECTED] Hi again, I tried the whole weekend, but I didn't get any results other than those mentioned in the email below. Shall I send some code to illustrate the problem or is it really so unusual, what I'm trying to do? Make sure that you have a navigation rule setup to handle the immediate command button. Try adding a rule that directs you to the target viewid (sounds like the page you are submitting from). If you don't have a navigation case, I think the veiw is just restored using the submitted values. navigation-rule from-view-id/somepage.jsp/from-view-id navigation-case from-outcomeedit/from-outcome to-view-id/somepage.jsp/to-view-id /navigation-case /navigation-rule Thanks a lot for any help! Peter Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help needed for Clay
Hi folks, after a good time on struts we are examinating seam and shale for jsf framework. My todays concern is the construction of the templating engine clay. I spent so much hours on a simple login page with a layout for header, menu, content and footer. The symbol example of usecases did not realy help. Can someone give my advice for minimal configuration of a tapestry like example. Thx alot timo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem deploying older versions of my WAR in struts project
Thanks a bunch! I think JBoss probably behaves the same as Tomcat in this instance. Since my JSP files had an older timestamp, they were not being updated. That is, after all, somewhat intuitive. What had really been puzzling me was why I couldn't manually clear all my stuff out of JBoss, and then load the old archive without having to worry about touching files and timestamps. Turns out I had noticed the tmp folder, but had not realized the work folder also had to be cleared. Now, with your help, I can finally load these older versions. Thanks for helping me once again become Master of my domain well, for struts anyhow :P -Jeff B Laurie Harper wrote: I'm not too familiar with JBoss, but the Tomcat solution would be to clear the 'work' directory. An alternative would be to 'touch' all your JSP files so their date stamps are newer than the corresponding compiled versions. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot find bean message in any scope
Make sure you have a form-bean and action defined in your struts config and that they map to actual classes by checking the class names and package names. The JSP page will reference the form-bean in the struts config through the action declaration on html:form. Make sure all your controls with property values are within a html:form action=/declaredActionInStrutsConfig html:text property=firstName/ /html:form Shawn -Original Message- From: Chipo Hamayobe [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 1:55 AM To: user@struts.apache.org Subject: Cannot find bean message in any scope Importance: High Sensitivity: Confidential Hi, I keep getting the error Cannot find bean message in any scope in most of my jsp pages. Anybody know whats causing this and how to fix it. It doesn't really say which bean has an invalid message. thanks -- Chipo ** Relevant company disclaimers are available at the following address: Web: http://www.syntell.co.za/EmailDisclaimer.aspx ** This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: memory usage
Yeah, but there is a weight class to it. Shawn -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 10:20 AM To: Struts Users Mailing List Subject: Re: memory usage LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up. -- James Mitchell EdgeTech, Inc. http://edgetechservices.net/ 678.910.8017 Skype: jmitchtx On Feb 13, 2006, at 5:00 PM, [EMAIL PROTECTED] wrote: Let me know if this is not a very good question. I need to know roughly how much memory a struts application uses. What is the equation? framework objects + application actions and forms + ?? My java classes that represent my business logic won't be in memory until an action executes . . . correct? ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - 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 email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[shale]Help needed for Clay
Hi folks, after a good time on struts we are examinating seam and shale for jsf framework. My todays concern is the construction of the templating engine clay. I spent so much hours on a simple login page with a layout for header, menu, content and footer. The symbol example of usecases did not realy help. Can someone give my advice for minimal configuration of a tapestry like example. Thx alot timo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: memory usage
You can tell him numbers with how many actions and how many form-beans. The memory the Servlet itself should be pretty constant. Shawn -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 12:28 PM To: Struts Users Mailing List Subject: Re: memory usage The footprint is still driven by your specific implementation. The more session based form beans you use, the larger the footprint. How should we determine this? I guess you could run the struts-blank application, and measure that. Would that be accurate? Probably not. -- James Mitchell EdgeTech, Inc. http://edgetechservices.net/ 678.910.8017 Skype: jmitchtx On Feb 14, 2006, at 1:07 PM, [EMAIL PROTECTED] wrote: I'm not sure I understand your gasps at my question. To extend on the that's like buying a truck asking them how much it will weight when you fill it up -- I can calculate the memory usage of the parts that I implement on behalf of my application itself. Obviously no one can speak to the size of the memory usage of the applications specific objects that I create, things, I put in session, etc. However, this isn't my question. My question seems answerable enough. I just want to know how much memory the struts framework tend to take up by itself, OR, alternately, what are the areas of memory usage to examine to decide such a thing. Is this really not easily determined? What would make it so hard to determine? --- On Tue 02/14, Dave Newton [EMAIL PROTECTED] wrote: From: Dave Newton [mailto: [EMAIL PROTECTED] To: user@struts.apache.org Date: Tue, 14 Feb 2006 11:24:58 -0500 Subject: Re: memory usage James Mitchell wrote: LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up.That's a better answer than mine; I was just gonna say 15K and call itday.Dave You don't code your Struts in assembly?!--- --To unsubscribe, e-mail: user- [EMAIL PROTECTED] additional commands, e-mail: user- [EMAIL PROTECTED] ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - 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 email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Shale: postRender method?
Hi All, I was wondering if there is an easy way to get a postRender method to be called in my Shale ViewController. Is a new Phase Listener the only / best option? Perhaps I can extend a Shale class to also call a postRender method? Here is my scenario: I have the concept of an ErrorEventCollector in the ViewController. Basically, the collector is passed around in the model calls to capture errors during the model execution. This might include errors caused by validation checks on the retrieved data from the DB, as well as any exceptions. These events can be generated in any phase - init, validation, application, or render. In my BaseViewController - I want to have the event collector checked for any events. If there are events in the collector, then I want to create FacesMessages for each event. I tried putting the check in the Shale destroy method, but the messages weren't being displayed by the JSP. So It seems I need to have this check as the last step in the render_response phase. Thanks for any help. Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [shale]Help needed for Clay
From: Timo Schnölzer [EMAIL PROTECTED] Hi folks, after a good time on struts we are examinating seam and shale for jsf framework. My todays concern is the construction of the templating engine clay. I spent so much hours on a simple login page with a layout for header, menu, content and footer. The symbol example of usecases did not realy help. Can someone give my advice for minimal configuration of a tapestry like example. You might take a look at this bugzilla ticket (http://issues.apache.org/bugzilla/show_bug.cgi?id=38482). Hopefully this will be pulled in as a clay example. Thx alot timo Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sharing the session between two war
Am I in the right forum? -VJ - Original Message - From: VIJAISENTHIL, P. K. [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, February 13, 2006 6:24 PM Subject: Re: Sharing the session between two war Sorry not to mention that I am using OC4J as my app server Thanks in advance Vijai Senthil, P. K. - Original Message - From: VIJAISENTHIL, P. K. [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, February 13, 2006 6:03 PM Subject: Sharing the session between two war Hi, I am deploying an ear file, which has two war files. (means with two different webcontext) I need to share the session values stored in one war file with other. Please let me know how to setup this in config files, if it can done. Thanks and Regards, Vijai Senthil, P. K. - 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: [shale]Help needed for Clay
Thx Gary, Looks promising... In my case it is now just a base idea of using a template (mainLayout.html) page and the tiles incls. So 1st step to layouting a page. All the other concepts work fine, e.g. dialog and so on. Thx for input timo -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 9:46 PM To: Struts Users Mailing List Subject: Re: [shale]Help needed for Clay From: Timo Schnölzer [EMAIL PROTECTED] Hi folks, after a good time on struts we are examinating seam and shale for jsf framework. My todays concern is the construction of the templating engine clay. I spent so much hours on a simple login page with a layout for header, menu, content and footer. The symbol example of usecases did not realy help. Can someone give my advice for minimal configuration of a tapestry like example. You might take a look at this bugzilla ticket (http://issues.apache.org/bugzilla/show_bug.cgi?id=38482). Hopefully this will be pulled in as a clay example. Thx alot timo Gary - 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: [shale] datatables request scope
On 2/14/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: Ah, OK. Then the t:saveState component from MyFaces would be more appropriate for the problem being discussed. We've used this in several applications, with no problems. All of our beans (except maybe two of them, that contain more static values) are request scope, but they carry their values through multiple pages of a conversation. All of the patterns that work for non-JSF-based webapps all work with JSF as well -- for example: * session scope state variables * hidden fields in input forms * request parameters on generated URLs * cookies Shale Dialogs is an instance of the first one, in that it gives you a sort of scope longer than a request, but shorter than a session, without you having to be responsible for cleanup. It's nice when you have your application organized into a series of conversations with the user that have well defined beginning and ending points. One idea I've seen discussed, but haven't seen actually implemented yet, would be a JSF-specific implementation of the flash concept in RoR, where it keeps state information around for exactly *one* more request for you. It should be easy to do this with a specialized variable resolver or something ... I'll think about how to do that when dialogs are heavier weight than you really need. Something along the lines of this in the second page: h:outputText value=#{flash.savedCustomerName}/ where savedCustomerName was stored away (until the next request) by some TBD mechanism. - Brendan Craig
RE: [shale]Help needed for Clay
From: Timo Schnölzer [EMAIL PROTECTED] Thx Gary, Looks promising... In my case it is now just a base idea of using a template (mainLayout.html) page and the tiles incls. You might take a look at the symbols shale usecase. It shows two options for alternate page entry points (XML and HTML). The full clay XML pages are most like tiles. These page definitions can be defined in a single configuration file or individual files. In the usecase example, they are in a single configuration file. In the web.xml this file is declared: !-- Clay Configuration Full XML view Resources -- context-param param-name org.apache.shale.clay.FULLXML_CONFIG_FILES /param-name param-value classpath*:org/apache/shale/usecases/symbols/clay-tiles-config.xml /param-value /context-param This file exists in the classpath. In this config file you will find two component definitions that define the page similar to a tiles-definition. component jsfid=/symbols/page1.xml extends=basePage symbols set name=@title value=Page 1/ set name=@bodyContent value=page1Panel/ set name=@logo value=http://myfaces.apache.org/images/myfaces-logo.png/ set name=@leftContent value=page1LeftPanel/ /symbols /component The symbols are like the tiles put variables. The jsfid is like the tiles path attribute. The page above extends basePage. This definition is in the common's config file and it's declared in the web.xml !-- Clay Common Configuration Resources -- context-param param-name org.apache.shale.clay.COMMON_CONFIG_FILES /param-name param-value /WEB-INF/clay-config.xml, /WEB-INF/clay-symbols-config.xml /param-value /context-param The basePage defines default symbol values: !-- Base layout defintion -- component jsfid=basePage extends=clay attributes set name=clayJsfid value=/symbols/layout.html / /attributes symbols set name=@title value=Default Title/ set name=@leftContent value=page3LeftPanel/ set name=@headercontent value=/symbols/header.html/ set name=@logo value=http://struts.apache.org/images/struts.gif/ set name=@bodycontent value=space/ set name=@footercontent value=footerPanel/ /symbols /component And, the base layout is a generic template: html headtitle@title/title/head body form table border=1 tr td id=leftContent rowspan=3span jsfid=clay clayJsfid=@leftContent allowBody=falseLeftbr/Content/span/td td id=headerContentspan jsfid=clay clayJsfid=@headercontent allowBody=falseHeaderbr/Content/span/td /tr tr td id=bodyContentspan jsfid=clay clayJsfid=@bodycontent allowBody=falseBodybr/Content/span/td /tr tr td id=footerContentspan jsfid=clay clayJsfid=@footercontent allowBody=falseFooterbr/Content/span/td /tr /table /form /body /html There's a view other details but that's the general ballpark. So 1st step to layouting a page. All the other concepts work fine, e.g. dialog and so on. Thx for input timo -Original Message- From: Gary VanMatre [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 9:46 PM To: Struts Users Mailing List Subject: Re: [shale]Help needed for Clay From: Timo Schnölzer Hi folks, after a good time on struts we are examinating seam and shale for jsf framework. My todays concern is the construction of the templating engine clay. I spent so much hours on a simple login page with a layout for header, menu, content and footer. The symbol example of usecases did not realy help. Can someone give my advice for minimal configuration of a tapestry like example. You might take a look at this bugzilla ticket (http://issues.apache.org/bugzilla/show_bug.cgi?id=38482). Hopefully this will be pulled in as a clay example. Thx alot timo Gary - 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: [SHALE] Using the Test Framework
On 2/14/06, Gary VanMatre [EMAIL PROTECTED] wrote: From: CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] OK. We're working with IBM's RSA IDE (which uses Eclipse underneath). I'm just trying to fit into my mind how to organize the two root source directories in that environment. We have a Web Project set up that contains the application code to be tested. Normally, we just export our application (including a J2EE Application project, which refers to Web Project(s), EJB project(s), and Java Utility project(s)) to an EAR file for deployment to the server, but we didn't want the test framework stuff to be part of that export. A new feature to RSA (I guess new to eclipse 3.x) is the ability to create links outside of a project. This is pretty handy for linking in source folders that are not under a project. ducks Or, you could just use NetBeans :-) /ducks Seriously, NetBeans cleanly supports a parallel structure for runtime sources (src/java) and test sources (src/test). Indeed, the Shale sources themselves conform to this pattern -- take a look at the organziation of the use-cases example app, for instance. Works great, even with a freeform Ant script (as this particular directory has). It didn't even need to be a formal NB project. Craig
Re: Shale: postRender method?
On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: Hi All, I was wondering if there is an easy way to get a postRender method to be called in my Shale ViewController. Is a new Phase Listener the only / best option? Perhaps I can extend a Shale class to also call a postRender method? Doesn't the destroy() method do what you want? It is called after rendering. Here is my scenario: I have the concept of an ErrorEventCollector in the ViewController. Basically, the collector is passed around in the model calls to capture errors during the model execution. This might include errors caused by validation checks on the retrieved data from the DB, as well as any exceptions. These events can be generated in any phase - init, validation, application, or render. In my BaseViewController - I want to have the event collector checked for any events. If there are events in the collector, then I want to create FacesMessages for each event. I tried putting the check in the Shale destroy method, but the messages weren't being displayed by the JSP. So It seems I need to have this check as the last step in the render_response phase. Hmm ... destroy() *is* called by an afterPhase listener for the Render Response phase, so something else must be going on here. Note, of course, that any messages you *add* in the destroy() method will, of course, not be rendered -- precisely because rendering *has* ben completed. Craig Thanks for any help. Jason
Re: Sharing the session between two war
On 2/13/06, VIJAISENTHIL, P. K. [EMAIL PROTECTED] wrote: Hi, I am deploying an ear file, which has two war files. (means with two different webcontext) I need to share the session values stored in one war file with other. The servlet spec prohibits sharing sessions between webapps. You'll need to find some other way to share information between them, such as a commonly accessed database, or perhaps (in a J2EE environment) in an EJB that is part of the same EAR. Please let me know how to setup this in config files, if it can done. It cannot. Thanks and Regards, Vijai Senthil, P. K. Craig
RE: [shale] datatables request scope
Isn't that functionally what the MyFaces t:saveState component does? - Brendan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Tuesday, February 14, 2006 3:26 PM To: Struts Users Mailing List Subject: Re: [shale] datatables request scope [snip] One idea I've seen discussed, but haven't seen actually implemented yet, would be a JSF-specific implementation of the flash concept in RoR, where it keeps state information around for exactly *one* more request for you. It should be easy to do this with a specialized variable resolver or something ... I'll think about how to do that when dialogs are heavier weight than you really need. Something along the lines of this in the second page: h:outputText value=#{flash.savedCustomerName}/ where savedCustomerName was stored away (until the next request) by some TBD mechanism. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [shale] datatables request scope
On 2/14/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED] wrote: Isn't that functionally what the MyFaces t:saveState component does? Yes, but t:saveState requires that you get the page author involved. From an architectural viewpoint, I don't think that's necessarily the right answer (in many cases) where the state being saved and restored is server side model state as opposed to view state. - Brendan Craig -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Tuesday, February 14, 2006 3:26 PM To: Struts Users Mailing List Subject: Re: [shale] datatables request scope [snip] One idea I've seen discussed, but haven't seen actually implemented yet, would be a JSF-specific implementation of the flash concept in RoR, where it keeps state information around for exactly *one* more request for you. It should be easy to do this with a specialized variable resolver or something ... I'll think about how to do that when dialogs are heavier weight than you really need. Something along the lines of this in the second page: h:outputText value=#{flash.savedCustomerName}/ where savedCustomerName was stored away (until the next request) by some TBD mechanism. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[shale] Clay component definition for t:validateEqual
Hello all, I'm trying to use the tomahawk validator for making sure two fields have the same value for users entering their password. There isn't a definition in the clay-config.xml in the Shale or MyFaces JIRA tickets so I'm trying to create one. So I went ahead and created one: component jsfid=t:validateEqual componentType=??? attributes set name=for bindingType=Early / /attributes /component I wasn't sure what to use for the componentType attribute of the component. I thought I'd try setting the componentType to the fully qualified class name of the component itself, e.g org.apache.myfaces.custom.equalvalidator.EqualValidator. But that doesn't work. It blows up with the following exception: 2006-02-14 15:24:21,630 14340 ERROR [http-8443-Processor25] org.apache.shale.clay.component.chain.CreateValidatorCommand (CreateValidatorCommand.java:90) - Cannot create validator jsfid=t:validateEqual componentType=org.apache.myfaces.custom.equalvalidator.EqualValidator extends=t:validateEqual allowBody=null facetName=null javax.faces.FacesException: Unknown validator id 'org.apache.myfaces.custom.equalvalidator.EqualValidator'. at org.apache.myfaces.application.ApplicationImpl.createValidator(ApplicationImpl.java:621) at org.apache.shale.clay.component.chain.CreateValidatorCommand.execute(CreateValidatorCommand.java:87) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:166) The usage of the validator is simply: component jsfid=inputPassword extends=panelGroup element renderId=0 jsfid=outputLabel attributes set name=for value=password / set name=value value=Password / /attributes /element element renderId=1 jsfid=inputSecret attributes set name=id value=password / set name=value value=[EMAIL PROTECTED] / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes /element element renderId=2 jsfid=inputSecret attributes set name=id value=password2 / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes validator jsfid=t:validateEqual attributes set name=for value=password / /attributes /validator /element /component What am I missing? I mean, obviously I'm setting the componentType to the wrong thing, but can someone give me a clue what it should be? Thanks, Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: postRender method?
Hmm... I guess a phase listener wouldn't work for me. From what you say, it appears that the outcome of the phase is already determined before the afterPhase listener is triggered. Is there a another place for me to plug into the steps taken during a phase, that is, before the final steps in the phase are completed? Or at least, I just need the FacesMessages to not get processed until the last step of the render phase. Thanks, Jason On 2/14/06, Craig McClanahan [EMAIL PROTECTED] wrote: On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: Hi All, I was wondering if there is an easy way to get a postRender method to be called in my Shale ViewController. Is a new Phase Listener the only / best option? Perhaps I can extend a Shale class to also call a postRender method? Doesn't the destroy() method do what you want? It is called after rendering. Here is my scenario: I have the concept of an ErrorEventCollector in the ViewController. Basically, the collector is passed around in the model calls to capture errors during the model execution. This might include errors caused by validation checks on the retrieved data from the DB, as well as any exceptions. These events can be generated in any phase - init, validation, application, or render. In my BaseViewController - I want to have the event collector checked for any events. If there are events in the collector, then I want to create FacesMessages for each event. I tried putting the check in the Shale destroy method, but the messages weren't being displayed by the JSP. So It seems I need to have this check as the last step in the render_response phase. Hmm ... destroy() *is* called by an afterPhase listener for the Render Response phase, so something else must be going on here. Note, of course, that any messages you *add* in the destroy() method will, of course, not be rendered -- precisely because rendering *has* ben completed. Craig Thanks for any help. Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: [shale] Clay component definition for t:validateEqual
Hi Have you tried to set as pr. the tomahawk.tld : org.apache.myfaces.custom.equalvalidator.ValidateEqual Hermod -Opprinnelig melding- Fra: Richard Wallace [mailto:[EMAIL PROTECTED] Sendt: 14. februar 2006 23:27 Til: Struts Users Mailing List Emne: [shale] Clay component definition for t:validateEqual Hello all, I'm trying to use the tomahawk validator for making sure two fields have the same value for users entering their password. There isn't a definition in the clay-config.xml in the Shale or MyFaces JIRA tickets so I'm trying to create one. So I went ahead and created one: component jsfid=t:validateEqual componentType=??? attributes set name=for bindingType=Early / /attributes /component I wasn't sure what to use for the componentType attribute of the component. I thought I'd try setting the componentType to the fully qualified class name of the component itself, e.g org.apache.myfaces.custom.equalvalidator.EqualValidator. But that doesn't work. It blows up with the following exception: 2006-02-14 15:24:21,630 14340 ERROR [http-8443-Processor25] org.apache.shale.clay.component.chain.CreateValidatorCommand (CreateValidatorCommand.java:90) - Cannot create validator jsfid=t:validateEqual componentType=org.apache.myfaces.custom.equalvalidator.EqualValidator extends=t:validateEqual allowBody=null facetName=null javax.faces.FacesException: Unknown validator id 'org.apache.myfaces.custom.equalvalidator.EqualValidator'. at org.apache.myfaces.application.ApplicationImpl.createValidator(ApplicationIm pl.java:621) at org.apache.shale.clay.component.chain.CreateValidatorCommand.execute(CreateV alidatorCommand.java:87) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:166) The usage of the validator is simply: component jsfid=inputPassword extends=panelGroup element renderId=0 jsfid=outputLabel attributes set name=for value=password / set name=value value=Password / /attributes /element element renderId=1 jsfid=inputSecret attributes set name=id value=password / set name=value value=[EMAIL PROTECTED] / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes /element element renderId=2 jsfid=inputSecret attributes set name=id value=password2 / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes validator jsfid=t:validateEqual attributes set name=for value=password / /attributes /validator /element /component What am I missing? I mean, obviously I'm setting the componentType to the wrong thing, but can someone give me a clue what it should be? Thanks, Rich - 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: Shale: postRender method?
On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: Hmm... I guess a phase listener wouldn't work for me. From what you say, it appears that the outcome of the phase is already determined before the afterPhase listener is triggered. Is there a another place for me to plug into the steps taken during a phase, that is, before the final steps in the phase are completed? I don't see how that would really help you ... what you seem to be needing is that the messages get generated before the h:messages component itself is rendered. Or at least, I just need the FacesMessages to not get processed until the last step of the render phase. Put your h:messages component last??? Thanks, Jason Craig
SV: [shale] Clay component definition for t:validateEqual
Hi I checked and it is supposed to be: org.apache.myfaces.validator.Equal This is the ID of the tag. Hermod -Opprinnelig melding- Fra: Hermod Opstvedt [mailto:[EMAIL PROTECTED] Sendt: 14. februar 2006 23:40 Til: 'Struts Users Mailing List' Emne: SV: [shale] Clay component definition for t:validateEqual Hi Have you tried to set as pr. the tomahawk.tld : org.apache.myfaces.custom.equalvalidator.ValidateEqual Hermod -Opprinnelig melding- Fra: Richard Wallace [mailto:[EMAIL PROTECTED] Sendt: 14. februar 2006 23:27 Til: Struts Users Mailing List Emne: [shale] Clay component definition for t:validateEqual Hello all, I'm trying to use the tomahawk validator for making sure two fields have the same value for users entering their password. There isn't a definition in the clay-config.xml in the Shale or MyFaces JIRA tickets so I'm trying to create one. So I went ahead and created one: component jsfid=t:validateEqual componentType=??? attributes set name=for bindingType=Early / /attributes /component I wasn't sure what to use for the componentType attribute of the component. I thought I'd try setting the componentType to the fully qualified class name of the component itself, e.g org.apache.myfaces.custom.equalvalidator.EqualValidator. But that doesn't work. It blows up with the following exception: 2006-02-14 15:24:21,630 14340 ERROR [http-8443-Processor25] org.apache.shale.clay.component.chain.CreateValidatorCommand (CreateValidatorCommand.java:90) - Cannot create validator jsfid=t:validateEqual componentType=org.apache.myfaces.custom.equalvalidator.EqualValidator extends=t:validateEqual allowBody=null facetName=null javax.faces.FacesException: Unknown validator id 'org.apache.myfaces.custom.equalvalidator.EqualValidator'. at org.apache.myfaces.application.ApplicationImpl.createValidator(ApplicationIm pl.java:621) at org.apache.shale.clay.component.chain.CreateValidatorCommand.execute(CreateV alidatorCommand.java:87) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:166) The usage of the validator is simply: component jsfid=inputPassword extends=panelGroup element renderId=0 jsfid=outputLabel attributes set name=for value=password / set name=value value=Password / /attributes /element element renderId=1 jsfid=inputSecret attributes set name=id value=password / set name=value value=[EMAIL PROTECTED] / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes /element element renderId=2 jsfid=inputSecret attributes set name=id value=password2 / set name=size value=15 / set name=maxlength value=15 / set name=required value=true / /attributes validator jsfid=t:validateEqual attributes set name=for value=password / /attributes /validator /element /component What am I missing? I mean, obviously I'm setting the componentType to the wrong thing, but can someone give me a clue what it should be? Thanks, Rich - 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: Another struts design question
Mark Lowe wrote the following on 2/14/2006 2:32 PM: The only other suggestion i would make if this were an issue is use separate action mappings for each point of entry.. Actually that seems pretty clean to me. Even if he has a lot of points of entry it can't be that many. Or another option is to simply embed some param that gets passed when the Action is called and you can call different forwards based on that. Simply define several forwards in the config... action path=/someAction name=someForm type=com.WhateverAction scope=request parameter=dispatch forward name=fromFooPage path=/WEB-INF/jsp/someOtherPageA.jsp/ forward name=fromBarPage path=/WEB-INF/jsp/someOtherPageB.jsp/ Or they may even be global forwards. In the action just look for some param like fromPage and key off of that for your return. (Of course a drawback is you'll need to remember to set this var on the pages that need it - of course there are ways you could simplify that even, if really necessary). -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [shale] Clay component definition for t:validateEqual
From: Richard Wallace [EMAIL PROTECTED] Hello all, I'm trying to use the tomahawk validator for making sure two fields have the same value for users entering their password. There isn't a definition in the clay-config.xml in the Shale or MyFaces JIRA tickets so I'm trying to create one. So I went ahead and created one: Try using the validatorId for the component type. The validatorId is is the name used to register the validator in the faces-config (http://myfaces.apache.org/tomahawk/validateEqual.html). component jsfid=t:validateEqual componentType=org.apache.myfaces.validator.Equal attributes set name=for bindingType=Early / /attributes /component Try something like this: component jsfid=myId extends=inputText validator jsfid=t:validateEqual attributes set name=for value=equal/ /attributes /validator /component What am I missing? I mean, obviously I'm setting the componentType to the wrong thing, but can someone give me a clue what it should be? I've not used this one but that should be what's required on the clay config side. Thanks, Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
On 2/14/06, Rick Reumann [EMAIL PROTECTED] wrote: In the action just look for some param like fromPage and key off of that for your return. (Of course a drawback is you'll need to remember to set this var on the pages that need it - of course there are ways you could simplify that even, if really necessary). Using session is much simpler ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
On 2/14/06, Rick Reumann [EMAIL PROTECTED] wrote: Mark Lowe wrote the following on 2/14/2006 2:32 PM: The only other suggestion i would make if this were an issue is use separate action mappings for each point of entry.. Actually that seems pretty clean to me. Even if he has a lot of points of entry it can't be that many. One occasion when i use the forward to referer was when i had a basket/cart presented all over the place.. Rather than have a boring old, go to basket page do some basket stuff, i wanted the user to be able to maniuplate the cart with out going anywhere, on anypage.. I guess there could be other ways, but sometimes you do have N amount of entry points.. Or another option is to simply embed some param that gets passed when the Action is called and you can call different forwards based on that. Simply define several forwards in the config... action path=/someAction name=someForm type=com.WhateverAction scope=request parameter=dispatch forward name=fromFooPage path=/WEB-INF/jsp/someOtherPageA.jsp/ forward name=fromBarPage path=/WEB-INF/jsp/someOtherPageB.jsp/ Or they may even be global forwards. In the action just look for some param like fromPage and key off of that for your return. (Of course a drawback is you'll need to remember to set this var on the pages that need it - of course there are ways you could simplify that even, if really necessary). In the case of a few entry points I see how this could be okay.. But if you've something thats present through out a load of pages, I'd take my chances using the Referer header. Mark -- Rick - 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: memory usage
Are you using r/o request beans or session r/w beans? How many users at a time? What is the mix? How many bytes per columns/rows? (ex: displaytag) Also, what is your DAO (data) caching plans? This in my designs is majority of RAM usage. I built one site to support 10,000 concurent users, and we used 64 bit CPU (AMD) on servers ( 6 of them) to be able to address 4 gig JVM space to do more DAO caching of blobs (media/images) Mostly this shakes itself out during stress testing (and struts is great at this since you can test your M (Data) layer by itself). So since majority of memory is related to your domain (business app area) The struts servlets takes very few bytes itself and there is one of each (even for multiple sessions). hth, .V [EMAIL PROTECTED] wrote: I'm not sure I understand your gasps at my question. To extend on the that's like buying a truck asking them how much it will weight when you fill it up -- I can calculate the memory usage of the parts that I implement on behalf of my application itself. Obviously no one can speak to the size of the memory usage of the applications specific objects that I create, things, I put in session, etc. However, this isn't my question. My question seems answerable enough. I just want to know how much memory the struts framework tend to take up by itself, OR, alternately, what are the areas of memory usage to examine to decide such a thing. Is this really not easily determined? What would make it so hard to determine? --- On Tue 02/14, Dave Newton [EMAIL PROTECTED] wrote: From: Dave Newton [mailto: [EMAIL PROTECTED] To: user@struts.apache.org Date: Tue, 14 Feb 2006 11:24:58 -0500 Subject: Re: memory usage James Mitchell wrote: LOL! That's like buying a truck from Ford, and then asking them how much it will weigh when you fill it up.That's a better answer than mine; I was just gonna say 15K and call itday.Dave You don't code your Struts in assembly?!-To unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL PROTECTED] ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
Michael Jouravlev wrote: On 2/14/06, Rick Reumann [EMAIL PROTECTED] wrote: In the action just look for some param like fromPage and key off of that for your return. (Of course a drawback is you'll need to remember to set this var on the pages that need it - of course there are ways you could simplify that even, if really necessary). Using session is much simpler ;-) This is one of those times I would agree :) My suggestion would be to have a base Action in which you set a session attribute to tell which page was server. Actually, you would store two, the current and the previous. Here's my concern... let's say you have page A and page B, from which you can go to page C. From page C you want to return to page A or B as appropriate. You could do this a number of ways, but what if you are using the common paradigm of a setup Action for a screen, and then a collection of Actions which really can be though of as event handlers for a given screen (could be a DispatchAction just as well, that wouldn't change anything). If you want to go back to page A from page C, and you got to page C by maybe submitting a form, then the problem is that you got to page C via an event handler in essence. But, when you return to page A, you really want the setup Action to fire again. So, just recording the last request isn't sufficient. If you have a base Action that sets that session attribute, then you can have only your setup Actions extend that base class. Then, when you want to return to the last page from any other page, you look up that value and you now know which SETUP Action you need to call. More precisely, you would look at the second value in session (think of it as a stack) because every time a setup Action is called you really need to push a value on the stack so that the second value on the stack is truly the last page, not the current pages' setup Action. Does that make any sense to anyone but me?? :) Frank - 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: Shale: postRender method?
ok... I got it to show the messages... I did what you suggested and moved the h:messages to the end of my page - THANKS! But the method to convert my ErrorEvents into FacesMessages still needed to be called. So I made it return true and set it as the render attribute for the messages tag. AHHH! It worked, but ew. :) I could change my design so that the FacesMessages are created immediately when the events are added to the collecor. That would eliminate the need for the render attribute. BUT, I'll need to beg for forgiveness from my UI designers when I tell them that the h:messages tag MUST be at the end of the page. I guess the original intent of the FacesMessages was to be used during the Validation phase. Hmmm. Is it a sign of mis-use of the JSF framework if my getter methods in the render phase can produce FacesMessages? HMMM Perhaps I could override/extend the responseComplete method to do my custom stuff first, and then call super.responseComplete??? Is this a good approach or even possible or even the right method to override? It seems like a path to the dark side. Thanks for the help. Jason On 2/14/06, Craig McClanahan [EMAIL PROTECTED] wrote: On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: Hmm... I guess a phase listener wouldn't work for me. From what you say, it appears that the outcome of the phase is already determined before the afterPhase listener is triggered. Is there a another place for me to plug into the steps taken during a phase, that is, before the final steps in the phase are completed? I don't see how that would really help you ... what you seem to be needing is that the messages get generated before the h:messages component itself is rendered. Or at least, I just need the FacesMessages to not get processed until the last step of the render phase. Put your h:messages component last??? Thanks, Jason Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Shale: postRender method?
On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: ok... I got it to show the messages... I did what you suggested and moved the h:messages to the end of my page - THANKS! But the method to convert my ErrorEvents into FacesMessages still needed to be called. So I made it return true and set it as the render attribute for the messages tag. AHHH! It worked, but ew. :) I could change my design so that the FacesMessages are created immediately when the events are added to the collecor. That would eliminate the need for the render attribute. BUT, I'll need to beg for forgiveness from my UI designers when I tell them that the h:messages tag MUST be at the end of the page. I guess the original intent of the FacesMessages was to be used during the Validation phase. Hmmm. Is it a sign of mis-use of the JSF framework if my getter methods in the render phase can produce FacesMessages? I would say yes, that's a misuse. If your messages represent the generic concept of validation errors, you should strive to have those messages created during the Process Validations phase (if it's things that validators should normally catch), or Invoke Application phase (if its business rule enforcement like you cannot claim that user id because it belongs to someone else'). HMMM Perhaps I could override/extend the responseComplete method to do my custom stuff first, and then call super.responseComplete??? Is this a good approach or even possible or even the right method to override? It seems like a path to the dark side. Yes ;-). Thanks for the help. Jason Craig On 2/14/06, Craig McClanahan [EMAIL PROTECTED] wrote: On 2/14/06, Jason Vincent [EMAIL PROTECTED] wrote: Hmm... I guess a phase listener wouldn't work for me. From what you say, it appears that the outcome of the phase is already determined before the afterPhase listener is triggered. Is there a another place for me to plug into the steps taken during a phase, that is, before the final steps in the phase are completed? I don't see how that would really help you ... what you seem to be needing is that the messages get generated before the h:messages component itself is rendered. Or at least, I just need the FacesMessages to not get processed until the last step of the render phase. Put your h:messages component last??? Thanks, Jason Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
ok, I let page A or B pass a returnURL to page C who keeps it in the session scoped actionForm. On 2/15/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Michael Jouravlev wrote: On 2/14/06, Rick Reumann [EMAIL PROTECTED] wrote: In the action just look for some param like fromPage and key off of that for your return. (Of course a drawback is you'll need to remember to set this var on the pages that need it - of course there are ways you could simplify that even, if really necessary). Using session is much simpler ;-) This is one of those times I would agree :) My suggestion would be to have a base Action in which you set a session attribute to tell which page was server. Actually, you would store two, the current and the previous. Here's my concern... let's say you have page A and page B, from which you can go to page C. From page C you want to return to page A or B as appropriate. You could do this a number of ways, but what if you are using the common paradigm of a setup Action for a screen, and then a collection of Actions which really can be though of as event handlers for a given screen (could be a DispatchAction just as well, that wouldn't change anything). If you want to go back to page A from page C, and you got to page C by maybe submitting a form, then the problem is that you got to page C via an event handler in essence. But, when you return to page A, you really want the setup Action to fire again. So, just recording the last request isn't sufficient. If you have a base Action that sets that session attribute, then you can have only your setup Actions extend that base class. Then, when you want to return to the last page from any other page, you look up that value and you now know which SETUP Action you need to call. More precisely, you would look at the second value in session (think of it as a stack) because every time a setup Action is called you really need to push a value on the stack so that the second value on the stack is truly the last page, not the current pages' setup Action. Does that make any sense to anyone but me?? :) Frank - 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: Multiple File Upload using Struts (number of files dynamic)
Prasad, Kamakshya kprasad at capitalservicing.co.jp writes: Hi, In the form bean keep an array list of FormFile and use it similarly as dynamic list control. KP -Original Message- From: Viral_Thakkar [mailto:Viral_Thakkar at infosys.com] Sent: Thursday, July 08, 2004 3:01 PM To: Struts Users Mailing List Cc: Ketan_Bhat Subject: Multiple File Upload using Struts (number of files dynamic) Hi, We are trying to implement uploading file via struts framework using form bean. According to our requirement we have two scenarios' in which we require uploading of our file. 1) Uploading single file (single html:file control and a single upload button in jsp page) 2) Uploading multiple files (Multiple html:file controls on the screen on the same form). The problem is that these number of html:file controls on the screen is not fixed, it is dynamic. The user can click on an Add More button to increase dynamically the number of files he/she wants to upload. We have implemented the first scenario by using html:file tag on the JSP and keeping a form bean with html control as one of its member variables. In the action class we extract the value from the bean and then upload the file using I/O streams. Now, for the second scenario we need to upload an indeterminate (determined at run time) number of files but at the same time the number of members in the bean class cannot be changed dynamically. So we either need a way to add members to a form bean dynamically or some other mechanism which will handle this multiple upload requirement. With Regards, Viral how can I mak the list of FormFile in the form bean I tried implementing it but got an exception of type mismatch I did somthin lik this private FormFile theFiles[]; public FormFile[] getTheFiles() { return theFiles; } /** * @param theFiles The FormFile to set. */ public void setTheFiles(FormFile[] theFiles) { this.theFiles = theFiles; } how can I do it plz reply soon, waiting.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing Parameters to ActionForward from Action
Hi Gunduz, At first place having to much session information using session.setAttribute will make the middleware to consume lot of memory. And, In an application where there will be more users who could be online at the same point of time. It is design constraint not to put lot of information in session. So, This can be done only by passing parameters to the page. But, I couldn't understand (came across) how to pass parameters to a jsp from Action. If you came across anything about how to pass parameters to a jsp page let me know. Thanks you very much, Siva -Original Message- From: Gunduz Can Topal [mailto:[EMAIL PROTECTED] Sent: Monday, February 13, 2006 6:42 PM To: 'Struts Users Mailing List' Subject: RE: Passing Parameters to ActionForward from Action I am new to struts, there might be better ways to make this work. You can maintain state information with session registery or http parameters.. A working example: struts-config.xml --- form-beans form-bean name=loginForm type=com.trend.forms.loginForm/ /form-beans action path=/login input=/chatwalk.jsp type=com.trend.actions.loginAction name=loginForm scope=request validate=true forward name=exception path=/exception.jsp / forward name=success path=/myChatwalk.jsp/ forward name=failure path=/chatwalk.jsp?auth=invalidamp;nav=main/ /action -loginAction.java - public final class loginAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CWUtil util = new CWUtil(); CWDAO service = new CWDAO(); HttpSession session = request.getSession(); String auth = null; ActionForward ret = null; userBean user = new userBean(); loginForm loginForm = (loginForm) form; loginBean login = new loginBean(); BeanUtils.copyProperties( login, loginForm ); try{ auth = service.login(login); if(!auth.startsWith(Ex)){ user = util.parseLogin(auth); session.setAttribute(user,user); ret = mapping.findForward(success); }else{ ret = mapping.findForward(failure); } }catch(Exception e){ System.out.println(exception at login action + e.getMessage()); ret = mapping.findForward(exception); } return ret; } } loginForm.java package com.trend.forms; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; public class loginForm extends ActionForm { String username,password; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request ) { ActionErrors errors = new ActionErrors(); HttpSession session = request.getSession(); if ( getUsername() == null || getUsername().trim().length() == 0 ) { errors.add(username,new ActionMessage(errors.required,username)); session.setAttribute(loginError,true); }if ( getPassword() == null || getPassword().trim().length() == 0 ) { errors.add(password,new ActionMessage(errors.required,password)); session.setAttribute(loginError,true); } return errors; } } ---loginBean.java--- package com.trend.beans; public class loginBean { String username,password; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } } -Original Message- From:
AW: Re: [Shale] Property in ViewController Backing Bean is null
Hi Jason, I'm a real newbie to JSF and Shale, but maybe the tip that Craig gave me about setting the immediate flag in the commandbutton could help you. Then validation is skipped, as far as I understood it. This helped me with my first problem. Maybe you can use it, too. Then you could remove the H. :) Greetings, Peter I think you may running into a simular problem that I ran into. I have the following scenario: page 1 has the user choose from a list of options. On page 2, the form saves the selected option of page 1 in a hidden field in its form. In addition the selected value from page 1 is used to populate a pull down on page 2. So the user hits the submit button on page 2 to save the changes and KA-BLAMMO, I get a NPE. What was happening was the JSF was attempting to Validate the pulldown values in the Validation phase. This was before any of the hidden fields were set. So because the hidden fields weren't set, the retrieve of the pulldown was failing. I saw 1 of 2 solutions: 1) Turn off the validation of the pulldown. Because, hey... why would I need to validate a pulldown? - it isn't like a user can mistype something. OR 2) somehow get the hidden fields to be set before any retrieval of the pulldown is made. The JSF mailing list from Sun gave no help for turning off the validator for the pulldown. So I had to do the following, for which I give myself a big Capital H for HACK. In the contructor of the backing bean, I grabbed the request parameters myself and called the setters from there for the values that were needed to get through the validation of the pulldown. Perhaps someone here can help turn off the need to retrieve the pulldown values in the validation phase. I hope this will help your situation, as well. Cheers, Jason On 2/14/06, Gary VanMatre [EMAIL PROTECTED] wrote: From: Peter Goetz [EMAIL PROTECTED] Hi again, I tried the whole weekend, but I didn't get any results other than those mentioned in the email below. Shall I send some code to illustrate the problem or is it really so unusual, what I'm trying to do? Make sure that you have a navigation rule setup to handle the immediate command button. Try adding a rule that directs you to the target viewid (sounds like the page you are submitting from). If you don't have a navigation case, I think the veiw is just restored using the submitted values. navigation-rule from-view-id/somepage.jsp/from-view-id navigation-case from-outcomeedit/from-outcome to-view-id/somepage.jsp/to-view-id /navigation-case /navigation-rule Thanks a lot for any help! Peter Gary - 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]
AW: Re: [Shale] Property in ViewController Backing Bean is null
Hello Gary! [...] Make sure that you have a navigation rule setup to handle the immediate command button. Try adding a rule that directs you to the target viewid (sounds like the page you are submitting from). If you don't have a navigation case, I think the veiw is just restored using the submitted values. navigation-rule from-view-id/somepage.jsp/from-view-id navigation-case from-outcomeedit/from-outcome to-view-id/somepage.jsp/to-view-id /navigation-case /navigation-rule I tried your tip yesterday and it seems to do the trick. Thank you very much! Until then my action methods were void, because I didn't know that you have to have navigation to get the jsf reloaded complete. I thought Well, it's being reloaded, so everythings all right. I will try this further tonight at home, but I think that was the missing link for me to get really startet with Shale. Thanks a lot and keep up the good work here, I really start to like Shale. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]