RE: how to configure struts2 for /*.action?
hi, can you give some exampels for which u had to put hacks? We will test those parts explicitly. -- ravi -- View this message in context: http://www.nabble.com/how-to-configure-struts2-for--*.action--tp24481000p24510603.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to configure struts2 for /*.action?
hi, Thanks for the response. We are not serving static content. We have a JSP which is used to upload images/ files etc.(submits the form to /upload.jsp) When we give the struts mapping, this Jsp doesnt work. As said in: https://svn.apache.org/repos/asf/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/FilterDispatcher.java; i think we should map only /* in web.xml. Please correct me if i am wrong. What will happen if i do *.action? Why did the doc say /* *should* be in web.xml? Thanks in advance, ravi -- View this message in context: http://www.nabble.com/how-to-configure-struts2-for--*.action--tp24481000p24495894.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how to configure struts2 for /*.action?
hi, We have an application in jsps. Now we added new functionality using Struts 2. The jsps (not struts2 jsps) have a file upload utility ( where the multi part form posts request to /upload.jsp). Now, this upload doesnt work if we have the struts2 filter mapping in web.xml. If we remove teh mapping then the upload works but not the struts2 application. The filter dispatcher documentation tells not to try other than /* i.e.. i cant wrtie /*.do or /*.action here. Why so? any reason? or in other words if i want to get this then how do i proceed? The filter is mapped to the end of the chain as said in the documentation. The cleanup Action context filter is placed before its execution. Any clues/ ideas? Please help. regards, ravi -- View this message in context: http://www.nabble.com/how-to-configure-struts2-for--*.action--tp24481000p24481000.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: how to configure struts2 for /*.action?
i didnt get u, did u mean that we cant map only *.action to struts filter? Or u were telling of some workaround? Why does struts put this restriction that all urls should pass through him? And Why does he put restrictions at container level. see web.xml is the container level and i have my own applications/ filters in it. I should be given the choice to decide what urls should go to what and what not! Now why does struts come at this level at all??; Now that it comes what is the work around? The Filter dispatcher documentations says not to use other than '/*' for url pattern. He doesnt say what i need to do if at all i cant put /* there? Please help, this is unexpected behavior of our application. We were thinking all are fine, but suddenly this file upload didnt work (of prev jsp application). any help/ ponters are of great help. regards, ravi Wes Wannemacher wrote: 2009/7/14 谢冬鸣 msys@gmail.com: Hi david, I have another question, I want to forward my Struts2 result to one jsp page which included in one jar file, how can I locate the jsp file? You said ...there are several Struts2 jars that house css and js files..., do you have any idea how to get these files? Thanks On Tue, Jul 14, 2009 at 23:29, Kawczynski, David david_kawczyn...@merck.com wrote: I was in the same boat... One of my clients use apache httpd for all static content and tomcat for all dynamic content... there are several Struts2 jars that house css and js files. If you don't map everything to the Struts2 filter your Struts2 app won't be as full-featured as it could be. (Javascript validation won't work, any themed presentation will appear quite plain, etc...) As far as I know, the content that is served by struts directly (css, js and image files) are always mapped to URLs that start with /struts. It might be possible to create two mappings, one to /struts/* and another to *.action. As for the question above, I don't think there is any good way to serve a JSP out of a jar file. Rather than packaging your JSPs into your jar, can you configure your build to copy the JSP somewhere into your app so that it can be served traditionally? If you have to put the content into a jar, maybe try looking at freemarker. We use freemarker internally for generating tag output because we can package it in the jar files and it is more general-purpose than JSP. -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/how-to-configure-struts2-for--*.action--tp24481000p24491177.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Interceptors and Thread safety
hi, http://struts.apache.org/2.x/docs/writing-interceptors.html says that interceptors are not thread safe, i wanted a deeper understanding on this. Case: 1. Suppose i have 2 action tags each having an interceptor (I) referenced in it 2. 2 action tags with interceptors referenced *twice in each* of them If interceptors are not thread safe then how many instances of the objects are created in the above cases. My common-sense says 2 4 objects respectively. Now, I have an interceptor which takes data from the struts.xml in the form of params tags. The value of these param tags are held in the interceptor class's field variables. I have this interceptor included in my struts.xml as said in the case1 and 2 above. Now on concurrent requests do i get threading issues? Please clarify. Is it thread safe if i dont put the field variables related to the internal processing of the class? i.e.. i have field variables only related to the param tags only and nothing more. Now is the interceptor thread safe? Kindly clarify. -- View this message in context: http://www.nabble.com/Interceptors-and-Thread-safety-tp24391223p24391223.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: couldn't access s:include param using #parameters
i remember some one having the similar issue... and the fix was to use scriplets %= request.getParameter(abc) % or %= request.getAttribute(abc) % should work -- ravi -- View this message in context: http://www.nabble.com/couldn%27t-access-s%3Ainclude-param-using--parameters-tp19173169p19174776.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help required in using S:set
the issue is solved. The corresponding signature for getSubCategories(#catId) is absent. Its fixed now.. THnaks for ur time. Ravi -- View this message in context: http://www.nabble.com/help-required-in-using-%3C-S%3Aset-tp19121396p19137857.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
help required in using S:set
hi, The below i need the getSubCategories(xxx) method of action class to be called. ANy idea where i am doing wrong below here. The method is not getting called here. (2) i nee the inner loop also to get executed. Any ideas how this can happen. (1) s:iterator status=catStat id=catId value=categoriesList s:set name=subCatList scope=page value=getSubCategories(#catId) /s:set abc abc abc s:property value=subCatList.size() / (2) s:iterator status=subCat value=#subCatList subMap.put(s:property value=#subCat.getId()/,s:property value=#subCat.getUrl()/,s:property value=#subCat.getName() /); /s:iterator /s:iterator Ravi -- View this message in context: http://www.nabble.com/help-required-in-using-%3C-S%3Aset-tp19121396p19121396.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: teardown
I would like to either make each launch of the jsp create a new exclusive running instance of the action : if i got u right but this is already happening. Each url call makes a new actionclass instance. -- View this message in context: http://www.nabble.com/teardown-tp19074593p19082819.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simplified usage of:@com.company.Constants.StaticCOnstants
hi, Thanks for the reply. We had done with the old approach (@[EMAIL PROTECTED]). However i think we can write an interceprotor read the constants (through java reflections) and put them in request scope. THe page can access them from there. The problem with this is that the action class variable names shouldnt conflict with constants names. We got this idea a few days back. Though we didnt validate it i see this as a potential soln. Any how thanks once again for your help. I shall try to use it. regards, ravi ravi_eze wrote: hi, we want to access the constants in our jsp page. So we are proceeding as follows: s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] / the problem with this is that we need to repeat the @com.company.Constants always. So is there a simple way to get this working? I wanted to try out S:bean and s:Push... but no luck... i tried out this way: s:bean name=com.company.framework.Constants id=C /s:bean s:property value=#C.POKER_TOTAL_DEPOSITS / please help. cheers, ravi -- View this message in context: http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p18938195.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to fix Validation isses in a wizard application + Train
we fixed the issue by writing a trainInterceptor whcih always takes a backup of the params passed through request and if the action doesnt return errors deletes them else stores them in session. The next pages to which user jumps we are first checking if there are nay backup objects in session... if yes then restoring them from there. -- View this message in context: http://www.nabble.com/how-to-fix-Validation-isses-in-a-wizard-application-%2B-Train-tp18625361p18684405.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to fix Validation isses in a wizard application + Train
hi, The issue: 1. We have implemented a wizard application (with 4 Steps) with action variables maintained in session. 2. The pages also have train in the top, i.e. from any step he can jump to any of the other steps. 3. The Step1, 2,3,4 (mentioned above ) are interdependent i.e. based on selection in step 1 step 2 is influenced; based on selection in step 2 step 3 is influenced and so on 4. Now: In step 1 user entered wrong value (1 say) for integer field which is not allowed by validations. He clicks on save and page throws validation exceptions (Expected) 5. He then clicks on train 2 i.e. he is jumping to page 2 6. The page is being displayed based on the incorrect value (10) which was rejected by validation of first page. If i use the train again and go back to the 1st step i still see 1 there 7. Question: When validation error happens aren't the action variable values restored to the previous once?(say the prev once is 10 or 0 i think they should be reset to 10 or 0 when system throws error at 1). Is there any way in which this can happen? is there any way to call an interceptor/ execute a method after the JSP is rendered? so that i can restore variables back incase of validation errors. Please help. cheers, ravi -- View this message in context: http://www.nabble.com/how-to-fix-Validation-isses-in-a-wizard-application-%2B-Train-tp18625361p18625361.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] What slows you down?
S2 is awesome by the way it modularises the things. But to me writing a valid ognl in jsp,validation layer, using value stack and debugging it is extremely difficult. The only way i do it is re-jaring, redeploying and restarting the tomcat. Moreover most of the times i do'nt understand why things are failing? Tiles is one more thing, i am not clear when i should use getAsString and when the others. Some times some way works out. Even today in some expressions scriplets are allowed while in some thing else they are not allowed (like Map[%= %]) doesnt work. I dont see any exception saying why and what went wrong. In conversions: for example i can put data into a HashMapString but i cant do it into Dto.someObject.HashMap object... why??? When ever i get such issus i turn to struts showcase trying to hackit and get my work.. but in this case it doesnt work. Writing Freemarker: to be frank i didnt invest good amount of time for it but AFAIK theres only a freemarker site which can help you. MOreover it would be nice if we can have an visual IDE using which i will drag drop things, jsps, actions, interceptors etc (agreed that this doesnt fall into struts domain.. but its nice to have feature which can exponentially decrease the dev time :) Thats my view on this application. cheers, ravi Ted Husted wrote: Since it's friday, let me pose a question to the group ... Even with rock-solid frameworks like Apache Struts, it still seems like web application development takes longer than it should. Some frameworks, like Ruby on Rails, speak directly to time to market concerns and have been gathering many followers. But why does web application still seem so difficult or so time-consuming? Are there time bandits that still suck days or weeks out of your development schedule? Are there time gremlins that nickel-and-dime you every hour of every day? Is there anything more that frameworks like Apache Struts can do to help? Or are just there intractable problems with web development itself? Thoughts? :) -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-OT--What-slows-you-down--tp18027912p18522821.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Recipe for Action and View
hi, i didnt get you. I have a page for which i need to do some preprocessing to display it. After the page is done by user it has to be processed. Can you please elaborate on the soln given? ravi Gabriel Belingueres-2 wrote: Sorry it seems I entered the conversation later and didn't saw that email. The problem you want to solve is very common (skipping form validation the first time you call an action) and, as Dave wrote, it is commonly solved by invoking the action with the input() method [1]. This method will do nothing and will return INPUT as the result, thus forwarding the response to the page with the form. [1] http://struts.apache.org/2.1.2/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html#input() 2008/7/12 Andreas Mähler [EMAIL PROTECTED]: Hello again, Gabriel Belingueres schrieb: Without knowing what are you actually trying to accomplish with this interceptor, I would warn that when an interceptor messes up with the parameters, you need to carefully think where in the interceptor chain this interceptor will execute. I explain what I am trying to do in my first post[1]. What do you mean by messing up with the parameters? The Interceptor only checks for the presence of at least one of the specified parameters. It does not change anything. Are there any interceptors that actually change the parameter map? As I said, I am a S2 newbie and haven't heard of many things, but I would consider it as bad style. Greetings, ~Andreas [1] http://article.gmane.org/gmane.comp.jakarta.struts.user/158395 - 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] -- View this message in context: http://www.nabble.com/-S2--Recipe-for-Action-and-View-tp18381617p18438070.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with checkbox (when using disabled property)
yes it doesnt. Atleast in version 2.0.9. i heard its fixed in 2.1 version. you can write a reset interceptor also for this. i.e. always (before param interceptor) reset the checkbox field. If there is some checkbox getting submitted then you will get them, else the field would be reset by the interceptor. hth ravi Owen Berry wrote: I would have thought s:checkbox.../ would handle all of that for you, but I guess it may not be working, or doesn't aim to. 2008/7/10 Paweł Wielgus [EMAIL PROTECTED]: Hi all, just yesterday i had the very same problem in rails with date field, so i searched for disabled definition and found this: http://www.w3.org/TR/html401/interact/forms.html#successful-controls and http://www.w3.org/TR/html401/interact/forms.html#h-17.12 It looks like disabled flag will simply prevent the field from submiting. So an extra hidden field read-only should do the job. Best greetings, Paweł Wielgus. On 10/07/2008, Dave Newton [EMAIL PROTECTED] wrote: --- On Wed, 7/9/08, Owen Berry [EMAIL PROTECTED] wrote: You need to have a hidden field value that will take the place of the disabled checkbox as some browsers do not send disabled field values. The s:checkbox.../ tag already includes the hidden field; I don't know what it does for disabled checkboxes, though. The checkbox interceptor *should* work in concert with the tag to handle disabled checkboxes as well, or at least I thought it did. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/problem-with-checkbox-%28when-using-disabled-property%29-tp18367328p18438098.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
required Int validator -How to.
hi, I see that the previous valid int value is being populated when i enter null in an integer text field. I want to show error in such a case. Any ideas how to get this done. The scenario is as follows: 1. When i enter no value in F1: i get validation error asking me to fill the field 2. now i enter a valid a valid integer but some other field (F2) an incorrect value. The page caomes back as expected. 3. NOw if i remove data from F1 and give correct value in F2 i see no validation error fired up. Debugging shows that Struts is returning me the old valid value of F1(int field) 4. if i give some string/ char in int field its throwing errors as expected. any help ??? cheers, ravi -- View this message in context: http://www.nabble.com/required-Int-validator--How-to.-tp17761272p17761272.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Writing valid OGNL
hi, i often get into funny problems and am not sure how to fix them for example: %@ import=com.constants ... %=constants.static1 % !-- gives output as value1 -- s:property value=%=constants.static1% !-- gives output as value1 -- but when i use : s:textfield name=hashmap['%=constants.static1%'] !--doesnt work... -- i am totally clueless as to what is happening here!!! some times s:property value=%{...} will work... some times s:property value=%{#... or some thing} will only work... and moreover tracing the ognl evaluation is hardly possible. so if we have a tool which can help me how the ognl is being evaluated... it would save me tons and tons of time. any ideas ??? :( cheers, ravi -- View this message in context: http://www.nabble.com/Writing-valid-OGNL-tp17355855p17421934.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Hot Deployment in Tomcat?
hi, i am not sure how to fix ur problem.. but i use the following steps in remote debugging.. may b it helps u. 1. in catalina.sh :JAVA_OPTS=$JAVA_OPTS -Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n 2. in eclipse under windows preferences in dialogue box on left click on remote debugging right click new on right side give the ip of the tomcat, port as '8000' now run open debug dialogue remote application configured debug thats it. hope it helps ravi Rubens wrote: Does anyone know how to get Hot deployment to work with Tomcat? I am using Struts2, Spring, Hibernate, and MySQL Tomcat Version: 6.0.16 Java version: JDK 1.6.0_06 Eclipse version: 3.4.0 Tomcat Sysdeo Plugin version: 3.2.1 Struts version: 2.0.11.1 Spring Framework version: 2.5.1 Hibernate version: 3.2.6.ga MySQL JDBC driver: 5.1.5 C3P0 connection pool: 0.9.1.2 I started tomcat outside eclipse using a remote JPDA debugging connection (catalina jpda start). And I started tomcat from within Eclipse using the SYSDEO tomcat pluggin. In both instances, I get the following message right after I change a line of code and save it when debug stepping. I have also tried to use JDK 1.5 and had the same error. Obsolete Methods on the Stack Reason: The virtual machine was unable to remove all the stack frames running old code from the call stack. The virtual machine is not supplying the debugger with valid data for those frames... I see the following exception on the logs when the above error is displayed: May 18, 2008 10:55:30 AM org.apache.catalina.core.StandardContext reload INFO: Reloading this Context has started May 18, 2008 10:55:30 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated May 18, 2008 10:55:31 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated May 18, 2008 10:55:32 AM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated May 18, 2008 10:55:32 AM org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext May 18, 2008 10:55:32 AM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.mysql.jdbc.profiler.ProfileEventSink. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1246) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4235) at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1453) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989) at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174) Exception in thread Resource Destroyer in BasicResourcePool.close() java.lang.NoClassDefFoundError: com/mysql/jdbc/profiler/ProfileEventSink at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4235) at com.mysql.jdbc.ConnectionImpl.close(ConnectionImpl.java:1453) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549) at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java:470) at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964) at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:989) at com.mchange.v2.resourcepool.BasicResourcePool.access$100(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:1174) Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.profiler.ProfileEventSink at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360) at
RE: Struts[2] : Checkboxlist Problems
hi, i solved this problem the following way: 1. created a custom reset interceptor to set the action class field of checkbox. 2. placed the interceptor just after the scope interceptor (in ur struts.xml) when u deselect all the checkboxes then the HTML doesnt submit any values to the action class and hence the class doesnt update the field value. So, here we always reset the respective field so the field is updated only iff some checkbox values are sent by the HTML. hope this helps. cheers, ravi Hoying, Ken-2 wrote: I did not have any errors. I am not sure exactly what I was doing that caused this not to work, but I reorganized my code in the action class and was able to make things work. -Original Message- From: Greg Lindholm [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 20, 2008 2:37 PM To: user@struts.apache.org Subject: Re: Struts[2] : Checkboxlist Problems Are you getting any errors? There is a bug in the CheckboxInterceptor where it does not properly handling arrays of checkboxes when none are selected. It might be related, but this issue did causes error messages. I submitted a patch for this issue WW-2339. https://issues.apache.org/struts/browse/WW-2339 Hoying, Ken-2 wrote: I have a list of search filters that I am displaying on the page where each is a checkboxlist. I am implementing this as such: s:iterator value=searchCriteria.filters status=filterStatus s:checkboxlist name=searchCriteria.filterMap['%{fieldName}'].selectedFilters value=%{selectedFilters} list=filterItems listKey=value listValue=label/ /s:iterator Everything works great except for one small problem. I do not seem to be able to deselect all of the values for a filter. For example, if one of my filters is Status and the check box values are Active and Inactive then: - I can select both Active and Inactive. - I can leave both Active and Inactive deselected. - I can default to have Active selected and then deslect it and then select Inactive. - I CANNOT default to have Active selected and then deselect it. It appears that if a checkbox was originally set you can change the value as long as you change it to some other value. However if I do not set the field to any value at all, then it keeps the previous or default value. I am not sure what is occurring here. Does anyone have any ideas on how I can overcome this? Thank you! Ken -- View this message in context: http://www.nabble.com/Struts-2--%3A--Checkboxlist-Problems-tp17339322p17 347543.html Sent from the Struts - User mailing list archive 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] -- View this message in context: http://www.nabble.com/Struts-2--%3A--Checkboxlist-Problems-tp17339322p17355805.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Writing valid OGNL
hi, is there some standalone application/ some way by which i can validate the ognl i write? instead of writing them in validation file, compiling deploying and then discovering there some problem (we only see some non descriptive error) cheers, ravi -- View this message in context: http://www.nabble.com/Writing-valid-OGNL-tp17355855p17355855.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts 2] Pass value between two action classes
quite possible. for this u need to define the object fruit in session scope. and in 1st page say: vitamins, color can be filled. In 2nd page say: weight, age can be filled and all the time the same object fruit in the session would be filled. http://struts.apache.org/2.x/docs/scope-interceptor.html hope this helps. ravi -- View this message in context: http://www.nabble.com/-Struts-2--Pass-value-between-two-action-classes-tp17234969p17246034.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting HTML form parameters to Custom classes (not action support)
hi, we have multiple classes (C1,C2,C3) each as java beans. now i have a form as: s:form... s:textfield name=a.field1 ../ s:textfield name=b.field1 ../ s:textfield name=c.field1 ../ is it possible for me to populate the individual classes? The problem is that we need to build a framework in struts2 and it requires the above to happen. After googling a lot... i found that that the current ActionSupport class is kept in ognl value stack which is later filled. If this is true then can we push the C1's object as a, C2's object as b etc into value stack??? Also, ModelInterceptor... would also push the object to the value stack. But my problem is that i need all the 3 objects into the stack... please correct me if i am wrong... any help would be great... cheers, ravi -- View this message in context: http://www.nabble.com/Setting-HTML-form-parameters-to-Custom-classes-%28not-action-support%29-tp17201248p17201248.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HashMap String, ArrayListString : Unable to populate the Array List from JSP
Team, any help??? now i configured the validation, workflow interceptors in my xml file. I see an error for this field variable. I tried configuring the converter... but as always its also failing... actionclass-conversion.properties: mapOfList=com.company.CustomMapConverter Element_mapOfList=java.util.ArrayList Key_mapOfList=java.lang.string I see a weird behavior: only the convertToString() function being called... had any body fixed such issues??? please help cheers, ravi -- View this message in context: http://www.nabble.com/HashMap%3C-String%2C-ArrayList%3CString%3E-%3E%3A-Unable-to-populate-the-Array-List-from-JSP-tp16975469p17201293.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HashMap String, ArrayListString : Unable to populate the Array List from JSP
hi, Thanks for he help. i am using as follows: s:checkboxlist name=mapOfList['key'] / I see that this is not working and the mapOfList is not getting populated at all. I tried out StrutsTypeConverter... then only convertToString() method is being called. Any ideas as how to go with this issue??? sorry for the wrong example prev. regards, ravi -- View this message in context: http://www.nabble.com/HashMap%3C-String%2C-ArrayList%3CString%3E-%3E%3A-Unable-to-populate-the-Array-List-from-JSP-tp16975469p17129314.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simplified usage of:@com.company.Constants.StaticCOnstants
hi, even this doesnt seem to be working. is it possible to load the constant class to the context and then display it form there.? or in that case it expects a setters and getters... or some way of getting this done.. the code is very bad to read 'cos every time i am using @com.company any help??? cheers, ravi Wes Wannemacher wrote: Did you try to import your Constants class? %@ page import=com.company.Constants % s:property value=@[EMAIL PROTECTED] / As far as say C.staticconstant1, all I can really say is that the @ symbol is how you access static vars/methods in OGNL. Another choice might be to use regular ol' EL expressions. -Wes On Tue, 2008-04-29 at 21:45 -0700, ravi_eze wrote: hi, Does the following work - s:set name=C value=@[EMAIL PROTECTED] / s:property value=#C / Yes it does. But my requirement is more like i would import the class into some bean/ variable (C) so that i can say C.staticconstant1 etc... but by the approach mentioned above, i should repeat the @com.company.Constant string always which reduces the readability. Hope this adds some clarity. Something similar to import and then say Constant Also, is com.company.Constants.STATIC_CONSTANTS1 a String? Yes its a string. i would be greatful to any further help. cheers, ravi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16993179.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simplified usage of:@com.company.Constants.StaticCOnstants
hi, Does the following work - s:set name=C value=@[EMAIL PROTECTED] / s:property value=#C / Yes it does. But my requirement is more like i would import the class into some bean/ variable (C) so that i can say C.staticconstant1 etc... but by the approach mentioned above, i should repeat the @com.company.Constant string always which reduces the readability. Hope this adds some clarity. Something similar to import and then say Constant Also, is com.company.Constants.STATIC_CONSTANTS1 a String? Yes its a string. i would be greatful to any further help. cheers, ravi -- View this message in context: http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16975464.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HashMap String, ArrayListString : Unable to populate the Array List from JSP
hi, When we had the data structure as: HashMapString,String the following jsp fragment was able to populate it: s:textfield name=map['key'] / but the same thing is not working with HashMapString, ArrayListStirng when we tried: s:textfield name=mapOfList['key']. We also tried instantiating the object in the action class constructor: mapOfList = new HashMap... (); mapOfList.put(key, new ArrayList()); still no luck Using POJOs instead of hashmap would not fit to my requirements. any help ??? cheers, ravi -- View this message in context: http://www.nabble.com/HashMap%3C-String%2C-ArrayList%3CString%3E-%3E%3A-Unable-to-populate-the-Array-List-from-JSP-tp16975469p16975469.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Simplified usage of:@com.company.Constants.StaticCOnstants
hi, we want to access the constants in our jsp page. So we are proceeding as follows: s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] / the problem with this is that we need to repeat the @com.company.Constants always. So is there a simple way to get this working? I wanted to try out S:bean and s:Push... but no luck... please help. cheers, ravi -- View this message in context: http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16941171.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simplified usage of:@com.company.Constants.StaticCOnstants
hi, i tried this way: s:set name=C value=@com.company.Constants / s:property value=[EMAIL PROTECTED] / but its not working nor it throws an exception if its wrong way of doing. any help? cheers, ravi Wes Wannemacher wrote: http://struts.apache.org/2.x/docs/set.html On Mon, 2008-04-28 at 08:17 -0700, ravi_eze wrote: hi, we want to access the constants in our jsp page. So we are proceeding as follows: s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] / the problem with this is that we need to repeat the @com.company.Constants always. So is there a simple way to get this working? I wanted to try out S:bean and s:Push... but no luck... please help. cheers, ravi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16952906.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation
hey! you can use theme=simple. This would generate the tags as a simple text box etc with out any trs and tds around. positioning the errors: s:fielderror s:paramfieldname/s:param /s:fielderror would display the erriors related to fieldname only. I think u can do the similar way with action errors and actino messages. Give a try ;) Hope I answered your question. cheers, ravi Rodrigo Pereira wrote: Hi, the problem is that I have a lot of fields and I'd like to position 2 fields in a row, but xhrml theme is not letting me do that. Also, some of the fields are poputated by an action based on the value of one of the fields in the form (using xhtml triggers form's action vs link's). I was wondering if there is another option. Thanks, Rodrigo Pereira - Original Message - From: Nuwan Chandrasoma [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Saturday, March 29, 2008 6:12 PM Subject: Re: Validation Hi, Simple theme doesn't support Validation and error reporting. you may have to use some other theme like xhtml theme http://struts.apache.org/2.x/docs/xhtml-theme.html Thanks, Nuwan Rodrigo Pereira wrote: Hi, how can I position validation message on the screen? Also, when I have a simple theme form I am getting JS error alert message [object Error], does anybody know how to fix that? form: s:form id=testForm action=save method=post validate=true table tr td align=rights:text name=label.email/ class=required*:/td tds:textfield name=user.email value=%{user.email} size=30 theme=simple//td /tr /table /s:form validation.xml: validators field name=user.email field-validator type=required message key=errors.email.required/ /field-validator field-validator type=email message key=errors.email.notValid / /field-validator /field /validators Thanks, Rodrigo Pereira - 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] -- View this message in context: http://www.nabble.com/Validation-tp16373207p16396501.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Actions for a single page. Is this possible
hi, We have a form in c.jsp which by some event makes an ajax call fetching b.jsp, a.jsp and rendering it. Now the requirement is that (1) i want to get this b.jsp by calling some other action class. (2) Once its rendered and i submit the page c.jsp the consecutive action class should be able to get all the entries made even in the b.jsp a.jsp (obtained by ajax call) i am not sure how action chanining/ s:action can help me. any hlep / pointers? regards, ravi -- View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16078474.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: selective validation using validation.xml
akash agrawal-2 wrote: Hi, Is this possible to do selective validation using validation.xml? What I meant by this is that calling a different set of validation on each(different) invocation of same action and same method. Quite possible: in that case u would write valildation as: ActionClass - action name mentioned in struts.xml-validation.xml. Example: I call UpdateAction and update method and use UpdateAction-validation.xml and want to validate different set of validation of invocation based on my application requirement. 1. Put validation for field A and B in xml file 2. validate field A but not field B on one invocation. 3. validate field B but not field A on other involcation. possible: in fact you can write custom interceptors which finally fill up action errors and field errors to their end. Include this btw validation interceptor and workflow interceptor in your xml file. Thanks, -Akash - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -- View this message in context: http://www.nabble.com/selective-validation-using-validation.xml-tp15903866p16044494.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple Actions for a single page. Is this possible
hi, We have two pages a.jsp and b.jsp developed with the action class mehods Ac.a() Ac.b() that render these pages. Now we need to develop a new page c.jsp which is combination of both a b.jsps. i can include the jsps into the c.jsp. But what abt the action class behind? can they not get automatically invoked and the pages get populated? More over i have some logic to be performed based on the inputs made in the two sections of c.jsp. Is it possible for me to only do this part as a layer? any ideas as how to go abt this? pl help. regards, ravi -- View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16044652.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2- DateTimePicker is not working. Display Format: dd-MMM-yy HH:m:ss
hi, I need to display the date as 21-jan-08 20:20:20 and when user changes it, the corresponding value should get populated in the Action class. I see that the date object is being displayed in the format specified but when getting converted back into the action class its throwing error. The Object that holds the date object is held in session. I proceeded as follows. I gave the following in the tag: s:datetimepicker name=currentEvent.criterion.startDate adjustWeeks=true toggleDuration=200 toggleType=fade displayFormat=dd-MMM-yy HH:m:ss id=startDateId theme=simple / uThe log file is showing: /u 2008-03-07 00:24:40,204 ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:204) - ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'currentEvent.criterion.endDate' on 'class com.admin.EdsWizardAction: Error setting expression 'currentEvent.criterion.endDate' with value '[Ljava.lang.String;@1b7f9f7' When i tried debugging the source code i found that S2 is trying out parsing with DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.SHORT and finally with default. any ideas? regards, ravi -- View this message in context: http://www.nabble.com/S2--DateTimePicker-is-not-working.-Display-Format%3A-dd-MMM-yy-HH%3Am%3Ass-tp15891129p15891129.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Field errors are firing twice twice
hi, When i submit the form i see the field errors coming twice beside the text box. The code is as follows: in JSP: tds:textfield name=currentEvent.criterion.name theme=simple label=Event Name //td tds:fielderror name=currentEvent.criterion.name //td in web.xml: web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 display-nameAdmin Tool/display-name filter filter-nameUTF8Filter/filter-name filter-classadmin.util.UTF8Filter/filter-class /filter filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter listener listener-classorg.apache.tiles.web.startup.TilesListener/listener-class /listener jsp-config taglib taglib-urihttp://displaytag.sourceforge.net//taglib-uri taglib-location/WEB-INF/displaytag.tld/taglib-location /taglib /jsp-config taglib taglib-uri/WEB-INF/jstl-core.tld/taglib-uri taglib-location/WEB-INF/jstl-core.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/taglib-location /taglib filter-mapping filter-nameUTF8Filter/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping servlet servlet-namedwr/servlet-name servlet-classuk.ltd.getahead.dwr.DWRServlet/servlet-class init-param param-namedebug/param-name param-valuetrue/param-value /init-param /servlet servlet servlet-nametiles/servlet-name servlet-classorg.apache.tiles.web.startup.TilesServlet/servlet-class init-param param-name org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG /param-name param-value /WEB-INF/tiles-defs.xml /param-value /init-param load-on-startup2/load-on-startup /servlet servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/promotions-struts-config.xml,/WEB-INF/magichand-struts-config.xml,/WEB-INF/struts-config.xml/param-value /init-param load-on-startup2/load-on-startup /servlet servlet servlet-nameServerStatsCollector/servlet-name servlet-classcom.partypoker.site.admin.ServerStatsCollector/servlet-class init-param !-- SERVER STATISTICS COLLECTION FREQUENCY IN SECONDS. DEFAULT VALUE IS 300 SECONDS (5 MINUTES). -- param-nameSERVER_STATISTICS_COLLECTION_FREQUENCY/param-name param-value240/param-value /init-param init-param !-- IF TRUE THE SERVER STATISTICS COLLECTIOR GENERATES SOPS THAT HELP DEBUGGING IN CASE OF ANY PROBLEM. DEFAULT VALUE IS FALSE. -- param-nameDEBUG/param-name param-valueflase/param-value /init-param load-on-startup1/load-on-startup /servlet servlet servlet-namejsp/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueWARNING/param-value /init-param init-param param-namefork/param-name param-valuefalse/param-value /init-param load-on-startup3/load-on-startup /servlet servlet
Re: Need help in Action class Design
can u post the code? cple of qns before that. Is the variable that holds the search list in session scope? try .. it could help. ravi Venkat Guru wrote: Hi, This is Venkat. Iam new to struts2 framework. Iam struck up with a small problem using s:select tag. I have a page which contains a select tag . on page load i will populate its list values from server. Its a search form. when i perform the search the results are displayed in the same page. In the action class, iam using the String member to get the selected value. but after displaying the results in the same page, iam unable to get s:select tag list data how can i maintain the s:select list data, plz help me ASAP, Thanks in Advance, Venkat -- View this message in context: http://www.nabble.com/Need-help-in-Action-class-Design-tp15803822p15806361.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem in populating Maps
hi, I am trying to populate a LinkedHashMap located in a DTO from a s:textfield.. / When i turn on the debug mode i seed the following error on the console: ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:199) - Developer Notification (set struts.devMode to false to disable this message): Error setting expression 'currentEvent.excludeRulesValues['dd']' with value '[Ljava.lang.String;@1f09665' 424209 [http-8080-Processor24] ERROR com.opensymphony.xwork2.interceptor.ParametersInterceptor - Developer Notification (set struts.devMode to false to disable this message): I am using the following syntax in the jsp: td Ignore people who have been given = s:textfield name=current.rules['dd'] / offers previously from EDS /td The action class is having current defined as a Dto with getters and setters, and rules is the LinkedHashMap defined in the DTO with getters and setters. The constructor of the Action class instantiates the 'current' variable and constructor of Dto instantiates the 'rules' variable of DTO. and in the textbox generated i entered dd as the input text. Any ideas why this is not working??? regards, ravi -- View this message in context: http://www.nabble.com/problem-in-populating-Maps-tp15613167p15613167.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts2 getting current page
http://www.nabble.com/Struts2%3A-Ajax-call-throws-an-exception---%3E-catch--td15613070.htmlcheck this: Srinivas Surapaneni wrote: I want to define a global exception handler where if this exception happens, it goes to the current page Is there any way to get the current page and specify it as the result ? Thanks -- View this message in context: http://www.nabble.com/struts2-getting-current-page-tp15519117p15613187.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2: Ajax call throws an exception -- catch?
The following captures the stack trace that the server throws: package name=... namespace=/... extends=struts-default global-results result name=Throwable/path/error.jsp/result /global-results global-exception-mappings exception-mapping exception=java.lang.Throwable result=Throwable / /global-exception-mappings action... hope this helps... ravi Otto, Frank wrote: hi, I use ajax (yui) with struts2. My method throws an exception, if there is something wrong. How is the best way to catch the exception? kind regards, Frank -- View this message in context: http://www.nabble.com/Struts2%3A-Ajax-call-throws-an-exception---%3E-catch--tp15613070p15613181.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: strut2 Ajax/dojo: rrrrrr what's wrong with my settings? cant get the theme=ajax to wrork (pictures included)
hi, if dojo is not defined: then probably the following should help: 1. define a folder struts in ur project (under webinf) 2. copy ajax, dojo, nifty corners, simple, xhtml, CommonFunctions.js, inputtransferselect.js, optiontransferselect.js, tabs.css, tree.css, validationClient.js. Search for these in the exploded struts core.jar file. 3. start the webapps i also had the problem and when i did this it got resolved. HIH cheers, ravi xianwinwin wrote: WHAT am I possibly doing wrong here? I want to get this result: (attention on the tabs example) http://www.nabble.com/file/p15600219/good.jpeg but I get this result: http://www.nabble.com/file/p15600219/wrong.bmp the code is: %@ include file=/pages/layouts/taglibs.jsp % html h2 class=menu id=titleWelcome s:property value=%{#session.USER_SESSSION_HANDLE.fname}/; last login s:property value=%{#session.security_user_last_logged_in}//h2 %@ include file=tabMenu.jsp %body class=section-3 head titleAjax examples - tabbled panel/title s:head theme=ajax/ link rel=stylesheet type=text/css href=s:url value=/struts/tabs.css/ body s:tabbedPanel id=test2 theme=simple cssStyle=width: 500px; height: 300px; doLayout=true closeButton=pane labelposition=bottom s:div id=left label=test1 theme=ajax I'm a Tab!!! /s:div s:div id=middle label=test2 theme=ajax I'm the other Tab!!! /s:div /s:tabbedPanel /body /html -- View this message in context: http://www.nabble.com/strut2---Ajax-dojo%3A-rr-what%27s-wrong-with-my-settings--cant-get-the-theme%3Dajax-to-wrork-%28pictures-included%29-tp15600219p15613177.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [eclipse] is it possible to debug jsp in eclipse ?
yes! its possible... but of very very less use.. 'cos u cannot see the context variables and the varibles in the expressions... the control just stops there at the break point.. the best way is to download the eclipse Europa version: this has all web, javascript etc... componetns already installed. if its remote tomcat application then: you need to configure the java application @ window preferences java application/ remote java application .. give respective debug port over which the tomcat would listen,.,.. in catelina.bat give the following entries:JAVA_OPTS=$JAVA_OPTS -Xmx512m -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n .. best to the end of the file (So the debug port would be 8000 in this case) hope this helps.. if not let me know.. shall help u out.. cheers, ravi miro wrote: Is there any free jsp debugger plugin for eclipse ? miro - Never miss a thing. Make Yahoo your homepage. -- View this message in context: http://www.nabble.com/-eclipse--is-it-possible-to-debug-jsp-in-eclipse---tp15618926p15627666.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2 NESTED iterators FLAT HashMaps:
hi, The answers were a real help. I could get the things to things working... now when i use: fruits Val :${fruitsId.value} this displays: fruits Val :[apple, banana, orange] but when i use: ${fruitsId.value.size()} its giving compile time errors:tAttributes.jsp(98,16) The function size must be used with a prefix when a default namespace is not specified. I need to get 3 so how should i form the expression? i basically need to use this in td colspan={...} ... is there any alternative ways of handling this? any ideas pl: help ravi Laurie Harper wrote: fruits KEY s:property value=#fruitsId.key / Gets the key from the map entry and displays it; OK here. fruits Val s:text name=%{fruitsStat.value} / Gets the 'value' property of the iterator status object and uses that as a lookup key in the application's message resources. Umm... First, I'm not sure if the iterator status object has a value property, but wouldn't you want the value from the map entry? And second, do you have the message properties set up? That should probably be fruits Val s:text name=%{fruitsId.value} / and, for sanity checing (in case your message resources aren't set up correctly) you should start with just fruits Val s:property value=%{fruitsId.value} / L. Ravichandra C wrote: Hi, I am trying this way: s:iterator id=fruitsId status=fruitsStat value=fruitscolourandInfo fruits KEY s:property value=#fruitsId.key / colour/ fruits Val s:text name=%{fruitsStat.value} / colour/ s:iterator id=colourId status=colourStatus value=fruitsId.value colour s:text name=%{top.value} / colour/ /s:iterator /s:iterator The issue is that: Fruits key: is being displayed fine Fruits Val: nothing is being dislayed; infact when I tried similarly with fruits KEY even that is not being displayed. Any ideas how to get this working.. (in fact I need to get the results in textboxes next) Any help? Ravi -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Monday, February 18, 2008 10:09 PM To: Struts Users Mailing List Subject: Re: S2 NESTED iterators FLAT HashMaps: When you use the iterator tag, the value of the id tag becomes the reference to the current object on that iteration(same as top on this case). When iterating over a map, the object is a Map.Entry, so you need to access the key and value properties, like s:iterator id=superMap value=myMap Key: s:property value=superMap.key / same as s:property value=key / Value: s:property value=superMap.value /same as s:property value=value / /s:iterator is not a direct answer to your question, but I think your problem is around that. //you can always do %{superMap[top.key]} to access the value, it is just harder to read regards musachy On Feb 18, 2008 11:21 AM, ravi_eze [EMAIL PROTECTED] wrote: hi, i have 4 hashmaps as follows: (1). HashMapString, HashSetString treesFruitsMap = new HashMap(); (2). HashMapString, HashSetString fruitsColourMap = new HashMap(); (3). HashMapString, String colourVitaminMap = new HashMap(); i.e. (1) has the mapping btw tree names and the fruits it bears (as a set of strings) (2) has the mapping btw fruit name and the possible colours it can come out in (3) mapping btw fruit and the vitamins it has in it. I need to display the output as follows: Fruit1 - Colour1 - Vitamin1 Fruit1 - Colour1 - Vitamin2 Fruit1 - Colour2 - corresponding vitamins ... any idea how to go with this? I tried as follows but its not working.. s:iterator id=frId status=frStat value=frColourMap.keySet() s:iterator id=coId status=coStatus value=top FE s:text name=%{top} / br/ BR s:text name=%{coStatus[top]} / br/ /s:iterator /s:iterator this is giving only the fruits names but not the colours... pl: help. -- View this message in context: http://www.nabble.com/S2-NESTED-iterators---FLAT-HashMaps%3A-tp15546918p 15546918.html Sent from the Struts - User mailing list archive 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] -- View this message in context: http://www.nabble.com/S2-NESTED-iterators---FLAT-HashMaps%3A-tp15546918p15561558.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 NESTED iterators FLAT HashMaps:
hi, i have 4 hashmaps as follows: (1). HashMapString, HashSetString treesFruitsMap = new HashMap(); (2). HashMapString, HashSetString fruitsColourMap = new HashMap(); (3). HashMapString, String colourVitaminMap = new HashMap(); i.e. (1) has the mapping btw tree names and the fruits it bears (as a set of strings) (2) has the mapping btw fruit name and the possible colours it can come out in (3) mapping btw fruit and the vitamins it has in it. I need to display the output as follows: Fruit1 - Colour1 - Vitamin1 Fruit1 - Colour1 - Vitamin2 Fruit1 - Colour2 - corresponding vitamins ... any idea how to go with this? I tried as follows but its not working.. s:iterator id=frId status=frStat value=frColourMap.keySet() s:iterator id=coId status=coStatus value=top FE s:text name=%{top} / br/ BR s:text name=%{coStatus[top]} / br/ /s:iterator /s:iterator this is giving only the fruits names but not the colours... pl: help. -- View this message in context: http://www.nabble.com/S2-NESTED-iterators---FLAT-HashMaps%3A-tp15546918p15546918.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: YUI and S2 : problem in rendering date component
hi, My implementation is as follows: I have a page that displays a datetimepicker provided by struts2(2.0.9). When i tried to put the same into the YUI tabbed panel the timepicker componetn is not being displayed. The following is the code in the YUI: script type=text/javascript (function() { var tabView = new YAHOO.widget.TabView(); tabView.addTab( new YAHOO.widget.Tab({ label: 'page 1', dataSrc: 'tiles:getAsString name=wizardUrl /', cacheData: true, active: true })); } )(); tiles:getAsString name=wizardUrl /: gets the URL that should be rendered. This page contains: head s:head theme=ajax / /head body s:datetimepicker name=... / /body any ideas? ravi ravi_eze wrote: hi, i am using YUI tabs to display the form which contains a datetimepicker. But the component is not being rendered. I amusing tiles to hold the tabs component and doing tiles insert the URL which makes a new call to the servr and get the page to be displayed under it. When i display the page by calling the URL without the tabs component the datetimepicker is coming fine. It seems like, some onload function of javascript is being called which renders the datetimepicker after the form/ page is completely loaded. In this case as the URL is being called by ajax this onload is not heppening. Can anybody help me how to complete this? Struts also provides tabcomponent, but YUI has additional flexibility of skinning, dynamic tab adding, nonching etc which are very difficult with S2. please help. ravi -- View this message in context: http://www.nabble.com/YUI-and-S2-%3A-problem-in-rendering-date-component-tp15426105p15453324.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
YUI and S2 : problem in rendering date component
hi, i am using YUI tabs to display the form which contains a datetimepicker. But the component is not being rendered. I amusing tiles to hold the tabs component and doing tiles insert the URL which makes a new call to the servr and get the page to be displayed under it. When i display the page by calling the URL without the tabs component the datetimepicker is coming fine. It seems like, some onload function of javascript is being called which renders the datetimepicker after the form/ page is completely loaded. In this case as the URL is being called by ajax this onload is not heppening. Can anybody help me how to complete this? Struts also provides tabcomponent, but YUI has additional flexibility of skinning, dynamic tab adding, nonching etc which are very difficult with S2. please help. ravi -- View this message in context: http://www.nabble.com/YUI-and-S2-%3A-problem-in-rendering-date-component-tp15426105p15426105.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 insertnig key and pojo(as its value) into a map
hi, i have a form which holds a textfield (name:username). I need to wrap this username into an object user and insert it into a map as the value object for the key 'field0'. Action class: User user; //with setters and getters. MapString, User map = new LinkedHashMap .., .. ();//with setters and getters MapString, String mapString = new LinkedHashMap .., .. ();//with setters and getters JSP: s:textfield name=map['field0'].name / !--Throwing errors: parameter chunk is ignored etc-- s:textfield name=mapString['field0'] / !-- Filling the object map as: [field0, nameEnteredInTextbox ] -- How do i get the map filled as : [field0,UserObjectHoldingusername ]... Any ideas as how to get this working? cheers, ravi -- View this message in context: http://www.nabble.com/S2-insertnig-key-and-pojo%28as-its-value%29-into-a-map-tp15426127p15426127.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0.11 + DWR 2.0 + ajax validation
yaa, in struts shwocase check the web.xml and dwr.xml. wou would require dwrxxx.jar for this in web-inf/lib and struts theme=ajax in the jsps. hope this helps. Filipe David Manana-2 wrote: Hi, Has anyone been able to put dwr 2.0 working with struts 2.0.11 ajax validation? -- Filipe David Manana, [EMAIL PROTECTED] Obvious facts are like secrets to those not trained to see them. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts-2.0.11-%2B-DWR-2.0-%2B-ajax-validation-tp15287347p15291439.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dojo script for DATEPICKER tag
hi, if i am uderstanding u right then this should solve ur problem. action class: Date inpDate = new Date(); jsp page: s:datetimepicker name=inpDate ... / so for the fist time when the page is being displayed the inpDate is set ot the current date which will solve ur problem hope this helps. cheers, ravi Naveen Kumar M wrote: THANKS Wannemacher FOR YOUR REPLY. My question is, I want to change the values being assigned the startDate and endDate parameters for the tag. So for example page using my datepicker is loaded in to browser today, than startDate should be todays systems date, for the same in next coming day the startDate should be that day's system date(server date) I hope i have posted my question more clearly. Expecting some response on the issue. Regards, Minchu Wes Wannemacher [EMAIL PROTECTED] wrote: Have you tried the startDate and endDate parameters for the tag and received an error? http://struts.apache.org/2.x/docs/datetimepicker.html -Wes On Thu, 2008-01-31 at 05:24 +, Naveen Kumar M wrote: Hi, We have a reqierment to control startdate and enddate of the datepicker dynamically, so i have tried out for controlling it by a dojo script, which is breaking up the appearance of datepicker. So can any one suggest how to control it dyanimcally. thanks in advance regards, minchu - Unlimited freedom, unlimited storage. Get it now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. -- View this message in context: http://www.nabble.com/dojo-script-for-DATEPICKER-tag-tp15198436p15203522.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type converters: please help!!! :(
any help? had any one encountered a similar situation. i am pasting thelink straight to the problem so that u need not navigate throught the discussion threads to locate it. http://www.nabble.com/Type-converters%3A-convertToString-not-called-to15034925.html any help would be great. regards, ravi ravi_eze wrote: hi, The code is as follows. Do not get terrified by the length of the post. I tried formatting the post for better readability. Hope this helps you... to help me ;) @new.xml, this is included in struts.xml struts package name=newsCreation namespace=/new extends=struts-default action name=configurenew class=com.comp.admin.news.newConfigurationAction method=viewnew interceptor-ref name=scope param name=session newData,disableFields /param /interceptor-ref interceptor-ref name=conversionError / interceptor-ref name=params / result/new/layout/newConfiguration_layout.jsp/result result name=input /new/layout/new_layout.jsp /result /action @com\comp\admin\news\newConfigurationAction-conversion.properties newData.maxLimit=com.comp.util.converter.newLongConverter ... @com.comp.util.converter.newLongConverter public class newLongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { if (null == values || values.length == 0 || values[0]==null || values[0].trim().length()==0 ) return 0; try { int i = Integer.parseInt(values[0]); return i; } catch (Exception ex) {} return 0; } public String convertToString(Map context, Object obj) { if (null == obj) return 0; if(obj instanceof Long) return ((Long)obj).longValue()+; return ; } } mgainty wrote: Hi Ravi- Could you display your code for your StrutsTypeConverter class please M- - Original Message - From: ravi_eze [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, January 25, 2008 12:58 AM Subject: RE: Type converters: please help!!! :( Thank you Jeff for the reply. did u mean the *converter* attribute of the action tag that we give in struts.xml? I didnt give any such attribute in it. I added ActionClass-conversion.properties: in which i mentioned the attribute to pickup a class which implements convertFromString and viceversa functions. My action tag in the xml are as follows: struts package name=eventsCreation namespace=/event extends=struts-default interceptors interceptor name=... class=... / interceptor name=... class=... / /interceptors action name=oneAct class=oneClass interceptor-ref name=... ... /interceptor-ref resultone.jsp/result /action ... let me know if you are looking for anything else. cheers, ravi Jeff Hill (RR) wrote: Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some
Re: Type converters: convertToString not called
hi, thanks for the reply. If the design had this behavior intended then probably we cannot do any thing but in that case i would not agree with the design. I read the post linked below and also the bug... but still unable to understand the reason behind for such a design. i think i will now have to redesign my application. thanks for all your help regards, ravi jimski wrote: Hi Ravi- I think the problem here is how the struts2 tags were implemented. As far as I can see from the code base the type converter definition you're referring to is used by the XWork API and not OGNL. The XWork api is used by the Struts Tags which have the option to call the converter or not. In the case of rendering content, the option chosen by the designers is not to call the converter and call toString() instead. Check out this bug report https://issues.apache.org/struts/browse/WW-2047 for more details. I asked a question about this: (http://www.nabble.com/Struts-framework-design-question%3A-Type-Converters-and-Tags-to15019888.html) ...and it seems like a community generated patch is probably the only way forward at this point. I started looking into it, but my day job has been way too busy to give me any time to actually code a patch. There's also a question on my part as to whether or not the patch would even be accepted given that 2.0.6 supported type conversion at render time and the core struts2 dev team has explicitly chosen to remove this feature (as mentioned by Don Brown in the referenced bug report). ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15203566.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type converters: convertToString not called
one more thing, then when would this method be called?? sounds like redundant. ravi_eze wrote: hi, thanks for the reply. If the design had this behavior intended then probably we cannot do any thing but in that case i would not agree with the design. I read the post linked below and also the bug... but still unable to understand the reason behind for such a design. i think i will now have to redesign my application. thanks for all your help regards, ravi jimski wrote: Hi Ravi- I think the problem here is how the struts2 tags were implemented. As far as I can see from the code base the type converter definition you're referring to is used by the XWork API and not OGNL. The XWork api is used by the Struts Tags which have the option to call the converter or not. In the case of rendering content, the option chosen by the designers is not to call the converter and call toString() instead. Check out this bug report https://issues.apache.org/struts/browse/WW-2047 for more details. I asked a question about this: (http://www.nabble.com/Struts-framework-design-question%3A-Type-Converters-and-Tags-to15019888.html) ...and it seems like a community generated patch is probably the only way forward at this point. I started looking into it, but my day job has been way too busy to give me any time to actually code a patch. There's also a question on my part as to whether or not the patch would even be accepted given that 2.0.6 supported type conversion at render time and the core struts2 dev team has explicitly chosen to remove this feature (as mentioned by Don Brown in the referenced bug report). ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15203570.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type converters: convertToString not called
hi, thanks for the reply. If the design had this behavior intended then probably we cannot do any thing but in that case i would not agree with the design. I read the post linked below and also the bug... but still unable to understand the reason behind for such a design. i think i will now have to redesign my application. thanks for all your help regards, ravi jimski wrote: Hi Ravi- I think the problem here is how the struts2 tags were implemented. As far as I can see from the code base the type converter definition you're referring to is used by the XWork API and not OGNL. The XWork api is used by the Struts Tags which have the option to call the converter or not. In the case of rendering content, the option chosen by the designers is not to call the converter and call toString() instead. Check out this bug report https://issues.apache.org/struts/browse/WW-2047 for more details. I asked a question about this: (http://www.nabble.com/Struts-framework-design-question%3A-Type-Converters-and-Tags-to15019888.html) ...and it seems like a community generated patch is probably the only way forward at this point. I started looking into it, but my day job has been way too busy to give me any time to actually code a patch. There's also a question on my part as to whether or not the patch would even be accepted given that 2.0.6 supported type conversion at render time and the core struts2 dev team has explicitly chosen to remove this feature (as mentioned by Don Brown in the referenced bug report). ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15203568.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s:if test with empty String
hi, probably u can go this way: s:if test={members[#status.index][1] eq null} s:property value=%{distinctIssuePartyId[#status.index][0]}/ / s:if or s:if test={''.equals(members[#status.index][1])} ... / s:if this is ognl and should help u out. let me know if it works. cheers, ravi quinquin2209 wrote: Hi All, I have an array of String members... where member[0] is the member id and member[1] is the member's name. In the jsp, I want to display member[1] if it is not empty, or member[0] if member[1] is empty. s:if test=%{members[#status.index][1]} == '' s:property value=%{distinctIssuePartyId[#status.index][0]}/ /s:if s:else s:property value=%{distinctIssuePartyId[#status.index][1]}/ /s:else However, the else logic is executed no matter member[1] is empty or not. How can I test with empty string? Thanks in advance Queenie -- View this message in context: http://www.nabble.com/s%3Aif-test-with-empty-String-tp15174836p15181533.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type converters: please help!!! :(
team any help??? :( ravi_eze wrote: hi, The code is as follows. Do not get terrified by the length of the post. I tried formatting the post for better readability. Hope this helps you... to help me ;) @new.xml, this is included in struts.xml struts package name=newsCreation namespace=/new extends=struts-default action name=configurenew class=com.comp.admin.news.newConfigurationAction method=viewnew interceptor-ref name=scope param name=session newData,disableFields /param /interceptor-ref interceptor-ref name=conversionError / interceptor-ref name=params / result/new/layout/newConfiguration_layout.jsp/result result name=input /new/layout/new_layout.jsp /result /action @com\comp\admin\news\newConfigurationAction-conversion.properties newData.maxLimit=com.comp.util.converter.newLongConverter ... @com.comp.util.converter.newLongConverter public class newLongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { if (null == values || values.length == 0 || values[0]==null || values[0].trim().length()==0 ) return 0; try { int i = Integer.parseInt(values[0]); return i; } catch (Exception ex) {} return 0; } public String convertToString(Map context, Object obj) { if (null == obj) return 0; if(obj instanceof Long) return ((Long)obj).longValue()+; return ; } } mgainty wrote: Hi Ravi- Could you display your code for your StrutsTypeConverter class please M- - Original Message - From: ravi_eze [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, January 25, 2008 12:58 AM Subject: RE: Type converters: please help!!! :( Thank you Jeff for the reply. did u mean the *converter* attribute of the action tag that we give in struts.xml? I didnt give any such attribute in it. I added ActionClass-conversion.properties: in which i mentioned the attribute to pickup a class which implements convertFromString and viceversa functions. My action tag in the xml are as follows: struts package name=eventsCreation namespace=/event extends=struts-default interceptors interceptor name=... class=... / interceptor name=... class=... / /interceptors action name=oneAct class=oneClass interceptor-ref name=... ... /interceptor-ref resultone.jsp/result /action ... let me know if you are looking for anything else. cheers, ravi Jeff Hill (RR) wrote: Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one
Re: [STRUTS2] Error in Dojo / Howto update Dojo
which version are u using?? i think u are getting error like dojo not defined. If yes then read the following u need to make dojo available do the following steps: 1. explode struts core.jar 2. create a folder in the war : struts 3. search for ajax,dojo,niftycorners,simple,xhtml in the exploded jars (step 1) 4. copy them all into the struts folder (step 2) start teh tomcat. view sourcet the page u are tring to use.. u will see the js files its tryuing to fetch from the server.. the above steps make sure that they all exist on the server.. hope this helps. ravi Julien RICHARD-2 wrote: Hi, I'm new in the mailing list, so hi to all users. Little presentation : french java struts2 developer. I have a question. I want to use richtext box with dojo (textarea theme=ajax) but i cant. In fact, the embedded version of dojo have a error and i need to update the dojo version. How can i make this with simple operation ? Thanks for your answers. -- View this message in context: http://www.nabble.com/-STRUTS2--Error-in-Dojo---Howto-update-Dojo-tp15132308p15152849.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type converters: please help!!! :(
hi, The code is as follows. Do not get terrified by the length of the post. I tried formatting the post for better readability. Hope this helps you... to help me ;) @new.xml, this is included in struts.xml struts package name=newsCreation namespace=/new extends=struts-default action name=configurenew class=com.comp.admin.news.newConfigurationAction method=viewnew interceptor-ref name=scope param name=session newData,disableFields /param /interceptor-ref interceptor-ref name=conversionError / interceptor-ref name=params / result/new/layout/newConfiguration_layout.jsp/result result name=input /new/layout/new_layout.jsp /result /action @com\comp\admin\news\newConfigurationAction-conversion.properties newData.maxLimit=com.comp.util.converter.newLongConverter ... @com.comp.util.converter.newLongConverter public class newLongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { if (null == values || values.length == 0 || values[0]==null || values[0].trim().length()==0 ) return 0; try { int i = Integer.parseInt(values[0]); return i; } catch (Exception ex) {} return 0; } public String convertToString(Map context, Object obj) { if (null == obj) return 0; if(obj instanceof Long) return ((Long)obj).longValue()+; return ; } } mgainty wrote: Hi Ravi- Could you display your code for your StrutsTypeConverter class please M- - Original Message - From: ravi_eze [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, January 25, 2008 12:58 AM Subject: RE: Type converters: please help!!! :( Thank you Jeff for the reply. did u mean the *converter* attribute of the action tag that we give in struts.xml? I didnt give any such attribute in it. I added ActionClass-conversion.properties: in which i mentioned the attribute to pickup a class which implements convertFromString and viceversa functions. My action tag in the xml are as follows: struts package name=eventsCreation namespace=/event extends=struts-default interceptors interceptor name=... class=... / interceptor name=... class=... / /interceptors action name=oneAct class=oneClass interceptor-ref name=... ... /interceptor-ref resultone.jsp/result /action ... let me know if you are looking for anything else. cheers, ravi Jeff Hill (RR) wrote: Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas
Re: is it possible to pass a parameter to an interceptor from the xml file?
hi, i think whats not possible is ... param name=...${actionclass'sVariable} /.. ... i.e. getting the variable form action calss and accessing it or evaluating an expression as the param value. any ideas how this is possible cheers, ravi nuwan chandrasoma-2 wrote: Hi, yes it is possible., just implement a setter and getter method for the parameter you have in the struts.xml file. and it will be available to you in the intercept method. eg:- // in the intercept class.. private String httpPort; public String getHttpPort() { return httpPort; } public void setHttpPort(String httpPort) { this.httpPort = httpPort; } // in the struts.xml interceptor-stack name=SecureStack interceptor-ref name=secure 80 /interceptor-ref the value 80 will be inject to the variable httpPort in the interceptor class., Thanks, Nuwan. (http://struts2-ssl-plugin.googlecode.com/) xianwinwin wrote: Hi all, I wonder if it is possible to pass a parameter with a value to an interceptor. Example: I have the following interceptor: interceptor name=authentication class=com.struts.security.AuthenticationInterceptor/ (parameterGivenInXmlFile==4) the implementation is: public String intercept (ActionInvocation invocation) throws Exception { ... if (parameterGivenInXmlFile ==3) //do something } thanks for any input - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/is-it-possible-to-pass-a-parameter--to-an-interceptor-from-the-xml-file--tp15074977p15080834.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Type converters: please help!!! :(
hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15080943.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Type converters: please help!!! :(
Thank you Jeff for the reply. did u mean the *converter* attribute of the action tag that we give in struts.xml? I didnt give any such attribute in it. I added ActionClass-conversion.properties: in which i mentioned the attribute to pickup a class which implements convertFromString and viceversa functions. My action tag in the xml are as follows: struts package name=eventsCreation namespace=/event extends=struts-default interceptors interceptor name=... class=... / interceptor name=... class=... / /interceptors action name=oneAct class=oneClass interceptor-ref name=... ... /interceptor-ref resultone.jsp/result /action ... let me know if you are looking for anything else. cheers, ravi Jeff Hill (RR) wrote: Ravi, From my understanding of OGNL, it *should* use the model object's conversion descriptor. It's probably more surprising that it called convertFromString without it. Are you using defaultStack? I believe providing the model object's descriptor is the correct approach, and you indicate that it's working. So why the long face? ;-) -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Thursday, January 24, 2008 11:45 PM To: user@struts.apache.org Subject: Type converters: please help!!! :( hi, i badly need the solution to this problem. i had posted this issue on xwork forums, struts fourms previously also, but hardluck: no reply :( i am reposting the same again... atleast let me know if this idea itself is wrong!!! or any better approach/ is there? ravi_eze wrote: hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp150349 25p15080943.html Sent from the Struts - User mailing list archive 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] -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15081469.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to validate field right after the data is entered, HELP!
i dont think ull run into problems atleast as long as u reatain the theme as ajax. try using theme as simple and give onblur=validate(this);. Also include the necessary .js files (make the necessary ajax configurations and view source in browser, ull see the .js files). check if the .js files are being served to the browser. (fire bug of mozilla would help u) basically a new node td is created and error is written into it (addError of validate.js) function addError(e, errorText) { try { // clear out any rows with an errorFor of e.id var row = e.parentNode.parentNode; var table = row.parentNode; var error = document.createTextNode(errorText); ... so this approach should resolve ur issues. regards, ravi Mei Wei wrote: Thank you!! This is a really detailed document. I finally got this problem solved. But now I noticed that the javascript creates html nodes to display error message dynamically. If I changed the layout then it does not work well. For example, if I have 4 columns in the table to display two fields. Do you or anyone have any experience about this? Thanks, Mei -Original Message- From: ravi_eze [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 9:04 PM To: user@struts.apache.org Subject: RE: how to validate field right after the data is entered, HELP! hi, i solved the same problem this way:http://java-x.blogspot.com/2006/11/struts-2-validation.html Its ajax based validation. hope it helps. cheers, ravi Mei Wei wrote: Thanks, I looked at this document. I think it is more referring to 2.1 which does not have a stable release yet. We prefer to use 2.0.11 since it is the latest stable release. I was thinking about something like in the showcase example (quiz-ajax). That we need to write a javascript function to listen to onblur() event on the input text field. But I am not sure how to ask struts to validate for this particular field, and how to get the error message back from the response. Can anyone help me on this? Thanks, Mei -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 4:54 PM To: Struts Users Mailing List Subject: Re: how to validate field right after the data is entered take a look at http://struts.apache.org/2.x/docs/dojo-submit.html for attributes validate and ajaxValidation M - Original Message - From: Wei, Mei [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 22, 2008 7:15 PM Subject: how to validate field right after the data is entered Hi, We want to validate the field data right after the data is entered. So that the user can fix the error right away instead of waiting until the whole form is submitted. We thought that struts2 and ajax can help us on that. But what would be the best way to do? Any helps or guidance are appreciated. Thanks, Mei - 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] -- View this message in context: http://www.nabble.com/how-to-validate-field-right-after-the-data-is-ente red-tp15032110p15035015.html Sent from the Struts - User mailing list archive 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] -- View this message in context: http://www.nabble.com/how-to-validate-field-right-after-the-data-is-entered-tp15032110p15037370.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help
did u try struts showcase?? its part of downloads available at the site. also is a good start for struts. Antonio Petrelli-3 wrote: 2008/1/23, mohammed hussain [EMAIL PROTECTED]: hi iam muzaffar,struts learner, Any body is having any struts application means pls send to me with source code,its will be very helpful to me and iam very thankful to you. Google struts tutorial, or go directly to: http://struts.apache.org/ Asking for help this way is pointless. http://thedailywtf.com/Articles/plz-email-me-teh-codez.aspx Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Need-Help-tp15037376p15037444.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Help
download, explode, and search for war files. then deploy them onto tomcat. http://mirror.x10.com/mirror/apache/struts/binaries/struts-2.0.11-all.zip mohammed hussain wrote: hi iam muzaffar,struts learner, Any body is having any struts application means pls send to me with source code,its will be very helpful to me and iam very thankful to you. waiting for ur reply -- View this message in context: http://www.nabble.com/Need-Help-tp15037376p15037720.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dojo version in struts 2
can we use dojo 1 in struts 2.0.9? newton.dave wrote: --- Mark Levitsky [EMAIL PROTECTED] wrote: Can I work some how with struts 2 and with dojo 1.0 together (instead the 0.4 version) You can use Dojo raw (i.e., not using the S2 tags), or you could get the 2.1 source and replace the Dojo plugin version with 1.0 and deal with any potential issues (I don't know what, if any, issues there would be). And another question do you know in what version of struts the dojo will be above 1.0 Nope. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/dojo-version-in-struts-2-tp15039807p15043402.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validating conditional fields...
one approach: you need to achieve appearing and dissappearing of the filelds based on some event (say radio button) using client side javascript. how ever in either case according to the html the fields are all present (i.e. x,y,z) now in action calss you can write validate method in which you can write conditional validation based on the radio value submitted to the method. Kavita Mehta wrote: Hi, i have a JSP in which either I show x , y fieds or y, z field based on some condition . Now, i have to validate all x, y,z fields in such a way that if these fields are present, they should be validated else not . can somebdy pls suggest how to do this ... Regards, Kavita *DISCLAIMER* This message and/or attachment(s) contained here are confidential, proprietary to HUGHES SYSTIQUE and its customers. Contents may be privileged or otherwise protected by law. The information is solely intended for the entity it is addressed to. If you are not the intended recipient of this message, it is strictly prohibited to read, forward, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately and delete the message. -- View this message in context: http://www.nabble.com/validating-conditional-fields...-tp15037677p15044693.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Type converters: convertToString not called
hi, We have Action class with Employee Object with setters and getters. The Typeconverter was configured to be called when EmployeeObject.empId is called by the jsp page. We found that convertFromString of type converter is being called but convertToString is never called. Any idea why this is happening? The details are as follows: Type converter: public class LongConverter extends StrutsTypeConverter { public Object convertFromString(Map context, String[] values, Class toClass) { ... } public String convertToString(Map context, Object o) { ... } } in actionClass-conversion.properties located along with the class file in the same package: employee.empId=com.comp.util.converter.LongConverter After some debugging we found that we need to add a new file: Employee-conversion.properties in the same package of Employee class with entries: empId=com.comp.util.converter.LongConverter and only then the convertToString would be called. I think we should have only one conversion.prop file instead of 2. Any ideas why this is happening this way? or am i missing any thing? please help. cheers, ravi -- View this message in context: http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp15034925p15034925.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to validate field right after the data is entered, HELP!
hi, i solved the same problem this way:http://java-x.blogspot.com/2006/11/struts-2-validation.html Its ajax based validation. hope it helps. cheers, ravi Mei Wei wrote: Thanks, I looked at this document. I think it is more referring to 2.1 which does not have a stable release yet. We prefer to use 2.0.11 since it is the latest stable release. I was thinking about something like in the showcase example (quiz-ajax). That we need to write a javascript function to listen to onblur() event on the input text field. But I am not sure how to ask struts to validate for this particular field, and how to get the error message back from the response. Can anyone help me on this? Thanks, Mei -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 4:54 PM To: Struts Users Mailing List Subject: Re: how to validate field right after the data is entered take a look at http://struts.apache.org/2.x/docs/dojo-submit.html for attributes validate and ajaxValidation M - Original Message - From: Wei, Mei [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 22, 2008 7:15 PM Subject: how to validate field right after the data is entered Hi, We want to validate the field data right after the data is entered. So that the user can fix the error right away instead of waiting until the whole form is submitted. We thought that struts2 and ajax can help us on that. But what would be the best way to do? Any helps or guidance are appreciated. Thanks, Mei - 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] -- View this message in context: http://www.nabble.com/how-to-validate-field-right-after-the-data-is-entered-tp15032110p15035015.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using YUI with struts 2
thanks a ton jayson. i may require it later, shall check it then:) Jayson Joseph Chacko wrote: Hi Ravi, Here is an example which uses YUI along with JSON to create a menu in Struts2. You might find it useful. http://www.struts2.org/creating-a-cascading-application-menu-using-struts2-and-yui Regards, Jayson On Jan 20, 2008 4:26 PM, ravi_eze [EMAIL PROTECTED] wrote: hi Jeromy Evans, Thanks for the quick reply. The YUI is working with the html tags also. I dont know if this is documented anywhere; any how thanks for the help :-) Jeromy Evans - Blue Sky Minds wrote: Hi Ravi, YUI doesn't require any specific tags. AFAIK, they're all plain old valid html. It can't get much better than that. ie. this is a TabView: div id=demo class=yui-navset ul class=yui-nav li class=selected #tab1 emTab One Label/em /li li #tab2 emTab Two Label/em /li li #tab3 emTab Three Label/em /li /ul div class=yui-content divpTab One Content/p/div divpTab Two Content/p/div divpTab Three Content/p/div /div /div It's instantiated with: var myTabs = new YAHOO.widget.TabView(demo); Which adds additional valid html markup to the DOM. You can create a TagLib or Struts2 tags for commonly used widgets if you like, as provided by the YUI plugin, but this doesn't add much value. For instance, I've created a TabView tags like this: yui:tabview id=demo selected=tab1 yui:tab id=tab1 label=Tab One LabelTab One Content/yui:tab yui:tab id=tab2 label=Tab Two LabelTab Two Content/yui:tab yui:tab id=tab3 label=Tab ThreeLabelTab Three Content/yui:tab /yui:tabview That renders the original HTML above. The value this adds over the original HTML is dubious considering the effort it took to write the custom-tag and the clarity of the original code. Writing custom tags for the DataTable, TreeView, Charts etc are definitely not worth the effort because the tags can't replicate the functionality of the API. What exactly were you hoping for? regards, Jeromy Evans ravi_eze wrote: hi, i want to use YUI library (http://developer.yahoo.com/yui/) with struts2. The problem is that YUI requires YUI specific tags while struts generates html tags. so, can we write themes(ftls etc similar to xhtml etc) which would generate YUI tags instead of HTML? would this bring in new problems? or did any one have tried this? YUI plugin is provided but its alpha version and doesnt provide all components that we require. any help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/using-YUI-with-struts-2-tp14978453p14980470.html Sent from the Struts - User mailing list archive at Nabble.comhttp://nabble.com/ . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/using-YUI-with-struts-2-tp14978453p14999390.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using YUI with struts 2
hi Jeromy Evans, Thanks for the quick reply. The YUI is working with the html tags also. I dont know if this is documented anywhere; any how thanks for the help :-) Jeromy Evans - Blue Sky Minds wrote: Hi Ravi, YUI doesn't require any specific tags. AFAIK, they're all plain old valid html. It can't get much better than that. ie. this is a TabView: div id=demo class=yui-navset ul class=yui-nav li class=selected #tab1 emTab One Label/em /li li #tab2 emTab Two Label/em /li li #tab3 emTab Three Label/em /li /ul div class=yui-content divpTab One Content/p/div divpTab Two Content/p/div divpTab Three Content/p/div /div /div It's instantiated with: var myTabs = new YAHOO.widget.TabView(demo); Which adds additional valid html markup to the DOM. You can create a TagLib or Struts2 tags for commonly used widgets if you like, as provided by the YUI plugin, but this doesn't add much value. For instance, I've created a TabView tags like this: yui:tabview id=demo selected=tab1 yui:tab id=tab1 label=Tab One LabelTab One Content/yui:tab yui:tab id=tab2 label=Tab Two LabelTab Two Content/yui:tab yui:tab id=tab3 label=Tab ThreeLabelTab Three Content/yui:tab /yui:tabview That renders the original HTML above. The value this adds over the original HTML is dubious considering the effort it took to write the custom-tag and the clarity of the original code. Writing custom tags for the DataTable, TreeView, Charts etc are definitely not worth the effort because the tags can't replicate the functionality of the API. What exactly were you hoping for? regards, Jeromy Evans ravi_eze wrote: hi, i want to use YUI library (http://developer.yahoo.com/yui/) with struts2. The problem is that YUI requires YUI specific tags while struts generates html tags. so, can we write themes(ftls etc similar to xhtml etc) which would generate YUI tags instead of HTML? would this bring in new problems? or did any one have tried this? YUI plugin is provided but its alpha version and doesnt provide all components that we require. any help? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/using-YUI-with-struts-2-tp14978453p14980470.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using YUI with struts 2
hi, i want to use YUI library (http://developer.yahoo.com/yui/) with struts2. The problem is that YUI requires YUI specific tags while struts generates html tags. so, can we write themes(ftls etc similar to xhtml etc) which would generate YUI tags instead of HTML? would this bring in new problems? or did any one have tried this? YUI plugin is provided but its alpha version and doesnt provide all components that we require. any help? -- View this message in context: http://www.nabble.com/using-YUI-with-struts-2-tp14978453p14978453.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Type conversion with Generics
hey! one thing btw: when u say something[0] how can it be represented in set/ map as the order is not maintained? and one more thing: *-conversion.prop does it work for a custom object in the action class (struts2) (i.e. i had seen fromString being called but not toString method ) any help rickcr wrote: Yup Maps will work also. On Jan 8, 2008 1:57 PM, Dave Newton [EMAIL PROTECTED] wrote: I've never used Sets, only Maps, which definitely work... As a sanity check perhaps you could try using a Map. I know you can get a Set view of a Map, so perhaps this is an alternative solution (I'm not so sure about going the other direction, however). This would at least narrow down the problem to see if it's a Set v. Map issue. d. --- jvleminc [EMAIL PROTECTED] wrote: I know. Unfortunately i can't change my business beans anymore :-( Anyway, any other ideas? I am trying now with a EoActivities-conversion.properties file, containing Element_eoActivity = com.datamat.care.bean.EoActivity Element_eoUser = com.datamat.care.bean.EoUser Element_eoUserAddress = com.datamat.care.bean.EoUserAddress but no avail yet...thanks anyway! rickcr wrote: At least in Struts1.1, If I'm not mistaken, you aren't going to be able to use indexed properties like you are to set items in a Set. If you use Lists it would be much easier to accomplish the nested collection population. On Jan 8, 2008 1:02 PM, jvleminc [EMAIL PROTECTED] wrote: Hello, I am facing with automatic type conversion upon the submit of my Form: Basically I have form fields with the names eoActivities[0].activityName eoActivities[0].eoUser[0].eoUserId eoActivities[0].eoUser[0].eoUserAddress[0].addressType eoActivities[0].eoUser[0].eoUserAddress[0].name ... eoActivities[0].eoUser[0].eoUserAddress[1].addressType eoActivities[0].eoUser[0].eoUserAddress[1].name ... eoActivities[0].eoUser[1].eoUserId eoActivities[0].eoUser[1].eoUserAddress[0].addressType eoActivities[0].eoUser[1].eoUserAddress[0].name ... eoActivities[1].activityName eoActivities[1].eoUser[0].eoUserId eoActivities[1].eoUser[0].eoUserAddress[0].addressType eoActivities[1].eoUser[0].eoUserAddress[0].name ... and so on I would like that the values of these form elements are automatically inserted into the following object: SetEoActivity with EoActivity a bean with two members variables: activityName and SetEoUser and appropriate getter and setter, with EoUser a bean with two members variables: eoUserId and SetEoUserAddress and appropriate getter and setter, with EoUserAddress a bean with member variables addressType and name Is this possible? Right now I receive a lot of 17:52:32 ERROR [ParametersInterceptor:204] ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'eoActivities[0].eoUser[0].eoUserId' on 'class com.datamat.care.actions.EoActivitiesAction: Error setting expression 'eoActivities[0].eoUser[0].eoUserId' with value '[Ljava.lang.String;@1aa4bb4' errors ;-( Thanks in advance! Joris -- View this message in context: http://www.nabble.com/Type-conversion-with-Generics-tp14695286p14695286.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rick -- View this message in context: http://www.nabble.com/Type-conversion-with-Generics-tp14695286p14695838.html Sent from the Struts - User mailing list archive 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] -- Rick -- View this message in context: http://www.nabble.com/Type-conversion-with-Generics-tp14695286p14727854.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wrong request parameters sent
yaa i am presetting the checkbox. any how i got the solution, may b a workaround one:i wrote a reset interceptor which would always reset the checkbox vairable of the action class when the jsp page is submitted. now if the checkbox is not selected the value remains reset. mgainty wrote: are you pre-setting the value or fieldValue attributes for s:checkbox please display code in your jspMartin __Disclaimer and confidentiality noteEverything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Mon, 31 Dec 2007 21:48:12 -0800 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: wrong request parameters sent hi any help?ravi_eze wrote:hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter.when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior:var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } }which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14564745.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Don't get caught with egg on your face. Play Chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_dec -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14631571.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unexpected behavior with a checkbox.
hi, the workaround works, but causes problems if the checkbox should be validated. More over the soln is based on assumptions that need not hold always. There are 2 possible soln for this in my view: 1. use checkbox interceptor (http://struts.apache.org/2.x/docs/checkbox-interceptor.html). But i found that this doesnt work if u are using s:checkboxList .. the reson being that the corresponding hidden text-field (__checkbox_checkboxListName) is not produced. (may be u can try creating this hidden field). Now use checkbox interceptor before param interceptor of ur config xml file. ... interceptor-ref name=conversionError / interceptor-ref name=checkbox / interceptor-ref name=params / ... 2. Create a reset interceptor!: now what is this? Write a custom interceptor (http://struts.apache.org/2.x/docs/writing-interceptors.html) which would reset all the attributes/ field/ only chcek-box-field variables of the action class. Place this interceptor as below: ... interceptor-ref name=resetInterceptor checkboxListvariable /interceptor-ref interceptor-ref name=conversionError / interceptor-ref name=checkbox / interceptor-ref name=params / ... Now what happens is: always before the paramas are loaded from the request they are all reset to null/ what ever. Now if the params do not have the checkbox field in it then the corresponding variables are not touched; this way ur work is achieved. This would fire validations also. I am currently using this approache and find it very useful. Hope this helps :) cheers, Ravi David Durham, Jr. wrote: request.getParameter(myUncheckedCheckbox) == null Oh.. yuck.. but thanks David for that work around. Tried it and it works for my purposes. There are things that can be done to avoid to the ugly null check. 1. Don't initialize check-box fields. No initial values. 2. Don't use session-scoped forms. It sounds like you need to start with a blank or default form that has a check-box checked. Perhaps the user should receive spam? :) I haven't thought about that case much, but it seems similar in that, if you don't want to use an initial value for reasons previously mentioned, you're faced with using some other means to indicate this box is checked by default. If you have a display new form action, you can put a value on the form whereby the box will start out checked. This is different than defining an initial value. So long as you don't specify an initial value for check-box fields, and Struts creates a new form object for each submission, the state of a check-box is preserved within an ActionForm. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/unexpected-behavior-with-a-checkbox.-tp14572206p14591715.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: regex validation problem
hi, seems like ur missing validation and workflow interceptors. Try out this entry in ur xml file: ... action name=bla blaclass=bla bla Action method=bla bla interceptor-ref name=scope bla bla /interceptor-ref interceptor-ref name=conversionError / interceptor-ref name=params / interceptor-ref name=validation / interceptor-ref name=workflow / resultbla bla/result ... hope this helps! Laurie Harper wrote: Hmm, sounds like the regex matching is stricter than I assumed. Try changing your rules from 'X' to '.*X.*' maybe, e.g. '.*[a-z]+.*'. Try commenting two of the regex validations and experimenting with the third until you're sure it's doing what you want, then bring the other two back and alter them to match. L. supa charoenchit wrote: Hi, thanks for the response. I removed the '^' and '$' characters and it still does not pass validation when I enter a valid password. It is a little wierd, when i enter only lower case characters (or only uppercase characters or only numbers), the check works correctly by saying I need to enter [A-Z] and [0-9]... but when I enter those characters, it says that I need to enter all three character groups: [a-z], [A-Z], [0-9]. To: user@struts.apache.org From: [EMAIL PROTECTED] Subject: Re: regex validation problem Date: Tue, 1 Jan 2008 18:38:55 -0500 supa charoenchit wrote: Hello, I am having a problem validating a password field.My requirement on my password is that it must be: 8 characters minimum length and contain at least one from each of the following groups: [a-z], [A-Z], and [0-9]. Here is what I have so far (which is not working):[...] field-validator type=regex ^[a-z]+$ message[ a-z]/message /field-validator field-validator type=regex ^[A-Z]+$ message[A-Z]/message /field-validator field-validator type=regex ^[0-9]+$ message[0-9]/message /field-validator When I attempt to submit my form with correct data, it does not submit and states that I need a-z, A-Z, and 0-9. What is going on here? Well, those regexs say a valid password must start and end with one or more lowercase letters, must also start and end with one or more uppercase letters and must also start and end with one or more digits. That's obviously not possible. If you remove the '^' and '$' characters from the expressions, you'll just be testing that the characters appear somewhere within the password, which I think is what you meant.. L. - To unsubscribe, e-mail: user-u [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The best games are on Xbox 360. Click here for a special offer on an Xbox 360 Console. http://www.xbox.com/en-US/hardware/wheretobuy/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/regex-validation-problem-tp14563510p14591718.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wrong request parameters sent
hi, the issue seems to be fixed. It seems like a problem with the xhtml theme thats not using .js files properly. i corrected the validation.js in xhtml and ajax folders, validationClilent.js and created a corrected theme (http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme : was vital in helping me for steps: http://thelittlefellow.blogspot.com/2008/01/eureka-eureka-got-soln-ajax-validations.html). Now the ajax validations are happening fine. I am posting a reply as it may be a help to some one who is looking for an soln to the problem :) hope this helps. cheers, ravi ravi_eze wrote: hi, when i replace the provided code with: for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { if(e.type =='checkbox'){ if(e.checked==true) params[e.name] = e.value; }else{ params[e.name] = e.value; } } the correct request parameters are being sent and are also getting correctly validated. Now i am facing a new problem: If there is a single checkbox then i see field errors being displayed, but if there are multiple checkboxes then i dont see any field errors. I strongly believe that i am going wrong some where... any help would be appreciated. after some debugging i found that an if condition ( if (form.elements[fieldName].touched) { 12 for (var i = 0; i errors.fieldErrors[fieldName].length; i++) { 13 addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]); 14 } 15 }) of validations.js failing for multiple checkboxes which is causing the problem. i believe that there is some mistake with configuration. any help? ravi_eze wrote: hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter. when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior: var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } } which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14591721.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Basic validation, input, and redirects
i think u can ty this way: create a new mapping where there are no validations for action 1. Now on validation errors of action 2 it would redirect to this action 1; thus skipping validations of action 1. if u want the function call only and no validations... may b u can call the method action1 when u detect an error executing aciton 1. or refactor... hope this helps kwade wrote: Thanks for the comment. The problem is not that I'm losing the validation errors. I'm keeping those across the redirect by using a modified interceptor stack with the STORE interceptor. So, that's cool. The problem is that *because* the errors are being preserved across the redirect (I think it's because), the validation/workflow interceptor for the action that is the destination of the input result type (back to 'Action1' that is) is ALSO picking up on the presence of those validation errors and ALSO looking for a place to go for an 'input' return type. It looks like this: Action1 - search screen.jsp - submit form - Action2 - (validation error found; input says 'Action1) - Action1 - (validation error found; looks for 'input' result type) - Exception since there is no mapping for 'input' on Action1 I wish it would just stop here: Action1 - search screen.jsp - submit form - Action2 - (validation error found; input says 'Action1) - Action1 I've worked on this some more and found a possible solution by further modifying the interceptor stack for Action1: action name=Action1 method=execute class=Action1 interceptor-ref name=defaultStack execute execute /interceptor-ref result name=successsearchQuery.jsp/result /action Now, the execute method of Action1 is excluded from validation. The propogating errors from Action2 don't cause a problem for Action1. I don't know if I need to exclude the execute method from BOTH validation and workflow interceptors, but it works. Any thoughts on that? I do have a second problem, though: the validation errors are remaining across multiple invocations of Action2. Even a successful (validated) form submission is not erasing the OLD validation errors. I need a way to remove the old errors after they are displayed. Anyone have any ideas on that too? Thanks as always, Kevin On Jan 2, 2008, at Wednesday, January 2, 2008 - 4:35 PM, Laurie Harper wrote: Kevin Wade wrote: Greetings. I've seen a number of posts about this issue -- or related issues -- but no comprehensive solution. I'll try again and be succinct: I have an action (Action1) that prepares a search screen (i.e. populates a drop-down box). The search screen/form calls Action2 but has a Action2-validation.xml file which specifies validation rules. In my struts.xml file, the result type of input for Action2 will redirect back to Action1 so that the search form is properly prepared and displayed. This isn't working as I would expect. The validation seems to work fine but when the redirect to Action1 occurs on the result type of input... Action1 is not running because it ALSO is trying to find a result type of input. So... any ideas? I'm not sure why the input return type is propagating from Action2 to Action1, but I gather that the presence of the validation errors is triggering something in the DefaultWorkflowInterceptor in Action1 when the re-direct back to it occurs. Any ideas how to make that not happen? How can I make validation not run on Action1? Or, alternatively, make the Interceptor ignore the validation errors after the redirect? I tried adding a @SkipValidation annotation to the execute() method of Action1, but that did nothing. Any ideas? Kevin Unless you've configured something to preserve them, the validation errors should be getting lost on the redirect (which is, of course, not what you want in this scenario but is the default behavior). What interceptor stack are you using? How are you preserving user input across the redirect? I would suggest creating a minimal sample application demonstrating the problem, then posting the relevant bits of code and configuration for people to play with to diagnose what's happening. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Basic-validation%2C-input%2C-and-redirects-tp14586204p14592027.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
viewing field errors at custom location
hi, I need the field errors to be displayed at a custom location instead of to the right (as we see in default case). any ideas/ links as how to get this done? regards, -- View this message in context: http://www.nabble.com/viewing-field-errors-at-custom-location-tp14557126p14557126.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wrong request parameters sent
hi, when i replace the provided code with: for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { if(e.type =='checkbox'){ if(e.checked==true) params[e.name] = e.value; }else{ params[e.name] = e.value; } } the correct request parameters are being sent and are also getting correctly validated. Now i am facing a new problem: If there is a single checkbox then i see field errors being displayed, but if there are multiple checkboxes then i dont see any field errors. I strongly believe that i am going wrong some where... any help would be appreciated. after some debugging i found that an if condition ( if (form.elements[fieldName].touched) { 12 for (var i = 0; i errors.fieldErrors[fieldName].length; i++) { 13 addError(form.elements[fieldName], errors.fieldErrors[fieldName][i]); 14 } 15 }) of validations.js failing for multiple checkboxes which is causing the problem. i believe that there is some mistake with configuration. any help? ravi_eze wrote: hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter. when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior: var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } } which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14557923.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wrong request parameters sent
i somehow feel checkboxes are not properly handled in struts 2.x any controversies??? ravi_eze wrote: hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter. when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior: var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } } which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14558085.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wrong request parameters sent
hi any help? ravi_eze wrote: hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter. when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior: var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } } which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14564745.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wrong request parameters sent
hi, i have 3 checkboxes(c1,c2,c3) enclosed in a form (theme: ajax; validate=true). I am trying to get the validation done by ajax and when i un-check all boxes or check some of the boxes i see that always c3 is being set in request parameter. when i tried to debug i found the following statement in validationClient.js which could be a cause of this behavior: var vc = this; var form = input.form; var params = new Object(); for (var i = 0; i form.elements.length; i++) { var e = form.elements[i]; if (e.name != null e.name != '') { params[e.name] = e.value; } } which is always putting the 3rd checkbox in the request parameter even though its not checked. If i remove all ajax related attributes (i.e. s:head, s:form.. ) the parameters are going right and the validations are happening fine. any ideas where i am going wrong/ is any body else is also getting the same behavior? -- View this message in context: http://www.nabble.com/wrong-request-parameters-sent-tp14555088p14555088.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Tiles (1.3.8) - NoSuchMethodError Exception
if you are using struts 2.0.x then you have to use tiles-*. 2.0.x jar files. Greg Reddin-4 wrote: On Dec 26, 2007 4:45 PM, Mohamed Mohideen [EMAIL PROTECTED] wrote: Hello there, I am trying the basic template example from Struts Tiles(1.3.8) website. I started with struts-blank-1.3.8.war. Getting the following exception. Looks like it's failing in the following line... tiles:insert beanName=templateDefinition / Some one suggested to replace it beanName to definition. It didn't help. Please shed your lights. I think the suggestion might be correct regardless. The difference is that beanName is looking for a named bean in a defined scope (page, request, session, application), while definition is looking for a named definition defined in the tiles-defs.xml file and/or at runtime. So if you're referencing beanName then there needs to be a bean available in some scope by that name templateDefinition. Since it's an example it may very well be correct, but it could very well be an error in the example. The error sounds like you might have incompatible versions of Struts and Struts-Tiles. Is it possible that another Tiles version is in your classpath or something? I don't have the war file readily available to check. HTH, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts-Tiles-%281.3.8%29---NoSuchMethodError-Exception-tp14507333p14522429.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: checkbox interceptor
hi, one update: CASE 1: when i write as: s:iterator status=s value=languageMap s:checkbox label=%{top.value} value=%{selectedClientLangList.contains(top.key)} id=%{top.key} fieldValue=%{top.key} name=selectedClientLangList theme=ajax / /s:iterator i see in html source: input type=hidden name=__checkbox_... CASE 2: but if u use: s:checkboxlist label=Client Language list=languageMap name=selectedClientLangList / but this doesnt produce : __checkbox_ named fields at all! the problem is when i write ajax validations: the CASE 2 doesnt produce onblur() functions and hence doesnt get validated. The CASE1 produces onblur() functions but this fellow doesnt produce __checkbox_ names hiddenfields and hence the checkbox interceptor has no effect. it seems like both of these cannot happen simultaneously or i m going wrong somewhere any help??? cheers, ravi ravi_eze wrote: hi, i have a form which has multiple checkbox lists in it. by default in each of the checkboxes few of them are selected. The problem is: when user unchecks all the boxes and submits the form is getting submitted with the default values. When i am using checkbox interceptor, and view source of the page i see the __checkbox_ is appearing to first of the list and not to all of the checkbox -lists! and even this gets submitted as a list with values [false] instead of [] list. Added, this is not happening to all check boxes list. it seems like the checkbox interceptor is happening for the 1st checkbox list and not to all. more over i need an empty list to be submitted instead of a list with [false] in it. is this not possible? -- View this message in context: http://www.nabble.com/checkbox-interceptor-tp14469895p14488746.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: checkbox interceptor
hi, one update: CASE 1: when i write as: s:iterator status=s value=languageMap s:checkbox label=%{top.value} value=%{selectedClientLangList.contains(top.key)} id=%{top.key} fieldValue=%{top.key} name=selectedClientLangList theme=ajax / /s:iterator i see in html source: input type=hidden name=__checkbox_... CASE 2: but if u use: s:checkboxlist label=Client Language list=languageMap name=selectedClientLangList / but this doesnt produce : __checkbox_ named fields at all! the problem is when i write ajax validations: the CASE 2 doesnt produce onblur() functions and hence doesnt get validated. The CASE1 produces onblur() functions but this fellow doesnt produce __checkbox_ names hiddenfields and hence the checkbox interceptor has no effect. it seems like both of these cannot happen simultaneously or i m going wrong somewhere any help??? cheers, ravi ravi_eze wrote: hi, i have a form which has multiple checkbox lists in it. by default in each of the checkboxes few of them are selected. The problem is: when user unchecks all the boxes and submits the form is getting submitted with the default values. When i am using checkbox interceptor, and view source of the page i see the __checkbox_ is appearing to first of the list and not to all of the checkbox -lists! and even this gets submitted as a list with values [false] instead of [] list. Added, this is not happening to all check boxes list. it seems like the checkbox interceptor is happening for the 1st checkbox list and not to all. more over i need an empty list to be submitted instead of a list with [false] in it. is this not possible? -- View this message in context: http://www.nabble.com/checkbox-interceptor-tp14469895p14488747.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
checkbox interceptor
hi, i have a form which has multiple checkbox lists in it. by default in each of the checkboxes few of them are selected. The problem is: when user unchecks all the boxes and submits the form is getting submitted with the default values. When i am using checkbox interceptor, and view source of the page i see the __checkbox_ is appearing to first of the list and not to all of the checkbox -lists! and even this gets submitted as a list with values [false] instead of [] list. Added, this is not happening to all check boxes list. it seems like the checkbox interceptor is happening for the 1st checkbox list and not to all. more over i need an empty list to be submitted instead of a list with [false] in it. is this not possible? -- View this message in context: http://www.nabble.com/checkbox-interceptor-tp14469895p14469895.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error: dojo is not defined
check if u had s:head theme=ajax / defined in ur jsp head tag. one more thing: explode strruts-core.jar and copy the folder struts in it. it would contain dojo.. etc files. on including the head tag as said above, and view source u will find stru ts is trying to call some .js files. make sure that u get them all from strus-core.jar (at some path inside) and make it available in the context ... or in other words copy paste it in ur war file. hope this helps Dean Pullen-2 wrote: Ok another one... I see the dojo is in the core jar, and the dojo head seems to get defined correctly in the JSP. Anyone know the resolution to this issue? -- View this message in context: http://www.nabble.com/Error%3A-dojo-is-not-defined-tp13158507p14469983.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
conversion is not happening for nested properties of action class; (XW-297
hi, issue: An action class has a dto(say EmployeeDto) in it. In a particular scenario (when object to string is happening) we are finding that dto-conversion.porperties (EmployeeDto-conversion.properties) is being called instead of actionClass-conversion.properties. This shouldn't happen according to documentation. details: i am trying to write a custom converter for Long in struts2 framework which internally uses xwork framework for the same. This class contains dto object which furter has longFieldName as long data type. I created the actionname -conversion.properties file which contains dto.longFieldName=path.LongConverter entry in it. The LongConverter extends StrutsTypeConverter which internally extends DefaultCOnverter . What i observed is that stringToObject method of LongCOnverter is being called by XWorkConverter but for objectTOString LongConverter is not being called! After sufficient investigation and debugging the source code i discovered that the XWorkConverter is expecting dto-conversion.properites file for ObjectToString conversion and ActionClass-conversion.properties for stringToObject conversion. I am not understanding as to why this is happening. The XW-297 issue puts forward the same issue but it seems like this is working partially now! any ideas where i am going wrong? pl: help. -- View this message in context: http://www.nabble.com/conversion-is-not-happening-for-nested-properties-of-action-class--%28XW-297-tp14466052p14466052.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Multi Level Type Conversion
hi, i had the same problem (http://forums.opensymphony.com/thread.jspa?threadID=184150tstart=0) try creating a file: Calender-conversion.properties at location: /java/util/ (i.e. assuming location of calendar @: java.util.calender and assuming calendar is the object type of the field variable in ur action class.) This should work, but not sure why for this absurd behavior. cheers, ravi richmondp wrote: Hi, I am trying to write a type converter that will convert a String to a Date Time (dd/mm/yyy HH:mm:ss) and then convert the Date back to a String. I already have a global converter that converts a String to a Date (dd/mm/) and back to a String so my DateTime conveter is class specific and only for the attribute 'user.modificationDate' The problem that I am getting is that when go between my JSP and my Struts 2 Action my DateTimeConverter.convertFromString() is being called successfully but on the way back to the JSP my DateTimeConverter.convertToString() is not being called. Instead the global DateConverter.convertToString () is being called. I have read some posts that indicate that if I change my attribute name to be single level i.e. modificationDate then my DateTimeConverter.convertToString() will be called. I have tried this and it does seem to work but I can't use this as a solution as the modificationDate is directly related to the user. Is there something that I am doing wrong or is this an issue with Struts 2?? For the record I am using Java 5 and Struts 2.0.9 A Sample of my code is below: DateTimeConvertor.java: private static final String DATE_TIME_FORMAT = dd/MM/ HH:mm:ss; public Object convertFromString(Map map, String[] strings, Class aClass) { if (strings == null || strings.length == 0) { return null; } SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME_FORMAT); Calendar cal; try { Date date = sdf.parse(strings[0]); cal = Calendar.getInstance(); cal.setTime(date); } catch (ParseException e) { cal = null; } return cal; } public String convertToString(Map context, Object object) { if (object != null object instanceof Calendar) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME_FORMAT); return sdf.format(((Calendar)object).getTime()); } return null; } UpdateUser conversion properties file: user.modificationDate=test.util.conversion.DateTimeConverter Global DateConverter: private static final String FORMAT = dd/MM/; public Object convertFromString(Map map, String[] strings, Class aClass) { if (strings == null || strings.length == 0) { return null; } SimpleDateFormat sdf = new SimpleDateFormat(FORMAT); Calendar cal; try { Date date = sdf.parse(strings[0]); cal = Calendar.getInstance(); cal.setTime(date); } catch (ParseException e) { cal = null; } return cal; } public String convertToString(Map map, Object object) { if (object != null object instanceof Calendar) { SimpleDateFormat sdf = new SimpleDateFormat(FORMAT); return sdf.format(((Calendar)object).getTime()); } return null; } Global XWork Conversion file: java.util.Calendar=test.util.conversion.DateConverter -- View this message in context: http://www.nabble.com/Struts-2-Multi-Level-Type-Conversion-tp13741515p14434672.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]