Set language in JSP

2007-04-24 Thread bjorn.de.bakker
I've encountered a rather annoying issue. To select the language in which our labels should be displayed, we use fmt:setLocale. Everything works fine, everybody's happy. But. To validate our forms, we use DynaValidator. In our webapp, we have 1 form which has only 1 field. When validation

How to realize ajax in struts2

2007-04-24 Thread red phoenix
I want to use ajax within Struts to realize following function,there is a textfield an a submit button which use register a username in a JSP page,then you can put you name into textfield and click register button,then will call ajax to search name is exist,if exist,there will be a message behind

Re: Tiles 2 Lifecycycle

2007-04-24 Thread Antonio Petrelli
2007/4/23, [EMAIL PROTECTED] [EMAIL PROTECTED]: Hi Antonio -- I have been teaching for the past couple weeks and now returning to S2/Tiles. I would like to understand how Tiles affects the S2 lifecycle. AFAIK Tiles affects S2 only in rendering the results. What I mean is if you are using a

[s2] Difference between actionMessages and actionErrors

2007-04-24 Thread Zoran Avtarovski
A quick question on what the recommended method for displaying general messages when using struts 2, actionMessages or actionErrors. I had a look at the ValidationAware interface and there appears to be no difference between the two. The only difference I could see what that they are accessed by

RE: Struts Validation Problems

2007-04-24 Thread Raghupathy, Gurumoorthy
^\w{2}-\w{6}(-\w{2}){0,5}$ | ^[0-9]{4,6}$ ^\\w{2}-\\w{6}(-\\w{2}){0,5}|([0-9]{4,6})$; Are different you are missing the ^ sign after the | operator... Please read the regular expression book properly .. -Original Message- From: Ferruh Zamangör [mailto:[EMAIL PROTECTED]

[S2] Newbie. Authentification Interceptors

2007-04-24 Thread Roger Varley
Hi I notice that there have been a few threads over the last couple of days where people have been talking about implementing login authentication via a Struts2 interceptor. Could someone simply outline the reason why they would want to do it this way rather than using container authentication?

Re: Use EL to access to a key from the MessageResources.properties

2007-04-24 Thread Niall Pemberton
On 4/23/07, piloupy GOTTAPIL [EMAIL PROTECTED] wrote: Hi, I'd like to do something like this in a JSP file : html-el:link href=${contact.mail}Email Link/html-el:link where contact.mail is a key from my MessageResources.properties. I think the solution is quite simple, but I can't find how to

Re: Set language in JSP

2007-04-24 Thread Niall Pemberton
On 4/24/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've encountered a rather annoying issue. To select the language in which our labels should be displayed, we use fmt:setLocale. Everything works fine, everybody's happy. But. To validate our forms, we use DynaValidator. In our webapp,

Null date become today in map when use textfield tag

2007-04-24 Thread longhao
TestDateAction.java public class TestDateAction extends ActionSupport { private Date singleDate; private Map mapDate; private List listDate; @Override public String execute() throws Exception { return

Re: Technology choice?

2007-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, Sullivan, David wrote: I am assuming that I wont. However many of the examples I have seen using the interceptor framework use Springs IoC container and I probably wont be using that given the EJB3 specification (Glassfish and Toplink)

Re: Could not load 'dojo.widget.html.Tooltip':last tried '__package__.js'

2007-04-24 Thread Musachy Barroso
You can just ignore it. musachy On 4/23/07, red phoenix [EMAIL PROTECTED] wrote: I want to use ajax in struts2,but when run my code like http://localhost:8080/test/index.html,it raise following Javascript error: Line:95 Char:1 Error:Could not load 'dojo.widget.html.Tooltip':last tried

Re: Use EL to access to a key from the MessageResources.properties

2007-04-24 Thread piloupy GOTTAPIL
Thank you all. The solution of Niall works. I was trying to get the fmt taglib work for nearly 2 days... without success. But I really prefer the solution of Niall, since it doesn't oblige me to declare another taglib. I really thank you guys for your help. piloupy On 4/24/07, Niall Pemberton

Re: [S2] Newbie. Authentification Interceptors

2007-04-24 Thread Shahak Nagiel
Others can chime in as well, but from my experience in the past, container-managed authentication is a little too rigid and doesn't offer anywhere near the flexibility of a custom-brewed authentication/authorization scheme. That's not to say a custom scheme need be entirely proprietary; we

Another file upload question

2007-04-24 Thread meeboo
Hey all I have an action class which handles file uploads via a setter method: private File uploadedMovie = null; public void setUploadedMovie(File uploadedMovie) {this.uploadedMovie = uploadedMovie;} The problem is that I can't set the name of the uploaded file before it is saved to the

Re: Null date become today in map when use textfield tag

2007-04-24 Thread Martin Gainty
please supply the applicationContext.xml definition for 'testDate' e.g. web..xml action name=springExample class=springAction result name=success /WEB-INF/view/springExample.jsp /result /action beans default-autowire=autodetect bean id=thingManager

Re: Another file upload question

2007-04-24 Thread Dave Newton
--- meeboo [EMAIL PROTECTED] wrote: private File uploadedMovie = null; public void setUploadedMovie(File uploadedMovie) {this.uploadedMovie = uploadedMovie;} The problem is that I can't set the name of the uploaded file before it is saved to the drive. I can specify the path but the file

Re: Null date become today in map when use textfield tag

2007-04-24 Thread Dave Newton
--- Martin Gainty [EMAIL PROTECTED] wrote: please supply the applicationContext.xml definition for 'testDate' Huh? I'd be more likely to think it has something to do with not using the s:form.../ tag, but I've never been entirely sure what the relationship between it and the input tags really

S2: Disable datetimepicker

2007-04-24 Thread Scott Nesbitt
I would like to enable/disable the datetimepicker when the user selects certain radio buttons. Here is my tag: s:datetimepicker name=untildate displayWeeks=4 displayFormat= MM-dd-/ I can disable (and clear) the textbox next to the calendar icon like

Re: [S2] Formatting inside Iterator tag

2007-04-24 Thread chengas123
Mark Menard wrote: s:text name=format.dates:param name=value value=orderDate //s:text That will do the date, there are some other formats listed on the Wiki I think. *shrug* Mark When I put the exact text you gave me into my .jsp the text format.date is printed out to the page.

Can I load filter-class from custom jar file in WEB-INF/lib dir

2007-04-24 Thread Vinit N
What I need to do to load the filter-class from custon jar or war file ? I am getting this exception : Apr 24, 2007 10:16:09 AM EDT Error HTTP BEA-101165 Could not load user defined filter in web.xml: ServletContext(id=31649343,name=dlymags,context-path=/dlymags)

Re: S2: Disable datetimepicker

2007-04-24 Thread Musachy Barroso
Assign an id to your datepicker, lets say dp1 and do this: dojo.widget.byId(dp1).disable(); to enable it: dojo.widget.byId(dp1).enable(); musachy On 4/24/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I would like to enable/disable the datetimepicker when the user selects certain radio

Re: [S2] Formatting inside Iterator tag

2007-04-24 Thread Dave Newton
--- chengas123 [EMAIL PROTECTED] wrote: Can this be any properties file or are you referring to struts.properties? It needs to be one of the normal properties files used for messages etc. that S2 searches for, where you keep the rest of your messages/properties. (So no, I don't think

Re: S2: Disable datetimepicker

2007-04-24 Thread Scott Nesbitt
Works great! Thanks, Musachy. Scott --- Musachy Barroso [EMAIL PROTECTED] wrote: Assign an id to your datepicker, lets say dp1 and do this: dojo.widget.byId(dp1).disable(); to enable it: dojo.widget.byId(dp1).enable(); musachy On 4/24/07, Scott Nesbitt [EMAIL PROTECTED]

Re: S2: Disable datetimepicker

2007-04-24 Thread Lance
I'm not a struts2 user (unfortunately) but this seems bad to me. From what I see of the s2 tags, they abstract you from the fact that dojo is being used under the hood. Should struts2 have it's own core js that proxies through to the dojo implementation? Scott Nesbitt wrote: Works great!

Re: [S2] Newbie. Authentification Interceptors

2007-04-24 Thread Mark Menard
On 4/24/07 8:49 AM, Shahak Nagiel [EMAIL PROTECTED] wrote: Others can chime in as well, but from my experience in the past, container-managed authentication is a little too rigid and doesn't offer anywhere near the flexibility of a custom-brewed authentication/authorization scheme. That's

Re: [s2] Difference between actionMessages and actionErrors

2007-04-24 Thread Musachy Barroso
redundantactionMessages is for general messages, and actionErrors for errors./redundant . I don't think there are any implications. regards musachy On 4/24/07, Zoran Avtarovski [EMAIL PROTECTED] wrote: A quick question on what the recommended method for displaying general messages when using

Re: [S2] Formatting inside Iterator tag

2007-04-24 Thread chengas123
Dave Newton-4 wrote: --- chengas123 [EMAIL PROTECTED] wrote: Can this be any properties file or are you referring to struts.properties? It needs to be one of the normal properties files used for messages etc. that S2 searches for, where you keep the rest of your

Re: S2: Disable datetimepicker

2007-04-24 Thread Martin Gainty
http://www.koders.com/javascript/fidFF0542A22748F79D50156F4B75564D76676002D4.aspx I would suggest using struts.widgets.HTMLDynArchCalendar whcih inherits from dojo.widget.DomWidget which has the enable() and disable() methods M-- This email message and any files transmitted with it contain

Re: S2: Disable datetimepicker

2007-04-24 Thread Musachy Barroso
In the beginning I think that was the idea(I wasn't around at that time so don't take my word for it :) ), as of 2.1 we are moving all these ajax tags to a dojo plugin, so they are dojo specific. If there was another implementation, it would be better to have a common interface, but just working

Re: S2: Disable datetimepicker

2007-04-24 Thread Musachy Barroso
That widget is long gone :) (since 2.0.3 I think) musachy On 4/24/07, Martin Gainty [EMAIL PROTECTED] wrote: http://www.koders.com/javascript/fidFF0542A22748F79D50156F4B75564D76676002D4.aspx I would suggest using struts.widgets.HTMLDynArchCalendar whcih inherits from dojo.widget.DomWidget

Re: [S2] Formatting inside Iterator tag

2007-04-24 Thread Dave Newton
--- chengas123 [EMAIL PROTECTED] wrote: Awesome. Got it working by adding that to a package.properties file. I have no plans to internationalize this site and it wasn't immediately obvious to me that formatting would fall under the category of localization (although I understand why it

Re: How to realize ajax in struts2

2007-04-24 Thread Felipe Rodrigues
I guess you're looking for custom validation. You can find it surfing at http://struts.apache.org/2.x/docs/home.html By the way, in your code, aren't you missing the s:form tag? Struts forms are similar to HTML forms. You must wrap the ui components in a s:form, except in special cases.

Optiontransferselect button customization.

2007-04-24 Thread Felipe Rodrigues
Hi guys, Can I somehow change the button (e.g. addAllToLeft) of a Optiontransferselect to some image? I imagine it can be done by changing the ftl, but I'd like some clues to do that. Would be great to define some id for these buttons, then we could change it by css. How about that? Thanks,

ForwardAction question/issue

2007-04-24 Thread Adam Gordon
Hi- So we're using ForwardAction for URIs that can just link to a JSP page and don't need a customized Struts Action to perform tasks ahead of time. When a user connects to our website, we essentially direct the user to the default main page, which is protected, so they have to log in first

Re: [s2] Difference between actionMessages and actionErrors

2007-04-24 Thread Harring Figueiredo
I was supposed to test the genereated HTML from both. (Laziness got the best of me). guess Here it goes, without testing. I think that the HTML generated is slightly different so that you may apply different CSS style sheets to it. /guess harringf On 4/24/07, Musachy Barroso [EMAIL PROTECTED]

S2 Tag Properties

2007-04-24 Thread stanlick
I notice key is now preferred over getText() and am now curious about something else. Is the name attribute necessary when using key? I would rather not duplicate myself unless S2 requires it. s:textfield name=user.zip.city key=user.zip.city size=40 readonly=true / -- Scott [EMAIL

Re: [s2] Difference between actionMessages and actionErrors

2007-04-24 Thread Skip Hollowell
Harring Figueiredo wrote: guess Here it goes, without testing. I think that the HTML generated is slightly different so that you may apply different CSS style sheets to it. /guess Bingo. That is exactly the reason for the two. Direct from my style sheet: span.actionMessage {

Re: [S2] Formatting inside Iterator tag

2007-04-24 Thread Harring Figueiredo
Oh Boy, I am glad to see that I was not the only one to have this problem :-) Dave, Here is how I got it to work: Edit the struts.properties with the following entry struts.custom.i18n.resources=translations Edit the properties file translations.properties with the entry

Re: S2 Tag Properties

2007-04-24 Thread Harring Figueiredo
They can the different and serve different purposes. The name attribute that you have there means that the value will be picked from yourAction.getUser().getZip().getCity(); The key will be used to lookup the resources files using the literal string 'user.zip.city', of course. Hope this

Re: S2 Tag Properties

2007-04-24 Thread Musachy Barroso
If the name is null, and there is a key, it will be used as the name. So, no, you don't need to duplicate it. musachy On 4/24/07, Harring Figueiredo [EMAIL PROTECTED] wrote: They can the different and serve different purposes. The name attribute that you have there means that the value will

Reset struts form values: Struts 1.3

2007-04-24 Thread Chaudhary, Harsh
Hi, I am using Struts 1.3. We have several struts forms which are pre-populated from a database. My questions is, if I want to provide the user with a way to reset the form to the initial values which were populated from the database. Is there any API or method calls for that. Or maybe some kind

Re: [s2] Difference between actionMessages and actionErrors

2007-04-24 Thread Eric Rank
Another important difference between ActionMessages and ActionErrors has to do with how the Validation interceptor works. If you add an ActionError in the 'validate' method (or before the ValidationInterceptor get ahold of the request) of a ValidationAware action, the interceptor will see

Re: Reset struts form values: Struts 1.3

2007-04-24 Thread Paul Benedict
Chaudhary, Harsh [EMAIL PROTECTED] wrote: Hi, I am using Struts 1.3. We have several struts forms which are pre-populated from a database. My questions is, if I want to provide the user with a way to reset the form to the initial values which were populated from the database. It sounds

Re: ForwardAction question/issue

2007-04-24 Thread Paul Benedict
Adam, It sounds like you have your protected logic in the JSP. If so, then the JSP will always be rendered. You should instead put such security logic in the application, such as in the Struts Controller. It's no good putting it on the JSP. Paul On 4/24/07, Adam Gordon [EMAIL PROTECTED] wrote:

RE: Reset struts form values: Struts 1.3

2007-04-24 Thread Chaudhary, Harsh
Yea, that's what I was thinking too. I was just wondering if Struts (or some other API) has a built-in caching mechanism. Thanks though, Harsh. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Benedict Sent: Tuesday, April 24, 2007 4:55 PM To: Struts

ear problem

2007-04-24 Thread Ashuin Sharma Chamorro
I have 3 struts applications (.war ) inside one .ear. One of these application's classes extend a base class that is defined in an external .jar. Somehow if I deploy the three applications separately everything works fine, But once I deploy only the .ear, it fails when creating the extended

[s2]theme=ajax for form/submit button

2007-04-24 Thread Harring Figueiredo
Folks, I have a form with a submit button as follows s:form action=member_login.action theme=ajax validate=true s:textfield key=username / s:password key=password showPassword=false/ s:submit key=button.save theme=ajax targets=RightPaneWindow / s:reset key=button.reset/ /s:form On

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Musachy Barroso
After the ajax request completes, for each target in the target list this will run: dojo.byId(id).innerHTML = text; try updating the div content like that, and see what happens. This is a dumb question, but are you using the same id for more than one div? musachy On 4/24/07, Harring

Re: [S2] Newbie. Authentification Interceptors

2007-04-24 Thread Zoran Avtarovski
For what it's worth we use a combination of both JAAS and a custom AuthInterceptor. JAAS handles authentication and the AuthInterceptor manages authorisation. This leverages off the strength of JAAS and has the flexibility required for our needs. A couple of sources of useful information are:

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Harring Figueiredo
Musachy, Thanks for the reply. I am using only one div with the id. I now tried something else while waiting for the reply: s:set nameframe value=LoginWindow/ s:if test=hasActionErrors s:set nameframe value=RightPaneWindow/ /s:if I then tried to replace the traget on the form itself (since

Response already committed

2007-04-24 Thread Gajbhe, Laxman \(Contractor\)
Hi, I've following global result to handle authentication. global-results result name=login type=chain param name=actionNamelogin/param param name=namespace/home/param param name=methodinput/param /result ... /global-results For most part this works fine. The only problem with this is

[s2] Extending struts.xml

2007-04-24 Thread Zoran Avtarovski
I'm trying to extend the standard struts.xml by using includes but tomcat is throwing errors. I found some info on the mail lists pointing to an error in xwork and that it was fixed in 2.08. When I went looking to download a nightly build there were only 2.10 builds. My question is what's the

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Musachy Barroso
Is the target div on a different frame? musachy On 4/24/07, Harring Figueiredo [EMAIL PROTECTED] wrote: Musachy, Thanks for the reply. I am using only one div with the id. I now tried something else while waiting for the reply: s:set nameframe value=LoginWindow/ s:if test=hasActionErrors

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Harring Figueiredo
This is the generated code: td colspan=2div align=rightinput type=submit dojoType=struts:Bind event=onclick value=Save id=member_login_button_savelabel=Save name=button.save targets=RightPaneWindow / /div The div is on a different IFrame. Harring On 4/24/07,

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Musachy Barroso
I think that's why it doesn't work, the ajax theme uses getElementBydId(id) (actually dojo.byId(), anyway) which returns the element in the current document, for an iframe it should be window.frames[0].document.getElementById(...). You can use the notifyTopics attribute and do it yourself inside

Re: [s2] Extending struts.xml

2007-04-24 Thread Dave Newton
--- Zoran Avtarovski [EMAIL PROTECTED] wrote: I found some info on the mail lists pointing to an error in xwork and that it was fixed in 2.08. When I went looking to download a nightly build there were only 2.10 builds. .10 is bigger than .08. The fix is probably still in it. d.

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Harring Figueiredo
H... I sm not sure I understood. Maybe the generated code is different for: form target=someT ..? then for : s:submit targets=someT / ??? If the target is used on the form, it does reference and update the right form (But I have to IFrames that I need to update and that is the reason I am

Re: [s2]theme=ajax for form/submit button

2007-04-24 Thread Musachy Barroso
The targets won't be updated if they are in another frame, you can do something like this: s:submit theme=ajax notifyTopics=/updateIframe / script dojo.event.topics.subscribe(/updateIframe, function(data, type, e) { if(type == load) { //use iframe index or name here

Re: [s2] Extending struts.xml

2007-04-24 Thread Zoran Avtarovski
Thanks for the big call Dave. My concern was that 10 may introduce more issues than it solved. So I should've said What's the easiest and least disruptive way to fix the problem? Z. --- Zoran Avtarovski [EMAIL PROTECTED] wrote: I found some info on the mail lists pointing to an error in

Re: [s2] Extending struts.xml

2007-04-24 Thread Dave Newton
--- Zoran Avtarovski [EMAIL PROTECTED] wrote: Thanks for the big call Dave. ;) My concern was that 10 may introduce more issues than it solved. So I should've said What's the easiest and least disruptive way to fix the problem? I haven't updated that far either... An XWork person will

Re: Re: Null date become today in map when use textfield tag

2007-04-24 Thread longhao
Hello Dave Newton, I confirm that i define the testDate in my applicationContext.xml file. And if you use s:form/ tag. the magic thing is still happen . Null date become today in map. Best regards, === At 2007-04-24,

How do I access Struts 2 action errors in request from Freemarker view.

2007-04-24 Thread Caine Lai
I'm trying to figure out a way to access the Struts 2 action messages in a Freemarker template. I copied the following code from the Struts template directory, into my Freemarker view, but the action errors do not show up, which tells me I must not be using the correct variable. [#if

[S2] Initializing Actions from Spring page not found

2007-04-24 Thread wolverine my
Hi! The page is not found when we clicked on Initializing Actions from Spring from http://struts.apache.org/2.x/docs/why-would-we-want-to-create-action-objects-from-the-spring-configuration.html Do you have any idea of what could be the problem?

[S2] Access DAOs in Spring actions

2007-04-24 Thread wolverine my
Hi! I have action classes configured in struts.xml and the DataSource, SessionFactory, DAO objects configured in Spring's applicationContext.xml. How can I reference the DAO objects in my action class? Please advise, thank you!