Please
unsubscribe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Model Layer in the MVC framework
Is there an alternative to Spring Integration. I have a project that I need to get a prototype out to the client FAST and I simply want to implement a Model layer with connection pooling. I have gone to the Spring Framework site and I don't have the time to come up to speed on how to make this useful. Any alternatives would be appreciated. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Larry Meadors Sent: Monday, September 11, 2006 6:43 PM To: Struts Users Mailing List Subject: Re: getDataSource, DAO pattern, and Struts On 9/11/06, Darren Hall <[EMAIL PROTECTED]> wrote: > So, should I use the datasource functionality provided in struts, or should > I "roll my own" database connection solution by creating a datasource > factory that can be used to retrieve connections? I wouldn't do either. If you can, use Spring to do this, and to wire together not just the DAO, but also to wire your services to the actions, and the DAOs to the services. Spring will give you simple abstraction if that is all you want, or all sorts of things beyond just that simple abstraction if you want. Larry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Submitting forms with javascript in struts
I'm confused here. Is it your intent to pass a variable 'what' from your form to the action? I think the problem is that you need to assign the value what to a hidden element then in your java script assign the value to the value of the hidden element document.form.cpKey.value = what; then if your form as the proper setters and getters for cpKey you can get the value in your action method. Hope this helps -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 12, 2006 4:20 AM To: user@struts.apache.org Subject: Submitting forms with javascript in struts Hello, I do have a problem, because I don't know how to submit a form with javascript in struts. Normally, I'm submitting forms like this: I'm receiving the value with the getter-method getMyvalue() of the appropriate ActionForm. This time, I want to submit the form with a Some text dosubmit is a function like dosubmit(what) { document.formname.value=what; document.formname.submit(); } The browser submits the form (I'm getting no javascript error), but I don't get the value of document.formname.value. I would be glad to get some help, kind regards, Andreas Hartmann BTW: Is there a way to send another value in the html:submit - button as this, which is displayed to the user? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Resources
I can't remember the last time I felt so embarrassed. With 30+ years of writing code and get this. The Application that I copied the page from had the code fragment ERROR: Application resources not loaded -- check servlet container logs for error messages. Thanks -Original Message- From: Adam J Samere [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 7:28 PM To: Struts Users Mailing List Subject: Re: Application Resources Try using more verbose logging. If using log4j for instance, set the level for org.apache.struts to debug, then watch the log file as the web application is deployed. Make sure whatever file(s) you specified in the struts-config doc(s) are available to the web applications context class loader. Adam Ray Madigan wrote: > I have checked all of the logs. I have built many Struts applications in > the past using previous versions of struts and Tomcat. If I knew what exact > Application resource the message is about, I could make some progress. > > I thought it was MessageResources.properties because in the beginning I > didn't include this file because I use JSTL fmt tags to display my messages. > I have just included the doesn't work. > > Thanks > > -Original Message- > From: Darren Hall [mailto:[EMAIL PROTECTED] > Sent: Monday, September 11, 2006 7:03 PM > To: 'Struts Users Mailing List' > Subject: RE: Application Resources > > > >> If you are using Tomcat, have you looked in stderr and stdout files for >> today in that directory? >> > Sorry - "that directory" would be the $CATALINA_HOME/logs directory (if you > are using Tomcat). > > Darren > > > -Original Message- > From: Darren Hall [mailto:[EMAIL PROTECTED] > Sent: Monday, September 11, 2006 9:43 PM > To: 'Struts Users Mailing List' > Subject: RE: Application Resources > > Ray, > > What application server are you using? Tomcat? > If you are using Tomcat, have you looked in stderr and stdout files for > today in that directory? (Not sure how much help I can be here, but I'm > starting simple. We may quickly run out of my depth.) > > Darren > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Resources
I have checked all of the logs. I have built many Struts applications in the past using previous versions of struts and Tomcat. If I knew what exact Application resource the message is about, I could make some progress. I thought it was MessageResources.properties because in the beginning I didn't include this file because I use JSTL fmt tags to display my messages. I have just included the mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 7:03 PM To: 'Struts Users Mailing List' Subject: RE: Application Resources > If you are using Tomcat, have you looked in stderr and stdout files for > today in that directory? Sorry - "that directory" would be the $CATALINA_HOME/logs directory (if you are using Tomcat). Darren -Original Message- From: Darren Hall [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 9:43 PM To: 'Struts Users Mailing List' Subject: RE: Application Resources Ray, What application server are you using? Tomcat? If you are using Tomcat, have you looked in stderr and stdout files for today in that directory? (Not sure how much help I can be here, but I'm starting simple. We may quickly run out of my depth.) Darren - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Application Resources
I haven't written a Struts application for over a year now and I am having some trouble. I have an application configured with only a welcome page taken from the Struts blank application. No matter what I do to display this page I get the message ERROR: Application resources not loaded -- Check servlet container logs for error messages. I check the logs and there are no error messages. Can anyone suggest to me where to look to find the fault? Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: help for changing the language, locale
You change the language using for English. then you need the resource bundles for resource_en.properties that fmt looks up For example needs file Foo_en.properties in the WEB-INF/classes directory of your webapp. For your application you would use a mailto:[EMAIL PROTECTED] Sent: Sunday, November 20, 2005 9:19 AM To: Struts Users Mailing List Subject: Re: help for changing the language, locale it runsbut i have one problem. in my struts pages i am working with fmt and jstl and this doesn't run with these (jstl, fmt). which is the solution? can anybody helps me? thanks - Original Message - From: "Danny Lee" <[EMAIL PROTECTED]> To: Sent: Sunday, November 20, 2005 2:24 PM Subject: Re: help for changing the language, locale > Well, > > that's really easy, just do: > > "request.getSession().setAttribute(Globals.LOCALE_KEY, new > locale(languageCode));" > > in your action, where languageCode is the locale you wish to use. > > Cheers > > Danny > > > > Miren Urkijo schrieb: >> HEllo y havo one struts aplicaicon. >> if into the borwser i change the locale, into the browser properties, my >> application load the properties files well. >> i am thinking for making onw struts action for changing the language, >> thelocale but i dont knows how to change it. >> can anybody says me how must i make it? >> thanks > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(OT) taglib
I know this is not a topic for this forum, I have posted this to the taglib mailing list with no response. In one week only a couple of posts were made. I am trying to use the ... ... ... I have tried usins setBundle as the top level Bundle and get the same result. I would very much appreciate any ideas Thanks in advance Ray Madigan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:checkbox
Greetings, I remember getting something like this to work in the past, I have searched and cannot find what is missing, or what I'm doing wrong, or if it is even possible. I want to connect a set of checkboxes to a HashMap in my action form. In my ActionForm I have a two methods like public void setValue ( String key, boolean value ); public boolean getValue ( String key ); in the form reset method I clear the HashMap. For the Action Class method of the class I initialize the hashmap like: theForm.setValue ( "Foo", false ); theForm.setValue ( "Bar", true ); In my JSP i have tried many things like ... ... When I do this I get a an exception no getter method for property 'value("Foo")' of bean org.apache.struts.taglib.html.BEAN I have tried many alternatives, too many to post here. Is this supposed to work? Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: display the form values from view page
I would advise you read the sections http://struts.apache.org/userGuide/introduction.html that explain how an ActionForm works and how you get/set the form properties. You need an ActionForm linked to your Action and struts will scrape the properties from your page into the form and you just manage the form. -Original Message- From: Joe Smith [mailto:[EMAIL PROTECTED] Sent: Friday, June 10, 2005 11:01 PM To: user@struts.apache.org Subject: display the form values from view page register.jsp is the view page, and when the user click submit button, it will go to result.jsp based on struts-config.xml. The followings are the code fragment of each significant files. My question is for result.jsp, I am now using request.getParameter("name") to get the name property specified in the form. It is working code, I just want to ask if this is the best appraoch in struts application? Please advise. thanks!! register.jsp = Name: Address: ZIP: Register Online result.jsp == Name = <%= request.getParameter("name") %> struts-config.xml = RegisterAction.java === public ActionForward execute(...) { //etc... forward = mapping.findForward("success"); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles]
Thanks for the information, I have a demo to give on Monday so I took the easy road and hacked a solution. It turns out mailto:[EMAIL PROTECTED] Sent: Friday, June 10, 2005 5:37 AM To: 'Struts Users Mailing List' Subject: RE: [Tiles] See intermixed > -Original Message----- > From: Ray Madigan [mailto:[EMAIL PROTECTED] ==== > > > I read the paper > > http://www.browsermedia.com/devcorner/whitepapers/tiles201.jsp > > which explains how to add attributes into a tile of a > definition then it > invokes the page. > > Unfortunatly all I want to do is replace the page that the > layout uses to > render the layout, without the calling page having to care about it. > > Humpf! > This is a limitation of Tiles. If I remember rightly, it was slightly disconsenting to look in Ted' books "Struts In Action" and see an example where there is a Tiles Definition with $ dollar notation and then read the text that it will never work. I think the only to do is with a special Struts or Tiles Action class. In other word you write an action `ViewInterceptor' that accepts a parameter `pageInclude' which is URL to a page in your application. You translate the token ${skin-directory} to whatever in relevant e.g a Folder name for skin path. You can invent an token and semantics you want. This actions simply request dispatch includes the transformed page URL. You tell the request processor not to perform action forward by returning `null' in your action. The above works because Tiles is itself performing a request dispatcher include, so the `ViewInterceptor' is just another level of indirection. The advantage is you can also set tiles attributes and push them to the request scope for example. etc etc It would be better if Struts Tiles had dynamic binding on the values of definitions (or components).We could employ the following schemes, then : (*) allowed String token substitution (*) access to Expression Language evaluator (*) had hooks like JSF with it VariableResolver interface. > -Original Message- > From: David G. Friedman [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 08, 2005 3:36 PM > To: Struts Users Mailing List > Subject: RE: [Tiles] > > > Ray, > > If Xinsheng [mike] Huang's suggestion about using the JSP ($) > dollar sign > notation doesn't work, I'd suggest looking at giving your > template a tiles > controller so you can set the navi attribute to some object > and scope. That > way the controller can specify the insert automatically > before the tile is > rendered and without having to put code into every action, > just that one > tile's controller class. > > Regards, > David > > -Original Message- > From: Ray Madigan [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 08, 2005 5:18 PM > To: Struts Users Mailing List > Subject: RE: [Tiles] > > > I have a fairly simple situation where a set of pages are > used throughout > the application. Based on a set of crriteria known about > the user, I want > the page to use a set of common tiles to fill some parts of > the page, like > the header of the page. Other parts of the page are filled > with specific > tiles relative to what the page is attempting to show. > Instead of each of > the pages that use the layout setting the attribute, I > thought if it was > computed in the layout, I would save some management of these entries. > > -Original Message- > From: David G. Friedman [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 08, 2005 1:58 PM > To: Struts Users Mailing List > Subject: RE: [Tiles] > > > Ray, > > What architectural problems prevent you from either using a > TilesAction, > instead of a regular action, or a tiles controller to look > those things up > and set them for you so the page doesn't need to be 'that smart?' > > Regards, > David > > -Original Message- > From: Ray Madigan [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 08, 2005 5:01 PM > To: Struts Users Mailing List > Subject: [Tiles] > > > I have beat this situation to death without coming up with an answer. > > I want to create a tile layout that includes a composed tile > in the layout > definition. > > Any suggestions would be appreciated > > It needs to look like > > > > > > > > > ** > > OR > ** > ** > **
RE: Multiple user - problem
You wrote: As using DynaValidatorForm, not sure how to reset the properties. If you look at the javadoc on this class you will see a reset method where you need to reset the properties to their initial state. -Original Message- From: croffman [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 12:50 PM To: Struts Users Mailing List Subject: Re: Multiple user - problem Thanks for the quick responses. Here is some more info: 1. >Is it worse with more users? This was done by manual users, before load testing. Couldn't try that now. 2. >Do you keep any non-synchronized user-specific info in an instance of a class that is only instantiated once (like a servlet or action)? That gets a lot of people even though it's in all the documentation. Looks like there is a similarity. But not sure. Had a MAIN action class (which extends from TilesAction), which contains a protected class defined and that got the CDTO in it. Whereever needed in all the action classes, the CDTO is got from this protected class. Is there any problem here? 3. >-synchronisation of all method calls No where explicit synchronization is being used in the application. 4. >-scoping of data entities(assuming you are implementing with beans) Kept the forms in request scope. 5. Also - are you resetting all of the properties in your forms classes. If not, some of the data set by one user can bleed over to another user. As using DynaValidatorForm, not sure how to reset the properties. In the app, are using Struts form-beans (org.apache.struts.validator.DynaValidatorForm). And in the action classes, calling the delegate by passing the cdto (custom data transfer object), which contains the request data. And when the delegate calls the EJB's, it gets the data from database and populates the custom data transfer object and sent back to the action class. And in the action class, this cdto is copied back to form. The wrong data came up for one user only. Is there any chance that this cdto is shared and being used for two users. Couldn't think of a chance, but...? Is there any chance by POINT #2 above. And EJB's are stateless and Entity Beans are with container managed persitance. Once again thanks for your suggestions. Croff - Original Message - From: "Martin Gainty" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, June 09, 2005 2:22 PM Subject: Re: Multiple user - problem > both concepts are applicable in that > scoping of session based information should ultimately pull from > user-neutral entity (such as Class Object) whose end of life is not > dependent on either client session passivation or client session termination > Any underlying synchronisation mechanisms for entities (synchronised > objects) are entirely dependent on selection of scope and > whether the implementor is controlling the object via declarative or > programmatically means > > Here are some good reads > Problem Scenario for Stateful Session Beans > http://docs.sun.com/source/817-2162-10/bpstatement.html > Software Architecture in Practice: The Luther Architecture > http://www.awprofessional.com/articles/article.asp?p=32063&seqNum=3 > > HTH, > Martin- > - Original Message - > From: "Dave Newton" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Thursday, June 09, 2005 1:47 PM > Subject: Re: Multiple user - problem > > > > Martin Gainty wrote: > > > >> -synchronisation of all method calls > > > > Why all? (Really, why _any_, since you can synchornized any shared data > > structures.) > > > >> -scoping of data entities(assuming you are implementing with beans) > > > > Unless he's storing user data in application scope, this shouldn't be an > > issue, should it? > > > > Dave > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple user - problem
The class org.apache.struts.action.ActionForm has a reset method. For a long time I would add form property variables without handling them in the reset method. I would get old values in the form and was getting spurious data in the forms. It is hard for me to believe you got past a single user with out resetting the properties, unless you only write to them. If you use the form properties to assist in populating your form, the properties need to be reset. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 10:59 AM To: Struts Users Mailing List Subject: Re: Multiple user - problem Ray Madigan wrote: >Also - are you resetting all of the properties in your forms classes. If >not, some of the data set by one user can bleed over to another user. > > ?! Really? I was not aware of that; we deployed and load-tested a Really Big Sruts app internally at a large company. Under what circumstances might that happen? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple user - problem
Also - are you resetting all of the properties in your forms classes. If not, some of the data set by one user can bleed over to another user. Hope that helps -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 10:15 AM To: Struts Users Mailing List Subject: Re: Multiple user - problem croffman wrote: >Using Struts & EJB's - For load testing, facing a problem, that if 10 multiple users are accessing at the same time, only one user is getting other user data (WRONG data) out of 10 users. But all other 9 users are getting correct data. > >The wrong data for that one user, is from one out of 9 other users. > > Is it worse with more users? Do you keep any non-synchronized user-specific info in an instance of a class that is only instantiated once (like a servlet or action)? That gets a lot of people even though it's in all the documentation. Without any more specific information it'll be really tough to be helpful in any meaningful way. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Tiles] and Parameter Substitution
Does anyone know hoe to get around using the tiles tags to utilize ${} EL expressions. I have asked this question before, but not as explicitly. I need to be able to either ... or The reason is all of my pages are context driven from the perspective of the user and the business they perform. I don't want to have to have all of my pages look like ... This will be way too much to maintain. If it is unreasonable to have a tile within a page be dependent upon the user characteristics please give me another alternative. I am at the end of my rope, and will have to come up with another alternative. Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Toggle Colors between Rows
try www.husted.com/struts/resources/rowtag.zip This taglib is really easy to use. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 5:01 AM To: user@struts.apache.org Subject: Toggle Colors between Rows What is the best way to toggle colors between rows using logic:iterate keeping in mind the View (MVCno scriptlets!!) best practice.? Amitava Basak ASE Tata Consultancy Services Limited Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Automatic Javadoc - ing
Have you looked at ant.apache.org. ant has a javadoc and a javadoc2 task. -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 7:17 AM To: Struts Users Mailing List Subject: [OT] Automatic Javadoc - ing I have just pretty much wrapped up the development phase of a prject and am cleaning up the code etc. I want to add javadoc comments to all my classes.. but am looking for a way to do this automatically. Does anyone know of a tool that can do this. I use netbeans as an editor and they have some limited auto javadocing.. but im looking to just press a button out put code and move on. There are hundreds of classes and i will NOT do this by hand. Probabably should have been more diligent during development, but im a dope. -thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with -- Help me OUT
Use the styleId attribute! Frm the online API Guide styleId Identifier to be assigned to this HTML element (renders an "id" attribute). N.B. If present, the errorStyleId overrides this attribute in the event of an error for the element. [RT Expr] -Original Message- From: Kade Jeevan Kumar [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 5:24 AM To: user@struts.apache.org Cc: dev@struts.apache.org Subject: Problem with -- Help me OUT Hi! i have an html code
RE: Toggle Colors between Rows
I have a tag that I got from somewhere that allows you to set the even element class and the odd element class. It works great for me, if you want it, let me know and I will email it to you. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 5:01 AM To: user@struts.apache.org Subject: Toggle Colors between Rows What is the best way to toggle colors between rows using logic:iterate keeping in mind the View (MVCno scriptlets!!) best practice.? Amitava Basak ASE Tata Consultancy Services Limited Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles]
I read the paper http://www.browsermedia.com/devcorner/whitepapers/tiles201.jsp which explains how to add attributes into a tile of a definition then it invokes the page. Unfortunatly all I want to do is replace the page that the layout uses to render the layout, without the calling page having to care about it. Humpf! -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 3:36 PM To: Struts Users Mailing List Subject: RE: [Tiles] Ray, If Xinsheng [mike] Huang's suggestion about using the JSP ($) dollar sign notation doesn't work, I'd suggest looking at giving your template a tiles controller so you can set the navi attribute to some object and scope. That way the controller can specify the insert automatically before the tile is rendered and without having to put code into every action, just that one tile's controller class. Regards, David -Original Message----- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 5:18 PM To: Struts Users Mailing List Subject: RE: [Tiles] I have a fairly simple situation where a set of pages are used throughout the application. Based on a set of crriteria known about the user, I want the page to use a set of common tiles to fill some parts of the page, like the header of the page. Other parts of the page are filled with specific tiles relative to what the page is attempting to show. Instead of each of the pages that use the layout setting the attribute, I thought if it was computed in the layout, I would save some management of these entries. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 1:58 PM To: Struts Users Mailing List Subject: RE: [Tiles] Ray, What architectural problems prevent you from either using a TilesAction, instead of a regular action, or a tiles controller to look those things up and set them for you so the page doesn't need to be 'that smart?' Regards, David -----Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 5:01 PM To: Struts Users Mailing List Subject: [Tiles] I have beat this situation to death without coming up with an answer. I want to create a tile layout that includes a composed tile in the layout definition. Any suggestions would be appreciated It needs to look like ** OR ** ** **
RE: [Tiles]
I guess I'm not sure about Mike's suggestion. He wrote: use the "navi" is defined in tiles definition file like "header" does. Is this in the layout file? maybe im mixing up which file is which. I have a layout definition that includes the code in my original post. It is called from a jsp that inserts it along with some attributes. I want everything about this attribute to be dealt with in the layout file. I do not have a definition for this tile in the struts-config file. I don't understand what a tiles controller is. I read the javadoc on it and TileAction and can't figure how to implement it or how it can help. I copy the attribute (it this case Foo), which is in sessionScope into the layout tile. can see it, but I cannot get anything to work in the layout jsp itself. I think this is what Mike was saying. Is there any web literature on what a tile controller is, how it works, and how you implement one? Thanks -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 3:36 PM To: Struts Users Mailing List Subject: RE: [Tiles] Ray, If Xinsheng [mike] Huang's suggestion about using the JSP ($) dollar sign notation doesn't work, I'd suggest looking at giving your template a tiles controller so you can set the navi attribute to some object and scope. That way the controller can specify the insert automatically before the tile is rendered and without having to put code into every action, just that one tile's controller class. Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 5:18 PM To: Struts Users Mailing List Subject: RE: [Tiles] I have a fairly simple situation where a set of pages are used throughout the application. Based on a set of crriteria known about the user, I want the page to use a set of common tiles to fill some parts of the page, like the header of the page. Other parts of the page are filled with specific tiles relative to what the page is attempting to show. Instead of each of the pages that use the layout setting the attribute, I thought if it was computed in the layout, I would save some management of these entries. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 1:58 PM To: Struts Users Mailing List Subject: RE: [Tiles] Ray, What architectural problems prevent you from either using a TilesAction, instead of a regular action, or a tiles controller to look those things up and set them for you so the page doesn't need to be 'that smart?' Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 5:01 PM To: Struts Users Mailing List Subject: [Tiles] I have beat this situation to death without coming up with an answer. I want to create a tile layout that includes a composed tile in the layout definition. Any suggestions would be appreciated It needs to look like ** OR ** ** **
RE: [Tiles]
I have a fairly simple situation where a set of pages are used throughout the application. Based on a set of crriteria known about the user, I want the page to use a set of common tiles to fill some parts of the page, like the header of the page. Other parts of the page are filled with specific tiles relative to what the page is attempting to show. Instead of each of the pages that use the layout setting the attribute, I thought if it was computed in the layout, I would save some management of these entries. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 1:58 PM To: Struts Users Mailing List Subject: RE: [Tiles] Ray, What architectural problems prevent you from either using a TilesAction, instead of a regular action, or a tiles controller to look those things up and set them for you so the page doesn't need to be 'that smart?' Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 5:01 PM To: Struts Users Mailing List Subject: [Tiles] I have beat this situation to death without coming up with an answer. I want to create a tile layout that includes a composed tile in the layout definition. Any suggestions would be appreciated It needs to look like ** OR ** ** **
RE: [Tiles]
header is defined in the page that implements the layout. I don't every page to add the line to compute this attribute if I don't have to. Thanks -Original Message- From: Xinsheng [mike] Huang [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 1:57 PM To: Struts Users Mailing List Subject: Re: [Tiles] use the "navi" is defined in tiles definition file like "header" does. Ray Madigan <[EMAIL PROTECTED]> wrote:I have beat this situation to death without coming up with an answer. I want to create a tile layout that includes a composed tile in the layout definition. Any suggestions would be appreciated It needs to look like ** OR ** outputs the correct page --> ** ** Xinsheng [Mike] Huang SCJP -- Sun Certified Programmer for Java 2 Platform SCJD -- Sun Certified Developer for Java 2 Platform SCEA -- Sun Certified Enterprise Architect for J2EE 410-790-7462(C) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Tiles]
I have beat this situation to death without coming up with an answer. I want to create a tile layout that includes a composed tile in the layout definition. Any suggestions would be appreciated It needs to look like ** OR ** ** **
RE: Tricky configuration?
Why are you making your users type in the action anyway. Why don't you mask this so they don't know how you implemented it. There are several ways to make this transparent to the user! I can send details if you don't know how? -Original Message- From: amol k [mailto:[EMAIL PROTECTED] Sent: Friday, June 03, 2005 11:50 AM To: Struts Users Mailing List Subject: Re: Tricky configuration? > Why not just map /do/* to the action servlet insted of *.do http://myserver/Login.do to http://myserver/do/Login, etc is not an issue but Making the users type http://myserver/do/user/blahblah instead of http://myserver/user/blahblah is a usability issue. (will have to ultimately do that if there's no other option but I want to avoid /do before user/blahblah as far as possible) On 6/3/05, Rick Reumann <[EMAIL PROTECTED]> wrote: > Why not just map > > /do/* to the action servlet insted of *.do > > Then all of these would go through Struts.. > > http://myserver/do/Login > http://myserver/do/Logout > http://myserver/do/user/blahblah > > This obviously wouldn't go through struts.. > > http://myserver/pages/blahblah.jsp > > amol k wrote the following on 6/3/2005 2:39 PM: > > Here is what I am trying to achieve: > > > > http://myserver/Login.do --> (maps to) LoginAction > > http://myserver/Logout.do --> (maps to) LogoutAction > > http://myserver/user/blahblah --> UserPageAction (notice that there is > > no .do in this case. blahblah can be replaced by anything at runtime) > > > > http://myserver/pages/blahblah.jsp --> not handled by ActionServlet (obviously) > > > > I am trying various combinations in web.xml and struts-config.xml > > (including configuring /user as a module) but havent yet found a > > decent solution. > > Any thoughts? > > > > Thanks in advance. > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Rick > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Messages
I am looking for the ability to handle the ActionMessage in a different way in my application. In the validate method of the form I create a new instance of ActionErrors and add ActionMessage instances to it. In the Action dispatch method I call validate and get a non empty ActionErrors instance. To figure how to make this work, I can get the iterator to the keys and copy it to the request attribute like Iterator iter = errors.properties ( ); request.setAttribute ( "ERRORS", errors ); but I can't get the messages associated with the property to allow me to manipulate my page. What I would like is: for ActionErrors to be a collection, the I could iterate on the errors and get the key and the values. I could iterate on the values, or reteive a specific one. I want the ability to inspect an error condition and if it exists or not and generate jsp accordingly with an error message. Does anyone know how to do this? it would look like, but I dream too much - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles-defs and Forms
In the menu handler I issue a url like mainAction theForm is the form associated with the action is shared by the menu and the body. Other Url's can replace the context, or attributes of it. I have one menu for all of the body pages, ant there are 8 attributes that make up the context for the application. It dynamically gets the information needed for the participant. The menu can change from day to day. But the context is defined in a way that the pages all handle the context correctly. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 2:58 PM To: Struts Users Mailing List Subject: RE: Tiles-defs and Forms Ray, I don't understand why you say you must tie a form name into a URL call. Can you give /webapp/XXX relative URL examles to help us make more sense of what you are doing? Regards, David -Original Message----- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Thursday, March 24, 2005 5:03 PM To: 'Struts Users Mailing List' Subject: Tiles-defs and Forms I think I am having an understanding problem of how to tie tiles and tile defs with struts forms. My application uses a classicLayout type definition that looks just like the one shipps with struts. It has a body and a menu section. My problem is as follows. My menu jsp has a set of attributes that sets a context for the pages that will show in the body section. So the body needs attributes that were determined by the menu element that was selected. To make this work it seems like I need one form that covers both the menu and the body sections of the page. To compilcate things the menu can work for several different body sections and the code was originally written when the application used frames. With frames I could have a seperate form for each frame so the body and the menu were not connected except for the Url's that were executed contained the context for the body that would service the request. With one form per jsp page, the menu needs to reference the form to create the url's for the body, and the body needs to reference the form for the context for the body. The problem is then the menu needs to know the name of the form. With several different forms I don't see how to manage this. I can see several choices: 1) One large form to cover all possible cases, It would have to have a large number of attributes. 2) A form for each set of body jsp's and a special bean in the Session attribute scope to maintain the page context. 3) A seperate instance of the navigate jsp for each set of body jsp's. Currently there is about 20 sets of body contexts with 5 to 20 pages per body context. In the future this could get larger. Has anyone figured out how to do this? Is there a best practices model for this situation? Any help would be appareciated. Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles-defs and Forms
I think I am having an understanding problem of how to tie tiles and tile defs with struts forms. My application uses a classicLayout type definition that looks just like the one shipps with struts. It has a body and a menu section. My problem is as follows. My menu jsp has a set of attributes that sets a context for the pages that will show in the body section. So the body needs attributes that were determined by the menu element that was selected. To make this work it seems like I need one form that covers both the menu and the body sections of the page. To compilcate things the menu can work for several different body sections and the code was originally written when the application used frames. With frames I could have a seperate form for each frame so the body and the menu were not connected except for the Url's that were executed contained the context for the body that would service the request. With one form per jsp page, the menu needs to reference the form to create the url's for the body, and the body needs to reference the form for the context for the body. The problem is then the menu needs to know the name of the form. With several different forms I don't see how to manage this. I can see several choices: 1) One large form to cover all possible cases, It would have to have a large number of attributes. 2) A form for each set of body jsp's and a special bean in the Session attribute scope to maintain the page context. 3) A seperate instance of the navigate jsp for each set of body jsp's. Currently there is about 20 sets of body contexts with 5 to 20 pages per body context. In the future this could get larger. Has anyone figured out how to do this? Is there a best practices model for this situation? Any help would be appareciated. Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles Question
I have found a suspecious behaviour with tiles. If I set the Attribute with an all lower case or all upper case String everything seems to work fine. When I use mixed case with a string like "Foo" tiles won't import the attribute into the tile, and what is worse, when the tile return, the attribute cann nolonger be found with the mixed case attribute name. Is this a defect? or is mixed case attributes a situation to stay away from. I programatically assign the String, so I have to String.toLowerCase ( ), to make my situation work. If this is a bug, I will submit a report. -Original Message- From: Sean Schofield [mailto:[EMAIL PROTECTED] Sent: Thursday, October 21, 2004 8:22 AM To: Struts Users Mailing List Subject: Re: Tiles Question > - Root Cause - > java.lang.NoSuchMethodError: > org.apache.log4j.Category.log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljav > a/lang/Object;Ljava/lang/Throwable;)V >at > org.apache.commons.logging.impl.Log4JCategoryLog.trace(Log4JCategoryLog.java > :77) >at > org.apache.struts.util.PropertyMessageResources.(PropertyMessageResour > ces.java:84) If you look at the RootCause of your application you'll notice something about log4j. I am not an expert on log4j (although I use it just fine.) Check that you are running the latest log4j and commons-logging. I'm assuming you have setup commons-logging to use log4j. Make sure that's all configured properly. I have the following line in my commons_logging.properties file to accomplish this: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategory Log HTH, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles Question
org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1013) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:322) at javax.servlet.GenericServlet.init(GenericServlet.java:256) -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:37 PM To: Struts Users Mailing List Subject: RE: Tiles Question I only mentioned the struts-tiles-el.tld because I didn't think the Tiles tags were "el" compatible. I found a struts-tiles-el.tld in 1.2.4 not in an old 1.1-b3 I have archived on my computer. Are you by any chance using a container like Tomcat 5.X.X which has native EL support so that would work? What about the departments.getItem() collection question? Is it the right object you want stored? Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 11:34 PM To: Struts Users Mailing List Subject: RE: Tiles Question Well - I looked all over for a struts-tiles-el tld and couldn't find one. I suspected that the support was native. I am still using struts 1.1 and haven't moved to struts 1.2. I see that I need to move to the new release. Like any project with deadlines, moving to a new release is costly, I was hoping to move after this project. Oh well, I guess it calls for an all nighter! Thanks for your help, and I will let you know how it goes. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 7:27 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Tiles Question Ray, >From your code examples, it seems like you are using struts-el and struts-tiles-el. Is this correct? If so I can make suggestions but I can't test it (not using them - I have JSP 2.0 in my Tomcat 5.0.2? + STruts v1.2.4 setup). HOWEVER, I have a few well-directed questions that might explain your issue(s): I see you have done logging but have you done them with the iterated names to be 100% sure they are loaded? Such as: (your loop here) request.setAttribute ( department.getItem ( ), departments ); System.out.println ( "Department: " + department.getItem ( ) + ", collection: " + departments ); I see you are saving the "departments" object to the request, not the "department". Yet in your tile:put you are trying to put departments.getItem(). Is there such a thing or did you mean to save the "department" object so your tile:put could do a department.getItem(). From the code you included (see next line), I'm expecting there to be JSP errors or something logged because I can't see how it could exist - how can the collection have a string getItem() method unless you extended the collection Interface? This makes me think the objects are NOT being loaded properly from this JSP tile call: You should do the same full logging/printing in your JSP as I recommended in your Action class. You should be able to import all direct Tile variables using a generic tile:importAttribute tag: Then you could manually check that the JSP can see them using something like this (it's late so don't penalize me for bad coding if this isn't the exact syntax): I hope these directed questions help point you in the right direction with your debugging. Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 2:52 PM To: Struts Users Mailing List Subject: RE: Tiles Question The action Looks like this Collection depList = getDepartmentList ( ); Iterator itor = depList.iterator ( ); while ( itor.hasNext ( ) ) { txDepartment department = ( txDepartment ) itor.next ( ); Collection departments = getOrganizationData ( department.getItem ( ) ); request.setAttribute ( department.getItem ( ), departments ); // I can iterate over the departments collection and get the right information // System.out.println ( "Department: " + department.getItem ( ) ); // Yields Department: Automotive // Among others } The starting JSP is If I change the put value to 'Automotive' It works for that case like The Department.jsp looks like The generated error is: importAttribute : property 'organization' not found in context. Check tag syntax' -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:41 AM To: Struts Users Mailing List Subject: RE: Tiles Question Ray, Do you have an example of your tile definitions and stub pages I can look at? Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 6:05 PM To: 'Struts Users Mailing List'
RE: Tiles Question
In the real code I store both the department and departments collections. I am still using tomcat 4.1.24 and haven't moved to 5.x for similar reasons. I just downloaded struts 1.2.4 and we will see how that works. Thanks again for all of your help. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:37 PM To: Struts Users Mailing List Subject: RE: Tiles Question I only mentioned the struts-tiles-el.tld because I didn't think the Tiles tags were "el" compatible. I found a struts-tiles-el.tld in 1.2.4 not in an old 1.1-b3 I have archived on my computer. Are you by any chance using a container like Tomcat 5.X.X which has native EL support so that would work? What about the departments.getItem() collection question? Is it the right object you want stored? Regards, David -Original Message----- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 11:34 PM To: Struts Users Mailing List Subject: RE: Tiles Question Well - I looked all over for a struts-tiles-el tld and couldn't find one. I suspected that the support was native. I am still using struts 1.1 and haven't moved to struts 1.2. I see that I need to move to the new release. Like any project with deadlines, moving to a new release is costly, I was hoping to move after this project. Oh well, I guess it calls for an all nighter! Thanks for your help, and I will let you know how it goes. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 7:27 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Tiles Question Ray, >From your code examples, it seems like you are using struts-el and struts-tiles-el. Is this correct? If so I can make suggestions but I can't test it (not using them - I have JSP 2.0 in my Tomcat 5.0.2? + STruts v1.2.4 setup). HOWEVER, I have a few well-directed questions that might explain your issue(s): I see you have done logging but have you done them with the iterated names to be 100% sure they are loaded? Such as: (your loop here) request.setAttribute ( department.getItem ( ), departments ); System.out.println ( "Department: " + department.getItem ( ) + ", collection: " + departments ); I see you are saving the "departments" object to the request, not the "department". Yet in your tile:put you are trying to put departments.getItem(). Is there such a thing or did you mean to save the "department" object so your tile:put could do a department.getItem(). From the code you included (see next line), I'm expecting there to be JSP errors or something logged because I can't see how it could exist - how can the collection have a string getItem() method unless you extended the collection Interface? This makes me think the objects are NOT being loaded properly from this JSP tile call: You should do the same full logging/printing in your JSP as I recommended in your Action class. You should be able to import all direct Tile variables using a generic tile:importAttribute tag: Then you could manually check that the JSP can see them using something like this (it's late so don't penalize me for bad coding if this isn't the exact syntax): I hope these directed questions help point you in the right direction with your debugging. Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 2:52 PM To: Struts Users Mailing List Subject: RE: Tiles Question The action Looks like this Collection depList = getDepartmentList ( ); Iterator itor = depList.iterator ( ); while ( itor.hasNext ( ) ) { txDepartment department = ( txDepartment ) itor.next ( ); Collection departments = getOrganizationData ( department.getItem ( ) ); request.setAttribute ( department.getItem ( ), departments ); // I can iterate over the departments collection and get the right information // System.out.println ( "Department: " + department.getItem ( ) ); // Yields Department: Automotive // Among others } The starting JSP is If I change the put value to 'Automotive' It works for that case like The Department.jsp looks like The generated error is: importAttribute : property 'organization' not found in context. Check tag syntax' -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:41 AM To: Struts Users Mailing List Subject: RE: Tiles Question Ray, Do you have an example of your tile definitions and stub pages I can look at? Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 6:05
RE: Tiles Question
Well - I looked all over for a struts-tiles-el tld and couldn't find one. I suspected that the support was native. I am still using struts 1.1 and haven't moved to struts 1.2. I see that I need to move to the new release. Like any project with deadlines, moving to a new release is costly, I was hoping to move after this project. Oh well, I guess it calls for an all nighter! Thanks for your help, and I will let you know how it goes. -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 7:27 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Tiles Question Ray, >From your code examples, it seems like you are using struts-el and struts-tiles-el. Is this correct? If so I can make suggestions but I can't test it (not using them - I have JSP 2.0 in my Tomcat 5.0.2? + STruts v1.2.4 setup). HOWEVER, I have a few well-directed questions that might explain your issue(s): I see you have done logging but have you done them with the iterated names to be 100% sure they are loaded? Such as: (your loop here) request.setAttribute ( department.getItem ( ), departments ); System.out.println ( "Department: " + department.getItem ( ) + ", collection: " + departments ); I see you are saving the "departments" object to the request, not the "department". Yet in your tile:put you are trying to put departments.getItem(). Is there such a thing or did you mean to save the "department" object so your tile:put could do a department.getItem(). From the code you included (see next line), I'm expecting there to be JSP errors or something logged because I can't see how it could exist - how can the collection have a string getItem() method unless you extended the collection Interface? This makes me think the objects are NOT being loaded properly from this JSP tile call: You should do the same full logging/printing in your JSP as I recommended in your Action class. You should be able to import all direct Tile variables using a generic tile:importAttribute tag: Then you could manually check that the JSP can see them using something like this (it's late so don't penalize me for bad coding if this isn't the exact syntax): I hope these directed questions help point you in the right direction with your debugging. Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 2:52 PM To: Struts Users Mailing List Subject: RE: Tiles Question The action Looks like this Collection depList = getDepartmentList ( ); Iterator itor = depList.iterator ( ); while ( itor.hasNext ( ) ) { txDepartment department = ( txDepartment ) itor.next ( ); Collection departments = getOrganizationData ( department.getItem ( ) ); request.setAttribute ( department.getItem ( ), departments ); // I can iterate over the departments collection and get the right information // System.out.println ( "Department: " + department.getItem ( ) ); // Yields Department: Automotive // Among others } The starting JSP is If I change the put value to 'Automotive' It works for that case like The Department.jsp looks like The generated error is: importAttribute : property 'organization' not found in context. Check tag syntax' -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:41 AM To: Struts Users Mailing List Subject: RE: Tiles Question Ray, Do you have an example of your tile definitions and stub pages I can look at? Regards, David -Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 6:05 PM To: 'Struts Users Mailing List' Subject: Tiles Question I am trying to pass an attribute to a tile as follows: . And foo.getName ( ).equals ( "Adventure" ) And I have verified a requestAttribute was added. in the tile when i do I get the message importAttribute : property 'offer' not found in context. Check tag syntax' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles Question
The action Looks like this Collection depList = getDepartmentList ( ); Iterator itor = depList.iterator ( ); while ( itor.hasNext ( ) ) { txDepartment department = ( txDepartment ) itor.next ( ); Collection departments = getOrganizationData ( department.getItem ( ) ); request.setAttribute ( department.getItem ( ), departments ); // I can iterate over the departments collection and get the right information // System.out.println ( "Department: " + department.getItem ( ) ); // Yields Department: Automotive // Among others } The starting JSP is If I change the put value to 'Automotive' It works for that case like The Department.jsp looks like The generated error is: importAttribute : property 'organization' not found in context. Check tag syntax' -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:41 AM To: Struts Users Mailing List Subject: RE: Tiles Question Ray, Do you have an example of your tile definitions and stub pages I can look at? Regards, David -----Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 19, 2004 6:05 PM To: 'Struts Users Mailing List' Subject: Tiles Question I am trying to pass an attribute to a tile as follows: .. And foo.getName ( ).equals ( "Adventure" ) And I have verified a requestAttribute was added. in the tile when i do I get the message importAttribute : property 'offer' not found in context. Check tag syntax' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles Question
I am trying to pass an attribute to a tile as follows: ... And foo.getName ( ).equals ( "Adventure" ) And I have verified a requestAttribute was added. in the tile when i do I get the message importAttribute : property 'offer' not found in context. Check tag syntax' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Formbean validate method forwarding to input pag e
Why don't you tell your action not to validate, and call validate yourself in your action. Seems like you will have all of the control you need. -Original Message- From: Paul Barry [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 3:18 PM To: Struts Users Mailing List Subject: Re: Problem with Formbean validate method forwarding to input pag e The form bean is populated by the RequestProcessor, but you can put your logic to validate the session where ever you want. The easiest way to understand it is to just look at the source code for org.apache.struts.action.RequestProcessor. It has a number of processXXX methods, one being processPreprocess. You might want to put your session validation there, which does it before the bean is instatiated, populated and validated and before processActionPerform is called. Todd Bryant wrote: > Interesting. I have never looked at the request processor before. The main > question I have is - is the formbean populated BEFORE the request processor > runs or after? If the form bean is populated before the method you mention, > then the request process will still be circumvented by the formbean. > > -Original Message- > From: Paul Barry [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 07, 2004 4:47 PM > To: Struts Users Mailing List > Subject: Re: Problem with Formbean validate method forwarding to input page > > Maybe you should be handling your security in the request processor. > Have a method like this: > > protected ActionForward processActionPerform( > HttpServletRequest request, > HttpServletResponse response, > Action action, > ActionForm form, > ActionMapping mapping) > throws IOException, ServletException { > try { > validSession(request); > return (action.execute(mapping, form, request, response)); > } catch (SecurityException e) { > return (processException(request, response,e, form, mapping)); > } > } > > Where validateSession throws a SecurityException if the user is not > logged in and processException knows where to send the user to log in. > There are different ways to do it, but the basic principle is to > authenticate the user's session before the Action executes, so you don't > have to worry about that in the Action. > > Todd Bryant wrote: > > >>That is a good suggestion, and I had thought of that, but the problem is >>that a user would have to go from the error page back to the page they > > were > >>on. This would make it prohibitively difficult to interact with this >>particular app (too many clicks). >> >>-Original Message- >>From: Paul Barry [mailto:[EMAIL PROTECTED] >>Sent: Wednesday, April 07, 2004 4:07 PM >>To: Struts Users Mailing List >>Subject: Re: Problem with Formbean validate method forwarding to input > > page > >>Make your input action an error page, which just has the error and no >>sensitive data and make a success forward that you only send the user to >>if everything checks out. >> >>Todd Bryant wrote: >> >> >> >>>I have need for every page in my web app to be secure. What I originally >> >>did >> >> >>>was extend the Action class to make a secure action class. The >>>SecureAction's perform method validates that the user is logged in and if >>>not, sends them to the login page. All actions in my app extend >>>SecureAction. To protect my jsp's, I put them in a subfolder of WEB-INF, >>>WEB-INF/jsp. This way a user cannot directly access any jsp. They can only >>>be accessed through a forward in an action. This completely secures all >>>resources in my application. >>> >>> >>> >>>This is where I run into a problem. If I use the validate() method of the >>>formbean and it returns a non-empty ActionErrors object, then the request >> >>is >> >> >>>diverted to resource that is set as the "input", in this case a jsp. >> >>Because >> >> >>>of this, if a user were to put in some bogus field values in the url, she >>>would be able to cause the formbean to no validate and get the jsp to >>>display, bypassing the secure action. I can secure each jsp, but this is >>>redundant if I have them in the WEB-INF folder in the first place. I would >>>rather avoid this "fix". >>> >>> >>> >>>I know that overriding the default action class is a common way to secure >>>your app as I have read about it more than one place, however, I have >> >>never >> >> >>>seen this problem addressed. Has anyone else ran across this problem >> >>before >> >> >>>and come up with a solution? Thanks in advance. >>> >>> >>> >>>Todd Bryant >>> >>>Programmer/Analyst >>> >>>University of Nebraska Foundation >>> >>>402-472-0107 >>> >>> >>> >>> >>> >>> >> >> >>- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >>- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For add
RE: DynaAction or Map Backed Form?
Im not sure how to do it with the iterate tag, I use the c:forEach tag in the jstl taglib. It goes something like this: Assume service is a bean with accessors getDocuments ( ) and getId ( ) Assume document is a bean wit accessors getId ( ) and getName ( ) -Original Message- From: Amin Lalji [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 1:26 PM To: 'Struts Users Mailing List' Subject: RE: DynaAction or Map Backed Form? Here is the Data structure: I have two tables (Services, Documents) I hit the database and pull two separate Collections. I need to iterate over both collections... here is the relationship: ServiceID ServiceName Documents DocumentID DocumentName So a service object contains a collection of documents I need to be able to output something like: DocumentName --- Contract Deposit Contract Deposit In my action, I created a DynaActionForm. I set a java.util.ArrayList property called requiredDocuments in struts-config.xml In my action I make the database calls, then I iterate the services collection creating a RequiredDocumentsBean (contains serviceID, serviceName, and documents Collection) I populate the first two properties (serviceID, and serviceName) and then iterate the documents collection setting a LabelValueBean Here is the code: <-- snip --> while(sIterator.hasNext()){ // for each service... RequiredDocumentsBean rd = new RequiredDocumentsBean(); ServiceBeanLocal service = (ServiceBeanLocal)sIterator.next(); rd.setServiceId(service.getId()); rd.setServiceName(service.getServiceName()); Iterator dIterator = documents.iterator(); while(dIterator.hasNext()){ // for each available document DocumentBeanValue document = DocumentBeanValue)dIterator.next(); rd.getRequiredDocuments().add(new LabelValueBean(document.getDocumentName(),document.getId())); } requiredDocuments.add(rd); } myForm.set("allRequiredDocuments",requiredDocuments); request.setAttribute("allRequiredDocuments",requiredDocuments); <-- snip --> Thanks -----Original Message- From: Ray Madigan [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 3:09 PM To: Struts Users Mailing List Subject: RE: DynaAction or Map Backed Form? It isn't clear what you have to work with. Is services a map of some sort, or is it a collection. Either way you should use the iterate tag in the logic tag set. If you could explain the data structure better, it would be easier to help. -Original Message- From: Amin Lalji [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 12:39 PM To: 'Struts Users Mailing List' Subject: RE: DynaAction or Map Backed Form? Sorry... to add... Each Service may have a unknown set of documents... E.g. Services: 001 Catering 002 Party Documents: 001 Contract 002 Deposit Should yield: Contract Deposit Contract Deposit Thanks, /A -Original Message- From: Amin Lalji [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 2:28 PM To: 'Struts Users Mailing List' Subject: DynaAction or Map Backed Form? Hello All, I have the following scenario: I need to populate a form using a runtime generated set of form properties... Essentially I have two collections I pull from a database Services (serviceID,serviceName) Documents (documentID,documentName) I want to populate a set of checkboxes for each service such that I achieve: documentName Any ideas? Thanks, Amin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DynaAction or Map Backed Form?
It isn't clear what you have to work with. Is services a map of some sort, or is it a collection. Either way you should use the iterate tag in the logic tag set. If you could explain the data structure better, it would be easier to help. -Original Message- From: Amin Lalji [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 12:39 PM To: 'Struts Users Mailing List' Subject: RE: DynaAction or Map Backed Form? Sorry... to add... Each Service may have a unknown set of documents... E.g. Services: 001 Catering 002 Party Documents: 001 Contract 002 Deposit Should yield: Contract Deposit Contract Deposit Thanks, /A -Original Message- From: Amin Lalji [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 2:28 PM To: 'Struts Users Mailing List' Subject: DynaAction or Map Backed Form? Hello All, I have the following scenario: I need to populate a form using a runtime generated set of form properties... Essentially I have two collections I pull from a database Services (serviceID,serviceName) Documents (documentID,documentName) I want to populate a set of checkboxes for each service such that I achieve: documentName Any ideas? Thanks, Amin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Form Validation
I have a problem that I cannot see why it behaves the way it does, and was hoping a couple more eyeballs might help, thanks! I have a jsp that has A couple of input controls including username When the user types in all of the fields correcly this work fine. The execute method of action signin is called and all is well. When the user doesn't fill in one of the fields is when the problem shows itself. The action looks like this When the user doesn't fill in the form correctly, the validate method of the form is executed, and the page that is displayed is at URL /signin.do and not the input page as I thought was to happen, based on the doc. The validate method look like this! public final class SigninForm extends ActionForm { public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((username == null) || (username.length() < 1)) errors.add("username", new ActionError("error.username.required")); if ((password == null) || (password.length() < 1)) errors.add("password", new ActionError("error.password.required")); return errors; } Any help would be greatly appreciated! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]