Re: forcing relative urls from struts instead of the absolute urls!
Max Cooper wrote: It sounds like your main challenge is that you have requests to a web server that look like http://web.domain.com/foo/bar/me mapped to an app deployed on an app server that you might access directly as http://app.domain.com/me. The app will make site-root relative URLs like /me/foo.html, and the browser will them make a request to the web server like http://web.domain.com/me/foo.html which is not what you want. That is correct. (I don't have the original message, so I answer to this one) I have similar problem like you. Applications are deployed as http://app1.domain.com/ and http://app2.domain.com/ for production use, and developers deploy them to local Tomcats as http://localhost:8080/app1/ and http://localhost:8080/app2/. I found the solution in html:rewrite tag, since it will convert the relative path in JSP to the absolute one. It also does the URL-rewriting, but I don't mind that. Did anyone else try this solution? Ognjen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 1/5/06, Tamas Szabo [EMAIL PROTECTED] wrote: I'm actually quite happy with what Struts has to offer except for the deal with having to use ActionForms. I'd really like a Struts-like framework but allows me to use POJOs to capture my data and provides a nice way to redisplay that data back to the user if validation fails (ie a POJO that backs a form with a Data datatype will display back the String they entered). You can bind request parameters to POJOs using Spring. And you can use the SpringBindingActionForm to redisplay the data to the user. From http://www.springframework.org/docs/api/org/springframework/web/struts/SpringBindingActionForm.html Note this ActionForm is designed explicitly for use in request scope. Will not work for me. Not out of the box. But you can extend it. We extended it, and use the subclass one in session scope. The other interesting thing is that you can't use c:out ... on properties exposed via a SpringBindingActionForm. That's probably because JSTL tags don't get properties using Commons Beanutils ... But if we are at the subject of binding request params to business layer objects... Probably a lot of people bind req params directly without using ActionForms just to avoid writitng all the ActionForms. How do you assure that only the allowed properties will be set in the object? Ex. we have a bean with prop1, prop2. Only prop1 is allowed to be changed, but no one can prevent someone sending a request having a prop2 parameter in it. If you bind the request params to objects directly prop2 will be set to the value set by the misbehaving user. I know a few solutions to this, but in all of them you will have to explicitly specify all the properties that are allowed to be set. And if you do this then it's the same as declaring these properties as a DynaActionForm or to give it to a tool that generates an ActionForm ahving all these properties. So why is it better to bind request params to business layer objects directly without using ActionForms? Tamas
[FRIDAY] How to RTFM
http://uncyclopedia.org/wiki/RTFM Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] How to RTFM
LOL, brilliant :-) Niall - Original Message - From: Dave Newton [EMAIL PROTECTED] Sent: Friday, January 06, 2006 12:32 PM http://uncyclopedia.org/wiki/RTFM Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] How to RTFM
HUAHUAHHAUHAUHAHUAHUAHUAHAU. 2006/1/6, Niall Pemberton [EMAIL PROTECTED]: LOL, brilliant :-) Niall - Original Message - From: Dave Newton [EMAIL PROTECTED] Sent: Friday, January 06, 2006 12:32 PM http://uncyclopedia.org/wiki/RTFM Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] How to RTFM
I just hope nobody on this list will take it seriously... Le Vendredi 6 Janvier 2006 13:32, Dave Newton a écrit : http://uncyclopedia.org/wiki/RTFM Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] How to RTFM
David Delbecq wrote: I just hope nobody on this list will take it seriously... I thought they already did :/ Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Tamas Szabo [EMAIL PROTECTED] wrote: So why is it better to bind request params to business layer objects directly without using ActionForms? It isn't, really. People do that, but when we do, we flirt with the dark side. The problem with ActionForms, and similar strategies, is that we are going for the quick fix rather than the big fix. We try to solve the immediate problems, but we don't step back and look at the big picture. The big picture is that the presentation layer, whether it's a web layer or not, needs to know a lot about every property that is exposed by the application. We need to know the property's * view name * view type (String or boolean) * validation constraints * default control type * model name * model type * persistence type * label * data entry hint * validation message * text format (mask) But, in no one place do we itemize these facts (and any others I missed). Instead, we scatter them throughout the application, and then we wonder why programming the web presentation is so hard. It's hard because, when it comes to presentation layer properties, we still don't * Separate Concerns, and * Say It Once (DRY) I know that some people say that we have too much XML in our applications, but I think the problem is that we have too much notation in some places because there is not enough notation in other places. If we graph the properties, and then list which properties go with a form, much of the validation and form layout can be deduced, and many simple forms could be generated from a single tag. WebWork is starting to do the latter now. You can list the controls for a form, and the UI tags take care of all the formatting, including table tags, labels, and messages. I'd like to take it a step further so that we could just say put form x here, and the rest could be generated from the object graph and style sheet. In the OverDrive whiteboard, we've been using a strategy where the input and output properties for a command (or Action) are explicit, along with which input properties are required. We also specify processors for each property that handle the validation and formatting concerns. Likewise, the labels, hints, and validation messages are specified *once* for each property. Nearly all the validation concerns can be deduced from a rich object graph, which eliminates a lot of bother. I expect that if you are using a rich domain object model, then annotations could be used in lieu of XML, or at least in conjunction with XML. But, regardless of how the presentation's view schema is created, I think the trick is that we need to stop repeating ourselves, and provide a central repository where all these facts can be maintained for all the view properties. Specifications like XForms imply that a view schema exists, but do not explicity define anything like a master object graph. Ideally, I believe that tit would be helpful if there were a unified set of mappings, accessible to each layer, that could describe an entity as it flows from the database, through an object graph, onto the presentation layer, and back again. (Or not, if it is a virtual property.) -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
On 12/30/05, Ted Husted [EMAIL PROTECTED] wrote: ... for Christmas, Santa brings you all six Star Wars movies, so you can watch them in order, from The Phantom Menace through Revenge of the Jedi. ... and, somehow, that gives you bragging rights on the Struts User list :) -T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[FRIDAY] You might be a Struts User if ...
... you write your New Year resolutions on the back of a page from your 2006 page-a-day Dilbert desk calendar, and every one ends with dot-do. * GetMoreExcercise.do * TakeYourVitamins.do * DrinkLightBeer.do -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
Ted Husted wrote: The big picture is that the presentation layer, whether it's a web layer or not, needs to know a lot about every property that is exposed by the application. We need to know the property's * view name * view type (String or boolean) * validation constraints * default control type * model name * model type * persistence type * label * data entry hint * validation message * text format (mask) I expect I'm just groggy, but why does the presentation side need to know about model/persistence stuff? But, in no one place do we itemize these facts (and any others I missed). Instead, we scatter them throughout the application [...] I know that some people say that we have too much XML in our applications [...] I'd like to take it a step further so that we could just say put form x here, and the rest could be generated from the object graph and style sheet. +1 IMHO, there are several problems with XML: 1) Wads of files, each serving a different purpose, instead of a collective file (which can get big, but that's easy enough to deal with on any of several layers). 2) XML is a pain; it's difficult to read (for me, anyway). Much of this can be solved with UI work. For one project I had a master XML file (physically many, but whatever) from which I generated Torque schema files, JSP pages, Action base classes, form beans, validation rules, application resources, etc. On top of this was layered a pseudo-GUI (mostly a property editor) such that a project stub could be created in minutes. I think the trick is that we need to stop repeating ourselves, and provide a central repository where all these facts can be maintained for all the view properties. Oh, that would be nice, especially if I didn't have to code JSPs for every freakin' form/display/etc. Typing sucks, and so far J2EE has made me do too much of it. Ideally, I believe that tit would be helpful Ah, yes... that it would. Or at least pleasant, if not technically helpful. Oh, typo. if there were a unified set of mappings, accessible to each layer, that could describe an entity as it flows from the database, through an object graph, onto the presentation layer, and back again. (Or not, if it is a virtual property.) One of my primary concerns is that I want as much of the application as reasonable to be accessible to the _developers_ of each layer but still provide safety. IOW, I want the HTML folks to know what's available to them on the page and how to use it (c:forEach seems easy to us, but man... :/ the back-end folks to know what the front-end needs, etc. All with a whiz-bang interface. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Tamas Szabo [EMAIL PROTECTED] wrote: On 1/6/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 1/5/06, Tamas Szabo [EMAIL PROTECTED] wrote: I'm actually quite happy with what Struts has to offer except for the deal with having to use ActionForms. I'd really like a Struts-like framework but allows me to use POJOs to capture my data and provides a nice way to redisplay that data back to the user if validation fails (ie a POJO that backs a form with a Data datatype will display back the String they entered). You can bind request parameters to POJOs using Spring. And you can use the SpringBindingActionForm to redisplay the data to the user. From http://www.springframework.org/docs/api/org/springframework/web/struts/SpringBindingActionForm.html Note this ActionForm is designed explicitly for use in request scope. Will not work for me. Not out of the box. But you can extend it. We extended it, and use the subclass one in session scope. The other interesting thing is that you can't use c:out ... on properties exposed via a SpringBindingActionForm. That's probably because JSTL tags don't get properties using Commons Beanutils ... But if we are at the subject of binding request params to business layer objects... Probably a lot of people bind req params directly without using ActionForms just to avoid writitng all the ActionForms. How do you assure that only the allowed properties will be set in the object? Ex. we have a bean with prop1, prop2. Only prop1 is allowed to be changed, but no one can prevent someone sending a request having a prop2 parameter in it. If you bind the request params to objects directly prop2 will be set to the value set by the misbehaving user. I know a few solutions to this, but in all of them you will have to explicitly specify all the properties that are allowed to be set. And if you do this then it's the same as declaring these properties as a DynaActionForm or to give it to a tool that generates an ActionForm ahving all these properties. So why is it better to bind request params to business layer objects directly without using ActionForms? Tamas Some folk will claim that writing action forms its too much hassle. Some solutions to this problem (if you percieve it as such) include generating action forms from business objects as is the case with xdoclet. JSF's backing beans are really slick at all this stuff (converting user input values to relevent types and validating before population etc), but the other burdens of JSF make it a hard technology to choose in production projects. Lets hope that JSF starts moving along faster than it has been. Its not good to bind request params to business objects if not mediated (converted and validated). After all request parameters are strings, something needs to be between the request and business tier. What that is or how you do it is debatable. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Dave Newton [EMAIL PROTECTED] wrote: I expect I'm just groggy, but why does the presentation side need to know about model/persistence stuff? Client side validation. One of my primary concerns is that I want as much of the application as reasonable to be accessible to the _developers_ of each layer but still provide safety. IOW, I want the HTML folks to know what's available to them on the page and how to use it (c:forEach seems easy to us, but man... :/ the back-end folks to know what the front-end needs, etc. Yes, a big advantage to explicit inputs and outputs per command is that it tells both tools and developers what a command expects and needs, and by implication, what it doesn't use, so that the presentation layers (including unit tests) can see how to use the command. -T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
Ted Husted wrote: On 1/6/06, Dave Newton [EMAIL PROTECTED] wrote: I expect I'm just groggy, but why does the presentation side need to know about model/persistence stuff? Client side validation. Doesn't it just need validation info rather than model knowledge (you listed validation constraints/msgs in your original list, which is why I can't figure out why it needs any more info). Dave
Re: The framework I think I want...
Dave Newton wrote the following on 1/6/2006 9:35 AM: Doesn't it just need validation info rather than model knowledge (you listed validation constraints/msgs in your original list, which is why I can't figure out why it needs any more info). Not necessarily related to the model per-se but I see what Ted is saying about other areas and to me it is the most 'grey' area in regard to web apps - that is the 'other stuff' such as How do I want my JSP form to know whether it should display certain things as an Edit form or an Insert form. If I have a JSP that has all my form inputs and set up looking exactly how I want, but if it's being used as insert page I want the title on the page to be different than if I'm doing an edit. Same thing with the buttons. Possibly I might want the button to say Update if I'm doing an edit and Insert if doing an insert. This came up in another post a while back, and there is no real clear-cut best practice. I'm guessing Ted refers to this as the data entry hint in his first list I posted. Then there are such things as maybe the user of the form is a Special User and thus we need to show a special text box for the user to enter the Gold club membership number. Then you need some logic to decide if the user is a gold member some processing needs to be totally different of the form data... so do you: a) Change where the form submits. In the Struts world a different dispatch or Action, which involves logic in the JSP to decide how to declare the html:form tag or b) submit to the same action or dispatch method and then branch from there. Obviously, I think choice b makes the most sense but in other cases it's not always so clear. In complex applications, things often become very blurry. As a side note, at the moment, this is why I'm comfortable with JSTL on the front end. When I was using MyFaces what I could do on the front end with complex situations seem to be predicated on what the renderer could give me - such as the DataTable (I think that was the name). Possibly it's just my particular use cases I've run into... but often times my front end had to be tweaked in different ways. if this type of user - display extra text boxes here. if this other user- hide this div but create another div with this stuff in it. Of course sometimes if the views become too complex different views need to be broken out into separate JSPs or possibly include files etc. The point is, though, that I seem to have a lot of control. I felt I was missing some of this front-end control when I was working with JSF - my markup seemed bound to what rendering components I used - versus me having the complete flexibility with JSTL to create the front end stuff in ways I was used to. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Dave Newton [EMAIL PROTECTED] wrote: Doesn't it just need validation info rather than model knowledge (you listed validation constraints/msgs in your original list, which is why I can't figure out why it needs any more info). If we consider the target type to be a validation constraint, then we are stating the same fact twice. Target type is an implicit validation constraint. Other domain constraints might be a range of values within the target type. And, of course, in practice, checking subranges usually begs converting the input to the target type. Ideally, formatting and conversion should be part of validation, so that we don't do any of these things more than once as part of the same request/response. But, all this is something that we also need to do with *any* presentation layer, not just a web front-end. For example, we should be able to run independant unit tests (another presentation layer) that demonstrate that input and output are being formatted as expected. These concerns, and many others, beg the existing of a layer between *any* presentation layer and *any* business layer. I think we've been trying to create this layer with efforts like XWork and Commons Chain. A controller layer between the view and model that handles concerns like conversion/formatting/validation, and even logical navigation, but that is independant of a particular presentation layer. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] You might be a geek if ...
...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( __ This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] You might be a geek if ...
LOL As well as a Cntrl-F when you are reading a book...!! Chris McCormack [EMAIL PROTECTED] wrote on 01/06/2006 11:01:18 AM: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :(
validation.xml ---- validate to make sure entered number is positive
Have a field in my jsp. Have to make sure the entered value in the field is a positive integer. Using validation.xml for validation. How to this? Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
I have been known to type :wq when trying to save documents written in those new-fangled gooey-thingies. :-) Simon On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: LOL As well as a Cntrl-F when you are reading a book...!! Chris McCormack [EMAIL PROTECTED] wrote on 01/06/2006 11:01:18 AM: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
...your wife, (meaning to compliment your reading of thick Java programming books) introduces you to her friends -- This is my husband, he reads phonebooks. On 1/6/06, Chris McCormack [EMAIL PROTECTED] wrote: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( __ This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Clayton Barnette Public Access Network Owner / Web Developer [EMAIL PROTECTED]
Need to display a page from a seperate site inside a Struts application
Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a Struts User if ...
... if you are typing an email with html enabled on, and you type instinctively something like bean:write, ${message}, c:out, html:text... Rafael Mauricio Nami 2006/1/6, Ted Husted [EMAIL PROTECTED]: ... you write your New Year resolutions on the back of a page from your 2006 page-a-day Dilbert desk calendar, and every one ends with dot-do. * GetMoreExcercise.do * TakeYourVitamins.do * DrinkLightBeer.do -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
Simon Chappell wrote: I have been known to type :wq when trying to save documents written in those new-fangled gooey-thingies. :-) Yeah, try switching from emacs :/ Mnemonics are for the weak. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
Clayton Barnette wrote: ...your wife [...] You may already be disqualified ;) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reset method with DyanValidatorForm
Thanks you all for responding. It's much clear now. I have created a DynaValidatorForm in strutsconfig.xml which has about 20 form properties for my jsp. I can see the components I need in my jsp. This form is session scoped which has radio's and checkboxes. So, I might have to reset the checkboxes now. Do, I have no other choice but to create a formbean Class with all the setter's and getter's and then add reset method too for it. or is there an easier way to do this using DynaValidatorForm? Thanks. From: Andre Van Klaveren [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: reset method in ActionForm Date: Tue, 3 Jan 2006 12:49:55 -0600 Q: When exactly this method has to be used and when does this get called? A: The reset method is called for each new request, for both request and session scoped ActionForms, before the ActionForm is populated from the request. Here's the sequence of events: 1. Request received by controller. 2. Create or recycle ActionForm (create request-scoped, recycle session-scoped) 3. Call reset() method on ActionForm. 4. Store ActionForm in scope as defined in stuts-config.xml 5. Populate ActionForm from request. 6. Validate the ActionForm if defined in struts-config.xml. Assuming no validation errors: 7a. Call execute() method of the Action passing ActionForm With validation errors: 7b. Go back to input with ActionForm in proper scope. Q: Why do the checkboxes have to be reset? A: The reset() method was originally designed to reset boolean variables that represent checkbox values in the HTML form. When an HTML form contains checkboxes, only the values for the checkboxes that are chedked are sent in the request (see HTTP spec). The reset() method was designed to reset the boolean properties in the ActionForm that represent checkboxes to false. This is necessary because false values aren't sent in the request, only true ones. If you have a session-scoped ActionForm, the boolean values for the checkboxes could be set to true from a previous request. Without resetting them they would always stay true. With a request-scoped ActionForm you don't have to implement the reset method unless you need your ActionForm properties to default to some value other than the default or that of which you defined when you declared the property on the ActionForm. Basically, the reset method is called before the request reaches the Action. Hope that answers your questions. On 1/3/06, fea jabi [EMAIL PROTECTED] wrote: When exactly this method has to be used and when does this get called? Why do the checkboxes have to be reset? Prepopulating the formbean is done in Action class. hence, it's not clear to me the exact use of using the reset method. Thanks. _ Is your PC infected? Get a FREE online computer virus scan from McAfee(r) Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Virtually, Andre Van Klaveren Architect III, SCP Global Public Sector Unisys Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.3: Arbitary key/value pair
Hi everybody. Since Struts 1.3 it is possible to set an arbitary key/value pair to retrieve at runtime such as: action path=/EditSubscription extends=Editor set-property key=foo value=bar / /action In a document from the struts university (author Ted Husted) is an example to retrieve such pair: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { string foo = getProperty(foo); // ... In the nightly builds and in the newest subversion branch (366511) there is no getProperty() method in the Action class. So does anybody know, how to retrieve such a pair von set-properties. Thanks a log Manfred -- === Dipl.-Inf. Manfred Wolff Software Engineer Fon : +49 421 534522 Fax : +49 421 4314578 Mobil: +49 173 2494181 --- http://www.manfred-wolff.de http://www.struts-it.org --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] You might be a geek if ...
Yeah, I get j's and k's all over my Word documents. -Original Message- From: Simon Chappell [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 11:09 AM To: Struts Users Mailing List Subject: Re: [FRIDAY] You might be a geek if ... I have been known to type :wq when trying to save documents written in those new-fangled gooey-thingies. :-) Simon On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: LOL As well as a Cntrl-F when you are reading a book...!! Chris McCormack [EMAIL PROTECTED] wrote on 01/06/2006 11:01:18 AM: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form submitted twice
Hi, I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. When I press submit the form is submitted. My code in the JSP is as follows: Javascript function called when submitting form: function setAction(action) { document.pendingRecordForm.action.value= action; document.pendingRecordForm.submit(); } To submit the form the following image: html:image src=../images/save_button.jpg onclick=setAction('approve')/ The submit then calls the perform method in my struts action class ( By the way I am using 1.0.2 version of Struts) The action class then works through the code and when the thread gets to the DAO class the second call arrives at the action class, This second call sends back a target of failure because of some validation error and the successful target from the first submit is ignored. I don't understand why my form gets submitted twice. The struts config is as follows for the action: action path=/approve type=com.myclass. name=pendingRecordForm scope=request input=/jsp/approvexx.jsp forward name=failure path=/jsp/approvexx.jsp/ forward name=success path=/jsp/menu.jsp/ /action Thanks in advance
Re: form submitted twice
any anchors, a name='blah'/a on the page? any chance the image is within a submit tag/button? how/where your action is forwarding after processing? ATTA On 1/6/06, Faisal Shoukat [EMAIL PROTECTED] wrote: Hi, I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. When I press submit the form is submitted. My code in the JSP is as follows: Javascript function called when submitting form: function setAction(action) { document.pendingRecordForm.action.value= action; document.pendingRecordForm.submit(); } To submit the form the following image: html:image src=../images/save_button.jpg onclick=setAction('approve')/ The submit then calls the perform method in my struts action class ( By the way I am using 1.0.2 version of Struts) The action class then works through the code and when the thread gets to the DAO class the second call arrives at the action class, This second call sends back a target of failure because of some validation error and the successful target from the first submit is ignored. I don't understand why my form gets submitted twice. The struts config is as follows for the action: action path=/approve type=com.myclass. name=pendingRecordForm scope=request input=/jsp/approvexx.jsp forward name=failure path=/jsp/approvexx.jsp/ forward name=success path=/jsp/menu.jsp/ /action Thanks in advance
Re: form submitted twice
Faisal Shoukat [EMAIL PROTECTED] wrote on 01/06/2006 11:46:51 AM: Hi, I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. When I press submit the form is submitted. My code in the JSP is as follows: Javascript function called when submitting form: function setAction(action) { document.pendingRecordForm.action.value= action; document.pendingRecordForm.submit(); } Wild guess: Try adding return false; to the end of your setAction(action) and see what happens..? Geeta
Re: Struts 1.3: Arbitary key/value pair
The properties get set in the ActionMapping - not the Action, so you can do mapping.getProperty(foo) to get the values. This feature works the same throughout - its available in the configuration objects, not the object itself - so ActionMapping which is the config for Action or FormBeanConfig rather than the ActionForm. Niall - Original Message - From: Manfred Wolff [EMAIL PROTECTED] Sent: Friday, January 06, 2006 4:43 PM Hi everybody. Since Struts 1.3 it is possible to set an arbitary key/value pair to retrieve at runtime such as: action path=/EditSubscription extends=Editor set-property key=foo value=bar / /action In a document from the struts university (author Ted Husted) is an example to retrieve such pair: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { string foo = getProperty(foo); // ... In the nightly builds and in the newest subversion branch (366511) there is no getProperty() method in the Action class. So does anybody know, how to retrieve such a pair von set-properties. Thanks a log Manfred - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form submitted twice
On 1/6/06, Faisal Shoukat [EMAIL PROTECTED] wrote: I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. To submit the form the following image: html:image src=../images/save_button.jpg onclick=setAction('approve')/ Try onclick=return setAction('approve'); or onclick=setAction('approve'); return; to stop the double submit. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reset method with DyanValidatorForm
On 1/6/06, fea jabi [EMAIL PROTECTED] wrote: So, I might have to reset the checkboxes now. Do, I have no other choice but to create a formbean Class with all the setter's and getter's and then add reset method too for it. or is there an easier way to do this using DynaValidatorForm? You don't have to add the get/set methods. Just extend DynaValidatorForm and add the reset method -- then be sure to change the type of the form in struts-config.xml to your new form type. package com.example.myapp; public final class AccountForm extends DynaValidatorActionForm implements Serializable {...} form-bean name=accountForm type=com.example.myapp.AccountForm ... -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.3: Arbitary key/value pair
At 5:43 PM +0100 1/6/06, Manfred Wolff wrote: Hi everybody. Since Struts 1.3 it is possible to set an arbitary key/value pair to retrieve at runtime such as: action path=/EditSubscription extends=Editor set-property key=foo value=bar / /action In a document from the struts university (author Ted Husted) is an example to retrieve such pair: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { string foo = getProperty(foo); // ... In the nightly builds and in the newest subversion branch (366511) there is no getProperty() method in the Action class. So does anybody know, how to retrieve such a pair von set-properties. The properties are set on the ActionMapping, not the Action class. So in this case you'd use String foo = mapping.getProperty(foo); Hope this helps Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] How to RTFM
Dave Newton replied: David Delbecq wrote: I just hope nobody on this list will take it seriously... I thought they already did :/ Me, too, but those people don't search the web looking for the meaning of a term, anyway. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.3: Arbitary key/value pair
Thanks - works fine. Niall Pemberton schrieb: The properties get set in the ActionMapping - not the Action, so you can do mapping.getProperty(foo) to get the values. This feature works the same throughout - its available in the configuration objects, not the object itself - so ActionMapping which is the config for Action or FormBeanConfig rather than the ActionForm. Niall - Original Message - From: Manfred Wolff [EMAIL PROTECTED] Sent: Friday, January 06, 2006 4:43 PM Hi everybody. Since Struts 1.3 it is possible to set an arbitary key/value pair to retrieve at runtime such as: action path=/EditSubscription extends=Editor set-property key=foo value=bar / /action In a document from the struts university (author Ted Husted) is an example to retrieve such pair: public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { string foo = getProperty(foo); // ... In the nightly builds and in the newest subversion branch (366511) there is no getProperty() method in the Action class. So does anybody know, how to retrieve such a pair von set-properties. Thanks a log Manfred - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional -- === Dipl.-Inf. Manfred Wolff Software Engineer Fon : +49 421 534522 Fax : +49 421 4314578 Mobil: +49 173 2494181 --- http://www.manfred-wolff.de http://www.struts-it.org --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
Ctrl+Z always meant an EOF for me ;-) On 1/6/06, Chris McCormack [EMAIL PROTECTED] wrote: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How does Shale affect my Struts development
If you've developed apps in the past with struts I'd just stay with struts. My company is starting to do some projects with JSF so it is inevitable that I will need to learn it so I'm trying to investigate shale. Shawn -Original Message- From: Alexandre Poitras [mailto:[EMAIL PROTECTED] Sent: Thursday, December 29, 2005 9:01 AM To: Struts Users Mailing List Subject: Re: How does Shale affect my Struts development Bernhard is totally right. The choice you are facing is wheter you want to go for now on with components-based frameworks (JSF/Shale, Tapestry) or a typical action-based framework (Struts/Webwork). Struts is supporting the two choices for the moment and I think it's great! But don't ask for the pro and cons of each approach here or you'll start a holy war! Just kidding ;) On 12/29/05, Bernhard Slominski [EMAIL PROTECTED] wrote: Hi Jim, don't make the following mistake: I use Struts but I want to move on, so I have to use Shale! Shale is build ON TOP of JSF, so to understand the benefit of Shale you have to know JSF. So the first question to ask yourself: Do I want to move to JSF or is Struts just fine for me? When you decided to move to JSF or to at least take a closer look at it then after being familiar with JSF you can look at Shale and see if that's the right technology for you. I guess in your case you seem to be fine with Struts, so just stay with it! Bernhard -Ursprüngliche Nachricht- Von: Jim Reynolds [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 29. Dezember 2005 15:10 An: user@struts.apache.org Betreff: How does Shale affect my Struts development First off, a little background. I have started using the 'Struts' framework about 1 year ago. I have created three apps, and all is moving along pretty well with the Struts and model 2 approach. I am just starting to use more design patterns for my business logic, etc. Anyway, as you may be aware I frequent this list, and try to keep up with what is going on with the Struts project. I am noticing a lot of 'Shale' discussion, and I have just finished reading the link here http://struts.apache.org/struts-shale/ and franky, I am not sure what Shale brings to the table that is not already included with Struts? I guess, the reason for this post is, I was hoping possibly there are people out there who understand this Struts/Shale and could tell me how to get started, and what the gain is. Whether the best approach is to build a simple Struts app and convert it, or what steps I need to take in order to be prepared and keep my skill set where it needs to be. Regards - 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] -- Alexandre Poitras Québec, Canada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaWebParts and Struts / Ajax integration
Hi Frank -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] ==== Peter A. Pilgrim wrote: Well that ok because I am now official on holiday (vacation ;-) As am I :) I have plenty of work to do at home though! I am back from vacation, and I solved the issue with taglibs. I had to downgrade the taglib DTD version from 1.2 to 1.1 for some reason, and the application deployed to WebLogic 8.1 I have a couple of questons. I am getting a 404 because the target URL in the Ajax JavaScript is wrong. How do I set the right target and make it context relative? E.g. the web context is `asds' Weblogic access.log 127.0.0.1 - auth1 [06/Jan/2006:17:26:12 +] GET /asds/secured/typeAheadSuggestions?enteredText=peassureUnique=2 HTTP/1.1 404 14169 127.0.0.1 - auth1 [06/Jan/2006:17:26:15 +] GET /asds/secured/typeAheadSuggestions?enteredText=petassureUnique=3 HTTP/1.1 404 14169 127.0.0.1 - auth1 [06/Jan/2006:17:26:18 +] GET /asds/secured/typeAheadSuggestions?enteredText=peteassureUnique=4 HTTP/1.1 404 14169 My ajax_config.xml is ajaxConfig !-- Define a single form. -- form ajaxRef=ContactDetailsForm !-- Only the textbox is Ajax-enabled. -- element ajaxRef=enteredTextChange !-- Any time a key is pressed (released actually), fire an event. -- event type=onkeyup !-- Just going to submit a simple query string with a single -- !-- parameter, enteredText, that will take the value of the -- !-- enteredTextbox element of the form. -- requestHandler type=std:QueryString method=get targettypeAheadSuggestions/target parameterenteredText=search.contact.contactName/parameter /requestHandler !-- When we get back, just insert the returned results into the -- !-- div named suggestions on the page, which contains the -- !-- matching suggestions. -- responseHandler type=std:InnerHTML parametersearch_contact_contactName_suggestions/parameter /responseHandler /event /element /form /ajaxConfig Assuming I get this working for one control. How do expand this example so that it support multiple fields submit to the same suggestion servlet? Thanks in advance Ok that makes sense then. Maybe when people switch Maven 2 then this dependency issues can be worked out. Maybe. I know *I* won't be switching to Maven any time soon, 1 *or* 2. Ant still serves my purposes just fine (did you notice the dependencies task in the JWP script? Ironic that it uses the Maven repository!) Even with Maven, it would still be an external dependency though... if someone uses JWP in their project, they would still need to know that they need Commons Lang and Commons BeanUtils and so on, even if they are simply going to specify it in their Maven config and forget about it. I prefer not having those dependencies at all, hence the reason they got rolled in. In order to build the type suggestion, what are the correct jars to include. I thought it was ``javawebparts_core.jar'' and ``javawebparts_taglibs.jar''. Now I get a strange deployment error like Error: Could not load asds: weblogic.servlet.jsp.JspException: (line 6): Error in using tag library uri='/tags/javawebparts_ajaxtags.tld' prefix='ajax': cannot find tag class: 'javawebparts.taglib.ajaxtags.AjaxEventTag' I downloaded the 1.0 beta release version. I found that the binary release included *.class in the javawebparts_taglib.jar file. Also, I checked the javawebparts_core.jar file. This was fine. I think there is problem with the `make_jars' in the ant build. I found that running that ant target (re-)created all the jars, but the `javawebparts_taglib.jar' contained only the TLD and Manifest.mf. Weird. ==== -- Peter Pilgrim :: J2EE Software Development Operations/IT - Credit Suisse First Boston, Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.csfb.com/legal_terms/disclaimer_external_email.shtml == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form submitted twice
I reckon the form is being submitted with the form.submit() and the input type=submit remove this document.pendingRecordForm.submit(); and see if it works for you. Mark On 1/6/06, Faisal Shoukat [EMAIL PROTECTED] wrote: Hi, I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. When I press submit the form is submitted. My code in the JSP is as follows: Javascript function called when submitting form: function setAction(action) { document.pendingRecordForm.action.value= action; document.pendingRecordForm.submit(); } To submit the form the following image: html:image src=../images/save_button.jpg onclick=setAction('approve')/ The submit then calls the perform method in my struts action class ( By the way I am using 1.0.2 version of Struts) The action class then works through the code and when the thread gets to the DAO class the second call arrives at the action class, This second call sends back a target of failure because of some validation error and the successful target from the first submit is ignored. I don't understand why my form gets submitted twice. The struts config is as follows for the action: action path=/approve type=com.myclass. name=pendingRecordForm scope=request input=/jsp/approvexx.jsp forward name=failure path=/jsp/approvexx.jsp/ forward name=success path=/jsp/menu.jsp/ /action Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] You might be a geek if ...
nah, if you were really a geek you'd type :x and save the keypress :) -Original Message- From: Simon Chappell [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 11:09 AM To: Struts Users Mailing List Subject: Re: [FRIDAY] You might be a geek if ... I have been known to type :wq when trying to save documents written in those new-fangled gooey-thingies. :-) Simon On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: LOL As well as a Cntrl-F when you are reading a book...!! Chris McCormack [EMAIL PROTECTED] wrote on 01/06/2006 11:01:18 AM: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 1/6/06, Dave Newton [EMAIL PROTECTED] wrote: Doesn't it just need validation info rather than model knowledge (you listed validation constraints/msgs in your original list, which is why I can't figure out why it needs any more info). If we consider the target type to be a validation constraint, then we are stating the same fact twice. Target type is an implicit validation constraint. Other domain constraints might be a range of values within the target type. And, of course, in practice, checking subranges usually begs converting the input to the target type. Rrright. You want to save on network bandwidth by validating in browser. At the same time we have Ajax suggest-type junk growing in popularity, where server is pulled each time a user hits a button. Nah. Imho, client-side validation should be minimal. Empty/non-emty, proper length. Maybe some simple data conversion check like is it a number or a valid email. Yes, it is not DRY and redundant because the final validation is done on the server anyway, but user's Athlon 64 needs some code to chew. Everything more complex than above, including custom error messages, inter-field dependencies, etc is checked on server. It will be checked on server anyway, because user's browser is in the open, whoever can change the validation rules or turn them off or turn Javascript off. Client validation is just a cherry on a cake, but I don't want this cherry to be too large. Ideally, formatting and conversion should be part of validation, so that we don't do any of these things more than once as part of the same request/response. But, all this is something that we also need to do with *any* presentation layer, not just a web front-end. For example, we should be able to run independant unit tests (another presentation layer) that demonstrate that input and output are being formatted as expected. These concerns, and many others, beg the existing of a layer between *any* presentation layer and *any* business layer. I think we've been trying to create this layer with efforts like XWork and Commons Chain. A controller layer between the view and model that handles concerns like conversion/formatting/validation, and even logical navigation, but that is independant of a particular presentation layer. Actually, if we talk about Struts, ActionForms is the basis of this layer, I only would prefer them to be combined with Actions. There are properties aka getters/setters, so setters can always check what is being passed from browser. I am an old school in terms that I usually don't use dynaforms, instead I define an ActionForm having dual typing either by having String-type and strong-type property right in the form, or by having String-type property in the form for display and a nested strong-type property from a business object. Yes, I would like this to be automated and JSF managed beans look nice in this extent. I also store error messages in the ActionForm, so my errors correspond to a page (or a component on a page). I guess I could go further and have error messages per property but this is too much hassle. Advertising ActionForm as a request parameter holder in Struts best practices is a mistake imho. It can be used as an input/output buffer, as this kind of layer that you talk about. Apparently, it should have session scope ;) and implement Serializable. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaWebParts and Struts / Ajax integration
On Fri, January 6, 2006 12:41 pm, Pilgrim, Peter said: I am back from vacation, and I solved the issue with taglibs. I had to downgrade the taglib DTD version from 1.2 to 1.1 for some reason, and the application deployed to WebLogic 8.1 Hmm, weird. Ok, well, it's a solution :) I have a couple of questons. I am getting a 404 because the target URL in the Ajax JavaScript is wrong. How do I set the right target and make it context relative? E.g. the web context is `asds' Looking at the access log, I'm not clear as to what's wrong... is it the /secured/ portion that you don't expect to see? If the context is asds, then I would expect to see /asds/typeAheadSuggestions, is that your expectation as well? I don't want to put forth any answer until I hear your answer to that, just so I know we're trying to get to the same place :) Actually, I guess I will take a stab at it first... try putting a leading slash before the target URL? Assuming I get this working for one control. How do expand this example so that it support multiple fields submit to the same suggestion servlet? You should just need to create an entry for the other fields in the config file and throw an ajax:event tag after them... just point them all at the same target URL, it should work fine. Should be as easy as copying the config that is there now and changing the element's ajaxRef. Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 1/6/06, Dave Newton [EMAIL PROTECTED] wrote: I expect I'm just groggy, but why does the presentation side need to know about model/persistence stuff? Client side validation. You also need to know the model data type for conversion, in both directions (modelDataType-String for rendering, String-modelDataType for updating). Struts Action Framework currently splits responsibilities for this ... the tags do conversion automatically on rendering, but it is up to the application's business logic to deal with it for updating. In most of the other technologies (JSF, SpringMVC, Tapestry, WW) the responsibility all belongs to the view tier. -T. Craig
JSF and Tiles
This has probably been posted before, but is there anyway to integrate JSF and Tiles seamlessly like Struts? I dont want to have to create two pages (i.e. one template page, one included fragment page) per forward. If this is the only solution, then I dont see any advantage using JSF in my app and I will have to revert back to Struts.
Re: JSF and Tiles
Both MyFaces and Shale have Tiles Integration strategies. I haven't quite used either yet, but I will be soon. Integration will be much simpler once we get Standalone Tiles out of the sandbox. Here's some info on Tiles with MyFaces: http://wiki.apache.org/ myfaces/Tiles_and_JSF and here's some stuff on Shale: http://jroller.com/page/dgeary? catname=%2FShale HTH, Greg On Jan 6, 2006, at 12:06 PM, Chan, Jim wrote: This has probably been posted before, but is there anyway to integrate JSF and Tiles seamlessly like Struts? I dont want to have to create two pages (i.e. one template page, one included fragment page) per forward. If this is the only solution, then I dont see any advantage using JSF in my app and I will have to revert back to Struts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
If I've understood what you're after then wont jstl's c:import do what you need? Mark On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - 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: The framework I think I want...
On Fri, January 6, 2006 1:01 pm, Michael Jouravlev said: Rrright. You want to save on network bandwidth by validating in browser. At the same time we have Ajax suggest-type junk growing in popularity, where server is pulled each time a user hits a button. Well, not *each* time a key is pressed... look at the code for Google Suggests and you will see they do a really cool thing where they throttle the number of requests based on how fast you are typing. It's not a 1:1 call per keypress unless you are typing really slow. (My own AjaxTags example doesn't do this, but hey, Google has Ph.D's to spare whereas I don't have even one!) Nah. Imho, client-side validation should be minimal. Empty/non-emty, proper length. Maybe some simple data conversion check like is it a number or a valid email. Yes, it is not DRY and redundant because the final validation is done on the server anyway, but user's Athlon 64 needs some code to chew. Everything more complex than above, including custom error messages, inter-field dependencies, etc is checked on server. It will be checked on server anyway, because user's browser is in the open, whoever can change the validation rules or turn them off or turn Javascript off. Best practices have dictated for a long time that any validation that occurs on the client should also occur on the server. But, the more you can pull off on the client, the more responsive and user-friendly your application will usually be. Of course there is that fine line of not having business logic on the client (i.e., should an entered dollar amount be checked against a mutual fund load table on the client? Probably not). Client validation is just a cherry on a cake, but I don't want this cherry to be too large. I would argue the bigger the cherry, the better. The application will be better for it in most cases. Yes, there is more to consider when you do that, but the benefits outweigh the negatives IMO. But, I always give the cherry to my wife off my sundaes anyway, I'm not a fan of cherrys to begin with :) Actually, if we talk about Struts, ActionForms is the basis of this layer, I only would prefer them to be combined with Actions. There are properties aka getters/setters, so setters can always check what is being passed from browser. I am an old school in terms that I usually don't use dynaforms, instead I define an ActionForm having dual typing either by having String-type and strong-type property right in the form, or by having String-type property in the form for display and a nested strong-type property from a business object. Yes, I would like this to be automated and JSF managed beans look nice in this extent. The idea of an ActionForm was a great concept to begin with, and it seems like many people don't see the benefit (not saying you Michael, just making a general statement). Think about the case where you want to slap a VB-based front-end over a Struts-based application. When you have an object that serves as a string-only buffer between the presentation and the rest of the application, you have effectively abstracted away any data types differences between how the presentation is built and how the rest of the app is built because strings are, for all intents and purposes, universal. If you try and go directly to native types, you have to deal with the fact that maybe VB doesn't have a BigDecimal type for example. The conversion, assuming one is possible, has to occur at an arguably inappropriate time. I suppose the fact that not too many people have ever had to change from JSP to VB has something to do with this :) If you combine an ActionForm with an Action, what happens if you want to give that combined object session scope? Would you then store the entire thing in session? I would assume so. That seems like a (potentially) big waste of resources. Why wouldn't you rather have an object that contains almost nothing but data and store that? (I'm playing devil's advocate here... I haven't fully decided whether I agree with the basic premise or not). Advertising ActionForm as a request parameter holder in Struts best practices is a mistake imho. It can be used as an input/output buffer, as this kind of layer that you talk about. Apparently, it should have session scope ;) and implement Serializable. I would make the argument that session-scope for an ActionForm is the abomination. There should be something else, and I'm not sure I know what, that gets stashed in session scope. If an ActionForm is thought of ONLY as a buffer as you say, a DTO between presentation and control basically, Struts seems a lot cleaner all of a sudden. Of course, that then leaves a lot of questions about how you persist user entries and such, and I admit I don't have a good answer there. Michael. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
Well this is not a static page. Actually my jsp page requires some parameters passed to it by th calling struts application as well. Using these parameters the jsp page renders some results, which in turn needs to be displayed in a tile inside the struts application. Is it possible to achieve this ? I appreciate your help very much, Tyrell On 1/6/06, Mark Lowe [EMAIL PROTECTED] wrote: If I've understood what you're after then wont jstl's c:import do what you need? Mark On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - 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] -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaWebParts and Struts / Ajax integration
-Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: 06 January 2006 18:03 To: Struts Users Mailing List Cc: 'Struts Users Mailing List' Subject: RE: [OT] JavaWebParts and Struts / Ajax integration On Fri, January 6, 2006 12:41 pm, Pilgrim, Peter said: I am back from vacation, and I solved the issue with taglibs. I had to downgrade the taglib DTD version from 1.2 to 1.1 for some reason, and the application deployed to WebLogic 8.1 Hmm, weird. Ok, well, it's a solution :) Me too. I developing on the old Service Pack 1 of WLS. Production has the latest SP4 and SP5 better. May be it was me, Eclipse, My Eclipse, and combination of all. Either way I rewrite tag library definitions in web.xml and my JSP by hand, just to make sure I wasn't going crazy! I have a couple of questons. I am getting a 404 because the target URL in the Ajax JavaScript is wrong. How do I set the right target and make it context relative? E.g. the web context is `asds' Looking at the access log, I'm not clear as to what's wrong... is it the /secured/ portion that you don't expect to see? If the context is asds, then I would expect to see /asds/typeAheadSuggestions, is that your expectation as well? I don't want to put forth any answer until I hear your answer to that, just so I know we're trying to get to the same place :) Actually I forgot to saw that the JSP page itself is `/asds/secured/showContactDetails.jsp' where `/asds' is the context root. Actually, I guess I will take a stab at it first... try putting a leading slash before the target URL? I thought of that before heading home, but I wanted to wait for response, because what I would really need is access the `contextRoot' as a variable. I could write something like this target%contextPath%/typeAheadSuggestions/target But I will give it shot now and see what happens requestHandler type=std:QueryString method=get target/typeAheadSuggestions/target parameterenteredText=search.contact.contactName/parameter /requestHandler ... ( No it does not work) Sorry 127.0.0.1 - auth1 [06/Jan/2006:18:21:41 +] GET /typeAheadSuggestions?enteredText=xassureUnique=1 HTTP/1.1 404 1214 127.0.0.1 - auth1 [06/Jan/2006:18:21:44 +] GET /typeAheadSuggestions?enteredText=xaassureUnique=2 HTTP/1.1 404 1214 The ajax submission is now missing the context path completely. Can you cut a release of the javawebparts to fix the bug or tell me where I can patch it please. Assuming I get this working for one control. How do expand this example so that it support multiple fields submit to the same suggestion servlet? You should just need to create an entry for the other fields in the config file and throw an ajax:event tag after them... just point them all at the same target URL, it should work fine. Should be as easy as copying the config that is there now and changing the element's ajaxRef. How do you discern in the Servlet what field is being query? I had a look at the source of the page, there is a JavaScript variable called `debugAjax'. Is there anywhere to switch on or off via the javawebparts custom tags? I looked at ajax:enable/, but the tag description says it an empty tag. You might want to allow this feature. Thanks in advance This is where I pause for the weekend in London. *PAUSE* -- Peter Pilgrim :: J2EE Software Development Operations/IT - Credit Suisse First Boston, Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.csfb.com/legal_terms/disclaimer_external_email.shtml == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
True, but it's been pointed out that having a wife already disqualified me! On 1/6/06, Daniel Blumenthal [EMAIL PROTECTED] wrote: nah, if you were really a geek you'd type :x and save the keypress :) -Original Message- From: Simon Chappell [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 11:09 AM To: Struts Users Mailing List Subject: Re: [FRIDAY] You might be a geek if ... I have been known to type :wq when trying to save documents written in those new-fangled gooey-thingies. :-) Simon On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: LOL As well as a Cntrl-F when you are reading a book...!! Chris McCormack [EMAIL PROTECTED] wrote on 01/06/2006 11:01:18 AM: ...after saying/handwriting the wrong thing your left hand instinctively moves to press CTRL-Z. Yes I have done this :( -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
Will this work? jsp:include jsp:param ... /jsp:include or c:import c:param /c:import On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Well this is not a static page. Actually my jsp page requires some parameters passed to it by th calling struts application as well. Using these parameters the jsp page renders some results, which in turn needs to be displayed in a tile inside the struts application. Is it possible to achieve this ? I appreciate your help very much, Tyrell On 1/6/06, Mark Lowe [EMAIL PROTECTED] wrote: If I've understood what you're after then wont jstl's c:import do what you need? Mark On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - 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] -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaWebParts and Struts / Ajax integration
On Fri, January 6, 2006 1:27 pm, Pilgrim, Peter said: Me too. I developing on the old Service Pack 1 of WLS. Production has the latest SP4 and SP5 better. May be it was me, Eclipse, My Eclipse, and combination of all. Either way I rewrite tag library definitions in web.xml and my JSP by hand, just to make sure I wasn't going crazy! Usually its Websphere driving me nuts like that :) Actually I forgot to saw that the JSP page itself is `/asds/secured/showContactDetails.jsp' where `/asds' is the context root. Hmm... the target should match whatever the mapping for the servlet is... which I *think* is just typeAheadSuggestions... I'll have to try and replicate what your seeing because it seems like it should be working. Does the sample webapp work as-is (after you change the TLD)? I thought of that before heading home, but I wanted to wait for response, because what I would really need is access the `contextRoot' as a variable. I could write something like this target%contextPath%/typeAheadSuggestions/target Yeah, that definitely won't work. IIRC, *not* having a leading slash will *almost* in effect do what you want though, calculate it relative to the location of the requesting resource (which is I think what your seeing). How about this... change the servlet mapping to secure/typeAheadSuggestions. ... ( No it does not work) Sorry 127.0.0.1 - auth1 [06/Jan/2006:18:21:41 +] GET /typeAheadSuggestions?enteredText=xassureUnique=1 HTTP/1.1 404 1214 127.0.0.1 - auth1 [06/Jan/2006:18:21:44 +] GET /typeAheadSuggestions?enteredText=xaassureUnique=2 HTTP/1.1 404 1214 Yeah, that confirms what I said above... you will need to not have the leading slash, which will cause it to be calculated relative to the requesting resource, so if you change the servlet mapping to match it should work. I'm not sure that is the most convenient answer, but it looks like things are actually doing what they are supposed to, so it might be the right answer. The ajax submission is now missing the context path completely. Can you cut a release of the javawebparts to fix the bug or tell me where I can patch it please. Give that a shot first... I don't think this is really a bug in AjaxTags, although it might be something of an enhancement (i.e., maybe add some attribute to the target element to tell how you want the URL to be calculated: contextRelative, resourceRelative or absolute). How do you discern in the Servlet what field is being query? Hmm, good one, you got me! That's *definitely* an enhancement across-the-board, you *should* get at least the ajaxRef passed in with every AJAX request, and at least for the standard handlers I can add that. For now, what I think you can do, although I haven't tried it, is add a parameter to the target URL. So, in the config file, for each element, your target might be: targettypeAheadSuggestions?field=1/target ...and so on. Actually, I have a feeling that won't work... I don't think the code in the request handler currently is smart enough to see that there is already a query string (that's another definite enhancement). The other alternative is to take the Javascript for the request handler you are using and create your own custom handler based on it, adding the capability you need. In most cases, if you can't get what you want from the standard handlers, that's the right answer. In this case though, what your asking for is something that will probably be pretty common, so I'll definitely add that as an enhancement. I had a look at the source of the page, there is a JavaScript variable called `debugAjax'. Is there anywhere to switch on or off via the javawebparts custom tags? I looked at ajax:enable/, but the tag description says it an empty tag. You might want to allow this feature. Yes, this was added by the new developer on the project and I already mentioned to him it should probably be an option. For now, you can simply throw this in the head of your page: scriptdebugAjax=true;/script That should do the trick. This is where I pause for the weekend in London. *PAUSE* Sounds good, let me know how it goes on Monday and I'll help however I can. FYI, I am planning on cutting a new release Sunday night, so you may want to grab that first thing, just in case any of this is fixed by that (I don't think so, but just in case). Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 12/30/05, Ted Husted [EMAIL PROTECTED] wrote: ... for Christmas, Santa brings you all six Star Wars movies, so you can watch them in order, from The Phantom Menace through Revenge of the Jedi. ... and, somehow, that gives you bragging rights on the Struts User list :) or, as Yoda might say, Watch Star Wars, you should .do -T. Craig
Re: The framework I think I want...
On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Fri, January 6, 2006 1:01 pm, Michael Jouravlev said: Rrright. You want to save on network bandwidth by validating in browser. At the same time we have Ajax suggest-type junk growing in popularity, where server is pulled each time a user hits a button. Well, not *each* time a key is pressed... look at the code for Google Suggests and you will see they do a really cool thing where they throttle the number of requests based on how fast you are typing. It's not a 1:1 call per keypress unless you are typing really slow. (My own AjaxTags example doesn't do this, but hey, Google has Ph.D's to spare whereas I don't have even one!) The above was not meant to be an attack on you (do you have suggest-type thing?) ;-)) Google has also bandwidth and number of connections to spare ;-) Nah. Imho, client-side validation should be minimal. Empty/non-emty, proper length. Maybe some simple data conversion check like is it a number or a valid email. Yes, it is not DRY and redundant because the final validation is done on the server anyway, but user's Athlon 64 needs some code to chew. Everything more complex than above, including custom error messages, inter-field dependencies, etc is checked on server. It will be checked on server anyway, because user's browser is in the open, whoever can change the validation rules or turn them off or turn Javascript off. Best practices have dictated for a long time that any validation that occurs on the client should also occur on the server. But, the more you can pull off on the client, the more responsive and user-friendly your application will usually be. ...and the larger the Javascript file gets. If validation still has to be done on server, how do you compare (1) one-time (hopefully) load of a large Javascript validation file for client-based validation, with (2) going back to the server and updating a relatively small page region without full page reload? [ I have my Ajax now too, :-) ] The latter is simpler for me. Is it better? It is not much worse than former I would say, but a lot simpler, and I do not have to duplicate Java validation in Javascript. If you combine an ActionForm with an Action, what happens if you want to give that combined object session scope? Would you then store the entire thing in session? I would assume so. That seems like a (potentially) big waste of resources. Why? The code and class definition are loaded only once. Where the resources are wasted? Advertising ActionForm as a request parameter holder in Struts best practices is a mistake imho. It can be used as an input/output buffer, as this kind of layer that you talk about. Apparently, it should have session scope ;) and implement Serializable. I would make the argument that session-scope for an ActionForm is the abomination. There should be something else, and I'm not sure I know what, that gets stashed in session scope. I am pretty happy with ActionForm in session ;) If an ActionForm is thought of ONLY as a buffer as you say, a DTO between presentation and control basically, Struts seems a lot cleaner all of a sudden. Um, a lot cleaner (1) if it contains only request parameters per-request as it is bieing recommended to be used now, or (2) if it contains I/O data between requests during conversation with a user, including wrong input values and error messages? Of course, that then leaves a lot of questions about how you persist user entries and such, and I admit I don't have a good answer there. The main drawback of session-scoped ActionForm is that I can have only one of each kind. Does not work well with several windows opened. Couple of years ago I was doing a little different, i had a list of session-scoped presentation objects that contained I/O values and errors. So I could have one action form and several session-scoped I/O objects related to it. But then I decided to abandon this, too complex to manage and users don't usually open secondary windows themselves. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sending file name containing unicode characters in http file download
You don't have any control over the client-side decoding; the browser will look at the HTTP header and 'do it's thing' with it. There is a way to do this, I think there's an encoding mechanism you can use for non-ASCII header data. I'm not sure if it's standardized by HTML or one of those 'by convention' things though. Just had a quick look at some old code, which turned out not to be doing exactly what I'd expect (!) but I *think* what you need to do is to convert the filename into a byte stream using the request encoding, then URL encode that byte stream and use the result as the filename in the Content-Disposition header. L. Daniel Blumenthal wrote: Sourav, I'm not sure, but I'd guess that you'd want to encode it as a transportable UTF-8 format on the server side, and decode it on the client side. Assuming that this is, in fact, what you need to do, you can find instructions on doing it here: http://www.w3.org/International/O-URL-code.html Good luck! Daniel -Original Message- From: souravm [mailto:[EMAIL PROTECTED] Sent: Thursday, January 05, 2006 10:36 PM To: Struts Users Mailing List Subject: Sending file name containing unicode characters in http file download Hi All, I've an application which can be used for downloading file over web. Now if the file name contains Unicode characters which are not in iso-8859-1 range, the name appearing at the browser (in the download window asking for save) coming as junk. I'm passing the fine name through http header by setting the filename parameter. The code is written in JSP. In this context I need to know following things - 1. As I was aware through http header one cannot send non iso-8859-1 characters. Is this problem happening due to the same reason ? 2. If the answer to above Qs is yes, the what is the solution/work around for downloading a file having name with Unicode characters which are not in iso-8859-1 range in http file download ? Any input/pointer would be highly appreciated. Regards, Sourav CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
Oh. Ugh. GROAN. :) LOL -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] On Fri, January 6, 2006 1:57 pm, Craig McClanahan said: On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 12/30/05, Ted Husted [EMAIL PROTECTED] wrote: ... for Christmas, Santa brings you all six Star Wars movies, so you can watch them in order, from The Phantom Menace through Revenge of the Jedi. ... and, somehow, that gives you bragging rights on the Struts User list :) or, as Yoda might say, Watch Star Wars, you should .do -T. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation.xml ---- validate to make sure entered number is positive
fea jabi wrote: Have a field in my jsp. Have to make sure the entered value in the field is a positive integer. Using validation.xml for validation. How to this? http://struts.apache.org//struts-doc-1.2.8/userGuide/dev_validator.html L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Oh. Ugh. GROAN. :) LOL You doing chewbacca or jabba? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] On Fri, January 6, 2006 1:57 pm, Craig McClanahan said: On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 12/30/05, Ted Husted [EMAIL PROTECTED] wrote: ... for Christmas, Santa brings you all six Star Wars movies, so you can watch them in order, from The Phantom Menace through Revenge of the Jedi. ... and, somehow, that gives you bragging rights on the Struts User list :) or, as Yoda might say, Watch Star Wars, you should .do -T. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On Fri, January 6, 2006 2:01 pm, Michael Jouravlev said: The above was not meant to be an attack on you (do you have suggest-type thing?) ;-)) Google has also bandwidth and number of connections to spare ;-) Oh, I know, I was just pointing it out because many people don't realize they do that, and it's kinda cool. Your right of course, they can spare some bandwidth for keypresses :) ...and the larger the Javascript file gets. If validation still has to be done on server, how do you compare (1) one-time (hopefully) load of a large Javascript validation file for client-based validation, with (2) going back to the server and updating a relatively small page region without full page reload? [ I have my Ajax now too, :-) ] The latter is simpler for me. Is it better? It is not much worse than former I would say, but a lot simpler, and I do not have to duplicate Java validation in Javascript. That's a fair point. Assuming it is a one-time load though, just the simple fact that there are less requests being made with client-side validation I think is a clear benefit. Well, PRESUMABLY less requests anyway... the more you can catch without hitting the server, the less requests. It *is* simpler when only the server is involved though, no question there. Just the fact that you don't have to have duplicate code (whether you write it yourself or have some taglib or something generate it) is a clear advantage. If you combine an ActionForm with an Action, what happens if you want to give that combined object session scope? Would you then store the entire thing in session? I would assume so. That seems like a (potentially) big waste of resources. Why? The code and class definition are loaded only once. Where the resources are wasted? Well, if I have a couple of pages that I want to store in session, and it is a combined object, my session is bigger than if the objects I'm storing are just data. That's what I was referring to. There is still physical memory being used to store the instance of the Action class in session. I'm a stickler about the size of session because I work in a distributed environment where session size is something you need to be very cognizant of. I am pretty happy with ActionForm in session ;) I know :) And I'm a big believer in whatever works for you, so I'm happy either way. If an ActionForm is thought of ONLY as a buffer as you say, a DTO between presentation and control basically, Struts seems a lot cleaner all of a sudden. Um, a lot cleaner (1) if it contains only request parameters per-request as it is bieing recommended to be used now, or (2) if it contains I/O data between requests during conversation with a user, including wrong input values and error messages? Good question... I'd say #1, but I treat it as an I/O buffer in the sense that yes, it takes in request parameters per-request, but it also is the container where output data goes to be rendered by the presentation layer, and that would include error messages. It would NOT include state between related requests though (i.e., a wizard flow). #2 is where that something else I mentioned comes in. And again, I'm talking generalities here... there are obviously places where session-scoped ActionForms make sense right now. And of course I have to reiterate that I don't have at the moment a better answer, we're just discussing what the problems with the current framework might be, expressed in terms of what we'd like to see, as per the original topic of the thread :) The main drawback of session-scoped ActionForm is that I can have only one of each kind. Does not work well with several windows opened. Couple of years ago I was doing a little different, i had a list of session-scoped presentation objects that contained I/O values and errors. So I could have one action form and several session-scoped I/O objects related to it. But then I decided to abandon this, too complex to manage and users don't usually open secondary windows themselves. That's along the lines of what I am describing above. Maybe what there needs to be is a single I/O buffer object and some peripheral objects attached to the same view for other things, which sonuds about like what your saying you played with :) Michael. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [FRIDAY] You might be a geek if ...
HAHAHA! Haba chunkawa yung Jehdii. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] On Fri, January 6, 2006 2:13 pm, Mark Lowe said: On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Oh. Ugh. GROAN. :) LOL You doing chewbacca or jabba? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] On Fri, January 6, 2006 1:57 pm, Craig McClanahan said: On 1/6/06, Ted Husted [EMAIL PROTECTED] wrote: On 12/30/05, Ted Husted [EMAIL PROTECTED] wrote: ... for Christmas, Santa brings you all six Star Wars movies, so you can watch them in order, from The Phantom Menace through Revenge of the Jedi. ... and, somehow, that gives you bragging rights on the Struts User list :) or, as Yoda might say, Watch Star Wars, you should .do -T. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
Or just reference the JSP in your Tile definition. If these suggestions don't help, you'll need to give more detail on what you're trying to achieve and how you've tried to achieve it. L. Mark Lowe wrote: If I've understood what you're after then wont jstl's c:import do what you need? Mark On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - 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: The framework I think I want...
Heh, Frank, The major problem with action forms is that there is an assumption that an action must be sandwiched between two instances of the same action form response object. This is simply contrary to what anyone would logically expect of a normal transversal by a client through a site. An action, typically, should yield a distinct action form from the prior action form. AF1 (response) -- request -- A1 -- AF2 (response). This has been, in my opinion, the biggest downfall of Struts. As you suggested, Frank, the whole way the view state is taken care of by Struts is poor. snip On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: The idea of an ActionForm was a great concept to begin with, and it seems like many people don't see the benefit (not saying you Michael, just making a general statement). Frank /snip -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: The framework I think I want...
On Fri, January 6, 2006 2:59 pm, Dakota Jack said: Heh, Frank, The major problem with action forms is that there is an assumption that an action must be sandwiched between two instances of the same action form response object. This is simply contrary to what anyone would logically expect of a normal transversal by a client through a site. An action, typically, should yield a distinct action form from the prior action form. AF1 (response) -- request -- A1 -- AF2 (response). I would tend to agree with that... you know, I have an interesting experience... almost three years ago I wrote a rather complex application that was not Struts-based, it used a home-grown framework. There was no notion of an ActionForm in it, or anything like it. As a result, the Actions have a method that pulls parameters out of request and stuffs them into a WorkContext object (which looks a lot like a cross between an ActionForm and a ChainContext). Almost two years ago, I was asked to convert the application to Struts. For a number of reasons, ActionForms wound up being used as (a) output containers, i.e., a place to store data destined for display and (b) as storage objects during a wizard flow. I did not use the Struts taglibs, and ActionForms were not attached to Action mappings, hence no auto-population occurred, no auto-validation, etc. Now, it is true that I didn't get much of the benefit of Struts doing this, but it was necassery to avoid rearchitecting the entire application. More importantly though, all the problems typically sited with Struts, and ActionForms in particular, were not present. I had a very easy time of making it do exactly what I want, and this thing is a pretty complex app, has a number of wizard flow, freeform navigation, is what most would now call an RIA, etc. To me, it's really the auto-population mechanism that causes problems, not because I think its a bad idea (it's not) but because I think we don't have enough control over it. I'd like to be able to turn it off on a per-mapping basis for instance, especially when I'm pulling the form out of session and I don't want to just automagically have what's there overwritten with what was submitted (which is, I believe, a problem Michael was pointing out). The interesting thing is, there are some relatively minor tweaks that could be done to Struts that would solve a lot of problems. How about creating Actions per-request? Not at all a significant enhancement, but think of all the things you could then do. How about a simple flag to tell the RP to populate the Action rather than an ActionForm, thereby giving Michael his dream of a combined Action and ActionForm? Again, we're not talking about a big change. These are also not new ideas by any stretch, I, and you, and Michael and others have been tossing these things around for at least a year or more. ...all of which raises a question that I don't know the answer to... does Struts 1.3 pool Commands? I.e., if I implement my Actions as Commands, do I get that per-request functionality I want? If so, that is at least a step in a good direction. This has been, in my opinion, the biggest downfall of Struts. As you suggested, Frank, the whole way the view state is taken care of by Struts is poor. Woah, hold on now, don't put words in my mouth :) I wouldn't go so far as to say it's poor because many people have had a great deal of success with it. I *do* think there are some shortcomings that may or may not have some relatively simple solutions, and I don't think too many people would disagree. No one thinks Struts is perfect, but based on how many people use it and use it successfully, it's probably not fair to say it's poor, or that any one part of it is poor. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: The interesting thing is, there are some relatively minor tweaks that could be done to Struts that would solve a lot of problems. How about creating Actions per-request? Not at all a significant enhancement, but think of all the things you could then do. How about a simple flag to tell the RP to populate the Action rather than an ActionForm, thereby giving Michael his dream of a combined Action and ActionForm? Again, we're not talking about a big change. These are also not new ideas by any stretch, I, and you, and Michael and others have been tossing these things around for at least a year or more. You're right in that these are not new ideas. I think crazybob implemented something like this a few years ago. I tried it out myself, and was having a lot of fun with it (yes, i'm a geek), but I don't have the time to pursue it right now. Anyway, with Ti, this should no longer be a problem. ...all of which raises a question that I don't know the answer to... does Struts 1.3 pool Commands? I.e., if I implement my Actions as Commands, do I get that per-request functionality I want? If so, that is at least a step in a good direction. IIRC, Craig implements Commands the way he did Actions, so there's one instance of it for the whole app (per jvm, etc, you know what i mean). No one thinks Struts is perfect, but based on how many people use it and use it successfully, it's probably not fair to say it's poor, or that any one part of it is poor. *Poor* is relative. Struts might've been the bleeding edge of tech years ago, but it's got a lot of catching up to do now. Not that it can't, but instead of slowly catching up, we'll quickly catch up instead by merging with WW. Frank Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
- Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:21 PM The interesting thing is, there are some relatively minor tweaks that could be done to Struts that would solve a lot of problems. How about creating Actions per-request? This will be easier to do in Struts 1.3 because rather than having to have a custom RequestProcessor you simply need to replace the Command that gets the Action instance with your own version that instantiates a new Action every time. So rather than using o.a.s.c.c.s.CreateAction create your own implementation by extending AbstractCreateAction and implement getAction() method that does this. Not at all a significant enhancement, but think of all the things you could then do. How about a simple flag to tell the RP to populate the Action rather than an ActionForm, thereby giving Michael his dream of a combined Action and ActionForm? Again for the same reasons as above this should be straightforward to do in Struts 1.3 - you could use a property on the ActionMapping to flag this and replace the PopulateActionForm command with one that populates the Action. In this case though as well as configuring the chain to use the custom Command, you will also need to change the sequence of Commands since the Action is currently created after the ActionForm is populated. Also, I've only just started reading the WebWork book (on Chpt 5), but it works in this way already (no separate form and a new instance every time) - I believe they're moving away from having to have any concrete classes / interfaces - just have a POJO that gets populated and then configure it to call a method. Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On Fri, January 6, 2006 3:36 pm, Hubert Rabago said: IIRC, Craig implements Commands the way he did Actions, so there's one instance of it for the whole app (per jvm, etc, you know what i mean). That would be a shame. Craig, can you confirm this? If that is the case, I'd be interested in knowing the rationale because I know the rationale for the decision originally with Actions, but as we've discussed a couple of times, the rationale doesn't really carry forward to the present. Is there another reason? (Quick, switch 1.3 to use the Chain implementation in Java Web Parts... it doesn't suffer that problem ;) ) *Poor* is relative. Struts might've been the bleeding edge of tech years ago, but it's got a lot of catching up to do now. Not that it can't, but instead of slowly catching up, we'll quickly catch up instead by merging with WW. As a plan, that sounds good :) It will be interesting to see how it turns out. Hubert Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Niall Pemberton [EMAIL PROTECTED] wrote: This will be easier to do in Struts 1.3 because rather than having to have a custom RequestProcessor you simply need to replace the Command that gets the Action instance with your own version that instantiates a new Action every time. So rather than using o.a.s.c.c.s.CreateAction create your own implementation by extending AbstractCreateAction and implement getAction() method that does this. snip/ Again for the same reasons as above this should be straightforward to do in Struts 1.3 - you could use a property on the ActionMapping to flag this and replace the PopulateActionForm command with one that populates the Action. snip/ Niall ... and this is how I did it when I said earlier I played with these approaches, so if anyone out there wants an example, just let me know and I'll send you a url. Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On Fri, January 6, 2006 3:49 pm, Niall Pemberton said: This will be easier to do in Struts 1.3 because rather than having to have a custom RequestProcessor you simply need to replace the Command that gets the Action instance with your own version that instantiates a new Action every time. So rather than using o.a.s.c.c.s.CreateAction create your own implementation by extending AbstractCreateAction and implement getAction() method that does this. Agreed. That's why a few weeks back I was making a lot of noise about getting 1.3 out. Once it is out, a lot of these sorts of things will become common knowledge and Struts will look a whole lot better in a number of ways. Also, I've only just started reading the WebWork book (on Chpt 5), but it works in this way already (no separate form and a new instance every time) - I believe they're moving away from having to have any concrete classes / interfaces - just have a POJO that gets populated and then configure it to call a method. I'm on chapter 4 :) Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Craig McClanahan [EMAIL PROTECTED] wrote: IIRC, Craig implements Commands the way he did Actions, so there's one instance of it for the whole app (per jvm, etc, you know what i mean). That's what the default Commons Chain imlementation does, so that's what the current 1.3 code does ... if you don't want that, use a different implementation of org.apache.commons.chain.Chain :-). On the other hand, if you're using the CoR design pattern, all your state information should be in the Context object that gets passed around, not in instance variables in a Command instance. Therefore, you shouldn't *want* to have multiple instances of the command classes. Put the per-request state information in the context (or approprately organized in a session scope attribute) where it belongs. Craig So, Frank, maybe what you want is a per-request POJO action object that gets populated by the framework with request parameters, stuffs the relevant data onto a context object, and triggers a chain to fulfill the request. Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On 1/6/06, Hubert Rabago [EMAIL PROTECTED] wrote: On 1/6/06, Craig McClanahan [EMAIL PROTECTED] wrote: IIRC, Craig implements Commands the way he did Actions, so there's one instance of it for the whole app (per jvm, etc, you know what i mean). That's what the default Commons Chain imlementation does, so that's what the current 1.3 code does ... if you don't want that, use a different implementation of org.apache.commons.chain.Chain :-). On the other hand, if you're using the CoR design pattern, all your state information should be in the Context object that gets passed around, not in instance variables in a Command instance. Therefore, you shouldn't *want* to have multiple instances of the command classes. Put the per-request state information in the context (or approprately organized in a session scope attribute) where it belongs. Craig So, Frank, maybe what you want is a per-request POJO action object that gets populated by the framework with request parameters, stuffs the relevant data onto a context object, and triggers a chain to fulfill the request. Or, the per-request POJO *is* the context object (which already has per-request lifetime). Why have two beans instead of one? Hubert Craig
[Shale] getting my first dialog to work with Shale/MyFaces
Hi all: I am back working with Shale after setting it down for a while. So anyway, I am trying to get my first dialog to work by making a trivial Search and Cancel button. Here's what i have in dialog-config.xml: dialog name=Search Contacts start=SearchHome view name=SearchHome viewId=/search.jsp transition outcome=search.find target=SearchHome/ transition outcome=cancel target=Exit/ /view end name=Exit viewId=/worklist.jsp /end /dialog My /menu.jsp (via tiles mapping) has: h:commandLink id=searchStartMenu action=dialog:Search Contacts h:outputText value=Search / /h:commandLink However, clicking on Search gives me nasty errors: [ERROR] [faces] - Servlet.service() for servlet faces threw exception java.lang.IllegalArgumentException: Search Contactsjava.lang.IllegalArgumentException: Search Contacts at org.apache.shale.dialog.faces.DialogNavigationHandler.start(DialogNavigationHandler.java:446) at org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(DialogNavigationHandler.java:183) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84) etc.. Do I need to configure anything else? Or am I running into trouble because I am using tiles? (I am working with the nightly struts-shale build dated today). Thanks in advance, Geeta
Re: The framework I think I want...
- Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:56 PM I'm on chapter 4 :) Frank Excellent. I can't decide if its a really well written book or that it seemed so familiar that it just felt like being at home - only better! Most technical books I get bored with v.quickly and end up just dipping in and out for the bits I want, but I sat and read the first 5 chapters and it seemed v.easy going. Got a bit busy in the last week so haven't been back to it yet. Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
On Fri, 2006-01-06 at 20:49 +, Niall Pemberton wrote: - Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:21 PM Not at all a significant enhancement, but think of all the things you could then do. How about a simple flag to tell the RP to populate the Action rather than an ActionForm, thereby giving Michael his dream of a combined Action and ActionForm? Again for the same reasons as above this should be straightforward to do in Struts 1.3 - you could use a property on the ActionMapping to flag this and replace the PopulateActionForm command with one that populates the Action. In this case though as well as configuring the chain to use the custom Command, you will also need to change the sequence of Commands since the Action is currently created after the ActionForm is populated. related to this, sort of, on this page: http://struts.apache.org/struts-action/roadmap.html under the Struts Action Framework 1.5.x considerations heading it says: Consider a populate method on ActionForm. From an OOP standpoint, it might be cleaner if an ActionForm populated itself rather than rely on a god class to populate it from the outside. It seems that even if you change the process, as stated in the original post, to populate the Action instead of the ActionForm, it would still be nice to allow the population method to be controlled somehow, either by having a populate method in the ActionForm or Action, or even declaring a populate class in the ActionMapping, that could be any java class that defines a populate method. Does anyone else care about this? Because i have an application in which i had to extend the RequestProccessor, i overloaded the processPopulate method to check the ActionForm for a populate method, via reflection, which would be run, if it existed. The application builds forms on the fly out of a set of form/page/field definitions that exist in a database, each field having a fieldType that corresponds to a class that defines a populate, validate and generateView method. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
Well, however, isn't it true that the common variety was created for this. This reminds me of the librarian who said she could not remain open an extra five minutes for me because of the rules. Upon examination, she authored and enforced the rules. On 1/6/06, Craig McClanahan [EMAIL PROTECTED] wrote: On 1/6/06, Hubert Rabago [EMAIL PROTECTED] wrote: On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: ...all of which raises a question that I don't know the answer to... does Struts 1.3 pool Commands? I.e., if I implement my Actions as Commands, do I get that per-request functionality I want? If so, that is at least a step in a good direction. IIRC, Craig implements Commands the way he did Actions, so there's one instance of it for the whole app (per jvm, etc, you know what i mean). That's what the default Commons Chain imlementation does, so that's what the current 1.3 code does ... if you don't want that, use a different implementation of org.apache.commons.chain.Chain :-). On the other hand, if you're using the CoR design pattern, all your state information should be in the Context object that gets passed around, not in instance variables in a Command instance. Therefore, you shouldn't *want* to have multiple instances of the command classes. Put the per-request state information in the context (or approprately organized in a session scope attribute) where it belongs. Craig -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: The framework I think I want...
On Fri, January 6, 2006 4:09 pm, Niall Pemberton said: Excellent. I can't decide if its a really well written book or that it seemed so familiar that it just felt like being at home - only better! That's what struck me too... I have to admit my feeling so far has been ok, this doesn't seem all *that* much better than what Struts offers, but I suspect there are some things coming that will change that. But, through it all I'm also thinking well, this isn't going to be a difficult transition at all for Struts developers, which is really good. It really *is* quite familiar, at least so far. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] getting my first dialog to work with Shale/MyFaces
On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all: I am back working with Shale after setting it down for a while. So anyway, I am trying to get my first dialog to work by making a trivial Search and Cancel button. Here's what i have in dialog-config.xml: dialog name=Search Contacts start=SearchHome view name=SearchHome viewId=/search.jsp transition outcome=search.find target=SearchHome/ transition outcome=cancel target=Exit/ /view end name=Exit viewId=/worklist.jsp /end /dialog My /menu.jsp (via tiles mapping) has: h:commandLink id=searchStartMenu action=dialog:Search Contacts h:outputText value=Search / /h:commandLink However, clicking on Search gives me nasty errors: [ERROR] [faces] - Servlet.service() for servlet faces threw exception java.lang.IllegalArgumentException: Search Contactsjava.lang.IllegalArgumentException: Search Contacts at org.apache.shale.dialog.faces.DialogNavigationHandler.start( DialogNavigationHandler.java:446) This particular exception means that Shale could not find a dialog named Search Contacts in the set of configured dialogs. (Yes, the error message should actually *say* that ... it will tonight :-). In turn, that implies the dialog configuration file hasn't been loaded. Is this file named /WEB-INF/dialog-config.xml? Do you have the Shale filter defined in web.xml? The web site has a useful checklist of stuff to make sure you've set up to use Shale in a webapp: http://struts.apache.org/struts-shale/using.html Craig
Re: The framework I think I want...
LOL Okay, Big Fella, stand at ease. If what you said does not suggest what I said, then you are safe as barrel water. Let me state it for myself. It is clearly POOR and has been for a long time. If people are too danged sensitive to accept that, sobeit. Yesterday is gone. I am not writing history but am writing and designing code. To heck with the ego parade. snip On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: This has been, in my opinion, the biggest downfall of Struts. As you suggested, Frank, the whole way the view state is taken care of by Struts is poor. Woah, hold on now, don't put words in my mouth :) I wouldn't go so far as to say it's poor because many people have had a great deal of success with it. I *do* think there are some shortcomings that may or may not have some relatively simple solutions, and I don't think too many people would disagree. No one thinks Struts is perfect, but based on how many people use it and use it successfully, it's probably not fair to say it's poor, or that any one part of it is poor. Frank /snip -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: The framework I think I want...
On 1/6/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: *snip* I'm not able to use 1.3 yet based on some politics here, so I've had to stick with 1.2.7. Luxury! I'm still out here allowed to use 1.1. So, you folks just feel free to change anything you like, it isn't going to make *any* difference to me. That said, 1.1 still works and solves enough of my problems that I praise it far more than I curse it, the struts-config.xml file excepted, of course. Simon -- www.simonpeter.com uab.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] getting my first dialog to work with Shale/MyFaces
From: Craig McClanahan [EMAIL PROTECTED] On 1/6/06, [EMAIL PROTECTED] wrote: This particular exception means that Shale could not find a dialog named Search Contacts in the set of configured dialogs. (Yes, the error message should actually *say* that ... it will tonight :-). In turn, that implies the dialog configuration file hasn't been loaded. Is this file named /WEB-INF/dialog-config.xml? Do you have the Shale filter defined in web.xml? Seems like a good opportunity to hijack a thread. On a related topic, Ryan Wynn was just suggesting that we adopt the spring convention for identifying a configuration resource. This would allow a configuration file could be loaded from the class path or context root by prefixing the file with classpath:. If you agree that this would be a useful feature, Clay and dialogs might be able to share a utility class? The web site has a useful checklist of stuff to make sure you've set up to use Shale in a webapp: http://struts.apache.org/struts-shale/using.html Craig Gary
Re: [Shale] getting my first dialog to work with Shale/MyFaces
[EMAIL PROTECTED] wrote on 01/06/2006 04:18:43 PM: This particular exception means that Shale could not find a dialog named Search Contacts in the set of configured dialogs. (Yes, the error message should actually *say* that ... it will tonight :-). Thanks! :) In turn, that implies the dialog configuration file hasn't been loaded. Is this file named /WEB-INF/dialog-config.xml? Actually I found that dialog-config.xml had an xml error so I guess it was silently not loaded. So I fixed it and now the Cancel works (yeahh!!) so I think at least I have gotten into the dialog..:) My Search still throws a nasty error, but I guess I shall struggle with that awhile before I give up and ask you again..(:( Craig Thank you again for your time, Geeta
Re: [Shale] getting my first dialog to work with Shale/MyFaces
On 1/6/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip/ Actually I found that dialog-config.xml had an xml error so I guess it was silently not loaded. So I fixed it and now the Cancel works (yeahh!!) so I think at least I have gotten into the dialog..:) My Search still throws a nasty error, but I guess I shall struggle with that awhile before I give up and ask you again..(:( snap/ Possibly rethink the corresponding outbound transition from the SearchHome view state (separate the search and results views). -Rahul Thank you again for your time, Geeta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
- Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, January 06, 2006 9:17 PM On Fri, January 6, 2006 4:09 pm, Niall Pemberton said: Excellent. I can't decide if its a really well written book or that it seemed so familiar that it just felt like being at home - only better! That's what struck me too... I have to admit my feeling so far has been ok, this doesn't seem all *that* much better than what Struts offers, but I suspect there are some things coming that will change that. But, through it all I'm also thinking well, this isn't going to be a difficult transition at all for Struts developers, which is really good. It really *is* quite familiar, at least so far. Going from memory, in one of the first few chapters they say something along the lines that its the small bits - attention to detail - just finishing off the product that little bit better - adds up to something that makes a big improvment as a whole. So far I'd have to agree and I think we have been guilty of not quite finishing things off well as we could - take errors as an example - how many users get really frustrated becuase they get some obscure message that makes no sense? Anyway the example they used to demonstrate this was v.poor (bean:message can only take 4 args) - I was tempted to pop in a new bean:arg tag - it would suited my perverse sense of humour to make the book out of date ;-) Even though the example was poor though I do agree with the overall point. Niall Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Shale/JSF]
Could you elaborate on this? Shawn -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, January 04, 2006 5:38 PM To: user@struts.apache.org Subject: Re: [Shale/JSF] Craig McClanahan wrote: On 1/4/06, Garner, Shawn [EMAIL PROTECTED] wrote: How do you get access to one managed bean from within another managed bean? We have some business logic that depends on values in another managed. If you're trying to gain access from a class that extends AbstractFacesBean or AbstractViewController, this is really simple: MyBean bean = (MyBean) getBean(name); // name == managed bean name of the other bean If you are in a class that doesn't extend one of these, it's a little more work but still straightforward: FacesContext context = FacesContext.getCurrentInstance(); ValueBinding vb = context.getApplication().createValueBinding(#{name}); MyBean bean = (MyBean) vb.getValue(context); Either of the above techniques will cause the other managed bean to be created, if it doesn't exist. If you *know* it exists, and what scope it is in, you can also use the appropriate scoped map. Assume the other bean is in session scope: FacesContext context = FacesContext.getCurrentInstance(); MyBean bean = (MyBean) context.getExternalContext ().getSessionMap().get(name); Shawn Craig It's probably also worth pointing out that you could use 'dependency injection' -- i.e. a managed property -- to supply the dependent bean with its dependency, declaratively, through the faces-config.xml. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale/JSF]
On 1/6/06, Garner, Shawn [EMAIL PROTECTED] wrote: Could you elaborate on this? Which this are you referring to? Laurie's comment about dependency injection? I covered that on my reply to the comment (on Wednesday), reproduced here: -- Good point ... that's even easier. Assume you have a managed bean named business that you want to inject into the backing bean containing your submit action. If that bean is called myself, you would ensure that it has a public property that corresponds to the type of your business logic bean: public MyBean getBusinessBean() { ... } public void setBusinessBean(MyBean bean) { ... } and you'd configure it in faces-config.xml like this: managed-bean managed-bean-namemyself/managed-bean-name managed-bean-classcom.mycompany.MyBackingBean/managed-bean-class managed-bean-scoperequest/managed-bean-scope ... managed-property property-namebusinessBean/property-name value#{business}/value /managed-property ... /managed-bean Then, the business logic bean will get injected for you (created if necessary the first time) any time your backing bean is created. The only restriction is that you can't inject a bean from a shorter scope into a bean with a longer scope ... but that won't be an issue for something like this, because your page-oriented backing bean would typically have request scope, and the business logic bean would have application scope (if it was shared across all users), or perhaps the none scope to get a new instance every time. --- Craig
RE: form submitted twice
Use the html:img tag instead of html:image Read here for the difference: http://struts.apache.org/struts-taglib/tagreference-struts-html.html -Original Message- From: Faisal Shoukat [mailto:[EMAIL PROTECTED] Sent: Friday, January 06, 2006 10:47 AM To: user@struts.apache.org Subject: form submitted twice Hi, I have a problem where for some unknown reason my form is submitted twice. I have a action class which calls a delegate which calls a DAO class. When I press submit the form is submitted. My code in the JSP is as follows: Javascript function called when submitting form: function setAction(action) { document.pendingRecordForm.action.value= action; document.pendingRecordForm.submit(); } To submit the form the following image: html:image src=../images/save_button.jpg onclick=setAction('approve')/ The submit then calls the perform method in my struts action class ( By the way I am using 1.0.2 version of Struts) The action class then works through the code and when the thread gets to the DAO class the second call arrives at the action class, This second call sends back a target of failure because of some validation error and the successful target from the first submit is ignored. I don't understand why my form gets submitted twice. The struts config is as follows for the action: action path=/approve type=com.myclass. name=pendingRecordForm scope=request input=/jsp/approvexx.jsp forward name=failure path=/jsp/approvexx.jsp/ forward name=success path=/jsp/menu.jsp/ /action Thanks in advance This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
pitfalls when moving from Tomcat 5.0 to 5.5 (Struts 1.1)?
Hello everybody, I have a Struts 1.1 application running in Tomcat 5.0. I THINK the transition to Tomcat 5.5 should be smooth, as a) the struts part should work pretty much in different Tomcats? b) Tomcat 5.0 to 5.5 is only a minor release, so it should be very compatible? However, I have various problems :-(( Both Tomcats are out of the box with only this one webapp deployed. In Tomcat 5.5, I get * Cannot find message resources under key org.apache.struts.action.MESSAGE Tomcat 5.5 * After a bit of research, this seems to be related to versions of commons-digester.jar commons-beanutils.jar I copied them from Tomcat 5 to my WEB-INF/lib, but I'm still confused about this (I did have those jar files in my lib, just different versions): Can anybody tell me what exactly the problem is and which versions I must or mustn't use? Now the start page works ok, but when trying to access one of my modules, I still get a similar error: javax.servlet.ServletException: Missing message for key title org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) org.apache.jsp.admin.index_jsp._jspService(org.apache.jsp.admin.index_jsp:659) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *root cause* javax.servlet.jsp.JspException: Missing message for key title org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:297) org.apache.jsp.admin.index_jsp._jspx_meth_bean_message_0(org.apache.jsp.admin.index_jsp:693) org.apache.jsp.admin.index_jsp._jspService(org.apache.jsp.admin.index_jsp:205) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) The only help I could find on the web said somthing about the resource declaration in web.xml. I use different resource files for my modules and want to keep it that way! The resources are defined in the struts-config-[module].xml like this: message-resources parameter=resources.admin/ I checked all config files and they are all valid XML. Can anybody help me find and fix this? Thanks in advance, Holger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Shale/JSF]
I was talking about the interjection part. Thanks. Shawn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Friday, January 06, 2006 4:44 PM To: Struts Users Mailing List Subject: Re: [Shale/JSF] On 1/6/06, Garner, Shawn [EMAIL PROTECTED] wrote: Could you elaborate on this? Which this are you referring to? Laurie's comment about dependency injection? I covered that on my reply to the comment (on Wednesday), reproduced here: -- Good point ... that's even easier. Assume you have a managed bean named business that you want to inject into the backing bean containing your submit action. If that bean is called myself, you would ensure that it has a public property that corresponds to the type of your business logic bean: public MyBean getBusinessBean() { ... } public void setBusinessBean(MyBean bean) { ... } and you'd configure it in faces-config.xml like this: managed-bean managed-bean-namemyself/managed-bean-name managed-bean-classcom.mycompany.MyBackingBean/managed-bean-class managed-bean-scoperequest/managed-bean-scope ... managed-property property-namebusinessBean/property-name value#{business}/value /managed-property ... /managed-bean Then, the business logic bean will get injected for you (created if necessary the first time) any time your backing bean is created. The only restriction is that you can't inject a bean from a shorter scope into a bean with a longer scope ... but that won't be an issue for something like this, because your page-oriented backing bean would typically have request scope, and the business logic bean would have application scope (if it was shared across all users), or perhaps the none scope to get a new instance every time. --- Craig This email may contain confidential material. If you were not an intended recipient, Please notify the sender and delete all copies. We may monitor email to and from our network. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale/JSF]
Garner, Shawn wrote the following on 1/6/2006 5:57 PM: I was talking about the interjection part. Thanks. Excuse me... but... huh?... wait!... stop!.. but.. excuse me... Dang, I'm a smart-arse. Well it's Friday so I couldn't resist:) Have a great weekend everyone. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
I am confused (there's an opening for those that like them): did you not vote for WebWorks, Niall? If so, how could it be that this education is happening now? That's not a challenge so please don't take it as one, but a curious question as to what is going on. On 1/6/06, Niall Pemberton [EMAIL PROTECTED] wrote: - Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:56 PM I'm on chapter 4 :) Frank Excellent. I can't decide if its a really well written book or that it seemed so familiar that it just felt like being at home - only better! Most technical books I get bored with v.quickly and end up just dipping in and out for the bits I want, but I sat and read the first 5 chapters and it seemed v.easy going. Got a bit busy in the last week so haven't been back to it yet. Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Advice for Struts expert wanting to try Shale?
Hi. I've done a couple of industrial-strength websites using Struts, Tiles JSTL. I decided to start on a little personal project, mostly as a way to get on board with some technologies, some of which I've used before (maven 1/2, torque), some which I want to learn (JSF, Shale). I looked around the Shale pages a bit last night, and found myself unable to grasp what it offered. I also looked at some of the JSF introductory articles, and was concerned that they referenced pre- release versions of JSF, and didn't reference Shale. I'm happy to abandon Struts if it makes sense, and certainly I'd like to replace Struts components when functionality is provided by Shale/ JSF. Can someone point me to (or give me) an appropriate overview? Thank you very much! -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The framework I think I want...
Its a valid point - I did vote for WebWork without much knowledge and anyone crticising my decision to do that probably has good grounds to do so. For the record the following was my response on the PMC list to the proposal to merge with WebWork. quote I like this idea and prefer it to Clarity. IMO a true merger of projects is the only way we might successfully pool resources and stop competing. Clarity is a good concept, but I don't believe it would be possible to keep everyone on board and prevent communities splitting. I have no real knowledge of WebWork, but it has a good reputation and I dabbled around in the source code a week or so ago and liked what I saw. I also think if Spring are involved then things are going to go badly - that may be an unfair criticism, but its my gut feeling. I don't have the time or ability to be driving Struts forward with major contributions or re-writes of the existing framework, but I am happy carrying on with smaller contributions and support -so pooling resources this way is IMO a good thing. It would be good to get to know the people from these other projects a bit better - I went to Eddie O'Neil's presentation at BeaWorld recently, but the others I know nothing about. Are any of them going to ApacheCon? end quote Niall - Original Message - From: Dakota Jack [EMAIL PROTECTED] Sent: Friday, January 06, 2006 11:59 PM I am confused (there's an opening for those that like them): did you not vote for WebWorks, Niall? If so, how could it be that this education is happening now? That's not a challenge so please don't take it as one, but a curious question as to what is going on. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice for Struts expert wanting to try Shale?
On 1/6/06, Rick Mann [EMAIL PROTECTED] wrote: Hi. I've done a couple of industrial-strength websites using Struts, Tiles JSTL. I decided to start on a little personal project, mostly as a way to get on board with some technologies, some of which I've used before (maven 1/2, torque), some which I want to learn (JSF, Shale). I looked around the Shale pages a bit last night, and found myself unable to grasp what it offered. I also looked at some of the JSF introductory articles, and was concerned that they referenced pre- release versions of JSF, and didn't reference Shale. I'd definitely ignore anything about prereleases of JSF 1.0 ... that has been out for nearly two years now. A good starting place for general JSF knowledge and information is http://jsfcentral.com. Kito does a good job of staying on top of the most recent articles and items of interest. This, by the way, is *exactly* the place to start before looking much at Shale itself -- Shale *srongly* presumes that you are familiar with JSF, and what it brings to the table all by itself, because it focuses on adding value around the edges. Without understanding those edges a little, it's harder to appreciate the benefits :-). I'm happy to abandon Struts if it makes sense, and certainly I'd like to replace Struts components when functionality is provided by Shale/ JSF. Can someone point me to (or give me) an appropriate overview? Thank you very much! Beyond the Shale web site[1], there's not a heck of a lot of stuff yet. One high level overview is the session I did at ApacheCon (reprised from one that David Geary and I did at JavaOne)[2] ... but the slides lose a little in the translation without the corresponding demo program, which is not in a shape that I'm quite ready to check in yet :-). -- Rick Craig [1] http://struts.apache.org/struts-shale/ [2] http://people.apache.org/~craigmcc/apachecon-2005-shale.pdf
Re: Advice for Struts expert wanting to try Shale?
Thanks for the response, Craig. It's nice to get an answer from THE authority :-). Questions below... On Jan 6, 2006, at 5:16 PM, Craig McClanahan wrote: I'd definitely ignore anything about prereleases of JSF 1.0 ... that has been out for nearly two years now. A good starting place for general JSF knowledge and information is http://jsfcentral.com. Kito does a good job of staying on top of the most recent articles and items of interest. This, by the way, is *exactly* the place to start before looking much at Shale itself -- Shale *srongly* presumes that you are familiar with JSF, and what it brings to the table all by itself, because it focuses on adding value around the edges. Without understanding those edges a little, it's harder to appreciate the benefits :-). Okay, I'll try to find a hello world JSF example. That might be enough for me to build on. A question comes up: what has happened to Tiles? Is it no longer a part of Struts? I'm still terribly unfamiliar with the new Struts website. Do I bother creating a nice Tiles hierarchy of layouts and tiles? Or is there some other way to get site LF re-use? Beyond the Shale web site[1], there's not a heck of a lot of stuff yet. One high level overview is the session I did at ApacheCon (reprised from one that David Geary and I did at JavaOne)[2] ... but the slides lose a little in the translation without the corresponding demo program, which is not in a shape that I'm quite ready to check in yet :-). Okay, I'll hold off worrying about Shale for now. Sounds like I can work it in easily enough when the time comes. Here's my big question: do I still think in terms of Struts Actions handling the business logic of my application (which they rarely do; they usually glue to the real biz code)? Or do I look to putting all that glue within JSF controllers? Thanks! -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need to display a page from a seperate site inside a Struts application
Thanks guys, I'll give these a try. Here's what I'm trying to do. One of our teams is developing a struts application. This application has a search component. I'm implementing the sid search using Apache Nutch. However, the Nutch search web application is a non-struts JSP web app. I did the required modifications to the Nutch appplication (Look and feel modifications, pagination etc.) and our QA did load testing and everything using this prototype. However, when the time came for integration, out strut guys were unable to call the seperate search application using parameters and display the results inside their strut app in a tile. The result was the suggetion to _strutify_ the Nutch web application. As you migh have guessed, I'm not famiiar with struts, so I'm almost a spectator in this process. Unfortunately, by yesterday evening, the _strutification_ team has broken search. The scary part is, that I cannot debug this due to my lack of struts internals knowledge. With a deadlne near, I was wondering whether the struts app can call my original search app and display the search results inside their application in a tile (which was the original plan). Thanks for your comments, I'll make them try those today, Tyrell. On 1/7/06, Laurie Harper [EMAIL PROTECTED] wrote: Or just reference the JSP in your Tile definition. If these suggestions don't help, you'll need to give more detail on what you're trying to achieve and how you've tried to achieve it. L. Mark Lowe wrote: If I've understood what you're after then wont jstl's c:import do what you need? Mark On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Has any one else come across this type of requirement ? I would really appreciate speedy help. Tyrell On 1/6/06, Tyrell Perera [EMAIL PROTECTED] wrote: Hi All, I'm developing a jsp application which generates a page which needs to be displayed in a tile of a truts application. Is it possible to do this and how. The struts developers do not seem to be able to do this. Please help !!! Regads, Tyrell -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - 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] -- === http://tyrell.perera.blogspot.com Simply I learned about her, and ungrudgingly do I share -- her riches I do not hide away - The Holy Bible (Book of Wisdom 7:13) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
double submit problem
Hi folks... I'm trying to solve my problem when an user submit a form and he clicks the submit button more than twice. My app runs perfect... I mean, It saves data. But in this case, it saves data as many clicks the user does. Do u know how I can solve that? I'm trying to use Struts Dialog: http://struts.sourceforge.net/strutsdialogs/dialogaction.html I implemented an app using that but it still has the same problem... why? maybe I'm doing something wrong??? I followed the login sample. But in my case I have a NewData module. thanks in advance... -- Rafael Taboada Software Engineer Cell : +511-97753290 No creo en el destino pues no me gusta tener la idea de controlar mi vida
Re: Advice for Struts expert wanting to try Shale?
I should clarify: not all our Actions are just glue. They perform significant work when such work is constrained to the website needs (choosing what data to display). When it comes to purchases and registration, however, they are more like glue, even even more so when some functions are called by non-web-container code (for example, our automated subscription renewals). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advice for Struts expert wanting to try Shale?
On 1/6/06, Rick Mann [EMAIL PROTECTED] wrote: Thanks for the response, Craig. It's nice to get an answer from THE authority :-). Questions below... On Jan 6, 2006, at 5:16 PM, Craig McClanahan wrote: I'd definitely ignore anything about prereleases of JSF 1.0 ... that has been out for nearly two years now. A good starting place for general JSF knowledge and information is http://jsfcentral.com. Kito does a good job of staying on top of the most recent articles and items of interest. This, by the way, is *exactly* the place to start before looking much at Shale itself -- Shale *srongly* presumes that you are familiar with JSF, and what it brings to the table all by itself, because it focuses on adding value around the edges. Without understanding those edges a little, it's harder to appreciate the benefits :-). Okay, I'll try to find a hello world JSF example. That might be enough for me to build on. Good. The JSF RI comes with several samples, as does MyFaces. A question comes up: what has happened to Tiles? Is it no longer a part of Struts? I'm still terribly unfamiliar with the new Struts website. Tiles itself is definitely still part of the Struts project. Two things are happening to it: * Organizationally, it becomes a subproject of Struts (just like Shale), so that it could be released independently of the rest of the core framework. * Technically, there is a sandbox version of Tiles that has its Struts-Action-Framework dependencies removed, so that it could be used with any MVC framework (and Shale is currently using a snapshot version of this code). Do I bother creating a nice Tiles hierarchy of layouts and tiles? Or is there some other way to get site LF re-use? Tiles is still one option for this (indeed, besides the Shale integration, MyFaces's JSF implementation comes with their own integration of the original Struts tiles code.) Another approach is to look for component solutions that do layout management for you -- plus things like the Clay plugin to Shale, which lets you accomplish lots of the same sorts of reuse issues, but at a finer grained level than just a page or a tile. The Shale use cases example app has several ways in which Clay can be used like this. If that's not enough technologies to look at :-), there's another interesting approach to reusing layouts called Facelets[1]. Like Clay, Facelets leverages a JSF extensibility point called a ViewHandler that lets you be pretty innovative at substituting in alternatives to JSP as the mechanism for authoring the view pages of your application. Beyond the Shale web site[1], there's not a heck of a lot of stuff yet. One high level overview is the session I did at ApacheCon (reprised from one that David Geary and I did at JavaOne)[2] ... but the slides lose a little in the translation without the corresponding demo program, which is not in a shape that I'm quite ready to check in yet :-). Okay, I'll hold off worrying about Shale for now. Sounds like I can work it in easily enough when the time comes. We'l be here :-). Here's my big question: do I still think in terms of Struts Actions handling the business logic of my application (which they rarely do; they usually glue to the real biz code)? Or do I look to putting all that glue within JSF controllers? For someone familiar with Struts 1.x, I would draw the following analogies: * Where in Struts you have an Action and an ActionForm, with JSF you tend to combine them into a single request scope object. * Where an ActionForm tells you to use Strings for the properties, JSF components deal with conversion for you, so you can use native data types. * It's also possible to bind JSF components directly to POJO model objects if you want ... sorta like what WebWork does too. * Where Struts actions tend to have either a single execute() method for the entire page, or some sort of dispatch mechanism, you tend to bind each submit button in a JSF page to a separate action method in some backing bean (although you can share them if two different buttons should really do the same thing). * Just like an Action in Struts, the action method called by JSF should be considered an adapter to the real business logic (although, just like you can do with Struts, it's possible to embed business logic directly in the method :-). * Shale's ViewController adds the notion of application event calbacks to the strictly UI events that JSF supports. Of particular interest is the prerender() callback, which is invoked just before the next page actually renders ... the perfect place to do what you'd put in a setup action in a traditionally architected Struts application. As you become more familiar with JSF and Shale, you're likely to end up agreeing with my judgement on the best two features of the combination for an experienced Struts developer contemplating using JSF: * Managed