Re: Runtime Expression in logic:equal
On 8/2/06, Chetan Pandey [EMAIL PROTECTED] wrote: Why don't you use displaytags ( http://www.jamesgood.com:8080/displaytag-examples-1.1-SNAPSHOT/docs/tut_bas ic.html) this thing looks fantastically easy. but alas i didnt have the time to dirty my hands into it.Did it with plain old javascript. THanks anyway. -- Puneet
Sturts form validation
Hi I have a form which consists of around another 5 forms object. And each form has its own validation.How to call the validate method of the each forms?? -- Thanks and Regards Hanmayya Udgiri
Re: Client Side Validation
your form shoud have been named : attendeeDetailsForm, like bean no caps for first letter . then validateAttendeeDeta onsubmit=validateAttendeeDeta ilsForm (); or validateAttendeeDeta onsubmit=validateAttendeeDeta ilsForm (this); u can see the javascript generated in the source of your jsp btw . hope it helps 2006/8/2, Chetan Pandey [EMAIL PROTECTED]: I have this: html:form action=/addAttendeeDetails onsubmit=return validateRequired(this) Where validateRequired comes from the following Javascript code in my validator-rules.xml validator name=required classname=org.apache.struts.validator.FieldChecks method=validateRequired methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest msg=errors.required javascript![CDATA[ function validateRequired(form) { } ]] /javascript /validator But no Client-side Validation is occuring -Original Message- From: Lixin Chu [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 10:35 AM To: Struts Users Mailing List Subject: Re: Client Side Validation do you have something like: onsubmit=validateAttendeeDetailsForm (this); in html:form ? and form name is not attendeeDetailsForn ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sturts form validation
If I understand you correctly If you have references to the subforms within an outter form, just call each subform's validate() method in the outter forms validate() method. Couldn't tell you how you'll get Struts to auto-populate those subforms though. MainActionForm{ validate(...){ mySubForm1.validate(...); mySubForm2.validate(...); } } On 8/2/06, Hanmay Udgiri [EMAIL PROTECTED] wrote: Hi I have a form which consists of around another 5 forms object. And each form has its own validation.How to call the validate method of the each forms?? -- Thanks and Regards Hanmayya Udgiri
[OT] How to limit tomcat sessions
Hi All, I want to limit the number of user sessions to 25. Is it possible to do it directly through tomcat configurations? If yes, then are the sessions limitations per applications deployed or on the whole? regards, Pankaj - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Batch files from JSP
May be you can google Java runtime exec I found this one good. - http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Hope this can help Thanks and Regards, Thomas Joseph Kott Software Pvt. Ltd. | Vallamattom Estate | M.G.Road | Cochin-682015 | India www.kottsoftware.com This email (including any attachments) is subject to copyright, the information in it is confidential, and it is legally privileged. Use of this email or of any information in it other than by the addressee is unauthorized and unlawful. If you are not the intended recipient of the mail, kindly intimate the author of the mail and delete the same. - Original Message - From: Akshay Ahooja To: Struts Users Mailing List Sent: Tuesday, August 01, 2006 11:35 PM Subject: Batch files from JSP Hi, This is not entirely a struts question, but how would I execute a batch from on the server from a jsp? If the .bat is in the same file as the jsp calling it. I tried Runtime rt = Runtime.getRuntime(); Process pr= rt.exec(db.bat); But it gives errors. java.io.IOException: CreateProcess: db.bat error=2 java.lang.ProcessImpl.create(Native Method) java.lang.ProcessImpl.init(ProcessImpl.java:81) java.lang.ProcessImpl.start(ProcessImpl.java:30) java.lang.ProcessBuilder.start(ProcessBuilder.java:451) java.lang.Runtime.exec(Runtime.java:591) java.lang.Runtime.exec(Runtime.java:429) java.lang.Runtime.exec(Runtime.java:326) org.apache.jsp.batch_jsp._jspService(batch_jsp.java:59) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Any help would be great, Thanks, Akshay
Re: Struts 2 snapshot build work on JDK 1.4.2?
On 8/2/06, Don Brown [EMAIL PROTECTED] wrote: Ah, yeah, we'll have to run XWork through the retrotranslater/weaver too, as it is built with Java 5. Ted, can you make the build changes to XWork too? If you need commit access, let Pat or Jason know. For now, I just ran the J5 JARs through the translator and posted the ZIP. There isn't a build per se yet. * http://people.apache.org/builds/struts/2.0.x/nightly/ I added a translated XWork JAR to the build from yesterday. I wish I could test this myself, but I just don't have any discretionary time this week. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Removing page from browser history
I am able restrict the user going back to previous page from current page by browser BACK button. script language=javascript window.history.forward(1); /script How to restrict the user going to previous page by removing the Previous page accessed by user from BROWSER HISTORY(Cntrl+H in IE). I am using Struts Tiles Web application i have few modules to navigate from home page after login. HOME PAGE - Module 1 - Module 2 - Module 3 In my Module 1 i have page1.d0 page2.do page3.do. Page3.do will load page3.jsp. This Jsp page can be viewed by User only if he comes from Home-page1.do page1.do-page2.do page2.do-page3.do page3.do-Home page User After Submit Form in page3 he will navigate to HOME page with message records saved succefully. My Requirment is he cannot go to page 3 from browser BACK Button or from Browser History. So, page 3.do is accessed only if user navigates all before 2 pages. What ever i write code for this issue can be written only in Page3.jsp, Any Suggestions on this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
Hi Ted, If you can place the updated builds or post a updated zip , I can test it and let you know how it works. Thanks, Aparna -- View this message in context: http://www.nabble.com/Struts-2-snapshot-build-work-on-JDK-1.4.2--tf1993746.html#a5611772 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
On 8/2/06, apka2109 [EMAIL PROTECTED] wrote: If you can place the updated builds or post a updated zip , I can test it and let you know how it works. Yes, the ZIP is updated, I just didn't rename it. -T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
I took the zip few minutes back and was getting same exception, so thought it is not updated. Thanks -Aparna -- View this message in context: http://www.nabble.com/Struts-2-snapshot-build-work-on-JDK-1.4.2--tf1993746.html#a5611859 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Messages and Validator
Hello, I am using Validator framework with a Struts application. I would like to know if it is possible to use message provided by a database (or java class) rather than a propertie file ? Thank you, Jean-Marie. --- Email Disclaimer http://www.cofidis.be/emaildisclaimer.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] A question on garbage collecting
Thank you Tamas, On 8/2/06, Tamas Szabo [EMAIL PROTECTED] wrote: Hi Leon, I doubt I have more experience :-) but as I know soft references are collected when the GC decides to do so. The only thing you can be sure of is that they will be collected _if_ the VM is running out of memory. But there is no guarantee that they will not be collected before. You are right, it is weird because you usually use them for caches but, I guess that it is VM-implementation specific. Maybe if you use another VM, or try to find some help from your VM providers Heh, getting help from sun? I think it's a myth!!! My best friends girlfriend works for storagetek which now belongs to sun, and even they don't get support. regards Leon :-) Tamas On 8/2/06, Leon Rosenberg [EMAIL PROTECTED] wrote: Hi, I have a question regarding a weird behaviour of the garbage collector, maybe someone here, has more experience with it, and can answer the question. Otherwise sorry for the OT. We have a cache for caching 1000.000 user objects along with many (some hundred thousand) not existing objects (negative cachingto prevent db requests). The cache is an array of softreferences to the objects. We used softreferences to prevent oome in case we don'T have enough ram. However now we do have enough ram - 6 Gb assigned to the java process, and System.freeMemory is always above 1 gig. However, I see that through the cache isn't full yet, and there is plenty of free memory, 500.000 objects have been garbage collected. Could it be that softreference are collected independent of available memory? If true, isn't it weird? ;-( regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two form one jsp
hi , The problem in using document.form[0]. and document.form[1] for first and second form respctively first form comes from Header.jsp and second form from myFoo.jsp and Header is there through out Application and the functionality that is part of Header that I need to write in myFoo.jsp there i need to pass same actionForm (This is where problem occured). And also i want myFoo.jsp as part of some Popup functionality where there is no Header.jsp included so in that case we have single form so document.form[1] will not work please suggest Thanx Shakti On 02/08/06, Monkeyden [EMAIL PROTECTED] wrote: Can we please stop suggesting use of the form name? It.will.not.work. If both forms have the same name, it makes a reference to document.forms ['foo'] an array and not a reference to the form. Of course you *could *do this: html head /head script language=JavaScript type=text/javascript function tellMe(){ alert(Form 1: + *document.forms['foo'][0].form2Text.value*); alert(Form 2: + *document.forms['foo'][1].form2Text.value*); } /script body form action=foo method=post name=foo id=foo input type=text name=form2Text value=This is 1 /form form action=bar method=post name=foo id=bar input type=text name=form2Text value=This is 2 /form input type=button name=myButton value=Click It onclick=tellMe(); /body /html but A, that would be stupid, and B, you have to use the index value anyway. On 8/1/06, kalpesh modi [EMAIL PROTECTED] wrote: I am not sure whether document. form['formName'] will work or not. Give it a try. -Kalpesh - Yahoo! Music Unlimited - Access over 1 million songs.Try it free.
Nested tiles layouts
Hi, I've seen a few threads similar to this, but nothing with my specific problem. Suppose I have a tiles definition file, with the following definitions: definition name=.default page=/stdLayout.jsp put name=title value=Default Title type=string / put name=css value=/css/main.css / put name=content value=/defaultContent.jsp / /definition definition name=.lib.layout page=/lib/layout.jsp put name=libContent value=/lib/default.jsp / /definition definition name=.lib.default extends=.default put name=css value=/css/lib/lib.css / put name=content value=.lib.layout type=definition / /definition definition name=.lib.home extends=.lib.default put name=title value=Library Home / put name=libContent value=/lib/home.jsp / /definition Now suppose that I have the following JSP pages: stdLayout.jsp: html headtitletiles:getAsString name=title //title/head body link rel=stylesheet type=text/css href=tiles:getAsString name=css / / tiles:insert name=content / /body /html defaultContent.jsp: THIS SHOULD NEVER SHOW UP /lib/layout.jsp hr / tiles:insert name=libContent / hr / /lib/default.jsp LIB DEFAULT /lib/home.jsp LIB HOME Now, what I would expect when going to .lib.home is the following: TITLE: Library Home --- LIB HOME --- Instead, I get: TITLE: -- THIS SHOULD NEVER SHOW UP -- So basically, every property that is inerited from .default can be overridden, but no property in .lib.default (namely the libContent property) can be overridden. Is there any way around this? (Please disregard any syntax errors above - it is merely an example and not the actual code) Thanks, Matt Kurjanowicz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validate integer with a comma thousands seperator using Validator
Using struts validator. have to validate the user entered value. The value entered should be a positive integer with a comma thousands seperator. the number need not be in thousands. I have as below to check for positive integer without comma seperator. but not sure how to validate if the user entered value with a comma seperator? i.e value like 25,349 // how to validate this? field property=hrs depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field how to validate the user entered value with a comma seperator? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested tiles layouts
Matt Kurjanowicz ha scritto: Hi, I've seen a few threads similar to this, but nothing with my specific problem. Suppose I have a tiles definition file, with the following definitions: ... Now suppose that I have the following JSP pages: stdLayout.jsp: html headtitletiles:getAsString name=title //title/head body link rel=stylesheet type=text/css href=tiles:getAsString name=css / / tiles:insert name=content / /body /html I calculated the final result of .lib.home definition and it should be: definition name=.lib.home page=/stdLayout.jsp put name=title value=Library Home / put name=libContent value=/lib/home.jsp / put name=css value=/css/lib/lib.css / put name=content value=.lib.layout type=definition / /definition But standardLayout has no libContent attribute, so it is ignored. Anyway if you really got: snip TITLE: -- THIS SHOULD NEVER SHOW UP -- /snip then it seems that Tiles engine did not replace the content attribute, you should get: snip TITLE: Library Home -- LIB DEFAULT -- /snip It seems like a bug to me... Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
Did you replace the XWork JAR with the XWork-J4 JAR, so that the XWork-J4 is the only one on the classpath at runtime? -T. On 8/2/06, apka2109 [EMAIL PROTECTED] wrote: I took the zip few minutes back and was getting same exception, so thought it is not updated. Thanks -Aparna -- View this message in context: http://www.nabble.com/Struts-2-snapshot-build-work-on-JDK-1.4.2--tf1993746.html#a5611859 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- HTH, Ted. * http://www.husted.com/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two form one jsp
Is it not possible to use two seperate form beans? -Kalpesh - How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.
Re: Nested tiles layouts
On 8/2/06, Antonio Petrelli [EMAIL PROTECTED] wrote: snip TITLE: Library Home -- LIB DEFAULT -- /snip Ciao Antonio That is what I get - sorry I confused myself with my example. -Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DHTML and Struts
Any form elements created dynamically on the client-side will have no intrinsic link to the ActionForm. However, this is not necessarily a problem... imagine if your ActionForm has this in it: private String firstName; public void setFirstName(String inFirstName) { firstName = inFirstName; } public String getFirstName() { return firstName; } What happens if your JSP *DOES NOT* include this form field? Obviously that will be just fine, Struts won't complain. Now, what happens if you dynamically add that field to your HTML form via JavaScript, and then submit the form? Again, this will be just fine, Struts will happily populate the firstName field in the ActionForm. It doesn't matter that it wasn't there when the HTML for the page was originally rendered by the JSP. In the case of indexed properties, the same is true... if you dynamically add a field to the HTML form, so long as the name follows the index naming paradigm, it will be populated in the ActionForm when submitted. The code you have here looks basically correct, with one possible exception... setting innerHTML doesn't necessarily add anything to the DOM. So, when the form is submitted, the fields you dynamically added may not be sent (I believe it will work in some browsers, but not in others... I'd have to go test to verify this, but that's what's in my memory). Instead, you should use DOM methods to create your new field and append it to the form, that should alleviate that problem. This is generally the preferred method to work with dynamic content anyway. So, your add method should be something like function add() { var newField = document.createElement(input); newField.type = text; newField.name = foo[ + count + ]; var newCell = document.createElement(td); newCell.appendChild(newField); var newRow = document.createElement(tr); newRow.appendChild(newCell); var theTable = document.getElementById(t1); theTable.appendChild(newRow); count++; } Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 2, 2006 12:48 am, Puneet Lakhina wrote: you were hung up (maybe I read into your question incorrectly). So are you actually hung up on the JavaScript to dynamically add fields? Yes, i am able to add text fields to my page, but I dont know what all attributes to specify in the input tag so that my user bean recieves the values from the dynamically added text fields. i.e. script language=javascript count=1; function add() { var row = document.getElementById('t1').insertRow(count); var cell=row.insertCell(0); cell.innerHTML=input type=text name=foo[ + count + ] + / count++; } /script input type=button onclick=add() / table id=t1 tr td html:text property=foo[0] /td /tr /table /table -- Puneet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Removing page from browser history
I wouldn't rely on the client side for this. With FireFox and a few extensions you can have your wicked way on the client side and send anything you want to the server. Hence it's up to the server to look after security not the client. If you rely on the client alone your system will be very vulnerable to attack. The way I would do it would be to have a variable in session scope to store whether or not page two is available and then wrap all the code in page3.jsp inside a logic:if tag that will only display it if the variable in session says it's OK. Hope that's some help. Bart. Raghuveer wrote: I am able restrict the user going back to previous page from current page by browser BACK button. script language=javascript window.history.forward(1); /script How to restrict the user going to previous page by removing the Previous page accessed by user from BROWSER HISTORY(Cntrl+H in IE). I am using Struts Tiles Web application i have few modules to navigate from home page after login. HOME PAGE - Module 1 - Module 2 - Module 3 In my Module 1 i have page1.d0 page2.do page3.do. Page3.do will load page3.jsp. This Jsp page can be viewed by User only if he comes from Home-page1.do page1.do-page2.do page2.do-page3.do page3.do-Home page User After Submit Form in page3 he will navigate to HOME page with message records saved succefully. My Requirment is he cannot go to page 3 from browser BACK Button or from Browser History. So, page 3.do is accessed only if user navigates all before 2 pages. What ever i write code for this issue can be written only in Page3.jsp, Any Suggestions on this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Removing page from browser history
Have you tried using redirect in your action mapping? It should work. Thanks, -Kalpesh - How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.
Re: Nested tiles layouts
Matt Kurjanowicz ha scritto: That is what I get - sorry I confused myself with my example. No problem, I thought really it was a Tiles bug :-) Ok if I understood you correctly, you wish to override an attribute that has been put inside another definition, right? In this case, you cannot do this directly (though in Standalone Tiles I posted a patch about nested definitions, but that's another story), you have to create a new definition that extends .lib.layout and use this one inside .lib.home. definition name=.lib.layout.new extends=.lib.layout put name=libContent value=/lib/home.jsp / /definition definition name=.lib.home extends=.lib.default put name=title value=Library Home / put name=libContent value=.lib.layout.new / /definition HTH Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested tiles layouts
Antonio Petrelli ha scritto: definition name=.lib.home extends=.lib.default put name=title value=Library Home / put name=libContent value=.lib.layout.new / /definition Whoops, I actually meant: definition name=.lib.home extends=.lib.default put name=title value=Library Home / put name=content value=.lib.layout.new / /definition - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Removing page from browser history
FYI, Michael Jouravlev has spoken quite a bit about controlling the browser history via the PRG pattern: http://www.theserverside.com/tt/articles/article.tss?l=RedirectAfterPost Another alternative is to use AJAX techniques. AJAX requests do not get stored in the browser's history, hence the back button doesn't have the usual effect... many people see this as a problem however, as in general, anything that makes the back button not simply go back to the last request Bart is very much correct in any case. If your system has to be secure and robust, don't trust client-side scripting to do something like this. It's way too susceptible to tomfoolery (wow, that may very well be the first time I've ever used that phrase!) Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 2, 2006 10:52 am, Bart Busschots wrote: I wouldn't rely on the client side for this. With FireFox and a few extensions you can have your wicked way on the client side and send anything you want to the server. Hence it's up to the server to look after security not the client. If you rely on the client alone your system will be very vulnerable to attack. The way I would do it would be to have a variable in session scope to store whether or not page two is available and then wrap all the code in page3.jsp inside a logic:if tag that will only display it if the variable in session says it's OK. Hope that's some help. Bart. Raghuveer wrote: I am able restrict the user going back to previous page from current page by browser BACK button. script language=javascript window.history.forward(1); /script How to restrict the user going to previous page by removing the Previous page accessed by user from BROWSER HISTORY(Cntrl+H in IE). I am using Struts Tiles Web application i have few modules to navigate from home page after login. HOME PAGE - Module 1 - Module 2 - Module 3 In my Module 1 i have page1.d0 page2.do page3.do. Page3.do will load page3.jsp. This Jsp page can be viewed by User only if he comes from Home-page1.do page1.do-page2.do page2.do-page3.do page3.do-Home page User After Submit Form in page3 he will navigate to HOME page with message records saved succefully. My Requirment is he cannot go to page 3 from browser BACK Button or from Browser History. So, page 3.do is accessed only if user navigates all before 2 pages. What ever i write code for this issue can be written only in Page3.jsp, Any Suggestions on this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sturts form validation
hi curently i am doing like this only?? but there any other way to call the validate mehtod of all the forms On 8/2/06, Monkeyden [EMAIL PROTECTED] wrote: If I understand you correctly If you have references to the subforms within an outter form, just call each subform's validate() method in the outter forms validate() method. Couldn't tell you how you'll get Struts to auto-populate those subforms though. MainActionForm{ validate(...){ mySubForm1.validate(...); mySubForm2.validate(...); } } On 8/2/06, Hanmay Udgiri [EMAIL PROTECTED] wrote: Hi I have a form which consists of around another 5 forms object. And each form has its own validation.How to call the validate method of the each forms?? -- Thanks and Regards Hanmayya Udgiri -- Thanks and Regards Hanmayya Udgiri
Re: two form one jsp
Hi All n Kalpesh, Here I can use seperate formBean but this may not be good practice... actually somebody suggested me to pass the form object as parameter in function while calling java script like script language=JavaScript type=text/javascript function fooBar( form){ if(form.criteria.value==' ' || form.criteria.value==null) { alert(Please provide criteria); return false;} //code to perform some function } form action= html:img page= onclick=fooBar(this.form) / This is working fine for most of the code but for one html:img onclick= / it is not able to call java script (giving some js error as form is not object) What is the problem I didnt get if it(form) is not object then why it is working for other code please suggest if this is good or I can Trustful approach Thanks Shakti Singh On 02/08/06, kalpesh modi [EMAIL PROTECTED] wrote: Is it not possible to use two seperate form beans? -Kalpesh - How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.
Re: Batch files from JSP
Thanks for that... I went over that document and a few others on Google...the batch file is still not working out. Instead of a batch file if I try and execute a perl script (.PL) located on the host from a remote computer ... Process pr= rt.exec(c:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\sheet\\batch\\db.PL); I get an error=193 error. Based on research, that error means that it cannot find the program with which to open the file. I have set the environment variables PATH to the perl bin, as well as added .PL in PATHTEXT. Any ideas what else I would need? Thanks, Akshay On 8/2/06, Thomas Joseph [EMAIL PROTECTED] wrote: May be you can google Java runtime exec I found this one good. - http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Hope this can help Thanks and Regards, Thomas Joseph Kott Software Pvt. Ltd. | Vallamattom Estate | M.G.Road | Cochin-682015 | India www.kottsoftware.com This email (including any attachments) is subject to copyright, the information in it is confidential, and it is legally privileged. Use of this email or of any information in it other than by the addressee is unauthorized and unlawful. If you are not the intended recipient of the mail, kindly intimate the author of the mail and delete the same. - Original Message - From: Akshay Ahooja To: Struts Users Mailing List Sent: Tuesday, August 01, 2006 11:35 PM Subject: Batch files from JSP Hi, This is not entirely a struts question, but how would I execute a batch from on the server from a jsp? If the .bat is in the same file as the jsp calling it. I tried Runtime rt = Runtime.getRuntime(); Process pr= rt.exec(db.bat); But it gives errors. java.io.IOException: CreateProcess: db.bat error=2 java.lang.ProcessImpl.create(Native Method) java.lang.ProcessImpl.init(ProcessImpl.java:81) java.lang.ProcessImpl.start(ProcessImpl.java:30) java.lang.ProcessBuilder.start(ProcessBuilder.java:451) java.lang.Runtime.exec(Runtime.java:591) java.lang.Runtime.exec(Runtime.java:429) java.lang.Runtime.exec(Runtime.java:326) org.apache.jsp.batch_jsp._jspService(batch_jsp.java:59) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Any help would be great, Thanks, Akshay
Re: Batch files from JSP
My advice would be to be more specific in the command you shell out with and directly call the perl executable. Something like: Process pr= rt.exec(c:\\Path_to_perl\\perl.exe c:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\sheet\\batch\\db.PL); Bart. Akshay Ahooja wrote: Thanks for that... I went over that document and a few others on Google...the batch file is still not working out. Instead of a batch file if I try and execute a perl script (.PL) located on the host from a remote computer ... Process pr= rt.exec(c:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\\sheet\\batch\\db.PL); I get an error=193 error. Based on research, that error means that it cannot find the program with which to open the file. I have set the environment variables PATH to the perl bin, as well as added .PL in PATHTEXT. Any ideas what else I would need? Thanks, Akshay On 8/2/06, Thomas Joseph [EMAIL PROTECTED] wrote: May be you can google Java runtime exec I found this one good. - http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html Hope this can help Thanks and Regards, Thomas Joseph Kott Software Pvt. Ltd. | Vallamattom Estate | M.G.Road | Cochin-682015 | India www.kottsoftware.com This email (including any attachments) is subject to copyright, the information in it is confidential, and it is legally privileged. Use of this email or of any information in it other than by the addressee is unauthorized and unlawful. If you are not the intended recipient of the mail, kindly intimate the author of the mail and delete the same. - Original Message - From: Akshay Ahooja To: Struts Users Mailing List Sent: Tuesday, August 01, 2006 11:35 PM Subject: Batch files from JSP Hi, This is not entirely a struts question, but how would I execute a batch from on the server from a jsp? If the .bat is in the same file as the jsp calling it. I tried Runtime rt = Runtime.getRuntime(); Process pr= rt.exec(db.bat); But it gives errors. java.io.IOException: CreateProcess: db.bat error=2 java.lang.ProcessImpl.create(Native Method) java.lang.ProcessImpl.init(ProcessImpl.java:81) java.lang.ProcessImpl.start(ProcessImpl.java:30) java.lang.ProcessBuilder.start(ProcessBuilder.java:451) java.lang.Runtime.exec(Runtime.java:591) java.lang.Runtime.exec(Runtime.java:429) java.lang.Runtime.exec(Runtime.java:326) org.apache.jsp.batch_jsp._jspService(batch_jsp.java:59) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service( JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Any help would be great, Thanks, Akshay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two form one jsp
http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html#ID-36113835 On 8/1/06, Monkeyden [EMAIL PROTECTED] wrote: Caroline (or Jen?) All I can say is Wow! document.getElementById() only works in IE, not FF. Your response is an arduous elaboration of my document.forms[0] and document.forms[1], which is the correct solution. On 8/1/06, Caroline Jen [EMAIL PROTECTED] wrote: 1. Each element in a document must have a unique id. This element is then accessed in script using document.getElementById(). e.g. p id=myP.../p -- document.getElementById(myP) If more than one element has the same id and you try to use that id with document.getElementById(), the method doesn't know which element you're talking about, and an error results. 2. form name=findUsers -- document.forms[findUsers] or document.findUsers form id=findUsers -- document.getElementById(findUsers) 3. Only form elements have a value attribute. Only form elements can pass a value with a form when the form is submitted. a is not a form element. Example: form name=myForm input name=myField type=text value=something input name=myOtherField type=text value=something-else input name=mySubmit type=submit value=Click to Submit /form Assuming that this is the first or only form in the page: The form can be referenced as: document.forms[0] document.getElementsByTagName(form)[0] document.forms[myForm] document.forms.myForm document.myForm document.getElementsByName(myForm)[0] All but the first two of these require that the form have a name attribute whose value is myForm. An id attribute will not work for this. Now, let's assume that we set a variable theForm equal to one of these references to the form whose name (not id) is myForm. The first input in this form can then be referenced as any of the following: theForm.elements[0] theForm.getElementsByTagName(input)[0] theForm.elements[myField] theForm.elements.myField theForm.myField theForm.getElementsByName(myField)[0] All but the first two of these require the the input have the name (not id) myField. Similarly, the second input can be accessed as any of the following: theForm.elements[1] theForm.getElementsByTagName(input)[1] theForm.elements[myOtherField] theForm.elements.myOtherField theForm.myOtherField theForm.getElementsByName(myOtherField)[0] All but the first two of these require the the input have the name (not id) myOtherField. You can give a form or form element element an id attribute and then access it using document.getElementById() as well as getElementsByTagName(). However, you cannot use the id attribute value for forms and element array references. Suppose you have this: form id=myForm !-- ...form elements... -- /form Then none of these references will work for the form: document.forms[myForm] document.forms.myForm document.myForm In each case, you'll get an error saying that the object reference is null, undefined, or isn't an object. The exact wording of the message depends on which browser you're using, but they all mean the same thing: I've no idea what you're talking about. This appears to be the root of your problem. The short version: Give name attributes to all your form and form element tags. You should do this in any case, since serverside scripts don't read id's. You needn't bother with an id attribute for a form or form element unless you want to (a) access it in a script by means of document.getElementById() or (b) you want to style it using a CSS id selector (e.g. form#myForm or #myForm). --- Li [EMAIL PROTECTED] wrote: Hi, Would it be possible if you can combine two form to one but have two object behind to accept the dat from form you submit? On 8/1/06, Krishna, Hari [EMAIL PROTECTED] wrote: pass the formbean name at run time change the logic It works for me:) -Original Message- From: Parvat Singh Ranawat [mailto:[EMAIL PROTECTED] Sent: Monday, July 31, 2006 11:32 PM To: user@struts.apache.org Subject: two form one jsp Hi all, I'm attempting to create a JSP that is made up of two forms. Each form needs a same form bean and is processed by a same action. The catch is that the one form comes from Header (This will be there for all the pages as part of left panel ) and second is coming from my jsp and problem occures while calling JAVA SCRIPT ie 1) if I use document. form[0] then this always points to the first form (which is there in Header) 2) if I use document.formName then there is ambiguity which form to call. so how to work in this situation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unlock Your Hidden Talent, Today...
Um, ya. Thanks for playing! -- James Mitchell 678.910.8017 On Aug 1, 2006, at 9:15 AM, John wrote: Is there something about yourself that you'd love to change? If you could create positive changes in yourself RIGHT NOW would you? www.HumanDataTransfer.com --- MAF Anti-Spam ID: 20060801082756H1v3CkI2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
Would you like me to add this to the nightly process? -- James Mitchell 678.910.8017 On Aug 2, 2006, at 6:38 AM, Ted Husted wrote: On 8/2/06, Don Brown [EMAIL PROTECTED] wrote: Ah, yeah, we'll have to run XWork through the retrotranslater/weaver too, as it is built with Java 5. Ted, can you make the build changes to XWork too? If you need commit access, let Pat or Jason know. For now, I just ran the J5 JARs through the translator and posted the ZIP. There isn't a build per se yet. * http://people.apache.org/builds/struts/2.0.x/nightly/ I added a translated XWork JAR to the build from yesterday. I wish I could test this myself, but I just don't have any discretionary time this week. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Has anyone had this problem? Getting 3 question marks ??? at top of HTML page using action class and rendering JSP in browser
Has anyone had this problem? Getting 3 question marks ??? at top of HTML page using action class and rendering JSP in browser Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
Feel free. Note that I included a README and the relevant license files in the S2-for-J4 distribution, which we might want to include in the nightly process. -T. On 8/2/06, James Mitchell [EMAIL PROTECTED] wrote: Would you like me to add this to the nightly process? -- James Mitchell 678.910.8017 On Aug 2, 2006, at 6:38 AM, Ted Husted wrote: On 8/2/06, Don Brown [EMAIL PROTECTED] wrote: Ah, yeah, we'll have to run XWork through the retrotranslater/weaver too, as it is built with Java 5. Ted, can you make the build changes to XWork too? If you need commit access, let Pat or Jason know. For now, I just ran the J5 JARs through the translator and posted the ZIP. There isn't a build per se yet. * http://people.apache.org/builds/struts/2.0.x/nightly/ I added a translated XWork JAR to the build from yesterday. I wish I could test this myself, but I just don't have any discretionary time this week. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- HTH, Ted. * http://www.husted.com/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Has anyone had this problem? Getting 3 question marks ??? at top of HTML page using action class and rendering JSP in browser
There's not much to go on, but check to see that all keys referenced in bean:message are defined in the appropriate message properties files. Look at message-resources in your struts-config.xml file to see what properties files are included. -ed On 8/2/06, Patterson, Marie E [CPB] [EMAIL PROTECTED] wrote: Has anyone had this problem? Getting 3 question marks ??? at top of HTML page using action class and rendering JSP in browser Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Messages and Validator
interesting question , but u will suffer low performance i think ( one database access for each message ? ) . i think if it's in a property file it's for simulate a static class . 2006/8/2, Jean-Marie Pitre [EMAIL PROTECTED]: Hello, I am using Validator framework with a Struts application. I would like to know if it is possible to use message provided by a database (or java class) rather than a propertie file ? Thank you, Jean-Marie. --- Email Disclaimer http://www.cofidis.be/emaildisclaimer.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Find out the old url after struts forwarding
Hi guys, I have this problem: I'm using websphere 4, wth JDK 1.3 and J2EE 1.2, and struts. I have set an action that after doing some coding would forward (redirect=false) to a jsp. In the browser url I correctly see the .do url. If in that page I ask for a request.getRequestURI() I get the url of the new jsp. How should I find out the old .do url as the request is still the same? Is there any way? Thanks a lot in advance!! mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5621340 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
I suppose you could get the http referer but it would have nothing to do with what you see in the browser address bar. req.getHeader(Referer); On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote: Hi guys, I have this problem: I'm using websphere 4, wth JDK 1.3 and J2EE 1.2, and struts. I have set an action that after doing some coding would forward (redirect=false) to a jsp. In the browser url I correctly see the .do url. If in that page I ask for a request.getRequestURI() I get the url of the new jsp. How should I find out the old .do url as the request is still the same? Is there any way? Thanks a lot in advance!! mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5621340 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accepting multiple date masks with the date validator
I have a requirement in my project that I be able to accept two different date masks. One with slashes (thus, 10 characters) and one without (8 digits). Is there any way to do this with the stock date validator, or do I need to roll my own wrapper? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
I suppose you could get the http referer but it would have nothing to do with what you see in the browser address bar. req.getHeader(Referer); Nope, that's not what I want. I need this as I want to make a link to reload page changing the language. So I want the url of the page I'm seeing. This could be a .jsp and that is not a problem, but in case of a .do I would like to have the .do url not the resultant .jsp url. As I'm keeping the request I don't see why I can't have the original url... mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5622597 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
mapping.getPath() On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote: I suppose you could get the http referer but it would have nothing to do with what you see in the browser address bar. req.getHeader(Referer); Nope, that's not what I want. I need this as I want to make a link to reload page changing the language. So I want the url of the page I'm seeing. This could be a .jsp and that is not a problem, but in case of a .do I would like to have the .do url not the resultant .jsp url. As I'm keeping the request I don't see why I can't have the original url... mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5622597 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
But how would I use a mapping.getPath() inside a jsp? mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote: Hi guys, I have this problem: I'm using websphere 4, wth JDK 1.3 and J2EE 1.2, and struts. I have set an action that after doing some coding would forward (redirect=false) to a jsp. In the browser url I correctly see the .do url. If in that page I ask for a request.getRequestURI() I get the url of the new jsp. How should I find out the old .do url as the request is still the same? request.getRequestURL() work for me, returning full URL including http and port number. If you need URI only, use request.getAttribute(javax.servlet.forward.request_uri) http://www.javaworld.com/javaworld/jw-03-2003/jw-0328-servlet_p.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
Pass it to the JSP from the action in the request object? action form? session? Pick your poison. request.setAttribute(URL, mapping.getPath() + ?language=swahili); On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote: But how would I use a mapping.getPath() inside a jsp? mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Messages and Validator
There's no reason a database-backed message bundle can't load all its messages in one go and cache them. That's all the standard property file-backed implementation does. To provide an alternate message bundle implementation, you just need to configure a custom factory in struts-config.xml; see the commends in the DTD for details. L. Romu wrote: interesting question , but u will suffer low performance i think ( one database access for each message ? ) . i think if it's in a property file it's for simulate a static class . 2006/8/2, Jean-Marie Pitre [EMAIL PROTECTED]: Hello, I am using Validator framework with a Struts application. I would like to know if it is possible to use message provided by a database (or java class) rather than a propertie file ? Thank you, Jean-Marie. --- Email Disclaimer http://www.cofidis.be/emaildisclaimer.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FormDef
On 7/20/06, Hubert Rabago [EMAIL PROTECTED] wrote: FormDef support nested beans, and nested collections of beans. If you had a nested Address object, your form would look like: html:text property=name/ html:text property=hireDate/ html:text property=address.zipCode/ In your example Address is nested within ActionForm, right? What if I have an object like Person having Address as its member. All properties are strongly-typed so I do not want to expose them for I/O, instead I want to have autogenerated ActionForm fields so that I could redisplay them on error. Say I do not nest Persion inside ActionForm. Can I still somehow have a string property inside my ActionForm that corresponds to Person.Address? Can this property be autogenerated? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find out the old url after struts forwarding
It's already there, as a request attribute, under the key org.apache.struts.action.mapping.instance, or more precisely, under the key named by the value of Globals.MAPPING_KEY. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! Monkeyden wrote: Pass it to the JSP from the action in the request object? action form? session? Pick your poison. request.setAttribute(URL, mapping.getPath() + ?language=swahili); On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote: But how would I use a mapping.getPath() inside a jsp? mario -- View this message in context: http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FormDef
On 8/2/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 7/20/06, Hubert Rabago [EMAIL PROTECTED] wrote: FormDef support nested beans, and nested collections of beans. If you had a nested Address object, your form would look like: html:text property=name/ html:text property=hireDate/ html:text property=address.zipCode/ In your example Address is nested within ActionForm, right? No. What happens is an ActionForm is nested within an ActionForm. ((DynaBean) form).get(address) will return another DynaBean. What if I have an object like Person having Address as its member. All properties are strongly-typed so I do not want to expose them for I/O, instead I want to have autogenerated ActionForm fields so that I could redisplay them on error. Say I do not nest Persion inside ActionForm. Can I still somehow have a string property inside my ActionForm that corresponds to Person.Address? Can this property be autogenerated? This is how FormDef works. Of course, you'll have to tell FormDef about the address form, but that's very easy: form name=addressForm beanType=my.package.Address/ form name=employeeForm beanType=my.package.Person !-- specify that our address field should use addressForm -- field property=address formName=addressForm/ /form FormUtils.getFormValues() and setFormValues() takes care of handling the nested objects, instantiating them as needed. As you can imagine, they can go multiple levels, all nesting Stringified versions of your business objects. In one of my sample apps, I have a companyForm with an addressForm and a collection of employeeForm objects, with each employee having its own addressForm nested form. Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem w.r.t javascript
Hi Velmurugan, Thanks for the link. Iam learning struts, after going through this link only iam able to modify my code. The code given in this site works fine. But the problem is in the name field modify depends=required, mask, minlength, maxlength, In address field modify depends=required, mask in email field modify depends=required, email then wht will happens is : if u enter a wrong name, address, email then the alert msg will be shown only for name address field but the alert msg will not be shown for the email field. Is it some thing like that All alert w.r.t required will be shown for the first time, THEN All msg w.r.t mask will be shown for the second time, so on? Pls have a look to my code below. Regards Rauf On 8/3/06, vel murugan [EMAIL PROTECTED] wrote: Hi, u refer the following site, http://www.roseindia.net/struts/address_struts_validator.shtml Thanks, velmurugan On 8/2/06, Rauf Khan [EMAIL PROTECTED] wrote: Hi, Iam doing client side validations. Let me explain the problem. All field are html:text using struts 1.1 case 1: Name :3456 Password : abc Email : def In case1, if i click the submit button with the respective values, iam getting alert msg enter only characters for name enter only numbers for password BUT its not displaying alert msg Please enter a valid Email address. Suppose if i enter proper values for name password field then it will display alert msg Please enter a valid Email address. As in case i all the 3 values are invalid so it should show all the 3 alert msgs in one alert. Only for name field iam checking that it should contain characters with min. length=5 max. length=6. For password field iam checking it should contain only numbers. For email field iam checking to have a proper email id. ALL field are required. messageresources.properties: - ComposeForm.OnlyNumbers =enter only numbers for password ComposeForm.OnlyChars = enter only characters for fname ComposeForm.InvalidEmail = Please enter a valid Email address. ComposeForm.fname.minlength = First Name cannot be less than {1} characters. ComposeForm.fname.maxlength = First Name cannot be greater than {2} characters. validation.xml - !-- compose form Validation-- form name=InfoForm field property=fname depends=required, mask, minlength, maxlength arg key= ComposeForm.fname position=0/ msg name=mask key=ComposeForm.OnlyChars/ var var-namemask/var-name var-value^[a-zA-Z]*$/var-value /var msg name=minlength key=ComposeForm.fname.minlength/ arg name=minlength key=${var:minlength} resource=false position=1/ var var-nameminlength/var-name var-value5/var-value /var msg name=maxlength key=ComposeForm.fname.maxlength/ arg name=maxlength key=${var:maxlength} resource=false position=2/ var var-namemaxlength/var-name var-value6/var-value /var /field field property=password depends=required, mask arg key=ComposeForm.password position=0/ msg name=mask key= ComposeForm.OnlyNumbers/ var var-namemask/var-name var-value^[0-9]*$/var-value /var /field field property=emailaddress depends=required, email arg key=ComposeForm.email position=0/ msg name=email key= ComposeForm.InvalidEmail/ /field /form Struts-config.xml -- plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml ,/WEB-INF/validation.xml/ set-property property=stopOnFirstError value=true/ /plug-in JSP -- html:form action = /some method= post onsubmit=return validateInfoForm(this); table trtdName :nbsp;/tdtd html:text property=fname //tdtd!--html:errors property=fname/--/td/tr trtd Password : nbsp; /tdtdhtml:text property=password / /tdtd/td/tr trtd Email : nbsp;/tdtdhtml:text property=emailaddress//td td/td/tr trtd colspan=3 html:submit//td/tr /table !-- Begin Validator Javascript Function-- html:javascript formName=InfoForm staticJavascript=true/ !-- End of Validator Javascript Function-- /html:form Regards Rauf Khan = On 8/1/06, Adam Gordon [EMAIL PROTECTED] wrote: Rauf- Are you doing client or server-side validation? Or both? W.R.T your multiple errors, there is an attribute you can set in your struts XML file, namely: | plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator- rules.xml ,/WEB-INF/validations.xml/ set-property property=stopOnFirstError value=true/ /plug-in| Note that you must be
Re: Struts 2 snapshot build work on JDK 1.4.2?
Hi Ted, Where can I find Xwork-j4 jar. I am not able to find it in struts2-core-j4-2.0.0-SNAPSHOT-20060801.zip. Thanks, Aparna -- View this message in context: http://www.nabble.com/Struts-2-snapshot-build-work-on-JDK-1.4.2--tf1993746.html#a5626722 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 snapshot build work on JDK 1.4.2?
Hi Ted, Where can I find xwork-j4 jar. I am not able to find it in struts2-core-j4-2.0.0-SNAPSHOT-20060801.zip. Thanks, Aparna -- View this message in context: http://www.nabble.com/Struts-2-snapshot-build-work-on-JDK-1.4.2--tf1993746.html#a5626756 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Client Side Validation
Hi All: This is what I am doing. html:form action=/addAttendeeDetails onsubmit=return validateAttendeeDetailsForm(this) . . . . . . html:javascript formName=AttendeeDetailsForm/ /html:form But the Code only does Server Side Validation. Am I missing naything pls. Thanks. Chetan Pandey -Original Message- From: Romu [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 3:28 PM To: Struts Users Mailing List Subject: Re: Client Side Validation your form shoud have been named : attendeeDetailsForm, like bean no caps for first letter . then validateAttendeeDeta onsubmit=validateAttendeeDeta ilsForm (); or validateAttendeeDeta onsubmit=validateAttendeeDeta ilsForm (this); u can see the javascript generated in the source of your jsp btw . hope it helps 2006/8/2, Chetan Pandey [EMAIL PROTECTED]: I have this: html:form action=/addAttendeeDetails onsubmit=return validateRequired(this) Where validateRequired comes from the following Javascript code in my validator-rules.xml validator name=required classname=org.apache.struts.validator.FieldChecks method=validateRequired methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest msg=errors.required javascript![CDATA[ function validateRequired(form) { } ]] /javascript /validator But no Client-side Validation is occuring -Original Message- From: Lixin Chu [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 10:35 AM To: Struts Users Mailing List Subject: Re: Client Side Validation do you have something like: onsubmit=validateAttendeeDetailsForm (this); in html:form ? and form name is not attendeeDetailsForn ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts based opensource e-Learning/Distance Learning framework
Hi, I am interested in building a e-Learning/Distance learning framework. Was wondering if there is any framework that exists that I can use as a starting point. First preference would be for a struts based application since I need to integrate it with my existing struts code. But anything in Java/J2EE would also suit my bill. And yes, if not that, I am willing to experiment with some thing like a java-php bridge if someone vouches for an excellent e-learning framework written in (say) php. Any of the struts users here have any pointers to any open source projects for education? Thanks. Regards, Raghu