回复:Re: how to Validate tabular input.

2009-02-27 Thread 张云勇
use vistor validator. you can see the sample app shipped with the struts full source download archives. 在2009-02-27,"Wes Wannemacher" 写道: On Thursday 26 February 2009 20:04:55 Greg Lindholm wrote: > I would really like to know the answer as well, how do you validate a list > of fields with ann

String manipulation

2009-02-27 Thread Richard Gundersen
Hi I'm trying to validate that a filename has a .csv extension. I would like to use @FieldExpressionValidator on the field but I can't get the syntax right, and searching the docs I can't find much on String manipulation in OGNL. Could anyone help me out please? Thanks

RE: String manipulation

2009-02-27 Thread Richard Gundersen
Oh, got it @FieldExpressionValidator(expression="(accountFileFileName.endsWith('.cs v')", message="", key="validate.invalidFilename", fieldName="accountFileFileName") Forgot you could just call methods in OGNL :) -Richard -Original Message- From: Richard Gundersen [mailto:r.gunder...@sa

RE: String manipulation

2009-02-27 Thread Richard Gundersen
Hmmm, no that also prevents genuine csv files from being selected too. Also investigating the accept attribute on the s:file tag to see if that will help... Any help appreciated. -Original Message- From: Richard Gundersen [mailto:r.gunder...@salford.ac.uk] Sent: 27 February 2009 10:27

RE: String manipulation

2009-02-27 Thread David Harland
Try adding this to your action static final Pattern pattern = Pattern.compile("^.+\\.((csv)|(xls))$", Pattern.CASE_INSENSITIVE); In your validateUpload method have something like Matcher matcher = pattern.matcher(fileName); if (!matcher.matches()) { addActionError("F

RE: String manipulation

2009-02-27 Thread Richard Gundersen
Thanks David. I've just got it working actually, I missed out a bracket in my original solution, so the syntax should be @FieldExpressionValidator(expression="(accountFileFileName.endsWith('.cs v'))", message="", key="validate.invalidFilename", fieldName="accountFileFileName") Silly mistake I kno

RE: Struts 2.1.6 - custom interceptor

2009-02-27 Thread Prasad M
Dear Greg Lindholm, Thanks so much. I could make it work with preresultlistener. Really Cool. Dear Lukasz Lenar, Thanks so much. So, I understand that the result has been created before it reaches the post invoke in interceptor. But, I still wonder with a question as to why this cannot happen

Re: Please help to get Arabic i18n(internationalization) using struts2.1.6

2009-02-27 Thread sajidbigler
Hi, have you tried this. Thanks, Nuwan Hi Nuwan, I tried and i got it as you said to Can you please elaborate what exactly it conveys to browser and what was going wrong ? But still that doest

Re: Please help to get Arabic i18n(internationalization) using struts2.1.6

2009-02-27 Thread Nuwan Chandrasoma
http://struts.apache.org/2.x/docs/how-do-i-add-i18n-to-a-ui-tag-like-the-textfield-tag.html sajidbigler wrote: Hi, have you tried this. Thanks, Nuwan Hi Nuwan, I tried and i got it as you said to

RE: Problem with file download.

2009-02-27 Thread Struts Two
I had the same problem that I used to get prompted for file save on IE6 but on IE7 the attachment was being displayed in a new pop up browser. and I did the following to resolve it: application/octet-stream Then make ur action class implement "ServletResponseAware" inte

[s2] accesing params from s:include tag

2009-02-27 Thread hernan gonzalez
I'm struggling with s:include + s:param in struts 2.0.14 The docs for the include tag http://struts.apache.org/2.0.14/docs/include.html states: "How To access parameters Parameters are passed as request parameters, so use the ${param.ParamName} notation to access them. Do not use the property

Re: [s2] accesing params from s:include tag

2009-02-27 Thread Nils-Helge Garli Hegvik
Haven't really tried, but I assume the parameter would be a String, so have you tried using 'eq' instead of '=='. Nils-H On Fri, Feb 27, 2009 at 3:06 PM, hernan gonzalez wrote: > I'm struggling with s:include + s:param in struts 2.0.14 > > The docs  for the include tag > http://struts.apache.or

Re: Struts performance metrics

2009-02-27 Thread Mohan Radhakrishnan
Ok. Are you able to access the Value Stack directly using JSTL without using s:iterator ? Thanks, Mohan -- View this message in context: http://www.nabble.com/Struts-performance-metrics-tp22077072p22247775.html Sent from the Struts - User mailing list archive at Nabble.com. -

Re: [s2] accesing params from s:include tag

2009-02-27 Thread Struts Two
I do not think you will be able to access the param value passed to s:include within struts tag [clearly an obvious shortcoming]. Your best bet is using jsp expression language as the parameter is put in request scope. I was not able to do it, despite trying a million different forms as well as

Re: javax.servlet.jsp.JspException: Cannot find bean under name

2009-02-27 Thread hermann . x . lau
Yes, I have a class where locationList is put in a RenderRequest object... ... log.info("Get Connection "); conn = ADFDAOUtil.getConnection(getDataSource(request)); dao = new CPCInventoryDAO(conn); ArrayList locList = dao.getLocations(mode); request.setAttribute("locationList", locList); ...

[S2] Famoso Double conversion problem in S2 2.0.11.1!

2009-02-27 Thread Milan Milanovic
Hi, I have again problem with Double conversion. I have a link in my page for double values: ... Set value ... In the form where refValue is entered I'm using my DoubleConverter conversion, and I checked with Firebug, refValue is set

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread SanJ.SANJAY
Ok, I was able to run and test the Sample Application that comes with struts distribution named StrutsInAction. Now I tried to add a new component to test and see if I could atleast run and see if it works atleast here. I wrote it exactly the same as other elements in the sample application l

Re: [S2] Famoso Double conversion problem in S2 2.0.11.1!

2009-02-27 Thread Milan Milanovic
When generated in jsp, this link looks like this: # Set value But when clicked nothing happes, it doesn't event came to conversion. -- M. Milan Milanovic wrote: > > Hi, > > I have again problem with Double conversion. I have a link in my page for > double values: > > > ... > > >

Preserving Action Messages during redirect action

2009-02-27 Thread Sundararaman, Anand
Hi, I want to redirect to another action but preserve the action messages/errors from the previous action. Is there any standard way to achieve this functionality in Struts 2? Or do I have to write an Interceptor for this? I have a use case where the errors on a web screen needs to be shown o

Re: Preserving Action Messages during redirect action

2009-02-27 Thread SanJ.SANJAY
Please use a new thread for this issue. The problem addressed here is totally diffirent from yours. Sundararaman, Anand wrote: > > Hi, >I want to redirect to another action but preserve the action > messages/errors from the previous action. Is there any standard way to > achieve this functi

Re: Preserving Action Messages during redirect action

2009-02-27 Thread Felipe Fraga
Glindholm solved this with an interceptor. http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/ Best regards, Felipe On Fri, Feb 27, 2009 at 1:12 PM, Sundararaman, Anand wrote: > Hi, >   I want to redirect to another action but preserve the action > mes

Re: [s2] accesing params from s:include tag

2009-02-27 Thread hernan gonzalez
> I was not able to do it, despite trying a million different forms as well as > suggestions by some folks in strust mailing list. > I do not think you will be able to access the param value passed to s:include > within struts tag [clearly an obvious shortcoming]. Your best bet is using > jsp ex

RE: Preserving Action Messages during redirect action

2009-02-27 Thread Sundararaman, Anand
Thanks Felipe, This was quick. I will incorporate the Interceptor and check it out. Thanks, Anand -Original Message- From: Felipe Fraga [mailto:felipefr...@gmail.com] Sent: Friday, February 27, 2009 10:17 AM To: Struts Users Mailing List Subject: Re: Preserving Action Messages during

Form validation: how can khow in jsp that my action validation failed?

2009-02-27 Thread boraldo
I need output special info in JSP if validation failed. How can I do it? ActionSupport has method hasActionErrors. I need smth like that for JSP. -- View this message in context: http://www.nabble.com/Form-validation%3A-how-can-khow-in-jsp-that-my-action-validation-failed--tp22250234p22250234.ht

Struts 2 question about validation and forwarding

2009-02-27 Thread laredotornado
Hi, If request validation fails, how can I forward the user to a different page than that from which they came? The scenario is that an external web site is going to invoke our site with something like "/ourForm.do?param1=xxx¶m2=" and if their parameters are not valid, we want to forward the

Re: Struts 2 question about validation and forwarding

2009-02-27 Thread Jim Kiley
Just have the result of the input() method return them to a different page under that condition. On Fri, Feb 27, 2009 at 12:41 PM, laredotornado wrote: > > Hi, > > If request validation fails, how can I forward the user to a different page > than that from which they came? The scenario is that a

Re: Form validation: how can khow in jsp that my action validation failed?

2009-02-27 Thread hernan gonzalez
Your jsp has access to your action, in the valuestack. So, you should be able to ask Beware: for validation errors, besides hasActionErrors() you might want to ask hasFieldErrors(). Or use hasErrors() , that includes both Hernán J. González http://hjg.com.ar/ On Fri, Feb 27, 2009

Re: Struts 2 question about validation and forwarding

2009-02-27 Thread laredotornado
But it seems like the "ActionErrors validate" method from my ActionForm class is called, fails, and my execute handler is not called. Is there a way in the struts-config.xml file that I can set up a foward upon validation failure? This is what my struts action is currently ...

Struts generate code

2009-02-27 Thread Mileidys Gonzalez Prieto
Hi, Im searching for tools that allows to generate some struts resources, like validation and app resources. I was looking around and I found the xDoclet annotations for to generate struts code, but my database is really so big, not so easy going to all the POJOs for to do that. Any other way, plea

Re: [s2] accesing params from s:include tag

2009-02-27 Thread Nils-Helge Garli Hegvik
You're right. I should have read the documentation more closely. It clearly states that no stack is created and you have to access the parameters through the regular servlet objects. If you believe this is a shortcoming, you could register a JIRA issue for it, unless there is one already. Nils-H

Re: javax.servlet.jsp.JspException: Cannot find bean under name

2009-02-27 Thread Nils-Helge Garli Hegvik
Does render anything? Nils-H On Fri, Feb 27, 2009 at 4:17 PM, wrote: > Yes, > > I have a class where locationList is put in a RenderRequest object... > > > ... > log.info("Get Connection "); > conn = ADFDAOUtil.getConnection(getDataSource(request)); > dao = new CPCInventoryDAO(conn); > ArrayLi

HttpServletResponse Transfer-Encoding header

2009-02-27 Thread Mike Finney
Hi, 1) What's a great way to manipulate HttpServletResponse existing headers using struts2? I tried changing Transfer-Encoding to Chunked using an interceptor (AbstractInterceptor) before and after the "actionInvocation.invoke();". I also tried again as a PreResultListener. I verified every

Re: Struts generate code

2009-02-27 Thread Musachy Barroso
You can use Java APT: http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html We use it for struts-annotations (internal tool to generate TLD files for tags): http://svn.apache.org/viewvc/struts/maven/trunk/struts-annotations/ musachy On Fri, Feb 27, 2009 at 12:59 PM, Mileidys Gonzale

Re: Struts 2 question about validation and forwarding

2009-02-27 Thread Burton Rhodes
Exactly. If validation fails, execute will not be called by design. Since all you want to do is forward, you shouldn't need to run your execute method. The forwarding will take place in your struts.xml file as previously suggested. If you need to execute code regardless of the validation, look int

[S2] json-plugin: includeProperties being ignored?

2009-02-27 Thread John . C . Cartwright
Hello All, I'm having trouble getting the json-plugin 0.32 to behave as I'd expected. The action is exposing a List of objects annotated as "@JSON(name="items")" in the action. I have my result configured as: true items.*\.name Howeve

Re: Struts performance metrics

2009-02-27 Thread Chris Pratt
The StrutsRequestWrapper should allow you to access the value stack from JSTL EL, so you could use to iterate over a value from the value stack. (*Chris*) On Fri, Feb 27, 2009 at 7:12 AM, Mohan Radhakrishnan < radhakrishnan.mo...@gmail.com> wrote: > > Ok. Are you able to access the Value Stack

[S2] Param tag with collection value

2009-02-27 Thread Relph,Brian
Hello, I would like to construct an action url with a collection-valued parameter, i.e.: http://host/context/search.action?names=NAME1&names=NAME2 Is there an easy way to do this? I was trying: where 'names' was a List, but this was

How to specify namespace for s:submit.

2009-02-27 Thread Leena Borle
Hi, Probably this questions has been asked before, but could not find answer on the list. How do I specify namespace for tag ? I have two buttons in the from and both of them call different action from different name space. These are not AJAX actions I tries using and also tried to give just

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread Dave Newton
SanJ.SANJAY wrote: Everything (code and configuration) in chapterZero(the component I have added in this existing SampleApplication) is same as it is there for others (chapterTwo, chapterThree etc etc). So I am wondering 1. this is not the struts2-1 configuration issue since it is also not run

Re: Struts 2 question about validation and forwarding

2009-02-27 Thread Dave Newton
laredotornado wrote: But it seems like the "ActionErrors validate" method from my ActionForm class is called, fails, and my execute handler is not called. Is there a way in the struts-config.xml file that I can set up a foward upon validation failure? This is what my struts action is currently

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread SanJ.SANJAY
Ok, If you check this thread , the previous entries have all the history of code and configuration. I did'nt want to put the code in every reply and mess the thread. By the way I have found out the issue with atleast the Sample Application, JBOSS and Eclipse are messing with each other and most o

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread Dave Newton
SanJ.SANJAY wrote: Ok, If you check this thread , the previous entries have all the history of code and configuration. I did'nt want to put the code in every reply and mess the thread. By the way I have found out the issue with atleast the Sample Application, JBOSS and Eclipse are messing with e

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread SanJ.SANJAY
Thanks you for your precious time. If you can't read what the thread is about, how are you trying to give insights? newton.dave wrote: > > SanJ.SANJAY wrote: >> Ok, If you check this thread , the previous entries have all the history >> of >> code and configuration. I did'nt want to put the

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread Dave Newton
SanJ.SANJAY wrote: Thanks you for your precious time. If you can't read what the thread is about, how are you trying to give insights? You're welcome. How can I try to give insights? I generally can't, because you don't provide enough information, even after being asked, repeatedly. Over th

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread SanJ.SANJAY
I'm sorry if I've offended you in anyway. chapterOne, chapterTwo are in the StrutsInAction.war that comes with struts 2 distribution. As I said I finally was able to run new component in this Sample Application and the issue was Eclipse and Jboss. newton.dave wrote: > > SanJ.SANJAY wrote: >>

Re: Action mapping issue while Integrating S2 and S1

2009-02-27 Thread Dave Newton
SanJ.SANJAY wrote: I'm sorry if I've offended you in anyway. Not offended, frustrated. chapterOne, chapterTwo are in the StrutsInAction.war that comes > with struts 2 distribution. I'm not aware that there's anything called StrutsInAction.war shipped with the Struts 2 distribution; must ha

Re: Struts performance metrics

2009-02-27 Thread Mohan Radhakrishnan
Yes. It does. Thanks. Now I find a big difference in performance. So unless I use freemarker I should be able to mix JSTL and OGNL and get some benefit. Iteration over a very large collection and access Javabean properties. JSTL - 2557 ms OGNL - 4499 ms Mohan -- View this message in context:

Re: Please help to get Arabic i18n(internationalization) using struts2.1.6

2009-02-27 Thread sajidbigler
i have changed to Still problem din't resolved. How about these too are not i18n only works fine More over i am able to see following warnings in console Feb 28, 2009 12:56:15 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn WARNING: Could not find property [theme] Feb