Re: additional scope of a variable

2007-01-04 Thread Antonio Petrelli
Leon Rosenberg ha scritto: If you want to start a project which performs a better (or more powerful) attribute management than struts does, feel free to do this on java.net or sourceforge (I'd even conribute some code :-)) but don't expect it to become a part of struts anytime. Err... maybe it

Re: additional scope of a variable

2007-01-04 Thread Leon Rosenberg
You are opening a real can of worms :-) The reason struts (and any else framework out there) support the 4 scopes is that those are the four defined by the servlet spec, and thus available in any container. Of course each application may and many will have some additional requirements. After a w

additional scope of a variable

2007-01-04 Thread Asthana, Rahul
Hi all, Leons posting about the scopes reminded me of something I have been meaning to post. My application is organized into logical modules, such as purchasing,banking, credit , shoppingcart etc. There are some variables that we have to use within a module.So,we added a new scope to our appl

RE: Action name vs. attribute

2007-01-04 Thread Edward Song
Thanks Niall for the suggestions and feedback. Both are good solutions, and I'm looking into both of them. Ed -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, January 04, 2007 2:54 PM To: Struts Users Mailing List Subject: Re: Action name vs. attribut

Re: Performance issue

2007-01-04 Thread Leon Rosenberg
there are 4 scopes or visibilities/lifecycles of attributes in the servlet/jsp world. page : the jsp page, same as local variable in a class. request: the duration of the request over multiple pages session: the duration of the user session, over multiple requests application scope: the whole web

Re: Performance issue

2007-01-04 Thread Daniel Chacón Sánchez
Thanks Leon!!! Ok I made it using the servletcontext like you have said :-), with this servlet.getServletContext().setAttribute("objHospital", objHospital); All works fine, even if the user made a mistake :) One question: 1- I dont understand something about the servletContext, which is the p

Re: Performance issue

2007-01-04 Thread Leon Rosenberg
Hmm, can you send some code? What kind of validation do you use? Serverside or js? I suppose it happens because the validation-whatsoever send the user directly to use jsp bypassing the action. If you need a quick and dirty solution, alter you preExecute method to put the objects into the sessio

Re: html:select and sorting

2007-01-04 Thread Ranjan Kumar Baisak
Puneet Lakhina wrote: On 1/4/07, Bolutiwi, Olu <[EMAIL PROTECTED]> wrote: Hi all, I have the same issue. I am selecting a list of town names and ids from the database (sorted by town name) and adding them to a TreeMap or HashMap. TreeMap sorts by key (in this case its my ids from the databas

Re: Problem with Dojo in Struts 2

2007-01-04 Thread Musachy Barroso
I should have said this first, but why are you calling "makeWidgets" directly? Dojo takes care of that, and if you are using S2 head svn, any widget used on a page returned from an asynchronous call will be loaded by S2 automatically. musachy André Faria wrote: Thank's... But if you call ma

Re: Performance issue

2007-01-04 Thread Daniel Chacón Sánchez
Leon!!! something happen... I applied your solution putting the objects in the request in the preExecute method of the base action, and all works fine, but... when the user made a mistake, for example leave a required field in blank, and the ActionErrors validate method of the ActionForm return

Re: Problem with Dojo in Struts 2

2007-01-04 Thread André Faria
Thank's... But if you call makeWidgets() again the input buttons out of the div that uses ajax tags will be added to the dojo lisneters again, and when you click in a button they will be execute the same number of post that you executed makeWidgets... Musachy Barroso escreveu: If you set "e

Re: Action name vs. attribute

2007-01-04 Thread Niall Pemberton
On 1/4/07, Edward Song <[EMAIL PROTECTED]> wrote: Hi all, STRUTS 1.2 Got a quick question on the Action "name" and "attribute" properties name - The name of the form bean associated with this action. This value must be the name attribute from one of the form-bean elements. This attribute is

Re: html:select and sorting

2007-01-04 Thread Puneet Lakhina
On 1/4/07, Bolutiwi, Olu <[EMAIL PROTECTED]> wrote: Hi all, I have the same issue. I am selecting a list of town names and ids from the database (sorted by town name) and adding them to a TreeMap or HashMap. TreeMap sorts by key (in this case its my ids from the database) and HashMap messes u

RE: [S2] ServletRequestInterceptor & ParameterAware

2007-01-04 Thread Dave Newton
From: Sébastien LABEY [mailto:[EMAIL PROTECTED] > I know that getParameters().get("myParamater") returns an array of > objects, > but isn't it supposed to return not only String[], but arrays of > Objects > depending on the type described (if described) for the parameter > through > getter and sett

Re: [S2] ServletRequestInterceptor & ParameterAware

2007-01-04 Thread Sébastien LABEY
Hi Dave, Thanks for your answer. I know that getParameters().get("myParamater") returns an array of objects, but isn't it supposed to return not only String[], but arrays of Objects depending on the type described (if described) for the parameter through getter and setter in the action : if getId

Re: Problem with Dojo in Struts 2

2007-01-04 Thread Musachy Barroso
If you set "executeScripts" to "true", in the submit tag, you can put a javascript section in the returned page, and it will be executed, like: makeWidgets(); There is an example if this in showcase, in the remote div section. regards musachy André Faria wrote: I have a problem with Dojo

Problem with Dojo in Struts 2

2007-01-04 Thread André Faria
I have a problem with Dojo in Struts 2. When the page loads a method dojo named makeWidgets is called, that method searchs for the dojo widgets and attach the necessary events to dojo listeners. Example: Div 1 href="%{ajaxTest}"/> the ftl adds some dojo notations dojoType, etc... The method on

Typed variables with bean:define

2007-01-04 Thread Ney André de Mello Zunino
Hello. When I try to define the following typed variable on a page, I get a ClassCastException: Looking at the generated servlet code, the error occurs at this line: totAquisicao = (java.lang.Double) _jspx_page_context.findAttribute("totAquisicao"); What am I doing wrong or missing? Tha

RE: html:select and sorting

2007-01-04 Thread Dave Newton
From: Bolutiwi, Olu [mailto:[EMAIL PROTECTED] > I am selecting a list of town names and ids from the database (sorted > by town name) and adding them to a TreeMap or HashMap. TreeMap sorts > by key (in this case its my ids from the database) and HashMap messes > up the sort order. > > How can

RE: html:select and sorting

2007-01-04 Thread Manos Batsis
Quoting "Bolutiwi, Olu" <[EMAIL PROTECTED]>: > How can I use a collection that supports key & value, keep it sorted > and > use it in my html:select without messing up the sort order. You can make your keys comparable [1] or put your results in a collection that does not try to re-sort them. [1

RE: html:select and sorting

2007-01-04 Thread Bolutiwi, Olu
Hi all, I have the same issue. I am selecting a list of town names and ids from the database (sorted by town name) and adding them to a TreeMap or HashMap. TreeMap sorts by key (in this case its my ids from the database) and HashMap messes up the sort order. How can I use a collection that supp

Re: html:select and sorting

2007-01-04 Thread Ranjan Kumar Baisak
Dave Newton wrote: From: Ranjan Kumar Baisak [mailto:[EMAIL PROTECTED] Is there any way to sort all the elements while using html:select? Sure; sort the collection before you use it in html:select. Dave - To unsubscr

RE: html:select and sorting

2007-01-04 Thread Dave Newton
From: Ranjan Kumar Baisak [mailto:[EMAIL PROTECTED] > Is there any way to sort all the elements while using html:select? Sure; sort the collection before you use it in html:select. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED

html:select and sorting

2007-01-04 Thread Ranjan Kumar Baisak
Hi, Is there any way to sort all the elements while using html:select? -R - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Caroline Jen
Hi Andrew, I ran into similar problems. Anoter developer on the team wrote a tag. It extracts the paging information and goes to the database table to find out the total number of records. The tag retrieves and displays only "the first set" of records in accordance with the paging spec

Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Manos Batsis
Making a suggestion is difficult without knowing what tools/tiers or other specifics are involved. Our MD4J [1] generated DAOs return implementations of a Page interface [2] for search queries. A Hibernate-based Page implementation [3] is also available. This serves generic memory and DB access r

Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Tom Schneider
For struts2 tags, checkout https://issues.apache.org/struts/browse/WW-1569 The problem I have with displaytag is that in an effort to satisfy everyone's needs, it is infinitely configurable. IMHO, that makes it hard to figure out and hard to use. The other issue we had with display tags is t

Re: Data security

2007-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thorsten, [EMAIL PROTECTED] wrote: > However, what happens if a user logs > in, but then submits an arbitrary id - this would enable him to see orders > from > other users! How can such security lacks be avoided best? I'm assuming that you are stori

Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrew, Andrew Martin wrote: > I am interested to know the ‘best’ practice for navigating through > long lists. I haven't used Struts-layout, so I'm not sure how my suggestion will fit-in with your preferred display engine, but here goes, anyway. We

RE: Data security

2007-01-04 Thread Dave Newton
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > What's the best way to avoid this situation? Um... Store the user ID with the order # (which you should be doing anyway) and make sure they match? Dave - To unsubscribe, e-mail

RE: [S2] ServletRequestInterceptor & ParameterAware

2007-01-04 Thread Dave Newton
From: Sébastien LABEY [mailto:[EMAIL PROTECTED] > [...] when I use getParameters().get("id"), I receive a String[]... "getParameters" is plural; it returns as many "id"s as it can in an array, even if there's just the one. Dave ---

Re: Data security

2007-01-04 Thread Leon Rosenberg
1. encode user id in the order id you store in the db: user-id 123 relative order-id 41 stored order-id = 123-41 this way he has no chance to request an order from another user ever, since even he sends 51 to check for order 51 of user 456 the system will look up for 123-51 instead of 456-51. 2.

Re: Data security

2007-01-04 Thread uni
No, I mean that I am a user and log in as usual. I can see that my orders have id's such as 5, 10 and 42. Now I trick a little bit and send another id, say 41 (which is an order of another user), and without a check the action would show me this order. What's the best way to avoid this situation?

Re: Data security

2007-01-04 Thread Leon Rosenberg
Just to clarify things, do you mean another user sending your sessionId stored in your cookie to the shop? leon On 1/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, The question I have is not purely specific to Struts, but I expect that it's a common problem for Struts users. Suppose yo

Data security

2007-01-04 Thread uni
Hi, The question I have is not purely specific to Struts, but I expect that it's a common problem for Struts users. Suppose you have a web application which is a shop. You have several users, each of which can have orders, accounting details, etc. Now a user logs in and you store the the user obje

[S2] ServletRequestInterceptor & ParameterAware

2007-01-04 Thread Sébastien LABEY
Hi all, I've experienced something that I think strange, but I would like to know if it is a normal behavior. I'm using Struts 2.0.1 with the default interceptors configuration. I have a generic Action that implements ParametersAware (and ServletRequestAware and SessionAware) and I have the gette

Problem with AJAX tags

2007-01-04 Thread Nagraj Rao
Hi all We're facing a problem with Struts +Ajax tags for getting to specify the href attribute in the submit tag as per given in one of the S2 documentation/tutorials. Please refer the link http://struts.apache.org/2.x/docs/ajax-tags.html and go to Prevent a request section where-in the guys

Re: Ideal solution to pagination (long lists)?

2007-01-04 Thread Gareth Evans
Hi Andrew, I suggest using displaytag with its external paging and sorting features http://displaytag.sourceforge.net/11/tut_externalSortAndPage.html Gareth Andrew Martin wrote: I am interested to know the ‘best’ practice for navigating through long lists. At the moment we have implemented S

Ideal solution to pagination (long lists)?

2007-01-04 Thread Andrew Martin
I am interested to know the ‘best’ practice for navigating through long lists. At the moment we have implemented Struts-layout for this purpose. Our implementation currently retrieves the full dataset and uses Struts-layout sorting and navigation pager options to navigate through the results. Ho

Re: [S2] struts2-portlet application problems

2007-01-04 Thread Dariusz Wojtas
Hi, After playing with it a bit with the sample portlet app on the 2.0.3 trunk code (jboss portal 2.4.1) I finally managed to pass the basic problems (descriptors, missing JAR files: spring, dwr, spring plugin) and now I get some strange exception that I do not understand: .. 08: