Re: [S2] Getting the AJAX Form Validations to work

2007-03-13 Thread Binil Thomas
Hi all, I got it working! I had to add a validate=true attribute on the s:form/. With that added, the form was trying to make an AJAX request onblur. But I got a JS error in FB: element.form.attributes['name'] is undefined. Debugging a bit, I figured that the JS figures out the validation

DispachAction - does not contain specified method

2007-03-13 Thread Nitin Ahuja
Hi, I am using DispatchAction as my base action class. when submit url http://.../myAction.do?action=view; and there is no view method defined in my action class, then it throws following exception. Is there any way to call a default method when the method view does not exists ? Or how can I

[s2] newbie - setting multiple values in an action

2007-03-13 Thread Martin Fanta
Hi all, I started playing around with Struts 2.0.6 on Saturday. All went well until I've run into the need to call an Action setter for a list of strings submitted from an html form (will switch to dates later, but I want to solve the multiple aspect first). I have a jsp with this body: s:form

[struts faces] How do i set default values?

2007-03-13 Thread David Delbecq
Hello, i am trying to convert some struts form to be JSf compatible using struts faces. However, there are a few problems with initialization for form. I have this: html:form action=/search.do acceptCharset=UTF-8 styleClass=search html:hidden property=scope value=${param.searchScope}/

Re: DispachAction - does not contain specified method

2007-03-13 Thread Mark Shifman
You should look at the source http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/DispatchAction.java?view=markup and the javadoc Method which is dispatched to when there is no value for specified request parameter included in the request. Subclasses

Re: [s1] handle exception in processPopulate?

2007-03-13 Thread Niall Pemberton
On 3/13/07, Paul Benedict [EMAIL PROTECTED] wrote: Strachan, Paul wrote: I resolved this myself by simply overriding the set(String, Object) method in my form, to ignore certain request parameter names that are not of type String in my LazyValidatorForm. If you feel strongly about this,

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Tamas Szabo
Yes, setting the dispatcher will work just for ignoring the forwards, it won't work for redirects. You can check for attributes as Paul suggests, but setting the dispatcher seems to be easier if you have a servlet container supporting 2.4. You'll have to handle redirects in another way though. A

Validation Framework

2007-03-13 Thread Balazs Michnay
Dear Struts Users, I'm relatively new to Struts and am trying to get the Validation Framework working without success. I've read several tutorials and articles on using it, but it just doesn't want to work. I'm using NetBeans 5.5, so that I can use Struts 1.2.9. Having set everything, I get

Re: Validation Framework

2007-03-13 Thread Mike Baroukh
I'm still using struts 1.1 and your struts config/form is really different from what I used to do. But, in struts 1.1, we had to add validate=true in the struts-config on the action ... your struts-config doesn't have any. Maybe ... Mike Balazs Michnay a écrit : Dear Struts Users, I'm

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Balazs Michnay [EMAIL PROTECTED] wrote: I'm relatively new to Struts and am trying to get the Validation Framework working without success. You neither set validate='true' on your Action (in the struts-config action-mapping configuration element) nor call the form bean's 'validate' method

Struts Question - multiple instances of an actionForm

2007-03-13 Thread xyz
Hi all, Is there any standard ways to manage multiple instances of one form with Struts? Say,I have application which is supposed to take theorerically unlimited number of person's descriptions. Every time user clicks add one more person he/she gets exactly the same form (with the same

Re: Session values getting lost

2007-03-13 Thread Dilip Ladhani
Well I figured it out. When I accessed the index.jsp, I accesses it with a different context root (In tomcat, it was the project name). Tomvat is somehow allowing me to do that. Since the history page had no context root, it woked, but after that when I use the correctcontext root, a new session

Re: [s2] newbie - setting multiple values in an action

2007-03-13 Thread Mark Menard
On 3/13/07 3:45 AM, Martin Fanta [EMAIL PROTECTED] wrote: I have a jsp with this body: s:form action=Process s:iterator value=dates status=day s:textfield label=%{top} labelposition=left name=days[%{#day.index}]/ /s:iterator s:submit/ /s:form It is meant to display a label and an

Re: DynaValidatorForm with java.util.Date

2007-03-13 Thread Gareth Evans
You register the converter using: ConvertUtils.register( new DateConverter( dd/MM/ , java.util.Date.class ) ); Gareth [EMAIL PROTECTED] wrote: I can't see how that can solve my problem? The ArrayList is actually gone. When I want to display the arraylist with c:forEach

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pierre, I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a super-simple way to do this: put a marker in the request

Re: Struts Question - multiple instances of an actionForm

2007-03-13 Thread Dave Newton
--- xyz [EMAIL PROTECTED] wrote: Any hints/ideas on achieving this? Have you considered using indexed properties? d. TV dinner still cooling? Check out Tonight's Picks on Yahoo! TV. http://tv.yahoo.com/

Re: Validation Framework

2007-03-13 Thread Balazs Michnay
Hi Dave, Thanks a lot for your help! It really does work! What I missed was the validate=true attribute of the action tag, however, this was not mentioned by any of the articles I read. The other thing is that now, the validation error message DID show up, but it is displayed on

[S2] Setting up actions

2007-03-13 Thread Skip Hollowell
I have spent a few weeks getting my hands dirty with Struts 2 now, and I have come to a crossroads of sorts, in my app design and layout of my actions. A good example of where I am looking for direction is the following: A user logs in and wants to add a transaction for an account. I have

Re: [S2] Setting up actions

2007-03-13 Thread Dave Newton
--- Skip Hollowell [EMAIL PROTECTED] wrote: 1 action per functional part of the app, or 1 action per data type, with many results corresponding to each method that I call inside that partuclar action? I think this is mostly a matter of preference, isn't it? I find it more concise (overall)

Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I am having an arguement with a co-worker here and here is how it goes. We have a JSP which has about 100 input fields. These fields have custom validators on them. When we try to run the JSP, it throws an exception something to the tune of Maximum try/catch size reached or something like that.

Re: Validation framework question

2007-03-13 Thread Mike Baroukh
Hi. This is only a problem with javac and depending on wich java version you use. jdk5 should not have the problem. You may also try to use jikes for compiler. There may be or may be no code added for the validation. But this is not the problem ... Mike Chaudhary, Harsh a écrit : I am

RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I know that the exception Maximum try/catch size reached has something to do with the compiler but what I would likt to know is that whether or not any validation code is added to the compiled JSP file itself. Harsh. -Original Message- From: Mike Baroukh [mailto:[EMAIL PROTECTED]

Re: Validation framework question

2007-03-13 Thread Mike Baroukh
then, you may try to look at the compiled jsp ? Chaudhary, Harsh a écrit : I know that the exception Maximum try/catch size reached has something to do with the compiler but what I would likt to know is that whether or not any validation code is added to the compiled JSP file itself.

Re: Setting up actions

2007-03-13 Thread Skip Hollowell
Dave Newton-4 wrote: --- Skip Hollowell [EMAIL PROTECTED] http://www.nabble.com/user/SendEmail.jtp?type=postpost=9458130i=0 wrote: 1 action per functional part of the app, or 1 action per data type, with many results corresponding to each method that I call inside that partuclar action? I

Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Mike Baroukh [EMAIL PROTECTED] wrote: jdk5 should not have the problem. Did 1.5+ remove the 64K limitation? There may be or may be no code added for the validation. But this is not the problem ... Technically, no, but it's the gating issue in this case. Try breaking up the JSP into

RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I tried to do that but I could not find where my IDE stores those files. I am using WSAD 5.1.1 with WebSphere. Any suggestions would be appreciated. Harsh. -Original Message- From: Mike Baroukh [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 13, 2007 11:56 AM To: Struts Users Mailing

Re: Validation framework question

2007-03-13 Thread Mike Baroukh
Did 1.5+ remove the 64K limitation? I'm not absolutly sure, but think. I read this once and it's been a long time since I didn't saw this exception ... Mike Dave Newton a écrit : --- Mike Baroukh [EMAIL PROTECTED] wrote: jdk5 should not have the problem. Did 1.5+ remove the 64K

Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Balazs, Balazs Michnay wrote: Thanks a lot for your help! It really does work! What I missed was the validate=true attribute of the action tag, however, this was not mentioned by any of the articles I read. If it's not mentioned, you should point

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote: Right. Under most circumstances, you should set validate=true in your action definition, and /not/ call form.validate() in your own action. You /are/ free to call validation by hand, but it's generally more convenient to allow Struts to handle the

Previous action's property file being accessed incorrectly

2007-03-13 Thread David Harland
Hi, We have a problem. Our home page is made up of three actions etc. s:action name=Home1 executeResult=true / s:action name=Home2 executeResult=true / s:action name=Home3 executeResult=true / When a link is clicked on the home page to the User page via the User action the User pages

Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dave, Dave Newton wrote: --- Mike Baroukh [EMAIL PROTECTED] wrote: jdk5 should not have the problem. Did 1.5+ remove the 64K limitation? The 64k is a limit for method bodies, not try/catch. It should still be very much in force:

Re: Validation framework question

2007-03-13 Thread Mike Baroukh
for Websphere, in a subdirectory of AppServer/temp/ you should find _*java or, at least _*class if it doesn't keep generated files. There is a checkbox to check on the console to keep generated files but I never remember where ... (I hate WebSphere !). If you use the integrated instance of

Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote: I wrote: Try breaking up the JSP into dynamic includes This might not help, depending in which type of include you use. Static includes, for example, [...] ... d. Looking

Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dave, Dave Newton wrote: --- Christopher Schultz wrote: Right. Under most circumstances, you should set validate=true in your action definition, and /not/ call form.validate() in your own action. You /are/ free to call validation by hand, but

S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Hi All, How do you utilize the s:submit tag in conjunction with 'Action Wildcards'. On my form I have 3 buttions: one to display tabular results, and the other 2 to display graphs. Here is my code excerpt. td s:submit type=button

Re: [s1] Filters: distinguishing between user-requests and redirects

2007-03-13 Thread Michael Jouravlev
On 3/13/07, Christopher Schultz [EMAIL PROTECTED] wrote: Pierre, I am trying to implement a flood control mechanism to prevent robots requesting pages after pages at an inhuman rate. I know you've gotten lots of feedback already, but there's a super-simple way to do this: put a marker in the

Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dave, Dave Newton wrote: --- Christopher Schultz wrote: I wrote: Try breaking up the JSP into dynamic includes This might not help, depending in which type of include you use. Static includes, for example, [...] ... Heh. Missed dynamic.

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote: I didn't say that you need another URL that doesn't perform validation. Oh. I guess I don't know another way to show a form via an Action without running validation except by defining an Action. d.

Re: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote: How do you utilize the s:submit tag in conjunction with 'Action Wildcards'. [...] s:submit type=button action=%{'queryResult'}... s:submit action=theAction!theMethod.../ will work and you don't need to do anything with wildcards. d.

RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Like this? s:submit type=button action=CityCountryLevelQueryAction!getMhtTrend Getting a 'Could not find action or result' error... Code Snippet public String getMhtTrend() throws Exception { System.out.println( getMhtTrend here ); return SUCCESS; }

RE: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote: Like this? s:submit type=button action=CityCountryLevelQueryAction!getMhtTrend Er... I thought so :/ Do you have struts.enable.DynamicMethodInvocation set to false? And you know that you are both returning a valid result and that the result exists? d.

RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
struts.enable.DynamicMethodInvocation=true Now almost working... I have 3 buttons on the form, it seems that only the first action defined for the first button is being submitted. I'm using MS IE.. Is this a bug? Thanks, Leon -Original Message- From: Dave Newton [mailto:[EMAIL

RE: S:SUBMIT action usage

2007-03-13 Thread Dave Newton
--- King, Leon C wrote: it seems that only the first action defined for the first button is being submitted. I'm using MS IE.. Is this a bug? http://cwiki.apache.org/WW/submit.html What version of IE are you using? I'm running a simplified version of multiple s:submit type=button

RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
IE 6.0I noticed a note 'Please note that the button type has advantages by adding the possibility to seperate the submitted value from the text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0' I tried with Netscape, it all three buttons utilize

RE: S:SUBMIT action usage

2007-03-13 Thread King, Leon C
Sorry, here's my code. s:submit type=button method=submitQueryResult value=submitQueryResult theme=simple label=Query Result / /td td width=10nbsp;/td td s:submit

Dynamic parameter question - S2

2007-03-13 Thread Scott Nesbitt
I would like to have a url pass a parameter based on the value of a field on the JSP. My code looks like this: s:url id=historyUrl action=LineupHistory includeParams=all s:param name=foo value=%{barbar}/ /s:url s:a href=%{historyUrl}Lineup History/s:a s:hidden name=barbar value=%{'baz'}/

Re: Dynamic parameter question - S2

2007-03-13 Thread Dave Newton
--- Scott Nesbitt [EMAIL PROTECTED] wrote: I would like to have a url pass a parameter based on the value of a field on the JSP. My code looks like this: Unless the field is set by the Action before displaying the JSP the parameter won't hold a value until it's submitted. s:url

Re: Dynamic parameter question - S2

2007-03-13 Thread Scott Nesbitt
Hmm, I see your point. I do not really need to do any fancy Ajax stuff here, I just want an action invoked by a url link to have access to what was selected on the page (which I was going to stuff into a hidden field.) I know I can do this with a form and submit button, but surely there is a

Validation on java.util.List

2007-03-13 Thread Alex Wibowo
Hi all... I am using Struts 2.0. Has anyone ever done validation on individual item in java.util.List before? Say, I have a property ListCustomer customers in my Action, and Customer is defined as: public class Customer{ private String username;// must not be empty

Re: Dynamic parameter question - S2

2007-03-13 Thread Laurie Harper
For your posted example, where that value you want to pass is the value you're rendering in the hidden field, you can just use the same OGNL expression in both places: ... s:param name=foo value=%{baz}/ ... If that hidden input's field is being changed by client-side Javascript,

OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Hello, I get the following error when trying to create a list with ognl: org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48) #{'F':'Female','M':'Male'} contains invalid expression(s): javax.el.ELException: Error Parsing: #{'F':'Female','M':'Male'} the code in jspx:

Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Found the answer in the opensymphony forum: http://forums.opensymphony.com/thread.jspa?messageID=100059 On glassfish, it seems you have to disable EL: !-- = Disable the JSP-EL, it messes up on pages with OGNL === -- jsp-config jsp-property-group

Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote: On glassfish, it seems you have to disable EL: !-- = Disable the JSP-EL, it messes up on pages with OGNL === -- jsp-config jsp-property-group url-pattern*.jspx/url-pattern el-ignoredtrue/el-ignored

Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Piero Sartini
Will this issue get resolved in the future? That may have to do with the JSF EL, which also uses # as its escape char. If that's the case, probably not? That is the case. But why not? Its not JSF EL but JSP EL. I don't think its good to be incompatible with JSP..

Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
Sorry, meant to include this link: http://today.java.net/pub/a/today/2006/03/07/unified-jsp-jsf-expression-language.html d. --- Dave Newton [EMAIL PROTECTED] wrote: --- Piero Sartini [EMAIL PROTECTED] wrote: On glassfish, it seems you have to disable EL: !-- = Disable the

Re: OGNL - invalid syntax. JSP EL?

2007-03-13 Thread Dave Newton
--- Piero Sartini [EMAIL PROTECTED] wrote: I don't think its good to be incompatible with JSP.. It wasn't incompatible until 2.1, IIRC, and it was JSF-only up until then, before the unification effort. Maybe take it up w/ the OGNL folks? I agree that this may cause a problem in some

Struts 2.0.6 portlets

2007-03-13 Thread tom tom
We were alble to successfully deploy the struts 2.06 portlet sample on our portal container which is uPortal. What we want to know is Can we write the portlet applications simillar to the Struts 2.0.6 web applications(not portlets). Does Struts 2.0.6 portlets got limitations compared to the

Re: Validation on java.util.List

2007-03-13 Thread Dave Newton
--- Alex Wibowo [EMAIL PROTECTED] wrote: I am using Struts 2.0. Has anyone ever done validation on individual item in java.util.List before? I'm drawing a blank on this one too after poking it with a stick for about an hour now... I have a similar requirement (but with fairly heavy

Global messages.jsp file included in a SiteMesh decorator

2007-03-13 Thread mraible
I have a messages.jsp[1] that's included (using %@ include file=/common/messages.jsp %) in my default decorator. This file has a couple of calls to the valueStack - namely hasActionErrors() and hasFieldErrors(). This worked fine in WebWork 2.1.x and Struts 2.0.1 - even when pages where rendered

Re: Struts 2.0.6 portlets

2007-03-13 Thread Nils-Helge Garli
A couple of things you should be aware of is: - You cannot use result types that require full control of the response object (e.g. rendering PDFs, images, charts etc). To do that, you must dispatch a request to a servlet instead. - You should be aware of the lifecycle and the phases of a