Problem with maintaining a database connection in a session bean
Hi, I'm trying to build a small pilot application with Struts. My ultimate goal is a dynamic web application with intensive use of database. My database is Oracle 8. The problem is following: in 'LoginAction' I set up a database connection (java.sql.Connection variable) with Oracle database. I save it in the User session bean as a bean-variable. Then I test it in a jsp-page. Everything seems to work: the variable containing the database connection is created and put into User bean (something like ...setConnection(connection)). The first time the jsp-page works well: the connection comes from conn=user.get_connection(), I can send a select-query to the database and display the outcome etc. But if I refresh the jsp-page, then at a certain moment an error message is displayed: java.sql.SQLException: Closed Connection I undestand that the connection gets somehow lost in the session bean. This happens especially when I test with two parallel sessions (one from IE and another from Netscape). Can anyone help me? Where could the connection go lost? Thanks, George. P.S I have to save a connection with every session because this way I can get user info from the database and administer database privileges. I can't use just a connection pool and get a connection from there every time I need something from the database. I have to lock records, maintain transactions etc., so every user/session needs to have an individual database connection. - Teatri- , kino- ja kontserdipiletid nüüd hiirekliki kaugusel! http://www.hot.ee -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Nested Tags question
On Thu, 13 Jun 2002, Arron Bates wrote: Date: Thu, 13 Jun 2002 14:14:13 +1000 From: Arron Bates [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Nested Tags question I know JSP will automatically save parameters to a javabean with the correctly named getters and setters, but there's obviously a gap in my knowledge because all my attempts to recreate the situation above have failed. Setting form properties against beans is a Struts thing, not a JSP thing. The property thing is a Bean thin and can be looked up in the JavaBean spec. The example you quote... monkeyTeamAlpha.monkeyWorkers[0].salary ...is a nested property. An invention implemented within Struts (Craig?). Yep, although in Struts 1.1 it is really a commons-beanutils thing because we abstracted out this generally useful code into a separate package. What it basically is, is a string of calls rather than the single property method. Here, it will get a hold of the form bean, get a hold of the bean returned from the monkeyTeamAlphaproperty. On this bean, it will invoke the indexed property monkeyWorkers[0] which will pluck a bean from a collection or index provided, from this last bean it will will get a hold of its salary property, and set the value. At each stage, you also get the benefit of some intelligence that is built in to the underlying PropertyUtils class. For example, the JavaBeans spec defines two ways to define an indexed property -- you can use getter and setter methods that take a value and a subscript, or you can use getter and setter methods that return the entire array. PropertyUtils makes the expression listed above work for either (or even for a property whose value is a java.util.List, which is an extension to the JavaBeans spec). All this boils down to, is that you can compose objects a little cleaner, rather than have truly enormous beans for everything. Having the indexed properties allows for lists and whatever else. The ability for nesting beans has been in Struts for a long time. The nested tags just make it much easier. There's a primer and tutorial for nested beans here... http://www.keyboardmonkey.com/next ...it should take you over creating and using such a construct. Hope this gets you on th path you're after. Another area of useful learning for the future is the JSP Standard Tag Library (JSTL). Although the expression language syntax supported by JSTL is different from the one in Struts, it is well worth learning about -- this expression language will be supported anywhere in a JSP page in JSP 1.3, and (in the mean time) we will likely adapt Struts tags to be able to use it as well. Arron. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: thread safety
Using the request scope can be troublesome to say the least. In my app I obtain an object (via an abstraction layer) from the j2ee side and I need to present certain properties of it in the form (via the action form), and then when the request comes back in from this form I need to compare various fields to see if they have changed and only then do certain things. While I could look up the object again, this seems most inefficient. Also, how do we deal with the situation where we need to build up information over a series of requests before we can actually save it or do something with it (ie: wizards etc...) -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 14:17 To: Struts Users Mailing List Subject: Re: thread safety On Wed, 12 Jun 2002, Noah Levitt wrote: Date: Wed, 12 Jun 2002 19:57:39 -0400 From: Noah Levitt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: thread safety Hello struts users, The issue of thread safety bugs me. It seems as though it is standard practice to write servlets thread-*unsafely*. The odds of it ever being a problem are slim, but still. It seems to me that form bean setters (and probably getters) should be synchronized. I found the following two quotes from Craig McClanahan. To me, they seem contradictory. However, even if we use the that's going to be real unusual standard, shouldn't we synchronize setters, since, in theory, it's the only thread-safe thing to do? http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml Craig: For the form beans, you are creating them in a particular user's session. If the user does two submits to the same form at the same time you might have overlapping setXxx method calls going on, but that's going to be real unusual. http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml Craig: It is surprisingly easy to have multiple requests active at the same time for the same session. The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig Noah -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: thread safety
Also, how do we deal with the situation where we need to build up information over a series of requests before we can actually save it or do something with it (ie: wizards etc...) In reply to an earlier post regarding something similar, my idea is to encapsulate the information required for the wizard in a DVO and not a form bean. This helps keep form beans in request and thus enables thread safety. On each page of the wizard, you update the DVO with the values in the form bean and only keep the DVO in session. I agree with Craig when he says that the form bean should only be kept in request scope. Rgs Vikram -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 14:17 To: Struts Users Mailing List Subject: Re: thread safety On Wed, 12 Jun 2002, Noah Levitt wrote: Date: Wed, 12 Jun 2002 19:57:39 -0400 From: Noah Levitt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: thread safety Hello struts users, The issue of thread safety bugs me. It seems as though it is standard practice to write servlets thread-*unsafely*. The odds of it ever being a problem are slim, but still. It seems to me that form bean setters (and probably getters) should be synchronized. I found the following two quotes from Craig McClanahan. To me, they seem contradictory. However, even if we use the that's going to be real unusual standard, shouldn't we synchronize setters, since, in theory, it's the only thread-safe thing to do? http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml Craig: For the form beans, you are creating them in a particular user's session. If the user does two submits to the same form at the same time you might have overlapping setXxx method calls going on, but that's going to be real unusual. http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml Craig: It is surprisingly easy to have multiple requests active at the same time for the same session. The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig Noah -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: workflow example explaination.
But when I serached for the methods like setPrimaryWorkflow, setNewState(), and setNextState() in SuccessAction class or GenericAction class, I couldn't. where are these methods data members defined. It is the class ApplicationMapping, these methods are defined in. You also need to tell the Struts Servlet to use this mapping instead of the standard action mapping by this entry in web.xml (see the test application that is provided with the workflow extension package): init-param param-namemapping/param-name param-valuecom.livinglogic.struts.workflow.ApplicationMapping /param-value /init-param Please note: this works for Struts 1.0.x only, because the action mappings are defined differently in Struts 1.1. I'm not able to map actually. In the struts-config.xml, set-property property=primaryWorkflow value=login / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/login.jspp / what does value 1 signify for property newState...? does it efine some kind of sequence...?? What it says is: - newState: when this action is executed set the state of the login workflow to 1 and - nextState: any action that is following must belong to the workflow login and must set this workflow's state to 2 (otherwise a control flow exception is encountered) Please explain comprehensively with the progression of screens.. Please look at the test application and work through it thoroughly. This should demonstrate the ideas behind the workflow package pretty well. --- Matthias -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tile config using tileplugin?
Subject: Re: tile config using tileplugin? From: Torgeir Veimo [EMAIL PROTECTED] === Cedric Dumoulin wrote: Tiles plugin is not available yet. I have started to implement it, but haven't finalize it. It is an error that it appear in the distribution ;-(. Certainly a commit done late in the night ... Ok, I'm allready using it with the added stuff, and it kind-of works and kind-of not. Before releasing it, I have to decide on a coherent scheme for Tiles factory : * one factory for each subapps or one for all subapps ? This is probably needed to get the automatic prefix? * do we automatically prefix definition names with subapps name ? The idea of the subapp stuff is that the subapp shouldn't need to know its own name. I pratice this would be to allways prefix. a forward can be context relative, meaning it will not be prefixed, eg. forward path=/selection.do name=/selection contextRelative=true/ . * How do we deal with default subapps ? * How can we refer to definitions common to all subapps ? contextRelative=true? Also, I noticed classes called UntyppedAttribute. Is there a reason for this unusual spelling? -- -Torgeir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
nested tags doubt by radhika
hi, Has anyone used nested:text tag, or any other tag like nested:checkbox etc ? Can anyone provide any info. on it _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: nested tags doubt by radhika
Yeah I have tried out most of the nested tags. What kind of info r u looking for. -Original Message- From: Radhika Nadkarni [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:34 PM To: [EMAIL PROTECTED] Subject: nested tags doubt by radhika hi, Has anyone used nested:text tag, or any other tag like nested:checkbox etc ? Can anyone provide any info. on it _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Problem with maintaining a database connection in a session bean
Georges, It is not recommended that you place the Connection in the users session. This is a potential hazard which can cause lots of open connections to the database. It is also not recommended that you have database interaction directly in your Action classes. Its best to encapsulate database interaction within a business object. If User is your business object, then something like User.login(userId, password); , where the login() of User contains all the necessary logic for logging the customer into the system (querying the database, validating password, etc...) The architecture of the business layer in Struts has been a topic of much discussion on this list. Search the archives for DAO (data access object). -Display the login screen -User submits request to login -LoginAction extracts the user id and password from the form -LoginAction gets User object -User object logs in the user -LoginAction forwards to next step This way the Connection is accessed, used, closed and released in a single business method which is reusable. HTH, robert -Original Message- From: Georges [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:21 AM To: [EMAIL PROTECTED] Subject: Problem with maintaining a database connection in a session bean Hi, I'm trying to build a small pilot application with Struts. My ultimate goal is a dynamic web application with intensive use of database. My database is Oracle 8. The problem is following: in 'LoginAction' I set up a database connection (java.sql.Connection variable) with Oracle database. I save it in the User session bean as a bean-variable. Then I test it in a jsp-page. Everything seems to work: the variable containing the database connection is created and put into User bean (something like ...setConnection(connection)). The first time the jsp-page works well: the connection comes from conn=user.get_connection(), I can send a select-query to the database and display the outcome etc. But if I refresh the jsp-page, then at a certain moment an error message is displayed: java.sql.SQLException: Closed Connection I undestand that the connection gets somehow lost in the session bean. This happens especially when I test with two parallel sessions (one from IE and another from Netscape). Can anyone help me? Where could the connection go lost? Thanks, George. P.S I have to save a connection with every session because this way I can get user info from the database and administer database privileges. I can't use just a connection pool and get a connection from there every time I need something from the database. I have to lock records, maintain transactions etc., so every user/session needs to have an individual database connection. - Teatri- , kino- ja kontserdipiletid n||d hiirekliki kaugusel! http://www.hot.ee -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: nested tags doubt by radhika
hi, wat is the diff. between nested:text and html:text tags ?? Help reqd. urgently From: Radhika Nadkarni [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: nested tags doubt by radhika Date: Thu, 13 Jun 2002 09:04:15 + hi, Has anyone used nested:text tag, or any other tag like nested:checkbox etc ? Can anyone provide any info. on it _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
serially numbered table
I want to have a serially numbered table. I have a formbean which contains an array of objects which I'm going to display. I don't want to save the numberes in these objects. So in the formbean I wrote a getId() and a setId(int i) method. The formbean holds a counter which gets increased when calling getId(). nested:form action=/saveCalendarSetting.do scope=session table nested:iterate property=cnCalendarListVMI tr td CLASS=Innercellcenter NOWRAPbean:write name=CalendarListForm scope=session property=id//td td CLASS=Innercells NOWRAPnested:write property=strOU_dc //td td CLASS=Innercells NOWRAPnested:write property=strCU_dc //td td CLASS=Innercellcenter NOWRAPnested:checkbox property=mbChanged value=on//td /tr /nested:iterate /table html:submit property=submitButton value=submit / /nested:form Is there a better method doing this? Hanel Matthias Fachinformatiker (Anwendungsentwicklung) in Ausbildung Logistik World GmbH Fon:+49-841-9014-300 Marie-Curie-Strasse 6 Fax:+49-841-9014-302 D- 85055 Ingolstadt mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re: nested tags doubt by radhika
nested:text is based on html:text but has added functionality to allow you to nest the tags to reflect beans nested in the formbean, like Russian Dolls. Check out the archives here, check out the tutorials at www.keyboardmonkey.com Adam Radhika Nadkarni [EMAIL PROTECTED] schrieb am 13.06.2002, 11:29:48: hi, wat is the diff. between and tags ?? Help reqd. urgently From: Radhika Nadkarni Reply-To: Struts Users Mailing List To: [EMAIL PROTECTED] Subject: nested tags doubt by radhika Date: Thu, 13 Jun 2002 09:04:15 + hi, Has anyone used tag, or any other tag like etc ? Can anyone provide any info. on it _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: For additional commands, e-mail: _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re: Nested Tags question
So Craig, does the process work at submit time (when the request parameters are being put into the nested beans) via calls to the getter methods to get the beans on which the parameters have to be set? I can't see how else it would work. Adam Craig R. McClanahan [EMAIL PROTECTED] schrieb am 13.06.2002, 08:22:43: On Thu, 13 Jun 2002, Arron Bates wrote: Date: Thu, 13 Jun 2002 14:14:13 +1000 From: Arron Bates Reply-To: Struts Users Mailing List To: Struts Users Mailing List Subject: Re: Nested Tags question I know JSP will automatically save parameters to a javabean with the correctly named getters and setters, but there's obviously a gap in my knowledge because all my attempts to recreate the situation above have failed. Setting form properties against beans is a Struts thing, not a JSP thing. The property thing is a Bean thin and can be looked up in the JavaBean spec. The example you quote... monkeyTeamAlpha.monkeyWorkers[0].salary ...is a nested property. An invention implemented within Struts (Craig?). Yep, although in Struts 1.1 it is really a commons-beanutils thing because we abstracted out this generally useful code into a separate package. What it basically is, is a string of calls rather than the single property method. Here, it will get a hold of the form bean, get a hold of the bean returned from the monkeyTeamAlphaproperty. On this bean, it will invoke the indexed property monkeyWorkers[0] which will pluck a bean from a collection or index provided, from this last bean it will will get a hold of its salary property, and set the value. At each stage, you also get the benefit of some intelligence that is built in to the underlying PropertyUtils class. For example, the JavaBeans spec defines two ways to define an indexed property -- you can use getter and setter methods that take a value and a subscript, or you can use getter and setter methods that return the entire array. PropertyUtils makes the expression listed above work for either (or even for a property whose value is a java.util.List, which is an extension to the JavaBeans spec). All this boils down to, is that you can compose objects a little cleaner, rather than have truly enormous beans for everything. Having the indexed properties allows for lists and whatever else. The ability for nesting beans has been in Struts for a long time. The nested tags just make it much easier. There's a primer and tutorial for nested beans here... http://www.keyboardmonkey.com/next ...it should take you over creating and using such a construct. Hope this gets you on th path you're after. Another area of useful learning for the future is the JSP Standard Tag Library (JSTL). Although the expression language syntax supported by JSTL is different from the one in Struts, it is well worth learning about -- this expression language will be supported anywhere in a JSP page in JSP 1.3, and (in the mean time) we will likely adapt Struts tags to be able to use it as well. Arron. Craig -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: workflow example explaination.
Struts 1.1b1 give us a chance to customize an ActionMapping in a per action basis rather than doing it for the whole app in web.xml. Just place in your action definition in struts-config something like: action path=/ type=.. name= .. className=com.mapfre.general.upload.YourNewActionMapping/ Adolfo From: Anjali Jain [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: workflow example explaination. Date: Thu, 13 Jun 2002 14:35:48 +0530 thanx a lot Matthias. I will now try to implement it. -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:31 PM To: Struts Users Mailing List Subject: Re: workflow example explaination. But when I serached for the methods like setPrimaryWorkflow, setNewState(), and setNextState() in SuccessAction class or GenericAction class, I couldn't. where are these methods data members defined. It is the class ApplicationMapping, these methods are defined in. You also need to tell the Struts Servlet to use this mapping instead of the standard action mapping by this entry in web.xml (see the test application that is provided with the workflow extension package): init-param param-namemapping/param-name param-valuecom.livinglogic.struts.workflow.ApplicationMapping /param-value /init-param Please note: this works for Struts 1.0.x only, because the action mappings are defined differently in Struts 1.1. I'm not able to map actually. In the struts-config.xml, set-property property=primaryWorkflow value=login / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/login.jspp / what does value 1 signify for property newState...? does it efine some kind of sequence...?? What it says is: - newState: when this action is executed set the state of the login workflow to 1 and - nextState: any action that is following must belong to the workflow login and must set this workflow's state to 2 (otherwise a control flow exception is encountered) Please explain comprehensively with the progression of screens.. Please look at the test application and work through it thoroughly. This should demonstrate the ideas behind the workflow package pretty well. --- Matthias -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Power your enterprise with custom solutions in eLearning and Knowledge Management from NIIT - Knowledge Solutions. For details visit our website http://www.ksb.niit.com ___NOTICE This electronic mail transmission contains confidential information intended only for the person(s) named. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you received this transmission in error, please notify the sender by reply e-mail and then destroy the message. Opinions, conclusions, and other information in this message that do not relate to the official business of NIIT shall be understood to be neither given nor endorsed by NIIT When addressed to NIIT clients, any information contained in this e-mail is subject to the terms and conditions in the governing client contract. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] HTML HEAD TITLEAdolfo's signature/TITLE /HEAD BODY centerbemAdolfo Rodriguez Miguelez/emb/center /BODY /HTML _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts Design/construction process. question
You might take a look at the Artimus example application. http://husted.com/struts/resources/artimus.zip This doesn't use custom Actions classes for most operations, and the ones I did use were mostly for show. There's a single framework Action that calls a business operation, the same way the Struts ActionServlet calls an Action. The difference is the business operation is not tied to Struts or HTTP, and can be unit tested using conventional tools. These business beans could be the disconnected components your project manager wants people to pump out. Someone would then connect the dots in the Struts config by associating URIs with the business operations. I'd also recommend using a single coarse-grained ActionForm for all your pages. Then subclass that for specific validations if needed. In a 1.0 team setting, this ActionForm can be maintained like the deployment descriptor or struts-config (usually by a designated guru). In 1.1, there can be a coarse-grained bean for each module, or you can switch over to a Map-based ActionForm or a DynaBean. The classes and architecture in Artimus is based on code developed for the Adalon tool, which Synthis kindly donated back to the ASF. http://synthis.com/ -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services [EMAIL PROTECTED] wrote: This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template (that would compile and run ), so it seems to me that the final code in the perform method would be added while brining the page to life. I would enjoy hearing other stories. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: workflow example explaination.
Your are right. This is exactly the place where the setters are located. Andre Beskrowni wrote: i thought that the usage of set-property below required the *ActionMapping*, not the Action, to have the appropriate setters. certainly it works if you specify an ActionMapping that has the necessary mutator methods, and that would seem to be the cleaner way of doing things since it doesn't require your Action instance to store any local values. ab -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 12:07 PM To: Struts Users Mailing List Subject: Re: workflow example explaination. The set-property tag is a general way to set JavaBeans properties on an underlying implementation class, even though the property name is not defined as a valid element in the DTD. !-- Display login -- action path=/displayLoginAction type=com.livinglogic.struts.workflow.SuccessAction set-property property=primaryWorkflow value=login / set-property property=newState value=1 / set-property property=nextState value=2 / forward name=success path=/login.jspp / /action This logic assumes that the SuccessAction class has public setter methods setPrimaryWorkflow(), setNewState(), and setNextState() -- you can still configure them in struts-config.xml even though these property names are not allowed on the action element itself. Many of the Struts elements allow set-property tags to be nested inside -- check out the Struts DTD for more information. Craig _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tiles question
Hi, can I mix servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class and my own RequestProcessor with Tiles and Struts 1.1? Do I have the full functionality of Tiles while keeping the functionality of my own RequestProcessor? Or, questioned the other way round: Do I need the TilesRequestProcessor for Struts 1.1? Thanks, Udo. Wellie W. Chao wrote: What version of struts are you using? I'm using 1.1 beta 1, and the forward to tiles definition feature works just fine. My action tags look just like what you specified. You may need to check and make sure you have the proper settings in web.xml. In web.xml, you should have: servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class Also, in struts-config.xml, you should have: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor nocache=true/ (You can change the nocache if you want) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 5:25 PM To: [EMAIL PROTECTED] Subject: tiles question Hi, Is it possible to call a tiles layout definition from an action tag in my struts-config.xml file? Here's the tag in my struts-config.xml: actionpath=/resources forward=site.resources.page/ Here's the definition in my tiles-defs.xml: definition name=site.resources.page extends=site.mainLayout put name=body value=/tiles/resources.jsp / /definition When I try to invoke this action forward I get an exception: java.lang.IllegalArgumentException: Path site.services.page does not start with a / character The forward tag is expecting a value like '/resources.jsp', not a tiles layout. Is what I'm trying to do possible? Thanks, Eric. ** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: serially numbered table
- Original Message - I want to have a serially numbered table. I have a formbean which contains an array of objects which I'm going to display. I don't want to save the numberes in these objects. So in the formbean I wrote a getId() and a setId(int i) method. The formbean holds a counter which gets increased when calling getId(). nested:form action=/saveCalendarSetting.do scope=session table nested:iterate property=cnCalendarListVMI tr td CLASS=Innercellcenter NOWRAPbean:write name=CalendarListForm scope=session property=id//td td CLASS=Innercells NOWRAPnested:write property=strOU_dc //td td CLASS=Innercells NOWRAPnested:write property=strCU_dc //td td CLASS=Innercellcenter NOWRAPnested:checkbox property=mbChanged value=on//td /tr /nested:iterate /table html:submit property=submitButton value=submit / /nested:form Is there a better method doing this? I don't know about the nested tag, but the logic:iterate tag has an indexId parameter, which already holds the relative positioning within the collection. nested:iterate property=cnCalendarListVMI indexId=serialNumber [...] -- -- Hanel Matthias Fachinformatiker (Anwendungsentwicklung) in Ausbildung Logistik World GmbH Fon: +49-841-9014-300 Marie-Curie-Strasse 6 Fax: +49-841-9014-302 D- 85055 Ingolstadtmailto:[EMAIL PROTECTED] -- -- /mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: struts-user Digest 7 Jun 2002 16:18:07 -0000 Issue 1540
On Fri, 2002-06-07 at 12:18, [EMAIL PROTECTED] wrote: From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 22:26 To: Struts (E-mail); Servlets (E-mail); J2ee (E-mail) Subject: Java Website ISP I fired my ISP yesterday for refusing to support server-side Java and am now actively looking at alternatives. I was surprised to find that there are only about 70 ISPs in the US supporting server-side Java. The good news is that most use Tomcat 3.2 on Apache and support JDK 1.3.1, Servlet 2.2 and JSP 1.1 with access to MySQL, and all that I have contacted are planning to upgrade to Tomcat 4.0x, JDK 1.4, Servlet 2.3 and JSP 1.2 within the next 8 weeks. One (SpinWeb.com) even will let you upload your own versions of Tomcat and JDK. The bad news is prices range from $350/year to $750 and I have no qualitative anecdotes regarding the level of service any provide. If anyone has first-hand knowledge of same, I'd appreciate the information. I want to make a decision in the next couple of hours so I can (hopefully) get the new DNS IPs propagated by tomorrow night. Thanks, Mark I've been using http://www.webpipe.net for about a year now and they do a great job for a good price. Les -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tiles question
You need the TilesRequestProcessor and ActionComponentServlet with Struts1.1. ActionComponentServlet takes in charge Tiles initialization. TilesRequestProcessor takes in charge Struts forward catching. You can have your own request processor extending the Tiles one, allowing functionalities from both. Hope this help, Cedric Udo Walker wrote: Hi, can I mix servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class and my own RequestProcessor with Tiles and Struts 1.1? Do I have the full functionality of Tiles while keeping the functionality of my own RequestProcessor? Or, questioned the other way round: Do I need the TilesRequestProcessor for Struts 1.1? Thanks, Udo. Wellie W. Chao wrote: What version of struts are you using? I'm using 1.1 beta 1, and the forward to tiles definition feature works just fine. My action tags look just like what you specified. You may need to check and make sure you have the proper settings in web.xml. In web.xml, you should have: servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class Also, in struts-config.xml, you should have: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor nocache=true/ (You can change the nocache if you want) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 5:25 PM To: [EMAIL PROTECTED] Subject: tiles question Hi, Is it possible to call a tiles layout definition from an action tag in my struts-config.xml file? Here's the tag in my struts-config.xml: actionpath=/resources forward=site.resources.page/ Here's the definition in my tiles-defs.xml: definition name=site.resources.page extends=site.mainLayout put name=body value=/tiles/resources.jsp / /definition When I try to invoke this action forward I get an exception: java.lang.IllegalArgumentException: Path site.services.page does not start with a / character The forward tag is expecting a value like '/resources.jsp', not a tiles layout. Is what I'm trying to do possible? Thanks, Eric. ** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tiles question
Hi, yes this helped. If I extend TilesRequestProcessor I only have to call the super methods first and then do my stuff? Thanks, Udo Cedric Dumoulin wrote: You need the TilesRequestProcessor and ActionComponentServlet with Struts1.1. ActionComponentServlet takes in charge Tiles initialization. TilesRequestProcessor takes in charge Struts forward catching. You can have your own request processor extending the Tiles one, allowing functionalities from both. Hope this help, Cedric Udo Walker wrote: Hi, can I mix servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class and my own RequestProcessor with Tiles and Struts 1.1? Do I have the full functionality of Tiles while keeping the functionality of my own RequestProcessor? Or, questioned the other way round: Do I need the TilesRequestProcessor for Struts 1.1? Thanks, Udo. Wellie W. Chao wrote: What version of struts are you using? I'm using 1.1 beta 1, and the forward to tiles definition feature works just fine. My action tags look just like what you specified. You may need to check and make sure you have the proper settings in web.xml. In web.xml, you should have: servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class Also, in struts-config.xml, you should have: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor nocache=true/ (You can change the nocache if you want) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 5:25 PM To: [EMAIL PROTECTED] Subject: tiles question Hi, Is it possible to call a tiles layout definition from an action tag in my struts-config.xml file? Here's the tag in my struts-config.xml: actionpath=/resources forward=site.resources.page/ Here's the definition in my tiles-defs.xml: definition name=site.resources.page extends=site.mainLayout put name=body value=/tiles/resources.jsp / /definition When I try to invoke this action forward I get an exception: java.lang.IllegalArgumentException: Path site.services.page does not start with a / character The forward tag is expecting a value like '/resources.jsp', not a tiles layout. Is what I'm trying to do possible? Thanks, Eric. ** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Validator 1.1 -- Solution WIll Not WOrk
The solution given below does not work for the case I described. jsType.jsp defines one form with several masked field validations. The example I'm having difficulty with is multiple forms with multiple fields with masked field validation which causes the Struts Validator to generate multiple versions of the function function mask () {} for each of the validator:javascript entries shown below: (1) validator:javascript formName=form1 dynamicJavascript=true staticJavascript=false/ (2) validator:javascript formName=form2 dynamicJavascript=true staticJavascript=false/ The first validator tag generates the following code (note the function mask() ) SCRIPT LANGUAGE=Javascript1.1 !-- Begin var bCancel = false; function validateForm1(form) { if (bCancel) return true; else return validateMask(form); } function mask () { this.aa = new Array(field6, Field 6 is invalid., new Function (varName, this.mask=/^\\d{7}/; return this[varName];)); } // End -- /SCRIPT while the second validator tag generates the following code (note the additional function mask() : NAMING CONFLICT ) SCRIPT LANGUAGE=Javascript1.1 !-- Begin var bCancel = false; function validateOmpModel(form) { if (bCancel) return true; else return validateRequired(form) validateMask(form) validateMaxLength(form) validateMinLength(form) validateInteger(form) validateRange(form); } function mask () { this.aa = new Array(field1, Field 1 is invalid., new Function (varName, this.mask=/^\\d{6}/; return this[varName];)); this.ab = new Array(field2, Field 2 is invalid., new Function (varName, this.mask=/^[ALST]/; this.maxlength='1'; return this[varName];)); this.ac = new Array(field3, Field 3 is invalid., new Function (varName, this.mask=/^\\d{6}/; this.maxlength='6'; return this[varName];)); this.ad = new Array(field4, Field 4 is invalid., new Function (varName, this.mask=/^\\d{1}/; return this[varName];)); this.ae = new Array(field5, Field 5 is invalid., new Function (varName, this.mask=/^\\c{1}/; return this[varName];)); } // End -- /SCRIPT In the static JavaScript generated by the following tag script language=JavaScript1.1 src=../includes/staticStrutsValidatorJavascript.jsp/script staticStrutsValidatorJavascript.jsp %@ page language=java % %-- set document type to Javascript (addresses a bug in Netscape according to a web resource --% %@ page contentType=application/x-javascript % %@ taglib uri=/WEB-INF/struts-validator.tld prefix=validator % validator:javascript dynamicJavascript=false staticJavascript=true/ - the problem lies in the last statement shown in the code listing below which is defined in validator-rules.xml and generated by the static JavaScript validator name=mask classname=org.apache.struts.validator.util.StrutsValidator method=validateMask depends=required msg=errors.invalid javascript![CDATA[ function validateMask(form) { var bValid = true; var focusField = null; var i = 0; var fields = new Array(); oMasked = new mask(); When the function runs the line oMasked = new mask();, it always retrieves the second mask() and thereby errs when attempting to validate the first form since (in the example I gave above), there is no field by the name of field6 in the second function mask() instance ( I get a JavaScript error on the following line form[oMasked[x][0]].value since form[oMasked[x][0]] is undefined ). I hope I have been clearer about the problem now. The solution I had in mind was to modify the Struts Validator to generate custom validation functions. So, for the example I gave above, it would generate the following functions: function maskForm1() { } function maskForm2() { }
Re: tiles question
Udo Walker wrote: Hi, yes this helped. If I extend TilesRequestProcessor I only have to call the super methods first and then do my stuff? Yes. But only for methods you overload (like init(...), doInclude(...), doForward(...)). Otherwise don't care about them. Cedric Thanks, Udo Cedric Dumoulin wrote: You need the TilesRequestProcessor and ActionComponentServlet with Struts1.1. ActionComponentServlet takes in charge Tiles initialization. TilesRequestProcessor takes in charge Struts forward catching. You can have your own request processor extending the Tiles one, allowing functionalities from both. Hope this help, Cedric Udo Walker wrote: Hi, can I mix servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class and my own RequestProcessor with Tiles and Struts 1.1? Do I have the full functionality of Tiles while keeping the functionality of my own RequestProcessor? Or, questioned the other way round: Do I need the TilesRequestProcessor for Struts 1.1? Thanks, Udo. Wellie W. Chao wrote: What version of struts are you using? I'm using 1.1 beta 1, and the forward to tiles definition feature works just fine. My action tags look just like what you specified. You may need to check and make sure you have the proper settings in web.xml. In web.xml, you should have: servlet-nameaction/servlet-name servlet-classorg.apache.struts.tiles.ActionComponentServlet/servlet-class Also, in struts-config.xml, you should have: controller processorClass=org.apache.struts.tiles.TilesRequestProcessor nocache=true/ (You can change the nocache if you want) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 5:25 PM To: [EMAIL PROTECTED] Subject: tiles question Hi, Is it possible to call a tiles layout definition from an action tag in my struts-config.xml file? Here's the tag in my struts-config.xml: actionpath=/resources forward=site.resources.page/ Here's the definition in my tiles-defs.xml: definition name=site.resources.page extends=site.mainLayout put name=body value=/tiles/resources.jsp / /definition When I try to invoke this action forward I get an exception: java.lang.IllegalArgumentException: Path site.services.page does not start with a / character The forward tag is expecting a value like '/resources.jsp', not a tiles layout. Is what I'm trying to do possible? Thanks, Eric. ** This message, including any attachments, contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, please contact sender immediately by reply e-mail and destroy all copies. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. TIAA-CREF ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JavascriptValidatorTag and Indexed Fields
what about what's shown at the following URL: http://home.earthlink.net/~dwinterfeldt/revision.html -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 6:02 PM To: Struts Users Mailing List Subject: Re: JavascriptValidatorTag and Indexed Fields No. It's on the long to do list. David --- Peter Onthrops [EMAIL PROTECTED] wrote: Have there been any updates to JavascriptValidatorTag to handle indexed fields? Thanks, P. - Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template (that would compile and run ), so it seems to me that the final code in the perform method would be added while brining the page to life. I would enjoy hearing other stories. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: WebLogic 6.1SP2 with Struts 1.1b-1
It is definitely a problem with WL6.1 SP2... it has to do with the method commons-logging uses to find the default classloader. I haven't quite figured out what to change, but it's picking the wrong classloader. Putting it in the ear will not work. commons-logging.jar must be in the Weblogic startup classpath, not in the ear. It won't work if it's in the WEB-INF/lib directory either. Also note that I think if you put commons-logging.jar in the startup classpath, then log4j.jar has to be there too. Don't quote me on that, but if you run into problems, try it and see. That makes sense because it is the highest level classloader, so it won't be able to see the ear or webapp classloaders that are extending it. Joe -Original Message- From: McVeigh, Ryan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:25 AM To: [EMAIL PROTECTED] Subject: RE: WebLogic 6.1SP2 with Struts 1.1b-1 I've done this and it didn't work for me. My example put commons-logging.jar in the root of the ear, and the Manifest.mf file in my war referred to it like this: Class-Path: commons-logging.jar Same problem everyone else has mentioned. I believe this is a specific problem with the WebLogic classloader, not a struts or commons logging problem. -Ryan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 8:38 AM To: [EMAIL PROTECTED] Subject: Re: WebLogic 6.1SP2 with Struts 1.1b-1 Mark, Have you tried packaging it as a J2EE app instead of a Web app? app.ear | |-webApp.war | |-META-INF | | | |-application.xml | |-lib | |-commons-logging.jar You would need to provide a manifest file for webApp.war that contained the following: Class-Path: lib/commons-logging.jar The application.xml file would look something like this: !DOCTYPE application PUBLIC -//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN http://java.sun.com/dtd/application_1_3.dtd; application display-nameMy Application/display-name module web web-uriwebApp.war/web-uri context-rootwebApp/context-root /web /module /application I haven't played around with 1.1 or commons logging, but this approach has solved some other class loading issues I've had with WL. Just a thought... -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Sample code for handling variable number of text fields
Hello everybody, This is newbie question. I have a form with the number of textfields on it which are known at runtime only, i.e. depend on the search result on DB. Could anyone send me sample code for this, on how to get the values from the forms (in the Formbean) as well as set vaues in it on re-populate. Help would be greatly appreciated. Thanks, Harjeet. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Two questions
Hi Niall, Thank you very much, My first question is Enabling calling) the reset method to an image that is in jsp. javascript:document.this.reset() is called on image but not working. and I tried with several options by replacing this with form and myForm, But none of them are successful.. In short how can we enable submit and reset button functionality to images?. TIA rayaku -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, 13 June 2002 7:44 AM To: Struts Users Mailing List Subject: RE: Two questions I didn't understand the first question. You can forward in a jsp using the struts forward tag: logic:forward name=sessionexpired/ Niall -Original Message- From: Yaman Kumar [mailto:[EMAIL PROTECTED]] Sent: 12 March 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Two questions Hi, I have 2 questions 1.Regarding calling a method that is in ActionForm from a jsp. Ex: I have an image and i would like to enable reset method to image that is in MyActionForm class. 2. I have a forward that is in global-forwards and i would like to get that in a jsp page, Ex. global-forwards forward name=sessionexpired path=/InvalidSession.jsp/ /global-forwards Can I call sessionexpired forward name in a jsp file rather than writing InvalidSession.jsp?, So that if i change path of this forward in future that should affect in whole web application. TIA rayaku -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 8:52 AM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template (that would compile and run ), so it seems to me that the final code in the perform method would be added while brining the page to life. I would enjoy hearing other stories. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be
Re: Dealing with many JSP files with one Action
Subject: Re: Dealing with many JSP files with one Action From: Eric Rizzo [EMAIL PROTECTED] === Niall Pemberton wrote: I'm sure you can do something more intelligent than duplicating the whole set of jsps for each different language. If the problem is that you need different images for different languages then write your own tag to generate the path for the image based on the localle. I suggest using the pageKey or srcKey attribute of the html:img tag to specify an ApplicationResources key that holds the real image file name. Then your images can be i18ned just like your text. HTH, Eric -- Eric Rizzo Software Developer http://www.jibeinc.com --- A man talking sense to himself is no more insane than a man talking nonsense not to himself...or just as insane. -Rosencrantz and Guildenstern Are Dead -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:19 AM To: struts-user Subject: RE: Struts Design/construction process. question As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 8:52 AM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template (that would compile and run ), so it seems to me that the final code in the perform method would be added while brining the page to life. I would enjoy hearing other stories. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --
Need Urgent help
Hi, I have a problem in using logic:equal tag given below logic:equal name=beaninstance property=method value=A DO SOME. /logic:equal This code is working fine when it is not null. But when ever it { beaninstance.getMethod() } is becoming null, page is getting exception as below... javax.servlet.jsp.JspException: Cannot compare null variable to value A at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193) at org.apache.jsp.HNCTemplate$jsp._jspService(HNCTemplate$jsp.java:317) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) Can any one help me out in this, I tried to break this in logic:equal source file.. TIA rayaku -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Need Urgent help
logic:present name=beaninstance property=method logic:equal name=beaninstance property=method value=A DO SOME. /logic:equal /logic:present -Original Message- From: Yaman Kumar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 10:40 AM To: Struts Users Mailing List Subject: Need Urgent help Hi, I have a problem in using logic:equal tag given below logic:equal name=beaninstance property=method value=A DO SOME. /logic:equal This code is working fine when it is not null. But when ever it { beaninstance.getMethod() } is becoming null, page is getting exception as below... javax.servlet.jsp.JspException: Cannot compare null variable to value A at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193) at org.apache.jsp.HNCTemplate$jsp._jspService(HNCTemplate$jsp.java:317) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) Can any one help me out in this, I tried to break this in logic:equal source file.. TIA rayaku -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
DispatchAction has a lot of things to improve on...use of declarative exceptions is one...then there's this issue you brought up about the validator...you may have to do programmatic validation to provide different validation rules for each method in the DispatchAction for now.. - William W [EMAIL PROTECTED] on 06/13/2002 07:46:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: Validator and DispatchAction I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Need Urgent help
Hi Yaman, Try checking for that property first using a logic:present logic:present name=beaninstance property=method logic:equal name=beaninstance property=method value=A DO SOME. /logic:equal /logic:present Regards Raj -Original Message- From: Yaman Kumar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 10:40 AM To: Struts Users Mailing List Subject: Need Urgent help Hi, I have a problem in using logic:equal tag given below logic:equal name=beaninstance property=method value=A DO SOME. /logic:equal This code is working fine when it is not null. But when ever it { beaninstance.getMethod() } is becoming null, page is getting exception as below... javax.servlet.jsp.JspException: Cannot compare null variable to value A at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:193) at org.apache.jsp.HNCTemplate$jsp._jspService(HNCTemplate$jsp.java:317) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) Can any one help me out in this, I tried to break this in logic:equal source file.. TIA rayaku -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
Yeah, those were the days (sigh). I suspected that was what you meant, but couldn't resist. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 9:33 AM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:19 AM To: struts-user Subject: RE: Struts Design/construction process. question As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 8:52 AM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template
DispatchAction with Image buttons
Is anyone successfully using the DispatchAction with html:image tags??? Jason Rosenblum (SCJD) Contractor ProAct Technologies 914.872.8171 (Voice) 914.872.8100 (Fax) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Form bean factory
Subject: Form bean factory From: Eric Rizzo [EMAIL PROTECTED] === Is there any strategy for having a factory class/method that generates the ActionForm instances? Instead of hard-coding a class name in my struts-config.xml and having Struts call newInstance() on that class, I'd rather be able to specify a class or method that can return an instance based on some logic. Has anyone any ideas for implementing something like this? TIA, Eric -- Eric Rizzo Software Developer Jibe, Inc. http://www.jibeinc.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Any draw backs of using DYNA FORM BEANS....?
Hi All, I justed wanted to see what the genral feeling is about using DYNAFORMBEANS instead of plain old Action Forms, in terms of -- using them with a validator -- transferring the data to a value object aka data tranfer object to hsip it to the next layer (what is the preferred approach to do this using dyna beans) -- Has any one tried to wrap value objects with a dyna bean to make the retreival easy ofcourse or otherwise. Any feed back is highly appreciated Regards Raj -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed Property Validation on a String[]
If all the options are going to have the same name, then this should work logic:iterate id=anOption name=myFormBean property=options html:text name=anOption property=options size=2/ /logic:iterate Since each element is a String, the tag will just that instead of making a property call. I believe that validator may just then apply whatever validation you have set for options to every element of the array. In 1.1, you can use the indexed attribute to number the options, and be sure they go back to the same elements in the array or collection, if that's important. Should just be logic:iterate id=anOption name=myFormBean property=options html:text name=anOption property=options indexed=true/ /logic:iterate For an array, I believe that's all you might need. -T. [EMAIL PROTECTED] wrote: Hi: I have a form bean that contains an attribute defined as a String[]. public class MyFormBean { String[] options = new String[100]; public void setOptions(String[] options) { this.options = options; } public String[] getOptions() { return options; } } I want to be able to display all 100 options in a JSP using the iterate tag. Let's assume that my form bean is stored in the session scope under the attribute named myFormBean. logic:iterate id=anOption name=myFormBean property=options indexId=index html:text indexed=true name=anOption property='?' size=2/nbsp;nbsp; % if ( (index.intValue()+1) % 10 == 0 ) % br /logic:iterate What should be filled in for the property since anOption is a String? Next, I need to set up a field validation in validation.xml. From the following URL, http://home.earthlink.net/~dwinterfeldt/revision.html a suggestion is made to use the following: logic:iterate id=listElement name=registrationForm property=listElementList indexId=index html:textarea indexed=true name=listElement property=value cols=60 rows=8/br /logic:iterate field property=value indexedProperty=listElement indexedListProperty=listElementList depends=required arg0 key=registrationForm.paragraph.displayname/ /field So far, I have the following: field property=? indexedProperty=anOption indexedListProperty=options depends=required arg0 key=label.optionLabel/ /field What should be filled in for the property since anOption is a String? Any help that anyone can provide will be greatly appreciated! Thanks in advance. Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DispatchAction with Image buttons
I haven't to date, but definitely will in my next project so I have done some research on it. From what I can tell neither DispatchAction nor LookupDispatchAction will support this out of the box, but there is a pretty simple modification that can be made to DispatchAction to make it work. I explain my ideas in this thread: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33005.html Unless someone has already implemented this, I will need to and will post it when done. robert --- Rosenblum, Jason [EMAIL PROTECTED] wrote: Is anyone successfully using the DispatchAction with html:image tags??? Jason Rosenblum (SCJD) Contractor ProAct Technologies 914.872.8171 (Voice) 914.872.8100 (Fax) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Any draw backs of using DYNA FORM BEANS....?
On Thursday, June 13, 2002, 11:03:04 AM, Rajesh wrote: RK I justed wanted to see what the genral feeling is about using DYNAFORMBEANS RK instead of plain old Action Forms, I'm loving them. Chuck has shown me the light:) You should read this chapter here http://www.theserverside.com/resources/strutsreview.jsp you might have to register if you aren't (free). At the bottom he talks about DynaForms. RK in terms of RK -- using them with a validator Piece of cake. I'm using type=org.apache.struts.validator.DynaValidatorForm to define the dynaForm in the struts-config.xml RK -- transferring the data to a value object aka data tranfer object to hsip RK it to the next layer Very easy also. It's only slightly different to access your properties. In an Action: DynaActionForm f = (DynaActionForm)form; String userName = (String)f.get(userName); similarly with settters: f.set(userName, userName ); I have a helper class that builds a DTO accepting the DynaForm as a parameter...ie: userDTO = ObUsersHelper.makeUserDTOfromDAF( dynaForm ); RK (what is the preferred approach to do this using dyna beans) RK -- Has any one tried to wrap value objects with a dyna bean to make the RK retreival easy ofcourse or otherwise. Haven't use dyna beans so I can't help you there. RK Any feed back is highly appreciated RK Regards RK Raj RK -- RK To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] RK For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Rick mailto:[EMAIL PROTECTED] A wise man would pick up a grain of sand and see the entire universe, a stupid man would get naked, role in seaweed, and stand up and say, 'Look, I'm vine man.' -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: A customized Struts
At 11:07 AM +0200 2002/06/13, Sann, Stephan wrote: Hello list, I'm new with Struts and this list so please bear with me. After I read a lot of tutos, howtos, manuals and mailing-list-posts I've got two questions left (for now): 1.) How can I add a static parameter to an html:link-Tag? I read this stuff about dynamically defined query parameters with beans and such, but that's not what I want. I just want to ad a ?customer=FirstCustomer to my GET-Request This works fine: html:link forward=entryweiter/html:link This html:link forward=entry?customer=FirstCustomerweiter/html:link ends in Cannot retrive ActionForward named entry?customer=FirstCustomer You have to use the same mechanism as with dynamically defined query parameters It only requires one bean:define tag. bean:define id=customerValue value=FirstCustomer / html:link forward=entry paramId=customer paramName=customerValueweiter/html:link 2.) How can I realize a customized Forward? Assumed there are two customers - FirstCustomer and SecondCustomer. These cusomers have totaly different JSPs but they share the same Web-Application. I may not totally understand your requirements here. I'd suggest that you try to isolate the presentational differences between the customers into data rather than requiring multiple JSPs -- for example, pull in a customer-specific CSS style sheet, and look up images and such based on the customer instead of hard-coding multiple JSPs with distinct images. If you can handle the logic with the same action, it's likely that you can externalize the presentation issues. If you really don't think you can externalize the presentation issues, I'd probably opt for installing two distinct instances of the web application, one per customer. That leaves you flexibility for more variation between customers if you need it. Hope this helps, Joe -- -- * Joe Germuska{ [EMAIL PROTECTED] } It's pitiful, sometimes, if they've got it bad. Their eyes get glazed, they go white, their hands tremble As I watch them I often feel that a dope peddler is a gentleman compared with the man who sells records. --Sam Goody, 1956 tune in posse radio: http://www.live365.com/stations/289268 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: thread safety
Subject: Re: thread safety From: srinivas sunkara [EMAIL PROTECTED] === Irrespective of the frombean being in the session scope or a DVO being in a session the threading issues are still the same. The two ways you can resolve them is to have your form bean or formbean and DVO in request scope and store all the values from previous pages in the wizard as hidden fields and repopulate them on each form submission. The hidden fields solution solves the threading problem but you still can submit duplicate requests by opening a new browser from an existing browser with the form and duplicate fields. Another alternative could be to use the token pattern implemented in the struts to prevent duplicate form submission. Or you could use the two together to achive threading safety as well as avoiding duplicate form submission. Neither of them are methods that I really like but if multi threading is a real issue you could use them. thanks, srinivas. Vikram Goyal01 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Also, how do we deal with the situation where we need to build up information over a series of requests before we can actually save it or do something with it (ie: wizards etc...) In reply to an earlier post regarding something similar, my idea is to encapsulate the information required for the wizard in a DVO and not a form bean. This helps keep form beans in request and thus enables thread safety. On each page of the wizard, you update the DVO with the values in the form bean and only keep the DVO in session. I agree with Craig when he says that the form bean should only be kept in request scope. Rgs Vikram -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 14:17 To: Struts Users Mailing List Subject: Re: thread safety On Wed, 12 Jun 2002, Noah Levitt wrote: Date: Wed, 12 Jun 2002 19:57:39 -0400 From: Noah Levitt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: thread safety Hello struts users, The issue of thread safety bugs me. It seems as though it is standard practice to write servlets thread-*unsafely*. The odds of it ever being a problem are slim, but still. It seems to me that form bean setters (and probably getters) should be synchronized. I found the following two quotes from Craig McClanahan. To me, they seem contradictory. However, even if we use the that's going to be real unusual standard, shouldn't we synchronize setters, since, in theory, it's the only thread-safe thing to do? http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml Craig: For the form beans, you are creating them in a particular user's session. If the user does two submits to the same form at the same time you might have overlapping setXxx method calls going on, but that's going to be real unusual. http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml Craig: It is surprisingly easy to have multiple requests active at the same time for the same session. The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig Noah -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed Property Validation on a String[]
There is an example of this in the Validator example webapp in the type.jsp page in the nightly builds using an ArrayList, but I believe everything should work for an array too (or you could use java.util.Arrays to convert to a Collection if you need to). web/validator/WEB-INF/validation.xml -- field property=value indexedListProperty=nameList depends=required arg0 key=typeForm.nested.name.displayname/ /field web/validator/type.jsp nested:iterate property=nameList tr th align=left nbsp; /th td align=left nested:messagesPresent property=value br ul nested:messages id=error property=value libean:write name=error//li /nested:messages /ul /nested:messagesPresent nested:text property=value size=15 maxlength=15/ /td /tr /nested:iterate David --- Ted Husted [EMAIL PROTECTED] wrote: If all the options are going to have the same name, then this should work logic:iterate id=anOption name=myFormBean property=options html:text name=anOption property=options size=2/ /logic:iterate Since each element is a String, the tag will just that instead of making a property call. I believe that validator may just then apply whatever validation you have set for options to every element of the array. In 1.1, you can use the indexed attribute to number the options, and be sure they go back to the same elements in the array or collection, if that's important. Should just be logic:iterate id=anOption name=myFormBean property=options html:text name=anOption property=options indexed=true/ /logic:iterate For an array, I believe that's all you might need. -T. [EMAIL PROTECTED] wrote: Hi: I have a form bean that contains an attribute defined as a String[]. public class MyFormBean { String[] options = new String[100]; public void setOptions(String[] options) { this.options = options; } public String[] getOptions() { return options; } } I want to be able to display all 100 options in a JSP using the iterate tag. Let's assume that my form bean is stored in the session scope under the attribute named myFormBean. logic:iterate id=anOption name=myFormBean property=options indexId=index html:text indexed=true name=anOption property='?' size=2/nbsp;nbsp; % if ( (index.intValue()+1) % 10 == 0 ) % br /logic:iterate What should be filled in for the property since anOption is a String? Next, I need to set up a field validation in validation.xml. From the following URL, http://home.earthlink.net/~dwinterfeldt/revision.html a suggestion is made to use the following: logic:iterate id=listElement name=registrationForm property=listElementList indexId=index html:textarea indexed=true name=listElement property=value cols=60 rows=8/br /logic:iterate field property=value indexedProperty=listElement indexedListProperty=listElementList depends=required arg0 key=registrationForm.paragraph.displayname/ /field So far, I have the following: field property=? indexedProperty=anOption indexedListProperty=options depends=required arg0 key=label.optionLabel/ /field What should be filled in for the property since anOption is a String? Any help that anyone can provide will be greatly appreciated! Thanks in advance. Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
ActionForm question
Where do we define where the view gets forwarded to by the ActionServlet when we encounter validation errors from an ActionForm in the struts-config.xml file? Or do we not need to do that at all and the original view gets selected and uses the html:errors/ tag which displays the errors in the ActionErrors object ? Anybody .. any help .. ? Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validation with multiple string files
There isn't a way currently. Could you file a bug/enhancement a on this in buzilla? That way your request won't get lost. David --- Alok Ghosh [EMAIL PROTECTED] wrote: Hi, IM Dying to find out if this is possible, and if I can do this. I am running the new struts validation that uses the validation.xml file. In my validation.xml file I have all my forms in there and the validation for every type of textbox of the different forms. My problem is the caption name (ie. firstName=First Name) for each of my forms are in sepearte Application.properties files. But validation.xml seems to only look at the default Application.properties file, (the one without a key=x specified in the struts-config.xml file. Is there any way I can use bundle=x (or something else) to make validation.xml goto different ApplicationResources.properties files to find the message caption of the text box? Thanks a million, this is a great Validation system! Alok, (who one day dreams of seeing the text First Name is Required in an alert box, rather than {space} is Requried :) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Validator 1.1 -- Solution WIll Not WOrk
Sorry, there isn't a way to change this now. You could file it in bugzilla as a feature request. David --- [EMAIL PROTECTED] wrote: The solution given below does not work for the case I described. jsType.jsp defines one form with several masked field validations. The example I'm having difficulty with is multiple forms with multiple fields with masked field validation which causes the Struts Validator to generate multiple versions of the function function mask () {} for each of the validator:javascript entries shown below: (1) validator:javascript formName=form1 dynamicJavascript=true staticJavascript=false/ (2) validator:javascript formName=form2 dynamicJavascript=true staticJavascript=false/ The first validator tag generates the following code (note the function mask() ) SCRIPT LANGUAGE=Javascript1.1 !-- Begin var bCancel = false; function validateForm1(form) { if (bCancel) return true; else return validateMask(form); } function mask () { this.aa = new Array(field6, Field 6 is invalid., new Function (varName, this.mask=/^\\d{7}/; return this[varName];)); } // End -- /SCRIPT while the second validator tag generates the following code (note the additional function mask() : NAMING CONFLICT ) SCRIPT LANGUAGE=Javascript1.1 !-- Begin var bCancel = false; function validateOmpModel(form) { if (bCancel) return true; else return validateRequired(form) validateMask(form) validateMaxLength(form) validateMinLength(form) validateInteger(form) validateRange(form); } function mask () { this.aa = new Array(field1, Field 1 is invalid., new Function (varName, this.mask=/^\\d{6}/; return this[varName];)); this.ab = new Array(field2, Field 2 is invalid., new Function (varName, this.mask=/^[ALST]/; this.maxlength='1'; return this[varName];)); this.ac = new Array(field3, Field 3 is invalid., new Function (varName, this.mask=/^\\d{6}/; this.maxlength='6'; return this[varName];)); this.ad = new Array(field4, Field 4 is invalid., new Function (varName, this.mask=/^\\d{1}/; return this[varName];)); this.ae = new Array(field5, Field 5 is invalid., new Function (varName, this.mask=/^\\c{1}/; return this[varName];)); } // End -- /SCRIPT In the static JavaScript generated by the following tag script language=JavaScript1.1 src=../includes/staticStrutsValidatorJavascript.jsp/script staticStrutsValidatorJavascript.jsp %@ page language=java % %-- set document type to Javascript (addresses a bug in Netscape according to a web resource --% %@ page contentType=application/x-javascript % %@ taglib uri=/WEB-INF/struts-validator.tld prefix=validator % validator:javascript dynamicJavascript=false staticJavascript=true/ - the problem lies in the last statement shown in the code listing below which is defined in validator-rules.xml and generated by the static JavaScript validator name=mask classname=org.apache.struts.validator.util.StrutsValidator method=validateMask depends=required msg=errors.invalid javascript![CDATA[ function validateMask(form) { var bValid = true; var focusField = null; var i = 0; var fields = new Array(); oMasked = new mask(); When the function runs the line oMasked = new mask();, it always retrieves the second mask() and thereby errs when attempting to validate the first form since (in the example I gave above), there is no field by the name of field6 in the second function mask() instance ( I get a JavaScript error on the following line form[oMasked[x][0]].value since form[oMasked[x][0]] is undefined ). I hope I have been clearer about the problem now. The solution I had in mind was to modify the Struts Validator to generate custom validation functions. So, for the example
Re: Re: Nested Tags question
On Thu, 13 Jun 2002 [EMAIL PROTECTED] wrote: Date: Thu, 13 Jun 2002 11:43:59 +0200 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Re: Nested Tags question So Craig, does the process work at submit time (when the request parameters are being put into the nested beans) via calls to the getter methods to get the beans on which the parameters have to be set? I can't see how else it would work. It depends on what context you are using the expressions in. For example: !-- Assume the form bean name is customerForm -- html:form action=/editCustomer ... html:text property=mailingAddress.city/ ... /html:form will, in effect, do a call to: customerForm.getMailingAddress().getCity() when the page is displayed, and a call to: customerForm.getMailingAddress().setCity() when the request parameters are being copied in to the form bean. Adam Craig Craig R. McClanahan [EMAIL PROTECTED] schrieb am 13.06.2002, 08:22:43: On Thu, 13 Jun 2002, Arron Bates wrote: Date: Thu, 13 Jun 2002 14:14:13 +1000 From: Arron Bates Reply-To: Struts Users Mailing List To: Struts Users Mailing List Subject: Re: Nested Tags question I know JSP will automatically save parameters to a javabean with the correctly named getters and setters, but there's obviously a gap in my knowledge because all my attempts to recreate the situation above have failed. Setting form properties against beans is a Struts thing, not a JSP thing. The property thing is a Bean thin and can be looked up in the JavaBean spec. The example you quote... monkeyTeamAlpha.monkeyWorkers[0].salary ...is a nested property. An invention implemented within Struts (Craig?). Yep, although in Struts 1.1 it is really a commons-beanutils thing because we abstracted out this generally useful code into a separate package. What it basically is, is a string of calls rather than the single property method. Here, it will get a hold of the form bean, get a hold of the bean returned from the monkeyTeamAlphaproperty. On this bean, it will invoke the indexed property monkeyWorkers[0] which will pluck a bean from a collection or index provided, from this last bean it will will get a hold of its salary property, and set the value. At each stage, you also get the benefit of some intelligence that is built in to the underlying PropertyUtils class. For example, the JavaBeans spec defines two ways to define an indexed property -- you can use getter and setter methods that take a value and a subscript, or you can use getter and setter methods that return the entire array. PropertyUtils makes the expression listed above work for either (or even for a property whose value is a java.util.List, which is an extension to the JavaBeans spec). All this boils down to, is that you can compose objects a little cleaner, rather than have truly enormous beans for everything. Having the indexed properties allows for lists and whatever else. The ability for nesting beans has been in Struts for a long time. The nested tags just make it much easier. There's a primer and tutorial for nested beans here... http://www.keyboardmonkey.com/next ...it should take you over creating and using such a construct. Hope this gets you on th path you're after. Another area of useful learning for the future is the JSP Standard Tag Library (JSTL). Although the expression language syntax supported by JSTL is different from the one in Struts, it is well worth learning about -- this expression language will be supported anywhere in a JSP page in JSP 1.3, and (in the mean time) we will likely adapt Struts tags to be able to use it as well. Arron. Craig -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionForm question
Dont have to answer this. Sorry, for posting it. Got the answer - Chuck's Chapter 7 talks about it. Thanks. Muki Soomar Where do we define where the view gets forwarded to by the ActionServlet when we encounter validation errors from an ActionForm in the struts-config.xml file? Or do we not need to do that at all and the original view gets selected and uses the html:errors/ tag which displays the errors in the ActionErrors object ? Anybody .. any help .. ? Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Servlet Load Order kills Logging, perplexed :o/
Good Morning/Afternoon/Evening Environment: Struts 1.1Beta, Log4J1.2, Tomcat4.0.3 Issue: My experiment has 2 stages and it involves reversing the order of Servlet Loading. I have 2 servlets in my web.xml.The first to load is the StartupServlet that starts Logging mechanism (Using Log4J) in addition to a doing few other things. The Struts ActionServlet is supposed to load next but I get the following error. please_noteMy Query continues at the end of the trace/please_note --Start Of Trace -- Apache Tomcat/4.0.3 Checking for log4J PropertyConfigurator... pc is /com/jny/operations/mplanning/mpi/properties/log4j.properties The class is class java.util.Properties Property Configurator Found... The url is valoader:/C:/Program Files/IBM/VisualAge for Java/ide/project_resources/mpi/com/jny/operations/mplanning/mpi/properties/log4j.properties Checking for log4J PropertyConfigurator... pc is /com/jny/operations/mplanning/mpi/properties/log4j.properties The class is class java.util.Properties Property Configurator Found... The url is valoader:/C:/Program Files/IBM/VisualAge for Java/ide/project_resources/mpi/com/jny/operations/mplanning/mpi/properties/log4j.properties 2002-06-13 12:04:20,326 [main] ERROR org.apache.commons.digester.Digester - End event threw exception java.lang.IllegalArgumentException java.lang.Throwable() java.lang.Exception() java.lang.RuntimeException() java.lang.IllegalArgumentException() java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object []) java.lang.Object org.apache.commons.beanutils.MethodUtils.invokeMethod(java.lang.Object, java.lang.String, java.lang.Object [], java.lang.Class []) void org.apache.commons.digester.SetNextRule.end() void org.apache.commons.digester.Digester.endElement(java.lang.String, java.lang.String, java.lang.String) void org.apache.xerces.parsers.SAXParser.endElement(org.apache.xerces.utils.QName) void org.apache.xerces.validators.common.XMLValidator.callEndElement(int) boolean org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(boolean) boolean org.apache.xerces.framework.XMLDocumentScanner.parseSome(boolean) void org.apache.xerces.framework.XMLParser.parse(org.xml.sax.InputSource) java.lang.Object org.apache.commons.digester.Digester.parse(java.io.InputStream) org.apache.struts.config.ApplicationConfig org.apache.struts.action.ActionServlet.initApplicationConfig(java.lang.String, java.lang.String) void org.apache.struts.action.ActionServlet.init() void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig) javax.servlet.Servlet org.apache.catalina.core.StandardWrapper.loadServlet() void org.apache.catalina.core.StandardWrapper.load() void org.apache.catalina.core.StandardContext.loadOnStartup(org.apache.catalina.Container []) void org.apache.catalina.core.StandardContext.start() void org.apache.catalina.core.ContainerBase.addChild(org.apache.catalina.Container) void org.apache.catalina.core.StandardHost.addChild(org.apache.catalina.Container) void org.apache.catalina.core.StandardHost.install(java.lang.String, java.net.URL) void org.apache.catalina.startup.HostConfig.deployApps() void org.apache.catalina.startup.HostConfig.start() void org.apache.catalina.startup.HostConfig.lifecycleEvent(org.apache.catalina.LifecycleEvent) void org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(java.lang.String, java.lang.Object) void org.apache.catalina.core.ContainerBase.start() void org.apache.catalina.core.StandardHost.start() void org.apache.catalina.core.ContainerBase.start() void org.apache.catalina.core.StandardEngine.start() void org.apache.catalina.core.StandardService.start() void org.apache.catalina.core.StandardServer.start() void org.apache.catalina.startup.Catalina.start() void org.apache.catalina.startup.Catalina.execute() void org.apache.catalina.startup.Catalina.process(java.lang.String []) java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object []) void org.apache.catalina.startup.Bootstrap.main(java.lang.String []) java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object []) void StartTomcat.main(java.lang.String []) 2002-06-13 12:04:20,537 [main] ERROR org.apache.struts.action.ActionServlet - Parsing error processing resource path /WEB-INF/struts-config.xml java.lang.IllegalArgumentException java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) org.xml.sax.SAXException(java.lang.String, java.lang.Exception) org.xml.sax.SAXParseException(java.lang.String, org.xml.sax.Locator, java.lang.Exception) org.xml.sax.SAXException org.apache.commons.digester.Digester.createSAXException(java.lang.String, java.lang.Exception) org.xml.sax.SAXException org.apache.commons.digester.Digester.createSAXException(java.lang.Exception)
RE: Struts Design/construction process. question
I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers. Our project management would like to see a developer pump out a list(s) of disconnected components and have one person connect them together. Our page layout is well in place, and I can create a list of form beans. *note - we are not using dynabeans. So... our HMTL guy can go ahead a create the 60 pages in one shot. A junior developer can create 60 form beans If you are not using something like Junit, is it practical to design and create many action classes ahead of time? I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. I would have already created a generic template (that would compile and run ), so it seems
RE: Who is Ralph Roland?
-Original Message- From: James Young [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 10:33 PM To: [EMAIL PROTECTED] Subject: Re: Who is Ralph Roland? Ralph, Would you mind to briefly describe what particular precautions one has to take to upgrade from Struts 1.0 to 1.1b in general? I couldn't find any messages regarding this in the archive... Thanks James. Sure, at least for the issues we encountered... First, a tiny bit of background on how we use Struts may make some of the comments below make more sense. We had taken the basic Struts 1.0 distribution and extended it to provide a slightly different set of taglibs than those supplied with Struts-proper. We also applied a thin layer over the Struts supplied DispatchAction and ActionForm to support developing pages in a more coarse-grained, page-oriented fashion than Struts' reusable-action oriented way. [It's my opinion that Struts' focus on reusable 'actions' is too fine-grained, and that developers building a web-application (as opposed to a web-site) need to approach each page of the application as a single unit, instead of 20 independant actions - but I digress...] Anyway, this layer that we built on top of Struts allowed us to build bug-fixes and extensions that we found necessary into this layer instead of making changes to the underlying Struts code-base. So, upgrading to Struts 1.1b1 was mostly a case of adapting this layer instead of adapting our application code. Changes we had to make were: 1] Drop our method of supporting sub-applications, and step up to the new Struts way of supporting sub-apps (via the config/subapp parameters on the controller servlet). This was very straight-forward, except we use action urls of the form subapp/do/action exclusively (as apposed to subapp/action.do), and apparently this is not supported in 1.1b1 (I saw a post from Craig M. recently stating this). We put a 'hack' into our FormTag overridding the getActionMappingURL method that gets around this limitation for our applications. 2] We switched our html/form tags to extend the NestedTags instead of the standard tags. This was actually the main reason for stepping up to 1.1; allowing the user to enter data within an iterate block just seems plain undoable in 1.0. The Nested tags in 1.1 however are intuitive and appear to work just fine. [I'm actually curious why the non-nested html tags are even being kept around, the nested versions appear to be backward-compatible and superior in funtion.] One problem we ran into here was that the struts-nested.tld did not actually match the supplied classes. If I remember correctly I think the FormTag had attributes of Title and TitleKey, but no get/set methods for them. We simply removed them from our .tld. 3] We had previously overridden the WriteTag in order to provide a basis for application-custom format tags, and the addition of built-in formating in the WriteTag meant that we had to revisit this. In the end we just needed to make a slight modification to our BaseFormatTag in order to continue to play nicely with the Struts 1.1. 4] We had a bug-fix built into the html:base tag to properly deal with https urls. As far as I can tell this appears to be working in 1.1, so we dropped our patch to the BaseTag. Original problem was that base (https:) url would sometimes be emitted with a spurious :80 port designation. I think those are the only code-change gotcha's that we experienced. As for actually getting Struts to run on WebLogic (which is the only app-server we've targetted thus far), there are apparently some real (potentially disturbing) underlying issues here... 5] I was unable to get Struts 1.1b1 to run on WebLogic 6.0SP1 or SP2 at all. The problem appears to be directly related to the use of JAXP1.1 in the underlying commons-digester code. If you take a look at the source you'll notice the following comment in the Digester.java: /** * By setting the reader in the constructor, you can bypass JAXP and be able * to use digester in Weblogic 6.0. */ Hmm... seems like a clue... We have other reasons for moving off WebLogic 6.0, so I didn't persue to a conclusion. But it would seem that this problem could be resolved by simply using a different constructor when instantiating the Digester. [Given WebLogic's market share, I am quite surprised that Struts is not tweaked for it 'out of the box'. Oh well...] 6] I was able to get Struts 1.1b1 to run on WebLogic 6.1SP2 and WebLogic 7.0, but I found it necessary to place the commons-logging.jar file into the server's classpath. I don't know whether this has any effect on the ability of WebLogic to dynamically unload and reload the application code - but I suspect it does. We currently have other classloader-weirdness that precludes us using the dynamic application re-loading anyway, so this is not a show-stopper for us (at the moment). Well I think I missed the 'briefly' target, but hopefully you'll find a
Re: thread safety
What's a DVO? On Thu, Jun 13, 2002 at 12:56:38PM +0530, Vikram Goyal01 wrote: Also, how do we deal with the situation where we need to build up information over a series of requests before we can actually save it or do something with it (ie: wizards etc...) In reply to an earlier post regarding something similar, my idea is to encapsulate the information required for the wizard in a DVO and not a form bean. This helps keep form beans in request and thus enables thread safety. On each page of the wizard, you update the DVO with the values in the form bean and only keep the DVO in session. I agree with Craig when he says that the form bean should only be kept in request scope. Rgs Vikram -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 14:17 To: Struts Users Mailing List Subject: Re: thread safety On Wed, 12 Jun 2002, Noah Levitt wrote: Date: Wed, 12 Jun 2002 19:57:39 -0400 From: Noah Levitt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: thread safety Hello struts users, The issue of thread safety bugs me. It seems as though it is standard practice to write servlets thread-*unsafely*. The odds of it ever being a problem are slim, but still. It seems to me that form bean setters (and probably getters) should be synchronized. I found the following two quotes from Craig McClanahan. To me, they seem contradictory. However, even if we use the that's going to be real unusual standard, shouldn't we synchronize setters, since, in theory, it's the only thread-safe thing to do? http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml Craig: For the form beans, you are creating them in a particular user's session. If the user does two submits to the same form at the same time you might have overlapping setXxx method calls going on, but that's going to be real unusual. http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml Craig: It is surprisingly easy to have multiple requests active at the same time for the same session. The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig Noah -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: thread safety
a DVO is a data value object. Look at the design pattern from sun, there they are described Am Don, 2002-06-13 um 18.56 schrieb Noah Levitt: What's a DVO? On Thu, Jun 13, 2002 at 12:56:38PM +0530, Vikram Goyal01 wrote: Also, how do we deal with the situation where we need to build up information over a series of requests before we can actually save it or do something with it (ie: wizards etc...) In reply to an earlier post regarding something similar, my idea is to encapsulate the information required for the wizard in a DVO and not a form bean. This helps keep form beans in request and thus enables thread safety. On each page of the wizard, you update the DVO with the values in the form bean and only keep the DVO in session. I agree with Craig when he says that the form bean should only be kept in request scope. Rgs Vikram -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 14:17 To: Struts Users Mailing List Subject: Re: thread safety On Wed, 12 Jun 2002, Noah Levitt wrote: Date: Wed, 12 Jun 2002 19:57:39 -0400 From: Noah Levitt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: thread safety Hello struts users, The issue of thread safety bugs me. It seems as though it is standard practice to write servlets thread-*unsafely*. The odds of it ever being a problem are slim, but still. It seems to me that form bean setters (and probably getters) should be synchronized. I found the following two quotes from Craig McClanahan. To me, they seem contradictory. However, even if we use the that's going to be real unusual standard, shouldn't we synchronize setters, since, in theory, it's the only thread-safe thing to do? http://archive.covalent.net/jakarta/struts-dev/2000/06/0117.xml Craig: For the form beans, you are creating them in a particular user's session. If the user does two submits to the same form at the same time you might have overlapping setXxx method calls going on, but that's going to be real unusual. http://archive.covalent.net/jakarta/struts-user/2001/03/0013.xml Craig: It is surprisingly easy to have multiple requests active at the same time for the same session. The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig Noah -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
Hard to believe there was a time when Cobol ruled the universe and programs were designed in a 'top-down' fashion isn't it? And as an old (actually 40+) mainframe programmer who is trying to make the transition from the non-object world of Cobol and (gasp here) assembler to the object-oriented world of Java (and JSP and struts and XML and and and), there are times when I really miss those 'good old days'. But then I think, nah, just post a question on the mailing list and get the 'right' answer from all of you guys! Jerry -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:51 AM To: Struts Users Mailing List Subject: RE: Struts Design/construction process. question I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is resonsible for these components. Things become very messy when you try to split the JSP, ActionForm, and Action work to different developers, IMHO. My $.02 ( more like $1.02?) peace, Joe Barefoot -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: Struts Design/construction process. question This is our *FIRST* Struts project and we are putting together a construction plan. I would like to find out how other projects divide the work between developers.
Starter question
Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [ann] Easy Struts 0.2 for Eclipse users
I'm dying to use Easy Struts for Eclipse, but am hesitant to go to Eclipse 2.0. Is the F2 release stable yet? The last time I tried it I couldn't get anything to work Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 5:36 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: [ann] Easy Struts 0.2 for Eclipse users Hi, Easy Struts 0.2 for Eclipse is out *Features - Wizard for action, form, jsp creation - Create Run with Tomcat Sysdeo Plugin *Changes - Wizard for forward creation added - Distribution - Some fix *More : - http://sourceforge.net/projects/easystruts - http://easystruts.sourceforge.net/ Enjoy, -Emmanuel ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
We may be heading off topic here... I started out at the tail end of that era... I swore an oath that I would never work on a mainframe and managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in school... Now back our regularly scheduled topics MAINFRAMES SUCK! (Happy Niall?) (incidentally the above was in jest - I hear you can run Linux on them now...) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:00 PM To: struts-user Subject: RE: Struts Design/construction process. question Hard to believe there was a time when Cobol ruled the universe and programs were designed in a 'top-down' fashion isn't it? And as an old (actually 40+) mainframe programmer who is trying to make the transition from the non-object world of Cobol and (gasp here) assembler to the object-oriented world of Java (and JSP and struts and XML and and and), there are times when I really miss those 'good old days'. But then I think, nah, just post a question on the mailing list and get the 'right' answer from all of you guys! Jerry -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:51 AM To: Struts Users Mailing List Subject: RE: Struts Design/construction process. question I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted to jsp/struts. Add ActionForm classes to the above statement and you are entirely correct. We tend to view an Action, its ActionForm, and the presentation logic (i.e., Struts tags) in their associated JSP(s) as an action module of sorts, and a single developer is
RE: Struts Design/construction process. question
Yeah, you can. That's why their called 'Enterprise Servers' now-a-days. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:35 PM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question We may be heading off topic here... I started out at the tail end of that era... I swore an oath that I would never work on a mainframe and managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in school... Now back our regularly scheduled topics MAINFRAMES SUCK! (Happy Niall?) (incidentally the above was in jest - I hear you can run Linux on them now...) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:00 PM To: struts-user Subject: RE: Struts Design/construction process. question Hard to believe there was a time when Cobol ruled the universe and programs were designed in a 'top-down' fashion isn't it? And as an old (actually 40+) mainframe programmer who is trying to make the transition from the non-object world of Cobol and (gasp here) assembler to the object-oriented world of Java (and JSP and struts and XML and and and), there are times when I really miss those 'good old days'. But then I think, nah, just post a question on the mailing list and get the 'right' answer from all of you guys! Jerry -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:51 AM To: Struts Users Mailing List Subject: RE: Struts Design/construction process. question I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action classes would be completed at the same time that the page is converted
RE: Struts Design/construction process. question
core dumps, anyone? :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:35 AM To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question We may be heading off topic here... I started out at the tail end of that era... I swore an oath that I would never work on a mainframe and managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in school... Now back our regularly scheduled topics MAINFRAMES SUCK! (Happy Niall?) (incidentally the above was in jest - I hear you can run Linux on them now...) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:00 PM To: struts-user Subject: RE: Struts Design/construction process. question Hard to believe there was a time when Cobol ruled the universe and programs were designed in a 'top-down' fashion isn't it? And as an old (actually 40+) mainframe programmer who is trying to make the transition from the non-object world of Cobol and (gasp here) assembler to the object-oriented world of Java (and JSP and struts and XML and and and), there are times when I really miss those 'good old days'. But then I think, nah, just post a question on the mailing list and get the 'right' answer from all of you guys! Jerry -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:51 AM To: Struts Users Mailing List Subject: RE: Struts Design/construction process. question I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you can build your own) for generating basic ActionForm beans, so this is not really an issue anyway. I have always assumed that the action
Please help clarify or confirm -- HttpSession
Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Please help clarify or confirm -- HttpSession
At my knowledge, under tomcat each webapp have his own memory space so you can't share HttpSession between 2 webapp. You can share object between 2 webapp with one condition, the class to be shared must be loaded in same ClassLoader. Did you understand my english ;) -Emmanuel --- Yuan, Tony [EMAIL PROTECTED] a écrit : Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
Good :) I will try !!! Thanks ! WIlliam. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT) You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands,
Re: DispatchAction with Image buttons
Is anyone successfully using the DispatchAction with html:image tags??? We have this Dispatch Action: package dhs.vcm.vis.action.finishReason; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.actions.DispatchAction; import dhs.vcm.vis.business.FinishVisitReasonBO; import dhs.vcm.vis.db.exception.Fin_Vst_Rsn_Exception; import dhs.vcm.vis.entity.Constants; import dhs.vcm.vis.entity.FinishVisitReason; import dhs.vcm.vis.form.finishReason.FinishReasonDeleteForm; import dhs.vcm.vis.form.finishReason.FinishReasonUpdateForm; import dhs.vcm.vis.form.finishReason.FinishVisitReasonFormConverter; /** * Implementation of strongDispatchAction/strong that manages the * insert, update, and delete functionality for the Finish Reason Maintenance page. * * @author Mark H. Nichols * @version $Revision: 1.0 $ $Date: 2001/02/25 9:08:00 $ */ public final class DispatcherAction extends DispatchAction { // - Public Methods /** * Process the specified HTTP request, and create the corresponding HTTP * response (or forward to another web component that will create it). * Return an codeActionForward/code instance describing where and how * control should be forwarded, or codenull/code if the response has * already been completed. * * @param mapping The ActionMapping used to select this instance * @param actionForm The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ public ActionForward delete( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // create a new delete form to hold the data for the delete jsp FinishReasonDeleteForm deleteForm = new FinishReasonDeleteForm() ; deleteForm.setShortDescription( (String)request.getParameter(shortDescription) ) ; request.setAttribute(Constants.FINISH_REASON_DELETE_KEY, deleteForm ) ; // Forward control to the specified success URI return (mapping.findForward(delete)); } public ActionForward insert( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Forward control to the specified success URI return (mapping.findForward(insert)); } public ActionForward update( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // get the row to update using the selected reason Id FinishReasonUpdateForm updateForm = new FinishReasonUpdateForm() ; FinishVisitReasonBO reasonBO = new FinishVisitReasonBO() ; FinishVisitReason reasonForUpdate = new FinishVisitReason() ; try { reasonForUpdate = reasonBO.getByReasonID(Integer.valueOf(request.getParameter(finishReasonID )).intValue()) ; }catch (Fin_Vst_Rsn_Exception fvre) { System.out.println( Finish Visit Reason Exception caught: + fvre.getMessage()) ; } FinishVisitReasonFormConverter.toFinishReasonForm(reasonForUpdate, updateForm) ; updateForm.debug() ; request.setAttribute(Constants.FINISH_REASON_UPDATE_KEY, updateForm ) ; // Forward control to the specified success URI return (mapping.findForward(update)); } } That works with this JSP using image buttons !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN !-- Some standard includes -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % %@ taglib uri=/WEB-INF/dhs-html.tld prefix=dhshtml % %@ taglib uri=/WEB-INF/pager-taglib.tld prefix=pg % html:html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titlebean:message key=finishReasonTest.title//title html:base/ LINK REL=STYLESHEET TYPE=text/css HREF=../theme/dhs.css script language=javascript type=text/javascript src=../js/chromeless_30.js/script script language=javascript type=text/javascript src=../js/mainScripts.js/script script language=javascript type=text/javascript src=../js/coolbuttons.js/script /head body bgcolor=#ff html:form action=FinishReason/Dispatcher method=post !-- define a page using the pager tag -- pg:pager maxIndexPages=10 maxPageItems=10 !-- use these variables to keep from getting warnings, but don't render them on the resulting page. -- !-- %= pagerPageNumber % -- !-- %= pagerOffset % -- !-- %=
RE: Please help clarify or confirm -- HttpSession
This is something I've wondered about, especially in a team development environment where there are several programmers working on different webapps that need to share a common framework - in other words, something like this: Tomcat\webapps framework-application WEB-INF ... webapplication_1 WEB-INF ... webapplication_2 WEB-INF ... etc etc etc Can the classes in webapplication_1 'see' session data that was created and stored in the session by the framework-application? Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:39 PM To: Struts Users Mailing List Subject: Re: Please help clarify or confirm -- HttpSession At my knowledge, under tomcat each webapp have his own memory space so you can't share HttpSession between 2 webapp. You can share object between 2 webapp with one condition, the class to be shared must be loaded in same ClassLoader. Did you understand my english ;) -Emmanuel --- Yuan, Tony [EMAIL PROTECTED] a écrit : Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Starter question
Unless you are submitting the request from a form you do not need an actionform that I know of. If you are always displaying the same list i think you want to: Invoke the action The actions perform method should get a collection of beans representing each row in the database. You then stuff the collection into an attribute in the session the forward action should send you to the JSP page to display it where you iterate through it using the html taglib in struts... This is in a nutshell and does not necessarily cover good practices but it will get you working -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:26 PM To: struts-user Subject: Starter question Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
advice- session vs request scope for Action Form
It seems as though the majority of times your ActionForms should use request scope, but what about situations where you might grab data from one jsp form and then need to use the information you got from that page during other parts of your application. Here's the actual situation... 1) user has to select a userType from some select options. 2) once this userType is selected I need to use this property in some DispatchAction methods and as a display on some other pages as the user traverses the application. (the userType can change if he/she goes back to the original form and selects a new one). Now the question is where should the userType field be stored so I have access to it in other parts of the user's session? I first thought it would be best stored as a field in my ActionForm with session scope so that other pages and Actions could have access to it, but if reset() is always called regardless of the scope it seems to imply that the ActionForms shouldn't really be used in Sesion scope? (Even though the default reset behavior wouldn't reset my field upon each request unless I provide implementation, it seems to imply that I should provide the implementation, and definitely as Chuck pointed out to me, in the case of DynaActionForms, the reset will truly reset the fields to default values, which means if I use a DynaActionForm and want it in Session scope I have to override the reset() method and make sure it doesn't touch the fields I want to keep in the session. That sort of seems ugly to me.) Am I better off just sticking the userType variable itself into the session after I get it from the Form? Or maybe just put it into the DTO (that I eventually convert the ActionForm into anyway) and then stick that DTO in the session? Thanks for any comments. -- Rick mailto:[EMAIL PROTECTED] Any man, in the right situation, is capable of murder. But not any man is capable of being a good camper. So, murder and camping are not as similar as you might think. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
You can with this : Foo foo = ... HttpSession session = request.getSession(); session.setAttribute(foo,foo); getServlet().getServletContext().getContext(/webapplication1).forward(request,reponse); But Foo.class must be loader in same ClassLoader foreach application. The problem is under Tomcat, each application has a differents ClassLoader. So you must put Foo.class in Tomcat\common\lib. If the class is already loaded in Tomcat ClassLoader, it won't be in your webapp ClassLoader. If not, you have a ClassClastException. -Emmanuel --- Jerry Jalenak [EMAIL PROTECTED] a écrit : This is something I've wondered about, especially in a team development environment where there are several programmers working on different webapps that need to share a common framework - in other words, something like this: Tomcat\webapps framework-application WEB-INF ... webapplication_1 WEB-INF ... webapplication_2 WEB-INF ... etc etc etc Can the classes in webapplication_1 'see' session data that was created and stored in the session by the framework-application? Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:39 PM To: Struts Users Mailing List Subject: Re: Please help clarify or confirm -- HttpSession At my knowledge, under tomcat each webapp have his own memory space so you can't share HttpSession between 2 webapp. You can share object between 2 webapp with one condition, the class to be shared must be loaded in same ClassLoader. Did you understand my english ;) -Emmanuel --- Yuan, Tony [EMAIL PROTECTED] a écrit : Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Starter question
When I started with Struts a few months ago, a colleague sent me these links to review. There is lots of information here.. but the one thing that really helped everything click were the diagrams. Main link: http://gallery.bluestone.com/scripts/SaISAPI.dll/StrutsTrailMap.class/struts -trailmap/default.htm Some diagrams - http://gallery.bluestone.com/scripts/SaISAPI.dll/StrutsTrailMap.class/struts -trailmap/article/strutsarticle2.htm Also, http://www.husted.com is a great resource as well... Cheers, Scott. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 13, 2002 1:51 PM Subject: RE: Starter question Unless you are submitting the request from a form you do not need an actionform that I know of. If you are always displaying the same list i think you want to: Invoke the action The actions perform method should get a collection of beans representing each row in the database. You then stuff the collection into an attribute in the session the forward action should send you to the JSP page to display it where you iterate through it using the html taglib in struts... This is in a nutshell and does not necessarily cover good practices but it will get you working -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:26 PM To: struts-user Subject: Starter question Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [ann] Easy Struts 0.2 for Eclipse users
Hi, About Eclipse, no problem, F3 was released today. This is the last stable release. ...or you can wait for June 28, official release date for Eclipse 2 ;) more information about release plan : http://www.eclipse.org/eclipse/freeze_plan_2_0.html -Emmanuel --- Jerry Jalenak [EMAIL PROTECTED] a écrit : I'm dying to use Easy Struts for Eclipse, but am hesitant to go to Eclipse 2.0. Is the F2 release stable yet? The last time I tried it I couldn't get anything to work Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 5:36 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: [ann] Easy Struts 0.2 for Eclipse users Hi, Easy Struts 0.2 for Eclipse is out *Features - Wizard for action, form, jsp creation - Create Run with Tomcat Sysdeo Plugin *Changes - Wizard for forward creation added - Distribution - Some fix *More : - http://sourceforge.net/projects/easystruts - http://easystruts.sourceforge.net/ Enjoy, -Emmanuel ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to localhost. Escape character is 'off'. GET /webapp1/session.jsp HTTP/1.0 [ -- I type ] HTTP/1.1 200 OK Content-Type: text/html;charset=ISO-8859-1 Date: Wed, 12 Jun 2002 00:39:49 GMT Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector) Connection: close Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1 html head titleTesting Session Management/title /head body Session ID = AC75B22FD1D283D1CEF0136928110679 /body /html Connection closed by foreign host. bash-2.05$ The JSESSIONID cookie is used by the servlet container to manage the user session. Notice that the the scope of the JSESSIONID Cookie in this example is limited to the '/webapp1' web application. So even if you have many web applications (or Struts applications) deployed in a servlet container, session tracking is isolated between them. ShamelessPlug I'll be covering topics such as this and others in my upcoming book Struts: Rapid Working Knowledge to be published by SAMS later this year. /ShamelessPlug HTH, Kevin Jerry Jalenak [EMAIL PROTECTED] on 06/13/2002 01:43:50 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession This is something I've wondered about, especially in a team development environment where there are several programmers working on different webapps that need to share a common framework - in other words, something like this: Tomcat\webapps framework-application WEB-INF ... webapplication_1 WEB-INF ... webapplication_2 WEB-INF ... etc etc etc Can the classes in webapplication_1 'see' session data that was created and stored in the session by the framework-application? Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:39 PM To: Struts Users Mailing List Subject: Re: Please help clarify or confirm -- HttpSession At my knowledge, under tomcat each webapp have his own memory space so you can't share HttpSession between 2 webapp. You can share object between 2 webapp with one condition, the class to be shared must be loaded in same ClassLoader. Did you understand my english ;) -Emmanuel --- Yuan, Tony [EMAIL PROTECTED] a écrit : Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
Actually, I think I take that back. You want to actually skip certain fields if it is an insert or a delete. Making a method validation that returns false (fails) will stop all validation. You really probably want a dispatchMethodRequired validator and any other ones so they skip that validation if it shouldn't be checked. The other Validator methods kind of work like this with required. Everything else depends on required, but if you remove the dependecies all those methods, like mask, check if the field isn't blank before they perform the validation. If it is blank, mask returns true and doesn't really do anything. David --- William W [EMAIL PROTECTED] wrote: Good :) I will try !!! Thanks ! WIlliam. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT) You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL
RE: Please help clarify or confirm -- HttpSession
hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to localhost. Escape character is 'off'. GET /webapp1/session.jsp HTTP/1.0 [ -- I type ] HTTP/1.1 200 OK Content-Type: text/html;charset=ISO-8859-1 Date: Wed, 12 Jun 2002 00:39:49 GMT Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector) Connection: close Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1 html head titleTesting Session Management/title /head body Session ID = AC75B22FD1D283D1CEF0136928110679 /body /html Connection closed by foreign host. bash-2.05$ The JSESSIONID cookie is used by the servlet container to manage the user session. Notice that the the scope of the JSESSIONID Cookie in this example is limited to the '/webapp1' web application. So even if you have many web applications (or Struts applications) deployed in a servlet container, session tracking is isolated between them. ShamelessPlug I'll be covering topics such as this and others in my upcoming book Struts: Rapid Working Knowledge to be published by SAMS later this year. /ShamelessPlug HTH, Kevin Jerry Jalenak [EMAIL PROTECTED] on 06/13/2002 01:43:50 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession This is something I've wondered about, especially in a team development environment where there are several programmers working on different webapps that need to share a common framework - in other words, something like this: Tomcat\webapps framework-application WEB-INF ... webapplication_1 WEB-INF ... webapplication_2 WEB-INF ... etc etc etc Can the classes in webapplication_1 'see' session data that was created and stored in the session by the framework-application? Jerry -Original Message- From: emmanuel.boudrant [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:39 PM To: Struts Users Mailing List Subject: Re: Please help clarify or confirm -- HttpSession At my knowledge, under tomcat each webapp have his own memory space so you can't share HttpSession between 2 webapp. You can share object between 2 webapp with one condition, the class to be shared must be loaded in same ClassLoader. Did you understand my english ;) -Emmanuel --- Yuan, Tony [EMAIL PROTECTED] a écrit : Hi Guys, Can anyone help clarify or confirm the relationship between an HttpSession and a web application? I mean, can two WAR (two application) share one common HttpSession and whatever resource this HttpSession contains? My understanding is that if WARs are deployed separately, then there will be different HttpSessions and therefore you can not share resources among them. Can anyone help confirm this? or correct if I am wrong? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person
RE: Starter question
When I tried action without name property, Struts complained. Can you give me a sample action struts-config element? Probably I'm missing something. /tb. On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote: Unless you are submitting the request from a form you do not need an actionform that I know of. If you are always displaying the same list i think you want to: Invoke the action The actions perform method should get a collection of beans representing each row in the database. You then stuff the collection into an attribute in the session the forward action should send you to the JSP page to display it where you iterate through it using the html taglib in struts... This is in a nutshell and does not necessarily cover good practices but it will get you working -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:26 PM To: struts-user Subject: Starter question Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
A couple of reasons 1. My company has three main lines of business that for various regulatory reasons need to be kept separate. This applies to deliver of content on the web as well. What I am trying to accomplish is essentially a single-signon capability (within the framework) that the business applications can then validate against (successful logon, etc.). It may be possible to have the individuals sign in to the default web app and access it through the URI of just / (instead of a URI such as /myWebApp. I believe this may scope the JSESSIONID cookie to / and have it returned to all webapps on the system. I have not tried this and don't know if it will work - though it would be easy to test. 2. I am also needing to integrate non-JSP applications (.ASP for instance) into the framework. I know they cannot directly access my JavaBeans, but I'm wondering if a .ASP page could access the HttpSession data. Can you say, Web Sevices? To begin, look at the Apache SOAP project (now extended under the Jakarta Axis project). Jerry Good luck, Kevin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
Kevin, I actually thought about the EJB solution, but we are trying to do this on the cheap without having to buy an EJB container (i.e. JBOSS). Something I was wondering about though - is it possible to run an EAR structure under Tomcat? I'm not very familiar with EJB, so forgive me if I sound stupid here, but is it possible to create a pseudo-J2EE environment and create an Entity-Bean that can do this? The XML-Soap solution also is appealing, but we would like to be able to integrate these various app's with a minimum of re-write. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:18 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to localhost. Escape character is 'off'. GET /webapp1/session.jsp HTTP/1.0 [ -- I type ] HTTP/1.1 200 OK Content-Type: text/html;charset=ISO-8859-1 Date: Wed, 12 Jun 2002 00:39:49 GMT Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector) Connection: close Set-Cookie: JSESSIONID=AC75B22FD1D283D1CEF0136928110679;Path=/webapp1 html head titleTesting Session Management/title /head body
Re: Please help clarify or confirm -- HttpSession
I came across a similar situation recently. We have a major asp application that we are slowly converting to jsp/struts/java. So - we need the two technologies to talk to one another... We use microsoft's msxml object to post data to a url/page, and then wait for a response. If the asp page needs to access the jsp's session data - what you could do is perform an empty post to the jsp page, which would execute the jsp page... in turn the jsp page would read the session data and convert it to name/value pairs and output it as a string - allowing the asp page to pickup the string (...read the response) and parse it just like a normal post this is just one idea... not sure what limitations may be imposed on your project so this may or may not work for you... - Scott. - Original Message - From: Jerry Jalenak [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 13, 2002 2:32 PM Subject: RE: Please help clarify or confirm -- HttpSession I did find a product called JIntegra (from a different posting a few days ago) that I think will allow the .ASP apps to access a Java class through some sort of smoke-and-mirror arrangement. I'm not sure if this will work across servers - if it does then I'm home free. If not, then it's back to XML. Anyway, back to the original question, I was also thinking about ease of code maintainability. If a webapp needs to be 'pulled' out and modified, wouldn't it be easier to do if the webapp was self-contained? That way a programmer could ensure that they have everything related to the webapp (checked out through CVS), modify it, test, and then return the webapp to a production status. Jerry -Original Message- From: Joseph Barefoot [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:27 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession wo-boy! Sounds like fun, Jerry, good luck! I think maybe you could store a UserRole object using a static or singleton class in a shared classloader. Should be pretty easy to test out with your setup (just try to store something in the shared class from one webapp and retrieve it from the other). I haven't a clue about ASPs accessing the session data though...perhaps by XML messaging through sockets? That would mean that any session data you wanted to share would have to be easily converted to an XML format, however, both in Java-land and ASP-land, and the conversion fairly swift. If you just wanted it for authentication purposes, might not be too difficult though. All of this depends on where the ASP application is running relative to the Java apps. too though. Much easier if they are both behind the same firewall (no encryption worries). peace, Joe Barefoot -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:12 AM To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]' Subject: RE: Please help clarify or confirm -- HttpSession A couple of reasons 1. My company has three main lines of business that for various regulatory reasons need to be kept separate. This applies to deliver of content on the web as well. What I am trying to accomplish is essentially a single-signon capability (within the framework) that the business applications can then validate against (successful logon, etc.). 2. I am also needing to integrate non-JSP applications (.ASP for instance) into the framework. I know they cannot directly access my JavaBeans, but I'm wondering if a .ASP page could access the HttpSession data. Jerry -Original Message- From: Joseph Barefoot [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:10 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the
Re: thread safety
Hello, Your suggestion is duly noted, and would probably be good advice for many web apps. But keeping form beans in session scope can be very handy at times, as has been pointed out in other posts. Sessions are one of the main advantages of servlets, after all. So, you concede that using form beans the way they are commonly used, in session scope with setters and getters unsynchronized, is not thread-safe? Would you also agree that every call to session.setAttribute() and session.getAttribute() needs to be synchronized? Noah On Wed, Jun 12, 2002 at 11:17:03PM -0700, Craig R. McClanahan wrote: The simplest way to avoid this whole set of problems is to use request scope for your form beans. Then, the container guarantees that only one thread can access these beans, so you don't need to be concerned at all about thread safety in them. Following this advice will also be beneficial, in general, to the scalability of your application -- because the server will not need to store the form beans in memory in between requests. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Of course. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Putting an object into a shared classloader DOES put it OUTSIDE of any of the individual webapps, in that that object's existence is not dependent on the existence of any webapp. If this were not true, then the classloader hierarchy employed by app. servers would be meaningless. peace, joe Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to
RE: Please help clarify or confirm -- HttpSession
Huh? JBoss is FREE. -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:41 PM To: 'Struts Users Mailing List' Subject: RE: Please help clarify or confirm -- HttpSession Kevin, I actually thought about the EJB solution, but we are trying to do this on the cheap without having to buy an EJB container (i.e. JBOSS). Something I was wondering about though - is it possible to run an EAR structure under Tomcat? I'm not very familiar with EJB, so forgive me if I sound stupid here, but is it possible to create a pseudo-J2EE environment and create an Entity-Bean that can do this? The XML-Soap solution also is appealing, but we would like to be able to integrate these various app's with a minimum of re-write. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:18 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type ] Trying 127.0.0.1... Connected to localhost. Escape character is 'off'. GET /webapp1/session.jsp HTTP/1.0 [ -- I type ] HTTP/1.1 200 OK Content-Type: text/html;charset=ISO-8859-1 Date: Wed, 12 Jun 2002 00:39:49
RE: Please help clarify or confirm -- HttpSession
Free? Didn't realize that.. -Original Message- From: Jerome Jacobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:50 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession Huh? JBoss is FREE. -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:41 PM To: 'Struts Users Mailing List' Subject: RE: Please help clarify or confirm -- HttpSession Kevin, I actually thought about the EJB solution, but we are trying to do this on the cheap without having to buy an EJB container (i.e. JBOSS). Something I was wondering about though - is it possible to run an EAR structure under Tomcat? I'm not very familiar with EJB, so forgive me if I sound stupid here, but is it possible to create a pseudo-J2EE environment and create an Entity-Bean that can do this? The XML-Soap solution also is appealing, but we would like to be able to integrate these various app's with a minimum of re-write. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:18 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each webapp are scoped for that webapp only. As an example, create the following .jsp file and name it session.jsp. Put it in webapp1 html head titleTesting Session Management/title /head body % out.print(Session ID = + request.getSession().getId() ); % /body /html Then, if you were to do a low-level http request from the server, you'd see something like: bash-2.05$ ./telnet -E localhost 8080 [ -- I type
RE: Please help clarify or confirm -- HttpSession
Thanks for all the reply and discussion on the question I asked. I am very interested in doing some proof-of-concept work by sharing the ClassLoader on two web apps. Can someone show me some sample code on how to specify a common class loader for two different web apps? I am running WebLogic 6.1. Thanks... -Original Message- From: Joseph Barefoot [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:50 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession The container makes sure that Session ID's are unique. It sets the cookie as well - nothing in the webapp has to do this. This is just how the containers work. Of course. Regarding storing objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. First, you can't physically store an object in another webapp because the memory spaces are isolated from each other. Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. But there are ways to share objects (in addition to classes) between webapps. And at times there may be good reasons to do so. For example, imagine you have an object representing a transaction to be executed on your system (maybe a stock trade). What if: - The user who entered the transaction wants to see its real-time status. - A trader who is going to execute the transaction needs to see it, and - An auditor needs to monitor all trades currently in the system. Imagine also you want them to use three seperate webapps (or non-servlet applications) to do their work. While not the only approach, it is possible to have all access the same physical Java object. Here are some ways: 1. Implement the Object as an Entity EJB in an EJB container such as JBOSS. Have all the webapps (or whatever) connect to the same EJB Container instance and manipulate the data in the object. The EJB container will manage locking and transactional integrity for you as well. 2. Create the object as a singleton in some JVM somewhere and wrap an RMI server around it. This is basically a hack, but I saw it done once to allow clustered applications to share Properties objects between them (ensuring they were all using the same Properties). (And, yes - it was a pain.) 3. Put the object behind a web service and access it via SOAP. This allows some of the clients to be non-Java. All these solutions are based on putting the object in some place OUTSIDE any of the individual webapps. Putting an object into a shared classloader DOES put it OUTSIDE of any of the individual webapps, in that that object's existence is not dependent on the existence of any webapp. If this were not true, then the classloader hierarchy employed by app. servers would be meaningless. peace, joe Joseph Barefoot [EMAIL PROTECTED] on 06/13/2002 02:09:43 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc:(bcc: Kevin Bedell/Systems/USHO/SunLife) Subject: RE: Please help clarify or confirm -- HttpSession hmmm...but the sessionIDs have to be unique, even across web apps., correct? If there weren't unique, URL rewriting would not work correctly if two users using two webapps on the same app. server happened to get the same session ID. Therefore, one *should* be able to store objects from webapp A in a shared classloader class keyed by the sessionID and retrieve them from webapp B. Am I missing something here? (besides why the hell you would want to do this) :) joe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 10:46 AM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession In general, there is no way session info from one webapp can be made visible to other webapps. Some details of this may vary depending on your app server. Sessions are controlled by cookies being set on the client. The cookies that are set by each
RE: Please help clarify or confirm -- HttpSession
Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. Sorry, misunderstood you. I'm not sure if this would work either, but I follow your logic. Seems like it would be easy to try. Just create a simple static class holding a counter and then hit two diff web apps that increment and display its value. Looking at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec 2.3 sections 9.4 9.6) provides exactly this functionality. It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
Damn, not yet ready to go to Tomcat 4.x. Might be a good argument to start moving that direction. (:-) Thanks to everyone for their comments - it's given me plenty to think about. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:00 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. Sorry, misunderstood you. I'm not sure if this would work either, but I follow your logic. Seems like it would be easy to try. Just create a simple static class holding a counter and then hit two diff web apps that increment and display its value. Looking at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec 2.3 sections 9.4 9.6) provides exactly this functionality. It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design/construction process. question
Yeah Excellent, yahh booo...you suck too. I still think we don't quite live up to the MG standard though - yoiu let yourself down on the 'take back', but thanks, hehe ;-) Niall -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 13 June 2002 18:35 To: [EMAIL PROTECTED] Subject: RE: Struts Design/construction process. question We may be heading off topic here... I started out at the tail end of that era... I swore an oath that I would never work on a mainframe and managed to avoid COBOL, RPG, JCL, Mainfram Assembler, Fortran except in school... Now back our regularly scheduled topics MAINFRAMES SUCK! (Happy Niall?) (incidentally the above was in jest - I hear you can run Linux on them now...) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:00 PM To: struts-user Subject: RE: Struts Design/construction process. question Hard to believe there was a time when Cobol ruled the universe and programs were designed in a 'top-down' fashion isn't it? And as an old (actually 40+) mainframe programmer who is trying to make the transition from the non-object world of Cobol and (gasp here) assembler to the object-oriented world of Java (and JSP and struts and XML and and and), there are times when I really miss those 'good old days'. But then I think, nah, just post a question on the mailing list and get the 'right' answer from all of you guys! Jerry -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 11:51 AM To: Struts Users Mailing List Subject: RE: Struts Design/construction process. question I saw this thread and thought...great, flame war..., but you guys are too nice. IMHO I suggest you learn from the guru before trying this next time: http://www.IamMarkGalbreath.org/FlameWar/HowTo/AnnoyTheHellOutOfEveryone Niall P.S. 'old (35?) mainframe programmers' on this list must have seen the light...Hallelujah! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I'd like to apologize for that comment... I did not mean it as a bad thing... I guess I just liken the old mainframes with the old programming methodologies that involved tons of upfront planning and an pretty unflexible design once programming started. Back when the project delivery times were in years, not weeks... :) -Original Message- From: Jerry.Jalenak [mailto:[EMAIL PROTECTED]] As an 'old mainframe programmer' I resent this. (:-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] I tend to agree on this. I have only done a few things in struts, but have been programming for quite a while. The idea of pumping everything out in seperate development projects just out right scares me. If this was to have any chance of working out you would need: (1) A horrendous amount of upfront planning (2) Program requirements that don't change at all (3) A programming team that would not quit during an upfront design this heavy All in all, if its a large project you could probably dub it a death march project. #1 is too terrible to consider, #2 is just plain silly, #3... well... Personally, iterative development has worked in most of the projects I have been on and run. Thats all from here... PS. Are the project managers old mainframe programmers or something? -Original Message- From: josephb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:54 PM To: struts-user Subject: RE: Struts Design/construction process. question This reminds me of the adage a former professor of mine used to preach: It is much easier to build a program than to give birth to one. The pump out a list of components and while bringing the page to life parts of your message make it sound an awful lot like your project management is involved in obstetrics in addition to software development. :) Seriously, though, you *will* run into problems doing things this way. For instance, having a junior developer create 60 form beans for the expected inputs on each page has several implications: 1. Your action developers will have to modify the beans anyway most likely because the form bean developer cannot know things like whether an array or a List is more appropriate for collection data in a particular instance (this usually depends on the Action). 2. A naming convention for the beans must be established or madness will ensue. 3. It may make sense to re-use a form bean for different jsps, or nest form beans depending on the implementation of the action classes. The form bean developer will not know the nature of this implementation ahead of time and thus cannot make these decisions. b.t.w., there are tools (or you
RE: Please help clarify or confirm -- HttpSession
Kevin wrote: It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. Thanks for the support Kevin, I was beginning to wonder if everyone thought I was wacko for suggesting this. :) I do realize that this isn't the most robust or generic solution in the world, but it damn sure would be easy to implement. Jerry (or anyone else interested): If you do test this out, could you please post your conclusions back to the list? This has been a very interesting thread for me (having dealt with classloader craziness in the past), so I'm curious if theory is backed by reality in this case. peace, Joe Barefoot -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:17 PM To: 'Struts Users Mailing List' Subject: RE: Please help clarify or confirm -- HttpSession Damn, not yet ready to go to Tomcat 4.x. Might be a good argument to start moving that direction. (:-) Thanks to everyone for their comments - it's given me plenty to think about. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:00 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. Sorry, misunderstood you. I'm not sure if this would work either, but I follow your logic. Seems like it would be easy to try. Just create a simple static class holding a counter and then hit two diff web apps that increment and display its value. Looking at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec 2.3 sections 9.4 9.6) provides exactly this functionality. It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Please help clarify or confirm -- HttpSession
I've got the framework and initial application to complete and demo before next Wednesday, so I'm a little tight on time. Hopefully around the first of the July I'll some time to play around with this. In the meantime if anyone else can give it a go, please be sure to let everyone know. Thanks. Jerry -Original Message- From: Joseph Barefoot [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:28 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession Kevin wrote: It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. Thanks for the support Kevin, I was beginning to wonder if everyone thought I was wacko for suggesting this. :) I do realize that this isn't the most robust or generic solution in the world, but it damn sure would be easy to implement. Jerry (or anyone else interested): If you do test this out, could you please post your conclusions back to the list? This has been a very interesting thread for me (having dealt with classloader craziness in the past), so I'm curious if theory is backed by reality in this case. peace, Joe Barefoot -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:17 PM To: 'Struts Users Mailing List' Subject: RE: Please help clarify or confirm -- HttpSession Damn, not yet ready to go to Tomcat 4.x. Might be a good argument to start moving that direction. (:-) Thanks to everyone for their comments - it's given me plenty to think about. Jerry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:00 PM To: Struts Users Mailing List Subject: RE: Please help clarify or confirm -- HttpSession Second, having common directories on the two CLASSPATHS for the two webapps allows you to load CLASSES to create new objects, but not to share the objects once they are created. True, but not what I suggested at all. Two webapps sharing a common CLASSPATH is far different from them having access to a common (shared,parent) CLASSLOADER. In the former two different classloaders are loading the same class into two different memory spaces, as you say. In the latter, a parent classloader is loading a class into a memory space accessible by either of the two child classloaders for the webapps. So I fail to see why a static class with static resources loaded by this parent classloader will not enable objects to be shared between the two child classloaders, so long as the objects themselves are also created from classes loaded by the shared classloader. Note that I am also not claiming that this will 100% work, I just don't see why it wouldn't. Sorry, misunderstood you. I'm not sure if this would work either, but I follow your logic. Seems like it would be easy to try. Just create a simple static class holding a counter and then hit two diff web apps that increment and display its value. Looking at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html it looks as it the Classloader Hierarchy in Tomcat 4.1 (per the Servlet Spec 2.3 sections 9.4 9.6) provides exactly this functionality. It even says that the shared class loader exists for classes and resources that you wish to share across ALL web applications. So as long as you've got a 2.3 compliant container and you can get the functionality you need from a static class, then this should work. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and
RE: Starter question
When you say struts complained... Can you be a little more informative? also, if you could paste in the relevant parts of the Struts-config.xml it would be great... Here are some of mine... (Also, if you are using Struts 1.1, get the Struts-console... form-beans form-bean name=drillDownReportForm type=com.ebind.twizard.reports.drillDownReportForm / /form-beans action-mappings action path=/drillDownReport parameter= type=com.ebind.twizard.reports.drillDownReportAction name=drillDownReportForm scope=request validate=true input=/WEB-INF/jsp/twizard/reports/drilldown.jsp set-property property=name value=drillDownReportForm / set-property property=scope value=request / forward name=continue path=twizard.drilldown redirect=false / forward name=success_area path=twizard.reportdisplay.area redirect=false / forward name=success_group path=twizard.reportdisplay.group redirect=false / /action action path=/index parameter= unknown=true forward=twizard.mainmenu forward name=success path=twizard.mainmenu redirect=false / /action action path=/todo parameter= forward=twizard.todo / action path=/login parameter= forward=global.login / -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 2:10 PM To: struts-user Subject: RE: Starter question When I tried action without name property, Struts complained. Can you give me a sample action struts-config element? Probably I'm missing something. /tb. On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote: Unless you are submitting the request from a form you do not need an actionform that I know of. If you are always displaying the same list i think you want to: Invoke the action The actions perform method should get a collection of beans representing each row in the database. You then stuff the collection into an attribute in the session the forward action should send you to the JSP page to display it where you iterate through it using the html taglib in struts... This is in a nutshell and does not necessarily cover good practices but it will get you working -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:26 PM To: struts-user Subject: Starter question Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Using a resource file for managing Form errors
Problem: I am trying to use a separate resource file for managing errors coming out of the form validation in an ActionForm. How do I access this resource file? This is a second resource file defined in my struts-config.xml file. Steps taken so far: - 1. Defined a Message Resource in the struts-config.xml file as follows: message-resources parameter=com.myDomain.RegistrationFormResources / 2. Dont have a clue how to utilize this in the ActionForm's Validate method. Tried doing this.. if ((addressLine_1 == null) || (addressLine_1.length() 1)) errors.add(addressLine_1, new ActionError(error.RegistrationForm.addressLine_1.required)); I checked the archives for finding out the answers, but could not find any. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33400.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33035.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31667.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31424.html Any help will be much appreciated. Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Re: Nested Tags question
When I use nested tags, I am not able to access it through java scripts since the name is mailingAddress.city. Does anyone have a work around or am I missing something? Jayaraman -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:23 PM To: Struts Users Mailing List Subject: Re: Re: Nested Tags question On Thu, 13 Jun 2002 [EMAIL PROTECTED] wrote: Date: Thu, 13 Jun 2002 11:43:59 +0200 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Re: Nested Tags question So Craig, does the process work at submit time (when the request parameters are being put into the nested beans) via calls to the getter methods to get the beans on which the parameters have to be set? I can't see how else it would work. It depends on what context you are using the expressions in. For example: !-- Assume the form bean name is customerForm -- html:form action=/editCustomer ... html:text property=mailingAddress.city/ ... /html:form will, in effect, do a call to: customerForm.getMailingAddress().getCity() when the page is displayed, and a call to: customerForm.getMailingAddress().setCity() when the request parameters are being copied in to the form bean. Adam Craig Craig R. McClanahan [EMAIL PROTECTED] schrieb am 13.06.2002, 08:22:43: On Thu, 13 Jun 2002, Arron Bates wrote: Date: Thu, 13 Jun 2002 14:14:13 +1000 From: Arron Bates Reply-To: Struts Users Mailing List To: Struts Users Mailing List Subject: Re: Nested Tags question I know JSP will automatically save parameters to a javabean with the correctly named getters and setters, but there's obviously a gap in my knowledge because all my attempts to recreate the situation above have failed. Setting form properties against beans is a Struts thing, not a JSP thing. The property thing is a Bean thin and can be looked up in the JavaBean spec. The example you quote... monkeyTeamAlpha.monkeyWorkers[0].salary ...is a nested property. An invention implemented within Struts (Craig?). Yep, although in Struts 1.1 it is really a commons-beanutils thing because we abstracted out this generally useful code into a separate package. What it basically is, is a string of calls rather than the single property method. Here, it will get a hold of the form bean, get a hold of the bean returned from the monkeyTeamAlphaproperty. On this bean, it will invoke the indexed property monkeyWorkers[0] which will pluck a bean from a collection or index provided, from this last bean it will will get a hold of its salary property, and set the value. At each stage, you also get the benefit of some intelligence that is built in to the underlying PropertyUtils class. For example, the JavaBeans spec defines two ways to define an indexed property -- you can use getter and setter methods that take a value and a subscript, or you can use getter and setter methods that return the entire array. PropertyUtils makes the expression listed above work for either (or even for a property whose value is a java.util.List, which is an extension to the JavaBeans spec). All this boils down to, is that you can compose objects a little cleaner, rather than have truly enormous beans for everything. Having the indexed properties allows for lists and whatever else. The ability for nesting beans has been in Struts for a long time. The nested tags just make it much easier. There's a primer and tutorial for nested beans here... http://www.keyboardmonkey.com/next ...it should take you over creating and using such a construct. Hope this gets you on th path you're after. Another area of useful learning for the future is the JSP Standard Tag Library (JSTL). Although the expression language syntax supported by JSTL is different from the one in Struts, it is well worth learning about -- this expression language will be supported anywhere in a JSP page in JSP 1.3, and (in the mean time) we will likely adapt Struts tags to be able to use it as well. Arron. Craig -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Using a resource file for managing Form errors
Seem to be finding my own answers: Since I did not find any clear answers in the archives, here is the procedure of doing this 1. Define the Resource bundle in the struts-config.xml file. If you have a resource bundle by name FormErrorResources.properties, then define it as follows: message-resources parameter=com.myDomain.FormErrorResources / Note: a. The resource bundle is expected to have the extension .properties . If you do not have this it will not work b. The path to the resource file uses the java package naming convention. So in the above example, it implies that the resource bundle resides in the WEB-INF/classes/com/myDomain/ folder. So if you have the resource bundle in the classes folder your parameter value should be just your resource bundle file name minus the .properties extension 2. If you want to check you have successfully configured it, try the following: MessageResource msgRes = servlet.getResources(); servlet.log (msgRes.getMessage (key); This will log the message corresponding to the key in your log file if you are using Tomcat. Muki Soomar --- -Original Message- From: Soomar, Muki (R.) [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 3:21 PM To: Struts-User (E-mail) Subject: Using a resource file for managing Form errors Problem: I am trying to use a separate resource file for managing errors coming out of the form validation in an ActionForm. How do I access this resource file? This is a second resource file defined in my struts-config.xml file. Steps taken so far: - 1. Defined a Message Resource in the struts-config.xml file as follows: message-resources parameter=com.myDomain.RegistrationFormResources / 2. Dont have a clue how to utilize this in the ActionForm's Validate method. Tried doing this.. if ((addressLine_1 == null) || (addressLine_1.length() 1)) errors.add(addressLine_1, new ActionError(error.RegistrationForm.addressLine_1.required)); I checked the archives for finding out the answers, but could not find any. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33400.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33035.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31667.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31424.html Any help will be much appreciated. Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Bean Instances
Hey everyone, I have a question for anyone that wouldn't mind helping me out a little bit. I have a form that stores a property in bean. I have a separate action mapped in my struts-config that is run from a different page that uses the same bean name. however, it seems to create a new instance of the bean. If i'm using the same bean name, is a new instance created for each action that i have mapped (that uses the same action class) or is it supposed to reuse that same instance? I'm not sure if I've been been clear enough about what I'm trying to say, but hopefully it's understandable. Keith Kamholz Moog East Aurora, NY (716) 687-7282 [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
servlet.getResources() method - deprecated ??
I am getting a deprecated warning when doing this, although when looking up the documentation on the the API (JAVADOC) link on the Struts site does not say that. Do we have the latest documentation on the site ? Using struts version 1.0.2 Thanks. Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Bean Instances
If I understand what you want, here is an example of how we do this: Here is the the java action and by using the input form, we can get a connection to the original instance and get thisReportForm. I hope this helps. The InsCommonReportForm is a common bean that our workgroup uses for different jsps. It sounds like you want to do a similar thing. public ActionForward perform( final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { if( isDebug() ) log( In perform method - DetailedDependent21ReportAction ); // Create Struts application errors object final ActionErrors errors = new ActionErrors(); RequestResult result = null; ActionForward forwardURL = null; final InsCommonReportForm thisReportForm = (InsCommonReportForm)form; Now use thisReportForm.methods/attributes names and go. Kamholz, Keith (corp-staff) USX [EMAIL PROTECTED] wrote: Hey everyone, I have a question for anyone that wouldn't mind helping me out a little bit. I have a form that stores a property in bean. I have a separate action mapped in my struts-config that is run from a different page that uses the same bean name. however, it seems to create a new instance of the bean. If i'm using the same bean name, is a new instance created for each action that i have mapped (that uses the same action class) or is it supposed to reuse that same instance? I'm not sure if I've been been clear enough about what I'm trying to say, but hopefully it's understandable. Keith Kamholz Moog East Aurora, NY (716) 687-7282 [EMAIL PROTECTED] -- To unsubscribe, e-mail: For additional commands, e-mail: - Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup
RE: Starter question
My bad.. Without name property action does the job for me now. I wonder what you meant by does not necessarily cover good practices. Would you spot on this a little? /tb. On Thu, 2002-06-13 at 20:51, [EMAIL PROTECTED] wrote: Unless you are submitting the request from a form you do not need an actionform that I know of. If you are always displaying the same list i think you want to: Invoke the action The actions perform method should get a collection of beans representing each row in the database. You then stuff the collection into an attribute in the session the forward action should send you to the JSP page to display it where you iterate through it using the html taglib in struts... This is in a nutshell and does not necessarily cover good practices but it will get you working -Original Message- From: tbaskan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 1:26 PM To: struts-user Subject: Starter question Hello everyone, I'm a beginner for Struts and can't still figure out how to do simple things with the framework. My difficulties are generally related with MVC, I think. For traning, I want to accomplish probably the easiest dynamic page for a web application: a page that shows some portion of a database table. To my understanding, I need the following: 1. a model object must have a static method that fetches rows from the database table and puts them in a Collection object. 2. a JSP page containing logic:iterate tags to iterate over this Collection. Now.. My real problem is how to attach these together. I decided to do this with an Action. I mean, when user hits a page like /myapp/groupList.do, the Action's perform method gets the Collection from model and sets it as a PageAttribute. But failed. Every action in configuration file needs a name property, which is an ActionForm. Do I need an ActionForm in this case? I need some enlightening. /tb. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionForm question
I am looking into the same problem... I just read chapter 7 and did not see anything about it... HELP? -Original Message- From: msoomar [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 12:25 PM To: struts-user Subject: RE: ActionForm question Dont have to answer this. Sorry, for posting it. Got the answer - Chuck's Chapter 7 talks about it. Thanks. Muki Soomar Where do we define where the view gets forwarded to by the ActionServlet when we encounter validation errors from an ActionForm in the struts-config.xml file? Or do we not need to do that at all and the original view gets selected and uses the html:errors/ tag which displays the errors in the ActionErrors object ? Anybody .. any help .. ? Muki Soomar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]