Html option:collection error
Hello Everyone, I have weird problem withhtml:optionsCollection tag. I am trying to populate the mutli select box using collection. It works some times and some times I get this exception: [ServletException in:/wspb_drivers.jsp] Failed to obtain specified collection' If I start the project again,I don't get this exception. This excception occurs randomly. Anyone has got clue what is going on? Here is my jsp: html:select property=driversSelect multiple=true size=5 html:optionsCollection property=driversList label=name value=value / /html:select Here is my Formbean code: I am pre-populating this collection in reset() method. private NameValue[] driversList; private NameValue[] regProgramDriversList; public void reset(ActionMapping mapping, HttpServletRequest request) { PlanDriverForm planDriverForm = null; ProjectBean projectBean = null; if (driversList == null){ driversList = new NameValue[0]; driversList = ((LookupServices)DataServicesDelegate.getInstance().getLookupServices()).getLookupByType(DRIVERS); } } public void setDriversList(NameValue[] driversList) { this.driversList = driversList; } public NameValue[] getDriversList() { return driversList; } Your help is really appreciated. -- View this message in context: http://www.nabble.com/Html-option%3Acollection-error-tf2352727.html#a6552421 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: Question about session time-out using Listener
Thanks for all your replies. My application is a struts application. I tried to use SessionInactivityFilter, i am getting compilation errors. I just have to include the following in my xml file or I need to do something else also: filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter/filter-class init-param param-nameforwardTo/param-name param-value/session_expired.jsp/param-value /init-param /filter I get the following error: Error(108,9): Invalid element 'filter' in content of 'web-app', expected elements '[taglib, resource-env-ref, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref, ejb-local-ref]'. Tamas Szabo wrote: Hi, You can use SessionInactivityFilter from the JavaWebParts project if you don't want to reinvent the wheel: Doc: http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html JWP Home Page: http://javawebparts.sourceforge.net/ Good Luck, Tamas http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html On 9/25/06, mosho [EMAIL PROTECTED] wrote: Hi All, When session times out I want to forward a request to another page.Is it possible to do it with HttpSessionListener? How can I get response object so that I can redirect to another page? Thanks for your help! -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480246 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6486905 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: Question about session time-out using Listener
Thanks Tamas. That seems to get rid of the errors but it doesn't work. When the session expires, it doesn't take me to any page, I tried forwarding to struts actions and .jsp files, it doesn;t work for both. Any idea? filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter/filter-class init-param param-nameforwardTo/param-name param-value/sessionError.do/param-value /init-param /filter Tamas Szabo wrote: Yes, you probably just added the filter at the end of the web.xml, after the error-page element that you already had in there. You have to declare the elements in the order defined by the DTD. For 2.3 this is: !ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*) So try to have the declaration of the filter and filter-mapping just before the listener elements or the servlet element if you don't have any listeners declared. Please don't hesitate to contact us if you have any other problems. Tamas On 9/25/06, mosho [EMAIL PROTECTED] wrote: Thanks for all your replies. My application is a struts application. I tried to use SessionInactivityFilter, i am getting compilation errors. I just have to include the following in my xml file or I need to do something else also: filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter/filter-class init-param param-nameforwardTo/param-name param-value/session_expired.jsp/param-value /init-param /filter I get the following error: Error(108,9): Invalid element 'filter' in content of 'web-app', expected elements '[taglib, resource-env-ref, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref, ejb-local-ref]'. Tamas Szabo wrote: Hi, You can use SessionInactivityFilter from the JavaWebParts project if you don't want to reinvent the wheel: Doc: http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html JWP Home Page: http://javawebparts.sourceforge.net/ Good Luck, Tamas http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html On 9/25/06, mosho [EMAIL PROTECTED] wrote: Hi All, When session times out I want to forward a request to another page.Isit possible to do it with HttpSessionListener? How can I get response object so that I can redirect to another page? Thanks for your help! -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480246 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6486905 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6488051 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: Question about session time-out using Listener
Hi Tamas I am getting this error. do I need to inculde class SessionInactivityFilter or implement this class. I didn't understand how it is going to work. Servlet error: Error loading filter 'SessionInactivityFilter', filter-class 'javawebparts.filter.SessionInactivityFilter' not found This is how my web.xml looks like; filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter/filter-class init-param param-nameforwardTo/param-name param-value/sessionError.do/param-value /init-param /filter filter-mapping filter-nameSessionInactivityFilter/filter-name url-pattern/*/url-pattern /filter-mapping Tamas Szabo wrote: Did you also map the filter to /* with a filter-mapping? Just after the filter element you declared you should have: filter-mapping filter-nameSessionInactivityFilter /filter-name url-pattern/*/url-pattern /filter-mapping This is the first think I can think of. If you think that you got that right it would be good if I could see your whole web.xml file. Tamas On 9/25/06, mosho [EMAIL PROTECTED] wrote: Thanks Tamas. That seems to get rid of the errors but it doesn't work. When the session expires, it doesn't take me to any page, I tried forwarding to struts actions and .jsp files, it doesn;t work for both. Any idea? filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter /filter-class init-param param-nameforwardTo/param-name param-value/sessionError.do/param-value /init-param /filter Tamas Szabo wrote: Yes, you probably just added the filter at the end of the web.xml, after the error-page element that you already had in there. You have to declare the elements in the order defined by the DTD. For 2.3 this is: !ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*) So try to have the declaration of the filter and filter-mapping just before the listener elements or the servlet element if you don't have any listeners declared. Please don't hesitate to contact us if you have any other problems. Tamas On 9/25/06, mosho [EMAIL PROTECTED] wrote: Thanks for all your replies. My application is a struts application. I tried to use SessionInactivityFilter, i am getting compilation errors. I just have to include the following in my xml file or I need to do something else also: filter filter-nameSessionInactivityFilter/filter-name filter-classjavawebparts.filter.SessionInactivityFilter /filter-class init-param param-nameforwardTo/param-name param-value/session_expired.jsp/param-value /init-param /filter I get the following error: Error(108,9): Invalid element 'filter' in content of 'web-app', expected elements '[taglib, resource-env-ref, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref, ejb-local-ref]'. Tamas Szabo wrote: Hi, You can use SessionInactivityFilter from the JavaWebParts project if you don't want to reinvent the wheel: Doc: http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html JWP Home Page: http://javawebparts.sourceforge.net/ Good Luck, Tamas http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/SessionInactivityFilter.html On 9/25/06, mosho [EMAIL PROTECTED] wrote: Hi All, When session times out I want to forward a request to another page.Isit possible to do it with HttpSessionListener? How can I get response object so that I can redirect to another page? Thanks for your help! -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480246 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6486905 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html
Question about session time-out using Listener
Hi All, When session times out I want to forward a request to another page.Is it possible to do it with HttpSessionListener? How can I get response object so that I can redirect to another page? Thanks for your help! -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480246 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: Question about session time-out using Listener
do you have any example to do this? Thanks. Li-3 wrote: you can create a taghandler, much simpler and flexible On 9/25/06, mosho [EMAIL PROTECTED] wrote: Hi All, When session times out I want to forward a request to another page.Is it possible to do it with HttpSessionListener? How can I get response object so that I can redirect to another page? Thanks for your help! -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480246 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death. -- View this message in context: http://www.nabble.com/Question-about-session-time-out-using-Listener-tf2329396.html#a6480446 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: Question about Lookup dispatch action
Yes, that's exactly the way it works. My navigation with lookupDispatchAction works perfectly. The problem arises when I have another to link instead of button to submit the form, how do I pass navigation parameter value then? The javascript with hidden field doesn't solve the problem. Thanks! Scott Van Wart-2 wrote: mosho wrote: Request[/planName] does not contain handler parameter named navigation In your struts-config.xml, are you including 'parameter=navigation' in your action mapping? A la: action path=/planName type=my.pkg.PlanNameAction name=planNameForm parameter=navigation ... /action The parameter gives you a place to pass additional data to your action. In the case of LookupDispatchAction, it uses it to find out which request parameter (in this case, navigation) it should look at to determine which method to call in your subclass. So your form will submit, and be stuff like: navigation=Next%20Record It looks messy, but that's OK. The framework takes it and translates it back into Next Record. Now in your subclass, you override getKeyMethodMap() right? And somewhere in there, you have something like, map.put( navigation.next.record, next ); Where next corresponds to the public ActionForward next( ActionMapping...) method you have defined in your subclass. And in your MessageResources.properties (or whatever the file's called in your web app), you have: navigation.next.record=Next Record See how everything links together? Now the button text you choose is likely different, but this flexibility is the reason you NEVER refer to the button by its text. Let Struts do that internally, only your users should see it. Just thought I'd give you a little background so you know what you're getting into; anyone correct me if I'm wrong :) Oh one last thing. Make sure you're NOT overriding execute() in your subclass. It's fine for regular Action-derived classes, but you're using LookupDispatchAction, which needs to run its own implementation of execute(). - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5945508 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about Lookup dispatch action
Hi Scott, I added a unspecified() method in my action class and it works now. I am not able to understand though how it is working, unspecified() is called when parameter name doesn;t exist, right? I have a parameter name= navigation and its value is shown as {submitText}. But it calls unspecified method, for that value as it would have done if value is null. I am assuming it is calling unspecified() because it is not able to find the key name {submitText} Any idea? Thanks, you have been very helpful. Scott Van Wart-2 wrote: mosho wrote: Yes, that's exactly the way it works. My navigation with lookupDispatchAction works perfectly. The problem arises when I have another to link instead of button to submit the form, how do I pass navigation parameter value then? The javascript with hidden field doesn't solve the problem. Is the hidden field within the html:form... (here) /html:form tags? - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5951171 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about Lookup dispatch action
Hey Scott FINALLY! It works !!! Including xml tag in my javascript is the solution for me. THANKS ! Scott Van Wart-2 wrote: mosho wrote: Hi Scott, I added a unspecified() method in my action class and it works now. I am not able to understand though how it is working, unspecified() is called when parameter name doesn;t exist, right? I have a parameter name= navigation and its value is shown as {submitText}. But it calls unspecified method, for that value as it would have done if value is null. I am assuming it is calling unspecified() because it is not able to find the key name {submitText} I hope I read your reply correctly. You should NEVER EVER see {submitText} when you're stepping through Java, or in the log window, or in an exception stack trace!!! The ONLY place it should appear is in your JSP. In ALL OTHER PLACES, you should see the text that you put in your MessageResources.properties. If you're seeing {submitText} verbatim, then your JSP compiler is ignoring EL, or it's not written correctly. For this line in your JSP, hiddenField.value = ${submitText}; Go ahead and request your page in your browser, then go to view source. Scroll down to where this line should appear in the HTML, and make sure it says something like, hiddenField.value = Next; instead. Now there might be a workaround... I gave you the EL method because I find it much cleaner than embedding XML-like tags in JavaScript, but the following may also work in your JSP: hiddenField.value = 'bean:message key=button.next /'; This might work... I don't LIKE it, because it's an XML (tag library, whatever) tag inside JavaScript inside HTML in a JSP... but oh well. Note the quotes -- the outermost are single quotes, the innermost are double quotes. Double check them even if you copied/pasted them just to get into the habit. If you were using {submitText} in your post as a placeholder for the actual text that should appear to the browser, my apologies, though I hope you understand what I was getting at :). If this WAS the case, since you're not using EL, feel free to remove the lines I gave you in an earlier post, c:set var=submitText bean:message key=button.submit / /c:set As you don't need them. - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5953411 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about Lookup dispatch action
Thanks for your help guyz. It doesn't seem to work. The value of submitText is not passed to the hidden.value The form gets submitted but gives an error Request[/planName] does not contain handler parameter named navigation I am pasting my code below. input type=hidden id=hiddenNavigation name=navigation value= disabled c:set var=submitText bean:message key=button.refresh / /c:set script type=text/javascript function onClickSubmit() { var hiddenField = document.getElementById( hiddenNavigation ); hiddenField.disabled = false; hiddenField.value = ${submitText}; alert(hiddenField.value); document.planNameForm.submit(); } /script !-- a onclick=onClickSubmit() -- Thanks again! Puneet Lakhina wrote: The return false; would have to go LAST, otherwise onClickSubmit() wouldn't get called. Yup..sorry.. my wrong.. -- Puneet -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5937309 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about Lookup dispatch action
Hi Scott, It doesn't seem to work. My submit buttons look like this: html:submit property=navigation value=Previous styleClass=button bean:message key=button.previous/ /html:submitnbsp;nbsp;nbsp; Now, if I have a link, how can I set the property navigation for it. onClickSubmit() pic.gif Scott Van Wart-2 wrote: Christopher Goldman wrote: On Thu, 2006-08-17 at 14:26 -0700, mosho wrote: Hi All, I have multiple buttons on my form and I am using LookUpDistpatchAction to submit the form depending on which button is clicked. I have another requirement now, I have multiple images that are going to be links. I need to submit the form using onclick. So in my javascript, I will have to submit the form. How can I change/ set the value for my parameter? It is giving me error: Request[/selectLocation] does not contain handler parameter named navigation Thanks for your help, In your onclick handler for the images, change the (presumably) hidden form input field value: document.forms[form-name].elements[navigation].value = new-value Then, submit the form. This is in Firefox. Looks like it works for IE as well. Not really a Struts question -- just straight Javascript... Doesn't he need to match up the message resource values, like if he had, protected Map getKeyMethodMap() { Map map = new TreeMap(); map.put( form.create, create ); return map; } Then it would take a little trickery in the JSP to get the right values in the Javascript: c:set var=createLabel bean:message key=form.create / /c:set So the web browser passes the correct value, and the lookup map will work: function onClickCreate() { document.someForm.action.value = ${createLabel}; document.someForm.submit(); } That should do it I think... - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a5876941 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about Lookup dispatch action
Hi All, I have multiple buttons on my form and I am using LookUpDistpatchAction to submit the form depending on which button is clicked. I have another requirement now, I have multiple images that are going to be links. I need to submit the form using onclick. So in my javascript, I will have to submit the form. How can I change/ set the value for my parameter? It is giving me error: Request[/selectLocation] does not contain handler parameter named navigation Thanks for your help, -- View this message in context: http://www.nabble.com/Question-about-Lookup-dispatch-action-tf2124092.html#a585 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to pass attribute values from bean in tiles
Hi, I have property pageTitle in my java bean. How can I pass that value to tile attribute? i have xml file, where I am defining my tile definitions. For example, if I include tiles:insert attribute=title beanName=pageTitle beanProperty=common.Page ignore=true/ Thanks -- View this message in context: http://www.nabble.com/how-to-pass-attribute-values-from-bean-in-tiles-tf2047115.html#a5637498 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to set tiles attribute dynamically?
Neil, I am trying to do same thing my page_title comes from the db and it depends on the parameter. I fail to understand, how are you doing it? Do you have some example code. You are creating another class as MyController? Thanks -- View this message in context: http://www.nabble.com/How-to-set-tiles-attribute-dynamically--tf132145.html#a5637812 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question regarding getRequestURI()
Thanks for your replies. This solution works for me, mapping.getpath(). -- View this message in context: http://www.nabble.com/Question-regarding-getRequestURI%28%29-tf2016924.html#a5576221 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to call other tiles from baselayout
I have a problem. I am using tiles for my layout. I have a baselayout.jsp where I am inserting all my header, body and footer tags. I want to insert another attribute called breadcrumbs which have some insert statements. for example, my tile definition is: definition name=baseLayout path=/templates/baseLayout.jsp put name=pageTitle value=Watershed Planning type=string / put name=header value=/templates/header.jsp type=page / put name=breadcrumb value=/templates/breadcrumbs.jsp type=page / put name=footer value=/templates/footer.jsp type=page / put name=pagecontent value=/wspb_planbuilderintro.jsp / /definition Can i do this in my base layout: tiles:insert attribute=breadcrumbs tiles:put name=pageTitle beanName=pageTitle beanScope=tile / /tiles:insert Value of breadcrumbs is another jsp file: litiles:getAsString name=pageTitle //li Thanks -- View this message in context: http://www.nabble.com/how-to-call-other-tiles-from-baselayout-tf2029501.html#a5582228 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question regarding getRequestURI()
Hi All, I am using struts 1.1 I need to get the process.do from the url. For example if I have http://11.1.30.222:1001/testproject/process.do By using getRequestURI(), I can get /testproject/process.do but I just need process.do. Is there any way to get this? Thanks -- View this message in context: http://www.nabble.com/Question-regarding-getRequestURI%28%29-tf2016924.html#a5544941 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Valdator - RequiredIf doesn't work for IE
Hi all, I am using struts 1.1 version. I have set up validator framework. I am using requiredIf rule, it works perfectly in Mozilla Firefox but it doesn't work in Internet Explorer version 6.0. Is there any reason for it? Is it not supported on IE. Thanks -- View this message in context: http://www.nabble.com/Valdator---RequiredIf-doesn%27t-work-for-IE-tf1968272.html#a5402491 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Valdator - RequiredIf doesn't work for IE
Thanks Adam. I got it working now -- View this message in context: http://www.nabble.com/Valdator---RequiredIf-doesn%27t-work-for-IE-tf1968272.html#a5403936 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html link tag to call action forward
Hi all, I am struts 1.1. My requirement is to have links which will call one action and each link will have unique identifier to get data. For example, something lilke this: home.do?action=link1 action parameter will keep changing. How can I do this? I would like to use one action class for all the link and have different action forwards. Is there a way to set the parameter for html:link tag and then use that parameter in the action mapping to find the relevant forward. Thanks for your help. -- View this message in context: http://www.nabble.com/html-link-tag-to-call-action-forward-tf1962710.html#a5385339 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Does validator work with Lookup dispatch action
I have two submit buttons previous and next. I need to validate only when I hit next button. I can control this by using page attribute in valdation.xml. This works for server-side. It doesn't work for client side validation. How can I do client side validation only when i hit next button. Is there any solution for it? Thanks for your help. -- View this message in context: http://www.nabble.com/Does-validator-work-with-Lookup-dispatch-action-tf1931125.html#a5314885 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does validator work with Lookup dispatch action
Hi, I am using struts for my application. I have 3 buttons in my form i.e prev,next,clear. I read few articles and found that Lookup dispatch action will be the best option to use. I have few concerns using lookupdispatch action, 1. Will I be able to validate using struts validator? 2. I need to validate only when next button is hit, is that possible? Is there any tutorial avialable for using lookup dispatch action. Thanks Mosho -- View this message in context: http://www.nabble.com/Does-validator-work-with-Lookup-dispatch-action-tf1931125.html#a5289472 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does validator work with Lookup dispatch action
Thanks for all the replies. Wendy, I am using struts 1.1 so I don't think I can use EventDispatchAction. Adam, what is the difference between MappingDispatchAction and LookupDispatchAction. Any advantages over LookupDispatchAction? Also, do you have an example of how to set page attribute and use client side script to set the page request parameter. I am new to this, all your help is appreciated. Mosho -- View this message in context: http://www.nabble.com/Does-validator-work-with-Lookup-dispatch-action-tf1931125.html#a5290199 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does validator work with Lookup dispatch action
I have another question, I was just trying to use LookupDispatchAction. It looks like if I am extending LookupDispatchAction, I don't have to use excute method. Is that right? I can do all the processing in the respective previous and next methods. Previous methods looks like ..for ex: public ActionForward previous(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do add return mapping.findForward(previous); } Wendy,you are right my application is a wizard. -- View this message in context: http://www.nabble.com/Does-validator-work-with-Lookup-dispatch-action-tf1931125.html#a5290575 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Does validator work with Lookup dispatch action
Hi Wendy, As per my requirement, I need to validate only when next button is hit. I can validate manually for server-side validation, it is working. How do I control for clients-side validation? If I include javascript tag in my jsp, it is going to validate even if I hit previous or next button. Thanks for your help -- View this message in context: http://www.nabble.com/Does-validator-work-with-Lookup-dispatch-action-tf1931125.html#a5291882 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Struts validator
I really appreciate all your help. David, I want to use struts validator and just control validation manually. Why do I need saveErrors() method and what does it do? Isn't the validator does all that. I am little confused. I am pasting my execute method below, please let me know what should I add to make it work. The way it is wortkng now: it is giving me null pointer exception if I hit go in the url for selstate.do action. It is doing client site validation only if i hit submit button. public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { SelStateForm sform = (SelStateForm) form; String isSubmitted = sform.getIsSubmitted(); if(isSubmitted == Yes || isSubmitted.equalsIgnoreCase(Yes)) { ActionErrors errors = sform.validate( mapping, request ); if((errors != null) errors.size() 0) { return mapping.findForward(mapping.getInput()); } } return mapping.findForward(success); } } Wendy, thanks for letting me know about making validate false in config file. Thanks. Rosh -- View this message in context: http://www.nabble.com/Question-about-Struts-validator-tf1851247.html#a5087526 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Struts validator
David, Thanks a lot! I understood the whole concept now. It's working perfectly!!! Thanks again! Rosh -- View this message in context: http://www.nabble.com/Question-about-Struts-validator-tf1851247.html#a5089649 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Struts validator
Thanks David for your reply. If I call validate method manually, can I still use validator framework and use the input attribute in the config file to display the errors? I need to validate only if form is submitted by clicking on a button. If, yes can you show me with an example how to call validate method in Action class, execute method. Thanks Rosh -- View this message in context: http://www.nabble.com/Question-about-Struts-validator-tf1851247.html#a5073203 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Struts validator
Thanks David and Wendy for your help but it doesn't seem to work. I added manually validate in my execute method. It still validates if I directly enter the url. I am pasting part of my code for you to take a look and let me know where I am going wrong. Thanks again! --Struts config part-- action path=/selState type=com.sami.view.SelStateAction name=selStateForm scope=session input=.selectState forward name=success path=.indianLandInfo/ /action ---SelStateAction-- SelStateForm sform = (SelStateForm) form; String isSubmitted = sform.getIsSubmitted(); if(isSubmitted == Yes || isSubmitted.equalsIgnoreCase(Yes)) { ActionErrors errors = sform.validate( mapping, request ); } return mapping.findForward(success); ---JSP file--- html:form action=selState.do method=POST onsubmit=return validateSelStateForm(this); . . html:hidden property=isSubmitted value=yes / /table html:javascript formName=selStateForm / /html:form -- View this message in context: http://www.nabble.com/Question-about-Struts-validator-tf1851247.html#a5074217 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question about Struts validator
Thanks David and Wendy for your help but it doesn't seem to work. I added manually validate in my execute method. It still validates if I directly enter the url. I am pasting part of my code for you to take a look and let me know where I am going wrong. Thanks again! --Struts config part-- action path=/selState type=com.sami.view.SelStateAction name=selStateForm scope=session input=.selectState forward name=success path=.indianLandInfo/ /action ---SelStateAction-- SelStateForm sform = (SelStateForm) form; String isSubmitted = sform.getIsSubmitted(); if(isSubmitted == Yes || isSubmitted.equalsIgnoreCase(Yes)) { ActionErrors errors = sform.validate( mapping, request ); } return mapping.findForward(success); ---JSP file--- html:form action=selState.do method=POST onsubmit=return validateSelStateForm(this); . . html:hidden property=isSubmitted value=yes / /table html:javascript formName=selStateForm / /html:form -- View this message in context: http://www.nabble.com/Question-about-Struts-validator-tf1851247.html#a5074256 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]