Re: [S2] Going nuts with s:set

2007-03-15 Thread Laurie Harper
Roger Varley wrote: Hi I have this fragment of .jsp code s:iterator value=order.details status=status s:set name=indexValue value=#status.index scope=request/ s:text name=index/ s:property value=#status.index/ s:text

Re: Passing a bean (out of an iteration) to an action

2007-03-15 Thread Laurie Harper
Balsi wrote: hi all, Wonder if you can help me on that one: I have an iteration over a collection of beans in my jsp site. I itererate on the list and generate a table with a row for each bean. The first attribute of the table is an index (its the primary key of the record in a database) now

struts 2.0 migration

2007-03-15 Thread mansour77
hello every one: I am new to struts but I have a collection of examples and tutorials (I believe for struts 1). I have been reading through these tutorial and now that I am about to start some thing, I found that struts 2.0 is totally different. For example, there's no struts-html.tld in

Struts2 and spring2 fails, adding RequestContextFilter/Listener doesnt work

2007-03-15 Thread Rikard
Hi im currently evaluating s2 and now trying to get the scope attr work in s2 and spring2. Tried all in the previous post http://www.nabble.com/Struts2-and-spring2-fails%2C-adding-RequestContextFilter-Listener-doesnt-work.-tf2872182.html#a8031133 scope post And i still got the same exception.

Re: Struts 2.0.6 and Validation

2007-03-15 Thread Hardy Ferentschik
Now it works. Thanks a lot. @ExpressionValidator(expression=(searchParam.keywords != '') (searchParam.location != ''), message=Need keywords and location.) I think there were several problems. First of all my OGNL syntax. I believe the documentation regarding this topic is a little

Re: How to submit multiple selection?

2007-03-15 Thread xushaoxun
I am using struts2, and I've been thinking for this questing for days. [s:checkbox] seems won't work. Because it only renders boolean value. Can anyone help? Alex Wibowo wrote: are you using struts 1 ? if so, have a look at html:multibox. basically you will need a collection in your

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Dave Newton
--- Marco from Balboa [EMAIL PROTECTED] wrote: I tried following the documentation where they instruct to place the name of the Spring bean in class attribute for the action definition in the struts.xml. I assume this is what you are doing as well, correct? No :( I wasn't doing that, and

Re: struts 2.0 migration

2007-03-15 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: I am new to struts but I have a collection of examples and tutorials (I believe for struts 1). I have been reading through these tutorial and now that I am about to start some thing, I found that struts 2.0 is totally different. [...] can I use the tutorials

Re: How to submit multiple selection?

2007-03-15 Thread Dave Newton
--- xushaoxun [EMAIL PROTECTED] wrote: I am using struts2, and I've been thinking for this questing for days. [s:checkbox] seems won't work. Because it only renders boolean value. Try using the fieldValue attribute of s:checkbox.../ For example, if I use: s:checkbox name=user.id

Fwd: Re: How to change the return of an action ?

2007-03-15 Thread Dave Newton
Forwarded to user list. --- Jonatas Gustavo Rodrigues wrote: It s ok, but if the return of an action method could be an object, it can provides an implementation like View Handler of JSF. The default handler could be the Struts one, but we could extend or change this code.

Re: [S2] Going nuts with s:set

2007-03-15 Thread Dave Newton
--- Laurie Harper [EMAIL PROTECTED] wrote: Roger Varley wrote: s:property value=#indexValue/ have you tried s:property value=#indexValue/? I'll bet he did ;) s:iterator value={1, 2, 3, 4, 5} status=status id=val s:set name=idx value=#status.index/

Re: [S2] Going nuts with s:set

2007-03-15 Thread Dave Newton
Or... s:set name=idx value=#status.index scope=request/ [...] s:property value=#request.idx/ Which is actually what you asked. d. Looking for earth-friendly autos? Browse Top Cars by Green Rating at

Re: [s2] Datetimepicker not working on non-English?

2007-03-15 Thread Musachy Barroso
Can you file a ticket with some more details on your environment (at least the language)? regards musachy On 3/15/07, Petr Blahos [EMAIL PROTECTED] wrote: If the field used by the datetimepicker is of type Date, there shouldn't be a problem, if it is an string, the displayFormat will be

Re: Is it possible to get Struts' FilterDispatcher to serve up static files

2007-03-15 Thread Felipe Rodrigues
Take the static content out of .jar, doesn't help the performance? I know that taking the template directory out of jar helps a lot at performance when rendering ui. Doesn't it heppen the same with static content? best, Felipe Musachy Barroso wrote: I don't think so, if you set it to

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Marco from Balboa
Spring generally requires that the no-arg constructor be accessible. It ought to be unless you explicitly override it in your class and mark it private. The only time I care about the instantiation of beans at startup is during development, where a quick application restart is helpful. When I am

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Dave Newton
--- Marco from Balboa wrote: In my case, I have connections to multiple databases and some other very expensive resources that I am allowing Spring to create and inject into the action objects. Do you need to define them (the actions) in the context file? For instance, I am (currently)

Re: [S2] Going nuts with s:set

2007-03-15 Thread Roger Varley
s:set name=idx value=#status.index scope=request/ [...] s:property value=#request.idx/ Which is actually what you asked. Doh! Thanks very much. It was the #request. bit I was missing. I also didn't realise that I could specify the values that s:iterator uses! Are there any in depth tutorials

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Martin Gainty
Marco you may have a concurrency problem as by the time the action is invoked the DataSource bean *should have been* already created with regards to Spring Beans you can set lazy-init in ApplicationContext.xml to false to both alloc and instantiate the bean straight off bean id=beanid

RE: initialize java form bean

2007-03-15 Thread Lim Hock-Chai
Ok. Thanks. Will try it out tonight. -Original Message- From: Harring Figueiredo [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 4:26 PM To: Struts Users Mailing List Subject: Re: initialize java form bean Try action name=SomeAction class=com.some.path.to.youAction

Re: How to session attributes Struts 2.0.6

2007-03-15 Thread Nate Drake
Have your action implement SessionAware, and give it a setter of the form: public void setSession(Map session); You can then add things to this map, and they will be added into the session. Then you can access them in your JSP like this: s:property value=#session\['NAME'\]/ See these pages

Struts2, JSF, Tiles

2007-03-15 Thread Ray Clough
In my S2 actions I set the result 'type' = jsf. The instructions do not seem to cover using both JSF and Tiles. How do I integrate Tiles with my Struts2-rendered jsf pages? Do I need to use the packages and instructions from MyFaces to do this? Thanks, Ray Clough -- View this message in

Re: Need Help -Urgent

2007-03-15 Thread Sachin
Sorry dave. I am not getting you. Could you elabrate little more. or give me some examples. On 3/14/07, Dave Newton [EMAIL PROTECTED] wrote: --- Sachin [EMAIL PROTECTED] wrote: yes dave. You are right. Map is containing all the form data. how can i resolve this ? Don't put all the form

Re: Revising user input

2007-03-15 Thread Christopher Becker
Chris; Thanks for the reply - I took the session-based form approach, which worked fine. Another issue - I wish to allow users to modify content to records saved to the database, by loading up the same (or identical ) form referenced below with a saved record and allow for modifications. I do

EL expression in html:form action

2007-03-15 Thread Lim Hock-Chai
I'm getting the cannot retrieve mapping for action error when using EL expression in the action attribute of html:form tag. See below. AcctContact.jsp == html:form action=AcctContact${contactType}Action . . . /html:form struts-config.xml == action path=/AcctContactBILAction

How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread David Harland
How do you provide a Map from the application scope for the list of a s:select. I keep getting the following error The requested list key 'referenceLookup.idQuestionOptions' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
I do have the same Problem. But my map does not come from app-context. The error is the same: tag 'select', field 'list', name 'country': The requested list key 'countryMap' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people. {name} - [unknown

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Marco from Balboa
Martin, Wouldn't your suggestion ensure that all the action beans and their dependencies (like database connections) get instantiated when the application gets loaded? This is the situation that I am seeking to avoid. If the dependencies are set up right, Spring will make sure that the

Re: Cross site scripting issue

2007-03-15 Thread Dale Newfield
rapsy wrote: I am trying to find a best solution to prevent Cross site scripting attacks. Aren't we all. The best suggestion I've found is in the first comment on http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html Basically the suggestion is to Tagsoup parse into

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Dave Newton
--- Piero Sartini wrote: return Constants.getCountryMap(); What does Constants.getCountryMap() return? I've never seen any issues populating an s:select.../ from a map. d. The fish are biting.

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Don Brown
I think a worthwhile enhancement would be the ability to enable/disable the verify action behavior in struts.properties/struts.xml. Please file a JIRA ticket. Thanks, Don On 3/15/07, Marco from Balboa [EMAIL PROTECTED] wrote: Martin, Wouldn't your suggestion ensure that all the action

Session Management

2007-03-15 Thread Maya menon
All, I have couple of questions while designing a web app using struts. My application uses Httpsession variables. 1. How do we handle a user from opening duplicate sessions ? Like if a user is already logged in, if he/she tries to login again, system should mention that user is already

RE: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread David Harland
We are running struts 1 and 2 in parallel. Struts 1 is putting the Map into application scope. A jsp running in struts 2 using struts 2 tags is trying to use this map to populate a select. Do I have to copy the map into the action for it to work. That seems a bit of a waste of time

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
Am Donnerstag, 15. März 2007 schrieb Dave Newton: --- Piero Sartini wrote: return Constants.getCountryMap(); What does Constants.getCountryMap() return? the map looks like: {de=de, it=it, en=en} - To unsubscribe,

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote: Am Donnerstag, 15. März 2007 schrieb Dave Newton: --- Piero Sartini wrote: return Constants.getCountryMap(); What does Constants.getCountryMap() return? the map looks like: {de=de, it=it, en=en} No, I want the actual code for the

RE: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Dave Newton
--- David Harland [EMAIL PROTECTED] wrote: We are running struts 1 and 2 in parallel. Same webapp I assume? Struts 1 is putting the Map into application scope. A jsp running in struts 2 using struts 2 tags is trying to use this map to populate a select. How is it trying to load the map? I

Re: EL expression in html:form action

2007-03-15 Thread Laurie Harper
Lim Hock-Chai wrote: I'm getting the cannot retrieve mapping for action error when using EL expression in the action attribute of html:form tag. See below. AcctContact.jsp == html:form action=AcctContact${contactType}Action .. . . /html:form struts-config.xml == action

RE: Session Management

2007-03-15 Thread manoj.tripathi
maya, Once a user is logged in session variables are set and your user interface should not display login option...but if you hit back button on browser you will see login option in that case use saveToken now to allow duplicate form submission Back buttons display thing because form

RE: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread David Harland
Thanks thats working a dream I tried that before just forgot the # It is nearly friday ;) -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 15 March 2007 16:58 To: Struts Users Mailing List Subject: RE: How do you provide a Map from the application scope for the list

RE: Re: EL expression in html:form action

2007-03-15 Thread Lim Hock-Chai
I'm pretty sure that contactType was not empty. It was showing BIL on the screen. contactType is created using jstl's core tag c:set with request scope. I just wonder if EL expression is allowed in html:form's action attribute. Has anybody done this before? -Original Message-

Re: Lazy loading actions in Struts 2

2007-03-15 Thread Marco from Balboa
Don, I agree. I think it would be even nicer if the verify action procedure did its job without actually instantiating the actions. This is the way it works when Spring is not being used to instantiate actions. The regular ObjectFactory (as opposed to the SpringObjectFactory), simply tries

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Piero Sartini
It just testing-code and does not make much sense. but here we go. I had a list before .. so the map is constructed from the list. --- code --- public static ListString countryCodes = new ArrayListString( Arrays.asList( de, en, it )); public static

Re: How do you provide a Map from the application scope for the list of a s:select

2007-03-15 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote: --- code --- Are you sure you are using the right Action to reach the JSP? I cannot duplicate the problem with identical code. (I am not using JSPX, although I'm not sure that would matter.) d.

Patch for ajax/remoteforms/AjaxRemoteForm (Ajax example from Struts-showcase)

2007-03-15 Thread Martin Gainty
Hello All I think this error occurs is a result of the 1)ajax/remoteforms/AjaxRemoteForm folder name not being parsed because folder parsing patch wasnt installed in this Struts2 distro 2)there is no AjaxRemoteForm class to be found anywhere and is mapped this way via struts-ajax.xml

Re: Patch for ajax/remoteforms/AjaxRemoteForm (Ajax example from Struts-showcase)

2007-03-15 Thread Musachy Barroso
Hi Martin I'm not sure which patch you are referring to, do you know the jira ticket number? regards musachy On 3/15/07, Martin Gainty [EMAIL PROTECTED] wrote: Hello All I think this error occurs is a result of the 1)ajax/remoteforms/AjaxRemoteForm folder name not being parsed because

Java-JSP data sharing mechanisms

2007-03-15 Thread stanlick
When it comes to sharing values between Java and JSP, I see the following conventions used 1. %foo 2. $foo 3. #foo 4. foo Is there a one-stop grid that identifies what each of these symbols represent and if/when they are even necessary? I read about OGNL and how prefixing attributes

Re: Cross site scripting issue

2007-03-15 Thread Joseph McGranaghan
I'm currently working on this problem for a website I'm building. I found this: on(?:(?:mo(?:use(?:o(?:ver|ut)|down|move|up)|ve)|key(?:press|dow + n|up)|c(?:hange|lick)|s(?:elec|ubmi)t|(?:un)?load|dragdrop|resize|focus| +

Re: Cross site scripting issue

2007-03-15 Thread Joseph McGranaghan
Sorry, just noticed a problem in that events filter. (;|) in the end should be just in case multiple statements. It's a work in progress :) -Joe Joseph McGranaghan wrote: I'm currently working on this problem for a website I'm building. I found this:

RE: Cross site scripting issue

2007-03-15 Thread Levan Dvalishvili
That looks interesting, can I add that to my toolking? One question thought, it is regexp pattern right? So I assume it's evaluated for every request that comes into the system, is not it kind of performance load on the system? But I guess that is the only way to fight XSS. -Original

Re: Java-JSP data sharing mechanisms

2007-03-15 Thread Martin Gainty
Stan-- From what I can see use of Object Graph Notational Language allows Regular Expression evaluations plus Lambda Expressions evaluations http://cwiki.apache.org/WW/ognl.html HTH, M-- --- This e-mail message (including

Re: Cross site scripting issue

2007-03-15 Thread Leon Rosenberg
On 3/15/07, Levan Dvalishvili [EMAIL PROTECTED] wrote: That looks interesting, can I add that to my toolking? One question thought, it is regexp pattern right? So I assume it's evaluated for every request that comes into the system, is not it kind of performance load on the system? But I guess

Re: Java-JSP data sharing mechanisms

2007-03-15 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: When it comes to sharing values between Java and JSP, I see the following conventions used 1. %foo 2. $foo 3. #foo 4. foo Is there a one-stop grid that identifies what each of these symbols represent and if/when they are even necessary? I

Re: Cross site scripting issue

2007-03-15 Thread Joseph McGranaghan
I here this all the time, am I missing something? What if you want the user to be able to input all kinds of markup to be redisplayed: div style=color:#ff000; a href=http://somewhere.com;somewhere/a /div At some point this makes it back into the page so the browser can render it. If this

Best Practices for reusability?

2007-03-15 Thread Piwoni, Andre
I'm working on a large and complex web application. One of the things that bothers me is a WizardAction with one ActionForm working on multiple JSP pages. All of these JSP pages have hardcoded action URLs that map to struts actions. I'd like to re-use several JSP pages form this wizard in another

Re: Cross site scripting issue

2007-03-15 Thread Dave Newton
--- Joseph McGranaghan wrote: [... huge-ass regexp, including...] |c(?:hange|lick)| IANAREW, but... what's with all the weird let's refactor out the first (and/or) last characters of the regexp? This seems like a really slow, really... weird way to deal with XSS. d.

Re: Cross site scripting issue

2007-03-15 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joseph, Joseph McGranaghan wrote: I [hear that worrying about XSS is not worth it] all the time, am I missing something? What if you want the user to be able to input all kinds of markup to be redisplayed: div style=color:#ff000; a

RE: Re: EL expression in html:form action

2007-03-15 Thread Strachan, Paul
It should work OK if you're using the http://struts.apache.org/tags-html-el taglib. -Original Message- From: Lim Hock-Chai [mailto:[EMAIL PROTECTED] Sent: Friday, 16 March 2007 4:08 AM To: Struts Users Mailing List Subject: RE: Re: EL expression in html:form action I'm pretty sure that

Re: How to session attributes Struts 2.0.6

2007-03-15 Thread tom tom
Hi, I implemented the following interface org.apache.struts2.interceptor.SessionAware; hence implemented the public void setSession(Map session) method and did add the following attribute session.put(NAME,USER1); and in my jsp I have the following s:property value=#session.NAME/ br It

Forward a action from one action programmatically in STruts 2.0

2007-03-15 Thread arunkumar S
Hi, I have a requirement where in the action has to be forwarded based on certain runtime conditions.The destination will be decided only on the runtime. --- if(Input = Case1 ) forward action1 else forward action2. --- Basically i want to

Re: Cross site scripting issue

2007-03-15 Thread Dale Newfield
There are two discussions here that are getting convoluted: WHEN to clean and HOW to clean. I still have yet to find a good comprehensive way to do the latter (more below), but right here I'm responding to the former. Christopher Schultz wrote: If you /are/ capturing text you will be using