how to crash your JVM with struts
This causes a JVM crash (dialog box with a hex number on Windows 2000 - JVM exits ungracefuly ) while doing Server Side validation. action path=/secureOrderChequesInit type=com.bmo.olb.controller.SecureOrderChequesAction parameter=mode name=secureOrderChequesForm scope=request validate=false forward name=form path=cheques/SecureChequeOrderingForm.jsp/ /action action path=/secureOrderCheques type=com.bmo.olb.controller.SecureOrderChequesAction parameter=mode name=secureOrderChequesForm scope=session validate=true input=/OLBmain/secureOrderCheques?mode=form forward name=confirm path=cheques/SecureChequeOrderingConfirm.jsp/ forward name=form path=cheques/SecureChequeOrderingForm.jsp/ /action The following works - no crashes of JVM action path=/secureOrderChequesInit type=com.bmo.olb.controller.SecureOrderChequesAction parameter=mode name=secureOrderChequesForm scope=request validate=false forward name=form path=cheques/SecureChequeOrderingForm.jsp/ /action action path=/secureOrderCheques type=com.bmo.olb.controller.SecureOrderChequesAction parameter=mode name=secureOrderChequesForm scope=session validate=true input=/OLBmain/secureOrderChequesInit?mode=form forward name=confirm path=cheques/SecureChequeOrderingConfirm.jsp/ forward name=form path=cheques/SecureChequeOrderingForm.jsp/ /action Obviously, the only change made is: input=/OLBmain/secureOrderChequesInit?mode=form instead of input=/OLBmain/secureOrderCheques?mode=form Now, I don't realy have a problem, but, I am curious why the JVM should crash so badly (no exceptions, just a crash with a hex number in the dialog box). In both cases mode=form - form here is a bit of a mis-nomer - it is a method name in the action : com.bmo.olb.controller.SecureOrderChequesAction The JVM in question is in Websphere Studio Enterprise Developer 5.0x on Win2K - Struts 1.1 RC3(?) Regards, Aleksandar.
Re: sslext
I think it should work - another thing to try would be to use maybe sslext:rewrite for the actual action inside of a plain html form. I have not tried this approach yet, but i will tonight... The behaviour you are showing (no parameters in the https page) is exactly what I was getting also. Do you have cookies enabled and URL rewriting? Regards, a.m. Nagendra Kumar O V S [EMAIL PROTECTED] 25/07/2003 08:27 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Re: sslext hi thnx for the input. i did try with the pageScheme tag.. it did't make any diff then next trial was to direct to https from creditcard page rather than http.. i observe that the paramerters are't anymore on the querystring.(strange) so to say, can't i submit a https form and then forward to http page?? - nagi ---Original Message--- From: Struts Users Mailing List Date: Friday, July 25, 2003 05:31:11 PM To: Struts Users Mailing List Subject: Re: sslext My page is not SSL, but my form does a https submit, and then it forwards on to itself - after submitting, the page IS https - and then I get only jsessionid in the line. I have a sslext:pageScheme secure=false / In my page right above the sslext:form This drove me nuts... Regards, a.m. Nagendra Kumar O V S wrote: hi, session is well established while login and i am using SSL for the creditcard page i forgot to mention, it appends along with jsessionid(obviously).. i feel i am missing something here in the configuration when i submit from the creditcard page, it comes back to the http protocol with jsessionid and all the creditcard details appended to the querystring. and i am using sslext:form on the creditcard jsp page any guess?? TIA -- nagi /---Original Message---/ /*From:*/ Struts Users Mailing List mailto:[EMAIL PROTECTED] /*Date:*/ Friday, July 25, 2003 04:59:07 PM /*To:*/ Struts Users Mailing List mailto:[EMAIL PROTECTED] /*Subject:*/ Re: sslext Do you have a session established before you do this? Try doing your request.getSession(true); before executing the sslext pages... a.m. Nagendra Kumar O V S wrote: hi, i am using struts1.1 with sslext . everything seems to be working fine , but one problem i observe is that, when the url is redirected , all the request parameters show up in the query string. how can i avoid it TAI --nagi *Nagendra Kumar O V S* Member Technical Staff /Ikigo India Private Ltd./ /470-B, Road No. 36,/ /Jubilee Hills,/ /Hyderabad 500033/ Contact(O): 23544671 Cell: 98482-41789 http://www.incredimail.com/redir.asp?ad_id=309lang=9 http://www.incredimail.com/redir.asp?ad_id=309lang=9 /IncrediMail/ - *Email has finally evolved* - *_Click Here_* http://www.incredimail.com/redir.asp?ad_id=309lang=9 http://www.incredimail.com/redir.asp?ad_id=309lang=9 - To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] . http://www.incredimail.com/redir.asp?ad_id=309lang=9 /IncrediMail/ - *Email has finally evolved* - *_Click Here_* http://www.incredimail.com/redir.asp?ad_id=309lang=9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . IncrediMail - Email has finally evolved - Click Here
validation sequence
Hi there, I was wondering, does anyone know in which sequence this kind of validation will happen - depends=acustomvalidation,mask,bcustomvalidation so, will it be alphabetic as in: acustomvalidation,bcustomvalidation,mask or acustomvalidation,mask,bcustomvalidation or random?? Thanks, Aleksandar.
RE: validation sequence
This is my form and the generated Javascript, please note the position of the * integer * validator. Most of the validators are custom, except the * integer * validator, and for some reason, it puts it at the END of the generated validator Javascript. Thanks, a.m. form name=incMortPayForm field property=mortNumber depends=reqXDefault,integer /field field property=newAmount depends=xor,amountNoRequired /field field property=pcntIncrease depends=xor,pcntAmount /field field property=coCardNumber depends=condRequired,condMask /field field property=coPassword depends=condRequired /field field property=guarCardNumber depends=condRequired,condMask /field field property=guarPassword depends=condRequired /field /form script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false; function validateIncMortPayForm(form) { if (bCancel) return true; else return validateReqXDefault(form) validateXOR(form) validateAmount(form) validatePcntAmount(form) validateCondRequired(form) validateCondMask(form) validateInteger(form); } Yansheng Lin [EMAIL PROTECTED] 25/07/2003 03:34 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: validation sequence On client side, if your javascript is something like: return validateA(form) validateMask(form) validateB(form) than the execution sequence will be from left to right. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: July 25, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: validation sequence Hi there, I was wondering, does anyone know in which sequence this kind of validation will happen - depends=acustomvalidation,mask,bcustomvalidation so, will it be alphabetic as in: acustomvalidation,bcustomvalidation,mask or acustomvalidation,mask,bcustomvalidation or random?? Thanks, Aleksandar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation sequence
Actualy, I just found out that this is not illegal and it will not crash anything ( it will just look odd in the validation.xml file ): form name=incMortPayForm field property=newAmount depends =xor,amountNoRequired,integer,required,blahblah /field /form can be split into: form name=incMortPayForm field property=newAmount depends=xor /field field property=newAmount depends=amountNoRequired /field field property=newAmount depends=integer /field field property=newAmount depends=required /field field property=newAmount depends=blahblah /field /form Thereby GURANTEEING the sequence of validation - we have very complex validations, and they must be done in a particular sequence... Regards, a.m. Yansheng Lin [EMAIL PROTECTED] To:'Struts Users Mailing List' [EMAIL PROTECTED] cc: 25/07/2003 04:24 PM Subject:RE: validation Please respond to Struts sequence Users Mailing List Ok, if you want to be 100% sure the sequence is right, add an alert() statement in each validate functions:). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: July 25, 2003 2:08 PM To: Struts Users Mailing List Subject: RE: validation sequence This is my form and the generated Javascript, please note the position of the * integer * validator. Most of the validators are custom, except the * integer * validator, and for some reason, it puts it at the END of the generated validator Javascript. Thanks, a.m. form name=incMortPayForm field property=mortNumber depends=reqXDefault,integer /field field property=newAmount depends=xor,amountNoRequired /field field property=pcntIncrease depends =xor,pcntAmount /field field property=coCardNumber depends=condRequired,condMask /field field property=coPassword depends=condRequired /field field property=guarCardNumber depends=condRequired,condMask /field field property=guarPassword depends =condRequired /field /form script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false;function validateIncMortPayForm(form) { if (bCancel) return true; else return validateReqXDefault(form) validateXOR(form) validateAmount(form) validatePcntAmount(form) validateCondRequired(form) validateCondMask(form) validateInteger(form); } Yansheng Lin [EMAIL PROTECTED] 25/07/2003 03:34 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc:Subject:RE: validation sequence On client side, if your javascript is something like: return validateA(form) validateMask(form) validateB(form) than the execution sequence will be from left to right. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: July 25, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: validation sequence Hi there, I was wondering, does anyone know in which sequence this kind of validation will happen - depends =acustomvalidation,mask,bcustomvalidation so, will it be alphabetic as in: acustomvalidation,bcustomvalidation,mask or acustomvalidation,mask,bcustomvalidation or random?? Thanks, Aleksandar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction problem
Hi Tim, I am not super-experienced in this, but it seems to me, that your line: html:submit property=method value=Query should actualy be: html:submit property=method value=some.key.value and then, in your .properties file for internationalization etc. some.key.value= Query and then in your class that extends LookupDispatchAction extended class, you need to implement the protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(some.key.value, doit); return map; } public ActionForward doit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do add return mapping.findForward(success); } Hope this helps... Regards, Aleksandar Matijaca Tim Clotworthy [EMAIL PROTECTED] 23/07/2003 03:44 PM Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:LookupDispatchAction problem I am getting the following exception: SupportOrgDispatchAction] does not contain handler parameter named method For this actionmapping: action path=/SupportOrgDispatchAction type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc tion name=SupportOrgForm parameter=method forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/ /action against these tags in my jsp: html:submit property=method value=Query bean:message key=button.selectOrgs /html:submit This is my first crack at subclassing the LookupDispatchAction. Any ideas as to what I am doing wrong are greatly appreciated. Thanks.
RE: LookupDispatchAction problem
So, try creating a method called submit where the signature of the method would match the signature (parameters, return value etc) of selectOrgs Regards, Aleksandar. Tim Clotworthy [EMAIL PROTECTED] 23/07/2003 04:39 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: LookupDispatchAction problem Thanks to all earnest responses. I still have a problem, but it has evolved a little. I have simplified the syntax (using husted tip 003), so that my jsp has: html:submit bean:message key=button.selectOrgs/ /html:submit (as he suggested, using the default name of submit that corresponds to the html:submit tag, and in my struts-config, I now have: action path=/SupportOrgDispatchAction type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc tion name=SupportOrgForm parameter=submit forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/ /action and in my action I have: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.selectOrgs, selectOrgs); return map; } But alas, I am still getting an error (below). I wonder if my resource bundled is not being read properly, because the button on the form appears with the tag syntax bean:message key (obviously red flag something is wrong), rather than the value from the properties file. How can I check that the property button.selectOrgs is being found in the resource bundle, or, for that matter, that the resource bundle is being found at all? Thanks so much to all. javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does not contain handler parameter named submit at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct ion.java:199) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:480) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193)...blah...blah -Original Message- From: Suzette Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 4:19 PM To: 'Struts Users Mailing List' Subject: RE: LookupDispatchAction problem With LookupDispatch you don't have to use a hidden tag. I think the problem might be in your action itself. Look at Ted's tip(http://husted.com/struts/tips/003.html) and below is a working sample. JSP: html:submit property=method titleKey=verify.order.add.another.button.title bean:message key=button.add / /html:submit Struts-config: .. action path=/doOrderVerification name=monitorInfoForm input=/pages/verifyorder.jsp parameter=method type=com.waca.nec.consumer.actions.StoreProductDispatchAction scope=session forward name=dontsaveproduct path=/pages/choosemonitor.jsp/ forward name=add path=/pages/choosemonitor.jsp/ forward name=checkout path=/pages/contactinfo.jsp/ /action ACTION: public class StoreProductDispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.add, AppConstants.ACTION_KEY_ADD); map.put(button.checkout, AppConstants.ACTION_KEY_CHECK_OUT); map.put(button.continue.shopping, AppConstants.ACTION_KEY_DONT_SAVE); return map; } public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { //DO STUFF return mapping.findForward(AppConstants.ACTION_KEY_ADD); } public ActionForward checkout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { //DO STUFF return mapping.findForward(AppConstants.ACTION_KEY_CHECK_OUT); } public ActionForward dontsaveproduct(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse
RE: LookupDispatchAction problem
Yes, that makes sense, the property should have the method (if method is a parameter passed in struts-config.xml action) and the value of method should be the name of the method inside the action... html:submit property=method value=myfunction/ and then public ActionForward myfunction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do add I think that's how it is supposed to work... Regards, a.m. Suzette Daniel [EMAIL PROTECTED] 23/07/2003 04:43 PM Please respond to Struts Users Mailing List To: 'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: LookupDispatchAction problem I received the same error, so I switched to using my own property method and if fixed that error. JSP: html:submit property=method titleKey=verify.order.add.another.button.title bean:message key=button.add / /html:submit Struts-config: .. action path=/doOrderVerification name=monitorInfoForm input=/pages/verifyorder.jsp parameter=method type=com.waca.nec.consumer.actions.StoreProductDispatchAction scope=session Suzette -Original Message- From: Tim Clotworthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 4:40 PM To: 'Struts Users Mailing List' Subject: RE: LookupDispatchAction problem Thanks to all earnest responses. I still have a problem, but it has evolved a little. I have simplified the syntax (using husted tip 003), so that my jsp has: html:submit bean:message key=button.selectOrgs/ /html:submit (as he suggested, using the default name of submit that corresponds to the html:submit tag, and in my struts-config, I now have: action path=/SupportOrgDispatchAction type=com.hotapp.fes.presentation.support.action.FESSupportOrgDispatchAc tion name=SupportOrgForm parameter=submit forward name=NextPage path=/fes/jsp/FESSupportOrgTable.jsp/ /action and in my action I have: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.selectOrgs, selectOrgs); return map; } But alas, I am still getting an error (below). I wonder if my resource bundled is not being read properly, because the button on the form appears with the tag syntax bean:message key (obviously red flag something is wrong), rather than the value from the properties file. How can I check that the property button.selectOrgs is being found in the resource bundle, or, for that matter, that the resource bundle is being found at all? Thanks so much to all. javax.servlet.ServletException: Request[/SupportOrgDispatchAction] does not contain handler parameter named submit at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct ion.java:199) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:480) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193)...blah...blah -Original Message- From: Suzette Daniel [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 4:19 PM To: 'Struts Users Mailing List' Subject: RE: LookupDispatchAction problem With LookupDispatch you don't have to use a hidden tag. I think the problem might be in your action itself. Look at Ted's tip(http://husted.com/struts/tips/003.html) and below is a working sample. JSP: html:submit property=method titleKey=verify.order.add.another.button.title bean:message key=button.add / /html:submit Struts-config: .. action path=/doOrderVerification name=monitorInfoForm input=/pages/verifyorder.jsp parameter=method type=com.waca.nec.consumer.actions.StoreProductDispatchAction scope=session forward name=dontsaveproduct path=/pages/choosemonitor.jsp/ forward name=add path=/pages/choosemonitor.jsp/ forward name=checkout path=/pages/contactinfo.jsp/ /action ACTION: public class StoreProductDispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.add,
mask validation.
Hi there, I am doing a mask validation for the phone - using the 'standard' regex pattern: constant constant-namephone/constant-name constant-value^(\d{3})[-| ]?(\d{4})$/constant-value /constant . . field property=workphone depends=mask arg0 key=orderforeign.workphone.label/ var var-namemask/var-name var-value${phone}/var-value /var /field Now, I have noticed that if no phone number is entered, it passes the Javascript validation (I have no required validation dependency for this field). So, Javascript let's it go, but, the Server side validation fails - so it displays an error message saying that no phone number has been entered. What gives?? Why am I getting a 'server side' validation error and Javascript seems to let it go. Perhaps I should change the regex pattern to allow empty string, but I am not sure how to do that. I am using IBM WSAD 5.0x Thanks, Aleks.