Disabling BACK buton
We have a Struts application that allows users to create/update orders etc. How can we disable the BACK button so users cannot use it to go back to previous 'submitted' screens to re-submit what's been submitted. Likewise, we don't want the user to go back to an outdated list of search results. Thanks for any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Someone out there must have done this with Struts 1.0
Thanks Niall. That's it. Puttingthe 'attrbute' in solve my problem. Thanks. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: Someone out there must have done this with Struts 1.0 The tag was introduced in Struts 1.1 so thats why it doesn't work - which means you are correct to use the tag. The only comment I have, the difference between your debug stuff and the tag is you missed out the "name" attribute on the tag . Also, on the tag if you use the "collection" attribute then the "name" attribute is not used - its not an issue, but you just don't need it. Try Niall - Original Message - From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 12, 2004 3:31 PM Subject: Someone out there must have done this with Struts 1.0 > Has someone out there successfully set the "selected" option of a > under Struts 1.0? > > What I try to do is to set the option as "selected" when "userId" > matches > "shopWorkOrder.engineerId": > property="engineerList"/> > > property="userId" labelproperty="commonName"/> > > > I tried the following two things based on all your input but still > can't get > it working: > Using optionsCollection -> > 1) The following gave a compilation error claiming doesn't recognize > "optionsCollection". I think this is a Struts 1.0 problem. > > property="engineerList"/> > > > > label="commonName"/> > > > > Using value"<%=...%>" -> > 2) The following also gave a compilation error that it doesn't like > value"<%=...%>" > > property="engineerList"/> > > value="<%=shopWorkOrder.engineerId%>"> > > property="userId" labelproperty="commonName"/> > > > > I use debug statements inside the JSP to make sure there is a matching > userId: > > Eng id: property="shopWorkOrder.engineerId"/> > > property="engineerList"/> > > Label: > name="element" property="commonName"/> > > Value: > > > > > > Here's the output from the above debug: > > Eng id:8 > > Label:JOE ENGINEER L Value:3 > > Label:VERLINDA BROOME Value:NZW32M > > Label:FRANK WHITON Value:NZ7Z1Q > > Label:Another Active Engineer Value:8 > > Setting the "selected" in a is a very basic operation. I > can't see that being a bug in Struts 1.0. But somehow it doesn't work. > Has anyone done it successfully before??? > > > > - > 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: Someone out there must have done this with Struts 1.0
Thanks Niall. Actually my original version did have the "name" attribute in it. It just got lost after I tried so many different things. In your opinion, don't you think one should be able to set "selected" under Struts 1.0? I dig through the Struts User Guide and Struts web site, there is no example and no mentioning that being a bug. Do you know is there a way that I can get to or send an email to one of the original Struts tag developers to ask the question? -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 10:54 AM To: Struts Users Mailing List Subject: Re: Someone out there must have done this with Struts 1.0 The tag was introduced in Struts 1.1 so thats why it doesn't work - which means you are correct to use the tag. The only comment I have, the difference between your debug stuff and the tag is you missed out the "name" attribute on the tag . Also, on the tag if you use the "collection" attribute then the "name" attribute is not used - its not an issue, but you just don't need it. Try Niall - Original Message - From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 12, 2004 3:31 PM Subject: Someone out there must have done this with Struts 1.0 > Has someone out there successfully set the "selected" option of a > under Struts 1.0? > > What I try to do is to set the option as "selected" when "userId" > matches > "shopWorkOrder.engineerId": > property="engineerList"/> > > property="userId" labelproperty="commonName"/> > > > I tried the following two things based on all your input but still > can't get > it working: > Using optionsCollection -> > 1) The following gave a compilation error claiming doesn't recognize > "optionsCollection". I think this is a Struts 1.0 problem. > > property="engineerList"/> > > > > label="commonName"/> > > > > Using value"<%=...%>" -> > 2) The following also gave a compilation error that it doesn't like > value"<%=...%>" > > property="engineerList"/> > > value="<%=shopWorkOrder.engineerId%>"> > > property="userId" labelproperty="commonName"/> > > > > I use debug statements inside the JSP to make sure there is a matching > userId: > > Eng id: property="shopWorkOrder.engineerId"/> > > property="engineerList"/> > > Label: > name="element" property="commonName"/> > > Value: > > > > > > Here's the output from the above debug: > > Eng id:8 > > Label:JOE ENGINEER L Value:3 > > Label:VERLINDA BROOME Value:NZW32M > > Label:FRANK WHITON Value:NZ7Z1Q > > Label:Another Active Engineer Value:8 > > Setting the "selected" in a is a very basic operation. I > can't see that being a bug in Struts 1.0. But somehow it doesn't work. > Has anyone done it successfully before??? > > > > - > 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]
Someone out there must have done this with Struts 1.0
Has someone out there successfully set the "selected" option of a under Struts 1.0? What I try to do is to set the option as "selected" when "userId" matches "shopWorkOrder.engineerId": I tried the following two things based on all your input but still can't get it working: Using optionsCollection -> 1) The following gave a compilation error claiming doesn't recognize "optionsCollection". I think this is a Struts 1.0 problem. > > > > Using value"<%=...%>" -> 2) The following also gave a compilation error that it doesn't like value"<%=...%>" > > > > I use debug statements inside the JSP to make sure there is a matching userId: > Eng id: > > > Label: > Value: > > > Here's the output from the above debug: > Eng id:8 > Label:JOE ENGINEER L Value:3 > Label:VERLINDA BROOME Value:NZW32M > Label:FRANK WHITON Value:NZ7Z1Q > Label:Another Active Engineer Value:8 Setting the "selected" in a is a very basic operation. I can't see that being a bug in Struts 1.0. But somehow it doesn't work. Has anyone done it successfully before??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE:
Paul: I tried the following in the JSP based on your suggestion and it is still not defaulting to the desired option. I just want to default the option to whatever matches between "shopWorkOrder.engineerId" and "userId". Segment of JSP: The following debug section is used to print out if "shopWorkOrder.engineerId" matches any "userId" in the ArrayList: String engineer = formBean.getShopWorkOrder().getEngineerId(); PeopleBean pBean; EtLog.debug(this,"EngineerId="+engineer+"***"); for (int i=0; i and won't default to it: 03/09/2004 10:54:28 [DBUG] ShopWorkOrderMaintainAction EngineerId=8*** 03/09/2004 10:54:28 [DBUG] ShopWorkOrderMaintainAction Found Matching ID=8*** Did I misunderstand what you suggested? -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:45 AM To: Au-Yeung, Stella H Subject: this is by far the simplest way to achieve what you desire, but it does assume that your form is already populated with data. if your form is populated, the populated values will be used to select the correct option in the . if it isn't (or the field is null) no will be selected. i like to set my defaults to the fields values on the form bean in "reset()" and at field initialisation. formBeanProp: the name of the field on the form bean of the enclosing tag. if this field has a value matching one of the "listProp" values, this item will be selected. collection: the name of the attribute you have stored the list you are using to populate the options under. listProp: the name of the field in the list elements that will be used to compare to the "formBeanProp". listLabel: the name of the field in the list elements that will be displayed to the user. note: if your value/label for your options is going to be the same you can omit this. hope this helps. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: question
I see. I'll try that tomorrow and let you know. Thx. -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:05 AM To: Struts Users Mailing List Subject: Re: question the most simplest solution is often the best Au-Yeung, Stella H wrote: > Paul wrote: > >>> >>> > labelProperty="name"/> > > No I don't know how to try yours because I don't see how the above > statement tells it to compare "userId" with "person.id" and then store > the value into "person.id". > > In other words, I don't know how to convert my statement below to > yours: > >> >> >collection="uList" name="UserFormBean" property="userId" >>labelproperty="commonName"/> > > > -Original Message- > From: Paul Stanton [mailto:[EMAIL PROTECTED] > Sent: Monday, March 08, 2004 6:45 PM > To: Struts Users Mailing List > Subject: Re: question > > > i think you are trying to do the following... > > > > > > this is assuming uList is a list of beans with id/name fields and your > form has a userId field. > > Au-Yeung, Stella H wrote: > > >>Hi: >>I need to set a "pre-defined" option in using the >>"value=" attribute, I thought the following will work: >> >> >> >collection="uList" name="UserFormBean" property="userId" >>labelproperty="commonName"/> >> >>I have a "person" bean. I want to set the "selected" option if >>"person.id" matches "userId" . I thought the "value" attribute is to > > be > >>compared with for marking an option selected. But the above doesn't > > work. > >>It always set the 1st option to be the "selected" option . >>Am I misunderstanding the use of "value="? >> >> >> >>- >>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] > > - 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: question
Paul wrote: >> >> No I don't know how to try yours because I don't see how the above statement tells it to compare "userId" with "person.id" and then store the value into "person.id". In other words, I don't know how to convert my statement below to yours: > > collection="uList" name="UserFormBean" property="userId" > labelproperty="commonName"/> -Original Message- From: Paul Stanton [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: Re: question i think you are trying to do the following... this is assuming uList is a list of beans with id/name fields and your form has a userId field. Au-Yeung, Stella H wrote: > Hi: > I need to set a "pre-defined" option in using the > "value=" attribute, I thought the following will work: > > > collection="uList" name="UserFormBean" property="userId" > labelproperty="commonName"/> > > I have a "person" bean. I want to set the "selected" option if > "person.id" matches "userId" . I thought the "value" attribute is to be > compared with for marking an option selected. But the above doesn't work. > It always set the 1st option to be the "selected" option . > Am I misunderstanding the use of "value="? > > > > - > 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: question
I tried the following and got the same result. Is this what you mean? If I remove the value="" then I don't get the compilation error. cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 93: symbol : method setValue (java.lang.Object) location: class org.apache.struts.taglib.html.SelectTag _html_select0.setValue(engineer); -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 8:44 PM To: Struts Users Mailing List Subject: RE: question >>engineerId is an attribute in the dataBean "shopWorkOrder". Can't I >>reference shopWorkOrder.engineerId inside the <%= %>? >> I guess "shopWorkOrder" is the attribute name of the bean. The <%= %> should contain a java expression. Use the to define a JSP variable and use it in <%= %> then use <%=engineerId%> in the . -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 4:49 PM To: 'Struts Users Mailing List' Subject: RE: question I got a compilation errror after I changed to using <%= %>: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: My actual segment of JSP: engineerId is an attribute in the dataBean "shopWorkOrder". Can't I reference shopWorkOrder.engineerId inside the <%= %>? I want to compare value of "userId" in the collection with "shopWorkOrder.engineerId". -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: question Try something like this, The "value" attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: question Hi: I need to set a "pre-defined" option in using the "value=" attribute, I thought the following will work: I have a "person" bean. I want to set the "selected" option if "person.id" matches "userId" . I thought the "value" attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the "selected" option . Am I misunderstanding the use of "value="? - 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] - 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: question
I got a compilation errror after I changed to using <%= %>: Here's my error: cannot resolve symbol probably occurred due to an error in /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp line 92: My actual segment of JSP: engineerId is an attribute in the dataBean "shopWorkOrder". Can't I reference shopWorkOrder.engineerId inside the <%= %>? I want to compare value of "userId" in the collection with "shopWorkOrder.engineerId". -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: question Try something like this, The "value" attribute is RT-Exp, and not name of a bean. hth -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 3:38 PM To: '[EMAIL PROTECTED]' Subject: question Hi: I need to set a "pre-defined" option in using the "value=" attribute, I thought the following will work: I have a "person" bean. I want to set the "selected" option if "person.id" matches "userId" . I thought the "value" attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the "selected" option . Am I misunderstanding the use of "value="? - 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]
question
Hi: I need to set a "pre-defined" option in using the "value=" attribute, I thought the following will work: I have a "person" bean. I want to set the "selected" option if "person.id" matches "userId" . I thought the "value" attribute is to be compared with for marking an option selected. But the above doesn't work. It always set the 1st option to be the "selected" option . Am I misunderstanding the use of "value="? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another struts question on
If I use to display a bean property "comments" which happens to be a long line of text. Is there a way to enforce "wrapping" with so the long "comments" can be displayed as a paragraph? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action not forwarding to another Action
Thanks Vincent and Hubert, I will try both your suggestions -Original Message- From: Vincent Lin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 11:01 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action It is my opinion. Please correct me if I am wrong. The JSP "DeleteOrder.jsp" submits to "/app/DeleteOrder.exe", Therefore the parameter "orderNumber" can be seen in "/app/DeleteOrder.exe". After the part is deleted the action "/app/DeleteOrder.exe" forwards the page to "/app/ListOfOrder.exe". It is another http request, because the path attribute specified in is only "/app/ListOfOrder.exe". Not "/app/ListOfOrder.exe?orderNumber=123". (You wouldn't know what the orderNumber will be when you write struts-config.xml) So the action "/app/ListOfOrder.exe" has no idea of "orderNumber". A simple way to solve this problem is that you can save the "orderNumber" to request scope in "/app/DeleteOrder.exe". request.setAttribute("orderNumber", new Integer(orderNumber)); And then retrieve it in "/app/ListOfOrder.exe". Integer orderNumber = (Integer) request.getAttribute("orderNumber"); Regards, Vincent --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> > Bascaily what I would like to accomplish is to > delete a "part" from an order > form and then re-query the database to display the > list of parts. > > "DeleteOrder.jsp": > - is a screen to confirm to delete part "XZY". > - it is of type OrderForm > - action = "/app/DeleteOrder" > - "orderNumber is a hidden field and is equal to > "123". This is the key to > re-query the database later. > > "OrderSearchAction": > - is the Action class to re-query the database with "orderNumber" > after the deletion and re-display the list of parts on the > next screen. > I have this statement at the beginning of the Action > class to retrieve > "orderNumber ": > String nbr = request.getParameter("orderNumber"); > > > Struts-config.xml: > > type="com.cat.action.OrderMaintainAction" >name="OrderFormBean" > scope="request" >validate="false"> > path="/app/ListOfOrder.exe" /> > > > > > type="com.cat.action.OrderSearchAction" >name="OrderSearchFormBean" > scope="request" >validate="false"> > path="/app/ListOfOrder.jsp"/> >path="/app/OrderError.jsp"/> > > > > So when I hit 'submit' on "DeleteOrder.jsp", I > expect "orderNumber " to be > visible in "OrderSearchAction" in the Request object > but it is not. > Thanks for any help. > - 每天都 Yahoo!奇摩 海的?色、?的?息、?你的?度,?在信?底? http://tw.promo.yahoo.com/mail_premium/stationery.html - 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: Action not forwarding to another Action
Bascaily what I would like to accomplish is to delete a "part" from an order form and then re-query the database to display the list of parts. "DeleteOrder.jsp": - is a screen to confirm to delete part "XZY". - it is of type OrderForm - action = "/app/DeleteOrder" - "orderNumber is a hidden field and is equal to "123". This is the key to re-query the database later. "OrderSearchAction": - is the Action class to re-query the database with "orderNumber" after the deletion and re-display the list of parts on the next screen. I have this statement at the beginning of the Action class to retrieve "orderNumber ": String nbr = request.getParameter("orderNumber"); Struts-config.xml: So when I hit 'submit' on "DeleteOrder.jsp", I expect "orderNumber " to be visible in "OrderSearchAction" in the Request object but it is not. Thanks for any help. == -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 02, 2004 12:48 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action Could you post the code snippet where you are trying to set & get parameters. I have a similar action chaining configuration that works fine for me. -jayash -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 8:21 PM To: 'Struts Users Mailing List' Subject: RE: Action not forwarding to another Action Nop. I removed 'redirect="true"' as followed and still can't retrieve the parameter in OrderSearchAction. I even tried to specifically do request.setParamter(...) first and that doesn't work either. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action I think when you say 'redirect="true"', then you lose your request object. This is like a client side/browser redirect. Remove this attribute from your element and give it a try. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 3:24 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action if ".exe" is what you hv configured in web.xml then I see there is no reason why it is not picking up possible reason could be... make sure that you are forwarding to "Content" which is mapped to "/app/ListOfOrder.exe" in your OrderMaintainAction >>1) Can someone also tell me if I have a "Request attribute" defined in >>OrderMaintainAction, if the above redirection works, will I be able to >>see the same "Request attribute" in OrderSearchAction? the same scenarion where I'm not able to get the value of request attribute which I set in my previous Action class then I set as session attribute and Im able to get that value in the other Action class where Im redirecting to. >>2) A general question: if formA is linked to formB through a 'link'. If I >>click on the 'link' in formA, can I get to the passed parameter of >>FormA by >>doing Request.geParameter("id") or I can only retrieve 'id' throught a >>'submit' rather than through a 'link'? I dont really understand your point but I assumed that you are passing a parameter from one form to another in such case if you are calling other page/calling action class by passing request parameter you could get those parameters on the other page/action class. hth -Ramadoss -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 5:51 PM To: '[EMAIL PROTECTED]' Subject: Action not forwarding to another Action Hi: I have a similar problem that I can't invoke OrderSearchAction.exe from OrderMaintainAction. I set a debug breakpoint at the beginning of OrderSearchAction and never get there. I have two other questions: 1) Can someone also tell me if I have a "Request attribute" defined in OrderMaintainAction, if the above redirection works, will I be able to see the same "Request attribute" in OrderSearchAction? 2) A general question: if formA is linked to formB through a 'link'. If I click on the 'link' in formA, can I get to the passed parameter of FormA by doing Request.geParameter("id") o
RE: Action not forwarding to another Action
Nop. I removed 'redirect="true"' as followed and still can't retrieve the parameter in OrderSearchAction. I even tried to specifically do request.setParamter(...) first and that doesn't work either. -Original Message- From: Gopalakrishnan, Jayesh [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 6:45 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action I think when you say 'redirect="true"', then you lose your request object. This is like a client side/browser redirect. Remove this attribute from your element and give it a try. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 3:24 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action if ".exe" is what you hv configured in web.xml then I see there is no reason why it is not picking up possible reason could be... make sure that you are forwarding to "Content" which is mapped to "/app/ListOfOrder.exe" in your OrderMaintainAction >>1) Can someone also tell me if I have a "Request attribute" defined in >>OrderMaintainAction, if the above redirection works, will I be able to >>see the same "Request attribute" in OrderSearchAction? the same scenarion where I'm not able to get the value of request attribute which I set in my previous Action class then I set as session attribute and Im able to get that value in the other Action class where Im redirecting to. >>2) A general question: if formA is linked to formB through a 'link'. If I >>click on the 'link' in formA, can I get to the passed parameter of >>FormA by >>doing Request.geParameter("id") or I can only retrieve 'id' throught a >>'submit' rather than through a 'link'? I dont really understand your point but I assumed that you are passing a parameter from one form to another in such case if you are calling other page/calling action class by passing request parameter you could get those parameters on the other page/action class. hth -Ramadoss -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 5:51 PM To: '[EMAIL PROTECTED]' Subject: Action not forwarding to another Action Hi: I have a similar problem that I can't invoke OrderSearchAction.exe from OrderMaintainAction. I set a debug breakpoint at the beginning of OrderSearchAction and never get there. I have two other questions: 1) Can someone also tell me if I have a "Request attribute" defined in OrderMaintainAction, if the above redirection works, will I be able to see the same "Request attribute" in OrderSearchAction? 2) A general question: if formA is linked to formB through a 'link'. If I click on the 'link' in formA, can I get to the passed parameter of FormA by doing Request.geParameter("id") or I can only retrieve 'id' throught a 'submit' rather than through a 'link'? Thanks for any help! - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action not forwarding to another Action
Thanks Ramadoss. You led me to look into my web.xml file. It is mapped to *.exec and not *.exe. It's an oversight on my part. Let me elaborate my question #3: If my .JSP has a , I know when I click a 'submit' button to get to an Action class, I can retrieve the id in my Action class by doing "String id = Request.getParameter("id");" But if my .jsp uses a link to pass the id such as .. In other words, I get to the Action class through a 'link' rather than a 'submit', can I still use " String id = Request.getParameter("id"); " to retrieve the id? I tried it and I can't find "id" from the Request object. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 6:24 PM To: Struts Users Mailing List Subject: RE: Action not forwarding to another Action if ".exe" is what you hv configured in web.xml then I see there is no reason why it is not picking up possible reason could be... make sure that you are forwarding to "Content" which is mapped to "/app/ListOfOrder.exe" in your OrderMaintainAction >>1) Can someone also tell me if I have a "Request attribute" defined in >>OrderMaintainAction, if the above redirection works, will I be able to >>see the same "Request attribute" in OrderSearchAction? the same scenarion where I'm not able to get the value of request attribute which I set in my previous Action class then I set as session attribute and Im able to get that value in the other Action class where Im redirecting to. >>2) A general question: if formA is linked to formB through a 'link'. If I >>click on the 'link' in formA, can I get to the passed parameter of >>FormA by doing Request.geParameter("id") or I can only retrieve 'id' >>throught a 'submit' rather than through a 'link'? I dont really understand your point but I assumed that you are passing a parameter from one form to another in such case if you are calling other page/calling action class by passing request parameter you could get those parameters on the other page/action class. hth -Ramadoss -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 5:51 PM To: '[EMAIL PROTECTED]' Subject: Action not forwarding to another Action Hi: I have a similar problem that I can't invoke OrderSearchAction.exe from OrderMaintainAction. I set a debug breakpoint at the beginning of OrderSearchAction and never get there. I have two other questions: 1) Can someone also tell me if I have a "Request attribute" defined in OrderMaintainAction, if the above redirection works, will I be able to see the same "Request attribute" in OrderSearchAction? 2) A general question: if formA is linked to formB through a 'link'. If I click on the 'link' in formA, can I get to the passed parameter of FormA by doing Request.geParameter("id") or I can only retrieve 'id' throught a 'submit' rather than through a 'link'? Thanks for any help! - 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]
Action not forwarding to another Action
Hi: I have a similar problem that I can't invoke OrderSearchAction.exe from OrderMaintainAction. I set a debug breakpoint at the beginning of OrderSearchAction and never get there. I have two other questions: 1) Can someone also tell me if I have a "Request attribute" defined in OrderMaintainAction, if the above redirection works, will I be able to see the same "Request attribute" in OrderSearchAction? 2) A general question: if formA is linked to formB through a 'link'. If I click on the 'link' in formA, can I get to the passed parameter of FormA by doing Request.geParameter("id") or I can only retrieve 'id' throught a 'submit' rather than through a 'link'? Thanks for any help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can a be made to function as a 'submit'
Thanks Nick...I completelu forgot you can 'dynamically' change form fields value such as 'document.myForm.partIdx.value'. What you suggested should work. -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 12:11 PM To: Struts Users Mailing List Subject: Re: Can a be made to function as a 'submit' Assuming I know what you're talking about, this is also pretty easy to address: The form is hidden, with one hidden field. It doesn't have to be hidden, certainly. The link calls the JavaScript function, passing in the current parameter. Click The function will set the value of the form field and call submit. function submitForm(indexVal) { document.myForm.partIdx.value = indexVal; document.myForm.submit(); } On 2004-Feb-25 11:02, Au-Yeung, Stella H wrote: > But each of my is within a .> tag and it passes the index to the next page base on which item in the list > the user clicks. How can I do that with what you suggested? > > My current : > > > > Thanks! > > -Original Message- > From: Nick Heudecker [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 25, 2004 10:45 AM > To: Struts Users Mailing List > Subject: Re: Can a be made to function as a 'submit' > > > > Sure, all you need is a bit of JavaScript that submits your form tag. > The 'myForm' form is representative: > > > > > > > Click > > And finally, the function: > > > function submitForm() { > document.myForm.submit(); > } > > > That should do it. > > > > On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: > > Hi: > > Can a be made to function as a 'submit' and upon > > submission, > > all the formBean properties are remembered in the Action class that > > handles it. When I try to use just the I can't get the formBean > properties to > > be remembered. But I can't change my list of as submit buttons > > because I need to pass arguments on each of the . Here's an > > example of what I try to do on my JSP page: When the user clicks a > > link to see a picture of an item, this JSP will be replaced by > > another JSP with the picture. So before I leave this page, I "must" > > save the Personal information and the item list in a temporary > > location so when I return to this page, those values will be > > repopulated. But my problem is, clicking the link will not carry over he > > formBean properties to the Action class for me to save. 'Submit' will > but > > I can't change those to 'submit' because I need to pass the > > item index (0,1,2 etc.) through each to the Action class. > > > > Personal information: > > First Name: Last Name: Mailing Address: > > > > > > List of items in your shopping cart: > > ABC tennis racket 1link to see a picture and pass the > > index of this item to the Action class > > Wilson tennis ball 5link to see a picture and pass the > > index of this item to he Action class > > XYZ tenis shirt 2 link to see a picture > and pass > > the index of this item to he Action class > > > > I appreciate any suggestion. > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > Nick Heudecker > System Mobile, Inc. > Email: [EMAIL PROTECTED] > Web: http://www.systemmobile.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] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can a be made to function as a 'submit'
But each of my is within a tag and it passes the index to the next page base on which item in the list the user clicks. How can I do that with what you suggested? My current : Thanks! -Original Message- From: Nick Heudecker [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 10:45 AM To: Struts Users Mailing List Subject: Re: Can a be made to function as a 'submit' Sure, all you need is a bit of JavaScript that submits your form tag. The 'myForm' form is representative: Click And finally, the function: function submitForm() { document.myForm.submit(); } That should do it. On 2004-Feb-25 10:02, Au-Yeung, Stella H wrote: > Hi: > Can a be made to function as a 'submit' and upon submission, > all the formBean properties are remembered in the Action class that > handles it. When I try to use just the I can't get the formBean properties to > be remembered. But I can't change my list of as submit buttons > because I need to pass arguments on each of the . > Here's an example of what I try to do on my JSP page: > When the user clicks a link to see a picture of an item, this JSP will be > replaced by another JSP with the picture. So before I leave this page, I > "must" save the Personal information and the item list in a temporary > location so when I return to this page, those values will be repopulated. > But my problem is, clicking the link will not carry over he > formBean properties to the Action class for me to save. 'Submit' will but > I can't change those to 'submit' because I need to pass the item > index (0,1,2 etc.) through each to the Action class. > > Personal information: > First Name: Last Name: Mailing Address: > > > List of items in your shopping cart: > ABC tennis racket 1link to see a picture and pass the > index of this item to the Action class > Wilson tennis ball5link to see a picture and pass the > index of this item to he Action class > XYZ tenis shirt 2 link to see a picture and pass > the index of this item to he Action class > > I appreciate any suggestion. > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.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]
Can a be made to function as a 'submit'
Hi: Can a be made to function as a 'submit' and upon submission, all the formBean properties are remembered in the Action class that handles it. When I try to use just the I can't get the formBean properties to be remembered. But I can't change my list of as submit buttons because I need to pass arguments on each of the . Here's an example of what I try to do on my JSP page: When the user clicks a link to see a picture of an item, this JSP will be replaced by another JSP with the picture. So before I leave this page, I "must" save the Personal information and the item list in a temporary location so when I return to this page, those values will be repopulated. But my problem is, clicking the link will not carry over he formBean properties to the Action class for me to save. 'Submit' will but I can't change those to 'submit' because I need to pass the item index (0,1,2 etc.) through each to the Action class. Personal information: First Name: Last Name: Mailing Address: List of items in your shopping cart: ABC tennis racket 1link to see a picture and pass the index of this item to the Action class Wilson tennis ball 5link to see a picture and pass the index of this item to he Action class XYZ tenis shirt 2 link to see a picture and pass the index of this item to he Action class I appreciate any suggestion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A question on Struts taglib.
Thanks Robert, that works. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 8:52 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. Try this: If you can use JSTL, this may work for you, assuming ShopWorkOrderFormBean named shopWorkOrderForm in some scope: robert > -Original Message- > From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 6:12 PM > To: 'Struts Users Mailing List' > Subject: RE: A question on Struts taglib. > > > I changed my code to use "indexId" and got the following error: > > symbol : variable indexId > location: class > jsp_servlet._app._fdd._shopworkorder.__createshopworkorder > > out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ > /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] > > > Here's the changed code: > collection="<%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% > >" > type="com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean"> > >property="partNumber"/> > > > href="app/fdd/shopWorkOrder/UpdatePartRequest.exec?partAction=update&partInd > ex=<%=indexId%>"> > > > > > > Any Idea? What did I do wrong? > > -Original Message- > From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 3:45 PM > To: Struts Users Mailing List > Subject: RE: A question on Struts taglib. > > > add index attribute in your logic iterate and append that index to > your host string. > > e.g > indexId="index" > > yourhoststring+<%=indexId %> > > > -R > > > -Original Message- > From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 24, 2004 3:18 PM > To: [EMAIL PROTECTED] > Subject: A question on Struts taglib. > > > A question on Struts taglib. > Can someone tell me how to reference the "index" of each element so I > can pass it as a parameter with the path string? > > For example I have the following code, I want to print out > 'partNumber' and 'partDescription' and a with index of each > element'. > >collection="<%=ShopWorkOrderFormBean.getShopWorkOrder().getPartList()% > >" > type="com.cat.sdl.fdd.dataBean.shopWorkOrder.PartBean"> > >property="partNumber"/> > > > > > > > > > Thanks in advance! > > Stella > > - > 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] > - 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: A question on Struts taglib.
I changed my code to use "indexId" and got the following error: symbol : variable indexId location: class jsp_servlet._app._fdd._shopworkorder.__createshopworkorder out.print(weblogic.utils.StringUtils.valueOf(indexId )); //[ /app/fdd/shopWorkOrder/CreateShopWorkOrder.jsp; Line: 136] Here's the changed code: Any Idea? What did I do wrong? -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:45 PM To: Struts Users Mailing List Subject: RE: A question on Struts taglib. add index attribute in your logic iterate and append that index to your host string. e.g yourhoststring+<%=indexId %> -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 3:18 PM To: [EMAIL PROTECTED] Subject: A question on Struts taglib. A question on Struts taglib. Can someone tell me how to reference the "index" of each element so I can pass it as a parameter with the path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a with index of each element'. Thanks in advance! Stella - 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]
A question on Struts taglib.
A question on Struts taglib. Can someone tell me how to reference the "index" of each element so I can pass it as a parameter with the path string? For example I have the following code, I want to print out 'partNumber' and 'partDescription' and a with index of each element'. Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Must have action="....." in tag?
I understand DispatchAction fairly well. But because there are certain extra things I need to do that DispatchAction won't help. Anyway, Shyam's suggestion of using to display the appropriate button with associate action should take care of my problem and I think it will be pretty simple. Thanks Shyam. I would also like to thank everyone who has responded to my plead for help (Geeta, Paul, Hubert,Ramadoss and Khalid etc.) Thanks you all. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:34 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? Well, as the others said DispatchAction is the way to go. Since, you already have two separate Actions defined, I thought it may be worthwhile to give my idea a try. What I meant was, instead of a "submit" button , use a normal button . You can display a "create" or "update" button based on the previous screen, i.e. Then, in your submitForm() Javascript, check for which button is clicked, or check for whichAction as you're doin now, and set the action accordingly. (Sorry, I'm not an expert in Javascript!) HTH, Shyam --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > Shyam: > I am not sure what you mean, can you elaborate that? > The current form only has one 'submit' button. > After the user fills in data > on the current form, I want the data to be submitted > to the DB and then > automatically be taken back to the 'previous' > screen. This previous screen > can be a 'Create main screen' or an 'Update main > screen'. I use a hidden > field 'whichAction' to "remember" which is the > 'previous' screen. So when > the user submits the input data on the cuurrent > form, that's when the > javascript submitForm() function decides which > screen > (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or > /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to > return to. > > Example: > > Create Main screen > use 'theForm' to input > data > return > back to Create main > > Update Main screen -> use 'theForm' to input > data > return > back to Update main > > (this screen 'theForm' is > where I decide > which precious screen to > return > to based on the hidden > field "whichAction". > That's why > has to be dynamic > > My user only wants "ONE" submit button on "theForm" > and the application > should be smart enough to return to the correct > 'previous' page. > > > > > -Original Message- > From: Shyam A [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 5:31 PM > To: Struts Users Mailing List > Subject: RE: Must have action="." in > tag? > > > Just a suggestion. Not sure if I'm right... > Instead of using onSubmit() event of your > , > why don't you call the Javascript when the user clicks/submits the > associcated HTML component - "Create/Update button", and set the > action accordingly. > > HTH, > Shyam > > __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - 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: Must have action="....." in tag?
Ramadoss: That's what I did already in one of my original version. My reason of posting to this group is because doesn't allow me to use a dynamically assigned "action" (such as one I set in my Javascript function to replace the one I have within the tag. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 7:10 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? I'm not sure this but you can try... Create Main screen (define a attribute in your form which holds the value of "which screen" and set update/create before dispatch) > use 'theForm' to input data (here check that attribute value whether it is create/update and assign the same to the action path either your JavaScript sumbit or whatever ) > return back to Create main -R -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 6:08 PM To: 'Struts Users Mailing List' Subject: RE: Must have action="." in tag? Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to "remember" which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen > use 'theForm' to input data > return back to Create main Update Main screen -> use 'theForm' to input data > return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field "whichAction". That's why has to be dynamic My user only wants "ONE" submit button on "theForm" and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your , why don't you call the Javascript when the user clicks/submits the associcated HTML component - "Create/Update button", and set the action accordingly. HTH, Shyam --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > But I don't always want > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to > be my action all the time. I want the action for > the form to be "dynamic" > and depends on the form field "whichAction". That's > why I created the > javascript function submitForm(frm) to pick the > action "dynamically". In > other words, I have in my > struts-config.xml file for both > path > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder". > But I want whichever one > to be chosen to be "dynamically". So how I do that > all within the > tag? > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 4:58 PM > To: Struts Users Mailing List > Subject: RE: Must have action="." in > tag? > > > I never said anything close to what you're asking > me. > All I said is choose one of your two possible > outcomes (doesn't matter which > one), take the path that you gave it in the struts-config.xml, then > use that in your . > Let's say you have the ff entry in your > struts-config: > > name="theForm"> > > > > then in your html:form, specify that action: > > method="post" >onSubmit="return > submitForm(document.theForm)"> > ... > > > You do have 's associated with fromCreateShopWorkOrder and > fromUpdateShopWorkOrder, right? > > - Hubert > > > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> > wrote: > > Hubert: > > Can you
RE: Must have action="....." in tag?
Shyam: I am not sure what you mean, can you elaborate that? The current form only has one 'submit' button. After the user fills in data on the current form, I want the data to be submitted to the DB and then automatically be taken back to the 'previous' screen. This previous screen can be a 'Create main screen' or an 'Update main screen'. I use a hidden field 'whichAction' to "remember" which is the 'previous' screen. So when the user submits the input data on the cuurrent form, that's when the javascript submitForm() function decides which screen (/app/fdd/shopWorkOrder/fromCreateShopWorkOrder or /app/fdd/shopWorkOrder/fromUpdateShopWorkOrder) to return to. Example: Create Main screen > use 'theForm' to input data > return back to Create main Update Main screen -> use 'theForm' to input data > return back to Update main (this screen 'theForm' is where I decide which precious screen to return to based on the hidden field "whichAction". That's why has to be dynamic My user only wants "ONE" submit button on "theForm" and the application should be smart enough to return to the correct 'previous' page. -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:31 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? Just a suggestion. Not sure if I'm right... Instead of using onSubmit() event of your , why don't you call the Javascript when the user clicks/submits the associcated HTML component - "Create/Update button", and set the action accordingly. HTH, Shyam --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > But I don't always want > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to > be my action all the time. I want the action for > the form to be "dynamic" > and depends on the form field "whichAction". That's > why I created the > javascript function submitForm(frm) to pick the > action "dynamically". In > other words, I have in my > struts-config.xml file for both > path > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder". > But I want whichever one > to be chosen to be "dynamically". So how I do that > all within the > tag? > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 4:58 PM > To: Struts Users Mailing List > Subject: RE: Must have action="." in > tag? > > > I never said anything close to what you're asking > me. > All I said is choose one of your two possible > outcomes (doesn't matter which > one), take the path that you gave it in the struts-config.xml, then > use that in your . > Let's say you have the ff entry in your > struts-config: > > name="theForm"> > > > > then in your html:form, specify that action: > > method="post" >onSubmit="return > submitForm(document.theForm)"> > ... > > > You do have 's associated with fromCreateShopWorkOrder and > fromUpdateShopWorkOrder, right? > > - Hubert > > > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> > wrote: > > Hubert: > > Can you elaborate that In othe words, how do I > do everything that > > the function submitForm() does to dynamically pick > an action all > > within the tag? > > > > -Original Message- > > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 23, 2004 4:36 PM > > To: Struts Users Mailing List > > Subject: Re: Must have action="." in > tag? > > > > > > Specify the Action associated with > "fromCreateShopWorkOrder" or > > "fromUpdateShopWorkOrder" in the > attribute. > > > > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> > wrote: > > > Hi: > > > My tag doesn't allow me to skip an > 'action' attribue. If > > you > > > look at my code below, I move the assignment of > the 'form action' > > > to > > > the javascript function so which action to take > is dynamically depends > > > on the form element 'whichAction'. But the > compiler insist I have to > &
RE: Must have action="....." in tag?
Paul and Hubert: If I do the following, just choose one of the paths to be the , you mean the form action can still be "dynamically overwritten" by what is actually picked in the submitForm() action? I thought I tried that and didn't work. > > > > function submitForm(frm) > > { > >var whichAction=frm.elements("whichAction") > > > >if (whichAction == "create") > >{ > > document.theForm.action = > > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder"; > >} > >else > >{ > > document.theForm.action = > > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder"; > >} > > > >return true; > > } > > > > > > > > > > > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/> > > -Original Message- From: Paul, R. Chip [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 5:23 PM To: 'Struts Users Mailing List' Subject: RE: Must have action="." in tag? You can't. Correct me if I'm wrong, but the property is what let's struts know which Form object to map your .jsp to. I'm don't think this will work for you unless all the possible urls you'd submit to share the same Form. What you may want to do instead then is look at something along the lines of DispatchAction, and pass a parameter that tells Struts which logical action it should forward to after hitting the for submit action (which would be a subclass of DispatchAction or something similar). Of course you could do as the previous poster said and change the action to submit to in your javascript onSubmit function: function onSubmit() { forms[0].action="/Some/New/Action.do"; return true; } And then you'd put logic to decide where to actually submit to inside the onSubmit function. -Original Message- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:13 PM To: 'Struts Users Mailing List' Subject: RE: Must have action="." in tag? But I don't always want "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to be my action all the time. I want the action for the form to be "dynamic" and depends on the form field "whichAction". That's why I created the javascript function submitForm(frm) to pick the action "dynamically". In other words, I have in my struts-config.xml file for both path "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder". But I want whichever one to be chosen to be "dynamically". So how I do that all within the tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your . Let's say you have the ff entry in your struts-config: then in your html:form, specify that action: ... You do have 's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > Hubert: > Can you elaborate that In othe words, how do I do everything that > the function submitForm() does to dynamically pick an action all > within the tag? > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 4:36 PM > To: Struts Users Mailing List > Subject: Re: Must have action="." in tag? > > > Specify the Action associated with "fromCreateShopWorkOrder" or > "fromUpdateShopWorkOrder" in the attribute. > > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > > Hi: > > My tag doesn't allow me to skip an 'action' attribue. If > you > > look at my code below, I move the assignment of the 'form action' to > > the javascript function so which action to take is dynamically depends > > on the form element 'whichAction'. But the compiler insist I have to > > have the 'action' property right inside the tag. But that > doesn't allow > > me to choose the action dynamically. Does anyone have any suggestion? > > > > > > function submitForm(frm) > > { > >var whichAction=frm.elements("whichAction") > > > >if (whi
RE: Must have action="....." in tag?
But I don't always want "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" to be my action all the time. I want the action for the form to be "dynamic" and depends on the form field "whichAction". That's why I created the javascript function submitForm(frm) to pick the action "dynamically". In other words, I have in my struts-config.xml file for both path "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder" and "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder". But I want whichever one to be chosen to be "dynamically". So how I do that all within the tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:58 PM To: Struts Users Mailing List Subject: RE: Must have action="." in tag? I never said anything close to what you're asking me. All I said is choose one of your two possible outcomes (doesn't matter which one), take the path that you gave it in the struts-config.xml, then use that in your . Let's say you have the ff entry in your struts-config: then in your html:form, specify that action: ... You do have 's associated with fromCreateShopWorkOrder and fromUpdateShopWorkOrder, right? - Hubert --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > Hubert: > Can you elaborate that In othe words, how do I do everything that > the function submitForm() does to dynamically pick an action all > within the tag? > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 4:36 PM > To: Struts Users Mailing List > Subject: Re: Must have action="....." in tag? > > > Specify the Action associated with "fromCreateShopWorkOrder" or > "fromUpdateShopWorkOrder" in the attribute. > > --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > > Hi: > > My tag doesn't allow me to skip an 'action' attribue. If > you > > look at my code below, I move the assignment of the 'form action' > > to > > the javascript function so which action to take is dynamically depends > > on the form element 'whichAction'. But the compiler insist I have to > > have the 'action' property right inside the tag. But that > doesn't allow > > me to choose the action dynamically. Does anyone have any suggestion? > > > > > > function submitForm(frm) > > { > >var whichAction=frm.elements("whichAction") > > > >if (whichAction == "create") > >{ > > document.theForm.action = > > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder; > >} > >else > >{ > > document.theForm.action = > > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; > >} > > > >return true; > > } > > > > > > > > > > > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/> > > > > > > > > I got the following error with the above code: > > Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' > > failed: > > /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' > > not specified for tag 'form' > > probably occurred due to an error in > > /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > __ > Do you Yahoo!? > Yahoo! Mail SpamGuard - Read only the mail you want. > http://antispam.yahoo.com/tools > > - > 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] > __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - 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: Must have action="....." in tag?
Hubert: Can you elaborate that In othe words, how do I do everything that the function submitForm() does to dynamically pick an action all within the tag? -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 4:36 PM To: Struts Users Mailing List Subject: Re: Must have action="." in tag? Specify the Action associated with "fromCreateShopWorkOrder" or "fromUpdateShopWorkOrder" in the attribute. --- "Au-Yeung, Stella H" <[EMAIL PROTECTED]> wrote: > Hi: > My tag doesn't allow me to skip an 'action' attribue. If you > look at my code below, I move the assignment of the 'form action' to > the javascript function so which action to take is dynamically depends > on the form element 'whichAction'. But the compiler insist I have to > have the 'action' property right inside the tag. But that doesn't allow > me to choose the action dynamically. Does anyone have any suggestion? > > > function submitForm(frm) > { >var whichAction=frm.elements("whichAction") > >if (whichAction == "create") >{ > document.theForm.action = > "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder; >} >else >{ > document.theForm.action = > "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; >} > >return true; > } > > > > > class="com.cat.sdl.fdd.formBean.shopWorkOrder.ShopWorkOrderForm"/> > > > > I got the following error with the above code: > Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: > /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' > not specified for tag 'form' > probably occurred due to an error in > /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - 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]
Must have action="....." in tag?
Hi: My tag doesn't allow me to skip an 'action' attribue. If you look at my code below, I move the assignment of the 'form action' to the javascript function so which action to take is dynamically depends on the form element 'whichAction'. But the compiler insist I have to have the 'action' property right inside the tag. But that doesn't allow me to choose the action dynamically. Does anyone have any suggestion? function submitForm(frm) { var whichAction=frm.elements("whichAction") if (whichAction == "create") { document.theForm.action = "/app/fdd/shopWorkOrder/fromCreateShopWorkOrder; } else { document.theForm.action = "/app/fdd/shopWorkOrder/fromUpdateShopWorkOrder; } return true; } I got the following error with the above code: Parsing of JSP File '/app/fdd/shopWorkOrder/CreateTLFPart.jsp' failed: /app/fdd/shopWorkOrder/CreateTLFPart.jsp(28): required attribute 'action' not specified for tag 'form' probably occurred due to an error in /app/fdd/shopWorkOrder/CreateTLFPart.jsp line 28: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tag doesn't recognize Struts dataBean property's value
Yes Geeta. I do need trim() and that makes it work. That is so strange even though when I printed out "ShopOrderExist" to confirm it has no trailing blanks. Thanks. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 1:45 PM To: Struts Users Mailing List Subject: Re: tag doesn't recognize Struts dataBean property'svalue Jumping in here.. yes, I think you need to trim() before you check. Also, if that too doesn't work, can you check for something "positive" (like if "ShopOrderExist" is equals to "false" rather than "ShopOrderExist" is not equals to "not exists"..?). Another thought, try to get this to work just using oridinary jsp tags and java code (<% java code here %>) and see oif things work. Than you can narrow the problem down to tag issues.. Good luck! Geeta "Au-Yeung, Stella H" wrote: > Niall: > I did what you suggested and print out the value of the property > "shopOrderExist". It is equal to "notExist" as expected. But somehow the > "Update link" is still displayed instead of the "Create link". Do you > think I have to do something to the value of "shopOrderExist" such as > .trim() or convert to "true" before letting it be compared in the > logic:equal tag? > > collection="<%=ShopWorkOrderSearchFormBean.getPage()%>" > type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean"> > > > property="sequence"/> > property="shopOrderExist"/> < ADDED > > > > value="notExist"> > > > > > value="notExist"> > > > > > > > > > -Original Message- > From: Niall Pemberton [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 11:16 AM > To: Struts Users Mailing List > Subject: Re: tag doesn't recognize Struts dataBean > property's value > > I doubt the problem is . > > Your jsp looks OK - why not try outputting the "shopOrderExist" > property in your table (along with yhe other stuff) - something along > the lines of: > > property="shopOrderExist"/> > > That way, you can see the value the is testing > against. > > Niall > > - Original Message - > From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, February 23, 2004 3:34 PM > Subject: tag doesn't recognize Struts dataBean property's > value > > > Hi: > > In my struts-based application I am using a tag in my > > JSP > page > > to print two links depends on the value of a struts-based databean's > > property. Bacially on this JSP page, a list of records wil be > > displayed. Next to each record, either a "Create" link or an > > "Update" link should be displayed depends upon the property > > '"shopOrderExist". If this property > has > > the value "notExist", it should display the "Create" link. If it is > > not equal to "notExist", it should display the "Update" link. For > > some reason, the "Update" link is always displayed even though > > "shopOrderExist" has a value of "notExist". So the logic:equal tag > > is not comparing things correctly. Am I doing it wrong? (note, the > > property "shopOrderExist" is of type String and in Debug I see that > > its value is "notExist") > > > > Here's my code: > > > collection="<%=ShopWorkOrderSearchFormBean.getPage()%>" > > type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean"> > > > > > property="sequence"/> > > > > > name="sequenceList" property="shopOrderExist" > value="notExist"> > > > > > > > > > value="notExist"> > href="app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec"> > > > > > > > > Thanks in advance! > > Stella > > > > > > > > - > > 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] - 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: tag doesn't recognize Struts dataBean property's value
Niall: I did what you suggested and print out the value of the property "shopOrderExist". It is equal to "notExist" as expected. But somehow the "Update link" is still displayed instead of the "Create link". Do you think I have to do something to the value of "shopOrderExist" such as .trim() or convert to "true" before letting it be compared in the logic:equal tag? < ADDED -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: tag doesn't recognize Struts dataBean property's value I doubt the problem is . Your jsp looks OK - why not try outputting the "shopOrderExist" property in your table (along with yhe other stuff) - something along the lines of: That way, you can see the value the is testing against. Niall - Original Message - From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 23, 2004 3:34 PM Subject: tag doesn't recognize Struts dataBean property's value > Hi: > In my struts-based application I am using a tag in my JSP page > to print two links depends on the value of a struts-based databean's > property. Bacially on this JSP page, a list of records wil be > displayed. Next to each record, either a "Create" link or an "Update" > link should be displayed depends upon the property '"shopOrderExist". > If this property has > the value "notExist", it should display the "Create" link. If it is > not equal to "notExist", it should display the "Update" link. For some > reason, the "Update" link is always displayed even though > "shopOrderExist" has a value of "notExist". So the logic:equal tag is > not comparing things correctly. Am I doing it wrong? (note, the > property "shopOrderExist" is of type String and in Debug I see that > its value is "notExist") > > Here's my code: > collection="<%=ShopWorkOrderSearchFormBean.getPage()%>" > type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean"> > > property="sequence"/> > > name="sequenceList" property="shopOrderExist" value="notExist"> > > > > value="notExist"> href="app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec"> > > > > > Thanks in advance! > Stella > > > - > 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: tag doesn't recognize Struts dataBean property's value
As you suggested I will display the shopOrderExist property on the form too. I know my loop is working fine because each of the ecord is displayed correctly. The only problem is when the flag is "notExist", it will display the Update Link instead of the "Create Link. That's why I thought my is not correct. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Monday, February 23, 2004 11:16 AM To: Struts Users Mailing List Subject: Re: tag doesn't recognize Struts dataBean property's value I doubt the problem is . Your jsp looks OK - why not try outputting the "shopOrderExist" property in your table (along with yhe other stuff) - something along the lines of: That way, you can see the value the is testing against. Niall - Original Message - From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 23, 2004 3:34 PM Subject: tag doesn't recognize Struts dataBean property's value > Hi: > In my struts-based application I am using a tag in my JSP page > to print two links depends on the value of a struts-based databean's > property. Bacially on this JSP page, a list of records wil be > displayed. Next to each record, either a "Create" link or an "Update" > link should be displayed depends upon the property '"shopOrderExist". > If this property has > the value "notExist", it should display the "Create" link. If it is > not equal to "notExist", it should display the "Update" link. For some > reason, the "Update" link is always displayed even though > "shopOrderExist" has a value of "notExist". So the logic:equal tag is > not comparing things correctly. Am I doing it wrong? (note, the > property "shopOrderExist" is of type String and in Debug I see that > its value is "notExist") > > Here's my code: > collection="<%=ShopWorkOrderSearchFormBean.getPage()%>" > type="com.cat.fdd.dataBean.shopWorkOrder.ShopWorkOrderSearchBean"> > > property="sequence"/> > > name="sequenceList" property="shopOrderExist" value="notExist"> > > > > value="notExist"> href="app/fdd/shopWorkOrder/UpdateShopWorkOrderRequest.exec"> > > > > > Thanks in advance! > Stella > > > - > 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]
tag doesn't recognize Struts dataBean property's val ue
Hi: In my struts-based application I am using a tag in my JSP page to print two links depends on the value of a struts-based databean's property. Bacially on this JSP page, a list of records wil be displayed. Next to each record, either a "Create" link or an "Update" link should be displayed depends upon the property '"shopOrderExist". If this property has the value "notExist", it should display the "Create" link. If it is not equal to "notExist", it should display the "Update" link. For some reason, the "Update" link is always displayed even though "shopOrderExist" has a value of "notExist". So the logic:equal tag is not comparing things correctly. Am I doing it wrong? (note, the property "shopOrderExist" is of type String and in Debug I see that its value is "notExist") Here's my code: Thanks in advance! Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] RE: Garbage Collection
The link fot the paper is http://java.sun.com/docs/hotspot/gc/ The reason I posted here is because my app, which is a J2EE/Struts/Weblogic app, is having a outOfMemoryError. There are a few things I am suspecting, one of the causes may be the 'size' of my Struts formBean or the size of my stateful EJB. Another cause may be the number of JSP and classes I have exceeded the Permanent Generation. I have reviewed some of the previous postings in this forum talk about those things. That prompted me to review the above article and came up with the questions. I am sorry if this is not the right place for this posting. Is there a GC forum that I can post my question? -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 5:54 AM To: Struts Users Mailing List Subject: [OT] RE: Garbage Collection Where is this paper? Can you provide a link? A problem similar to this was discussed earlier this week. Since you do not make it clear that you are using Struts or even a web application, please prepend your posts with [OT] next time. robert > -Original Message----- > From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] > Sent: Friday, September 19, 2003 4:58 PM > To: 'Struts Users Mailing List' > Subject: Garbage Collection > > > A few question on Garbage Collection. I read the paper on "Tuning > Garbage Collection". Can someone tell me: > 1) What's the default size of 'Permanent Generation'. > 2) How to print out the available memory in 'Permanent Gereration'? > My 'OutOfMemoryError' may be due to this space is fulled. > 3) The paper talkes about 'Promptness' (which is the time between when > an object becomes dead and when the memory becomes available). Is there a > default of this time. Can I print out what's the setting is. I also > suspend that my 'OutOfMemoryError' is due to memory from dead objecs > are not released soon enough. > 4) If I use 'NewRatio' to set the ratio between young and old generation, > why do I need 'NewSize' and 'MaxNewSize' since the latter too > are to bound > the young generation size. Doesn't that 'NewRatio' already > setting the size > of the young generation with respect to the old generation and the total > heap size? > > Any help will be appreciated. > > Stella > > - > 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]
Garbage Collection
A few question on Garbage Collection. I read the paper on "Tuning Garbage Collection". Can someone tell me: 1) What's the default size of 'Permanent Generation'. 2) How to print out the available memory in 'Permanent Gereration'? My 'OutOfMemoryError' may be due to this space is fulled. 3) The paper talkes about 'Promptness' (which is the time between when an object becomes dead and when the memory becomes available). Is there a default of this time. Can I print out what's the setting is. I also suspend that my 'OutOfMemoryError' is due to memory from dead objecs are not released soon enough. 4) If I use 'NewRatio' to set the ratio between young and old generation, why do I need 'NewSize' and 'MaxNewSize' since the latter too are to bound the young generation size. Doesn't that 'NewRatio' already setting the size of the young generation with respect to the old generation and the total heap size? Any help will be appreciated. Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tool to diagnose J2EE/Struts/Oracle problem
Matt: You mentioned the following: >> Garbage collection does not release database connections. IN that case, do you know who releases the connections and make it available for re-use after conn.close() has been done. It sounds like you must have read from somewhere that said GC doesn't release connections. Stella -Original Message- From: Sgarlata Matt [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 10:56 PM To: Struts Users Mailing List Subject: Re: Tool to diagnose J2EE/Struts/Oracle problem You should investigate using connection pooling, such as is offered by the DBCP project, which is a Jakarta Commons subproject. Garbage collection does not release database connections. I'm not sure on all the details why not, but there are other reasons to use connection pooling such as performance. - Original Message - From: "Au-Yeung, Stella H" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, September 17, 2003 10:52 PM Subject: Tool to diagnose J2EE/Struts/Oracle problem > I am havng a No resource Available problem with my J2EE/Struts/Oracle > application. It is saying I don't have any more Oracle connections > available. Even I am closing the result set, statement and connection, I > am still running into the problem. When I use the Oracle DBA monitor tool, > it shows that I have 10 'inactive' connection but then my app will give the > 'no resource available' error. So it looks like somehow it is not reusing > those inactive connections. Does Gabage Collection release those > connections? Does anyone have this problem before? > > So I am looking for a better 'tool' to find out why GC doesn't release those > connections or if those 10 'inactive' connections are actually available to > be re-used. Can someone give me a suggestion on this tool or how to > troubleshoot the problem? > > Thanks > Stella > > > - > 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: Tool to diagnose J2EE/Struts/Oracle problem
Amin: Yes we have have multiple users using sqlplus and everything works ok. SO the database is find. Somehow, the I think the problem is either in the JVM provided with Weblogic or the Oracle drivers because even though the oracle connections are ideled, they cannot be reused. Can you tell me what do you mean by 'hibernate' site. Are you referring to the Oracle site? Regards, Stella Auyeung EDS Digital Enablement - Saginaw 6200 State Street, Suite 1 Saginaw, MI 48603 * phone: 989-497-5766 (8-399) * pager: 989-201-1030 * mailto:[EMAIL PROTECTED] -Original Message- From: Mohd Amin Mohd Din [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 11:07 PM To: 'Struts Users Mailing List' Subject: RE: Tool to diagnose J2EE/Struts/Oracle problem Is your oracle database configured properly? Try connecting multiple users using oem or sqlplus to rule out is the issue is from the database. I had a max cursor reached error before which was attributed to not closing the preparedstatement. Another thing you may try is to use the latest JDBC drivers. There are some issues with 9.0.3 and below drivers, found out on hibernate site. Amin -Original Message----- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 10:52 AM To: Struts Users Mailing List Subject: Tool to diagnose J2EE/Struts/Oracle problem I am havng a No resource Available problem with my J2EE/Struts/Oracle application. It is saying I don't have any more Oracle connections available. Even I am closing the result set, statement and connection, I am still running into the problem. When I use the Oracle DBA monitor tool, it shows that I have 10 'inactive' connection but then my app will give the 'no resource available' error. So it looks like somehow it is not reusing those inactive connections. Does Gabage Collection release those connections? Does anyone have this problem before? So I am looking for a better 'tool' to find out why GC doesn't release those connections or if those 10 'inactive' connections are actually available to be re-used. Can someone give me a suggestion on this tool or how to troubleshoot the problem? Thanks Stella - 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]
Tool to diagnose J2EE/Struts/Oracle problem
I am havng a No resource Available problem with my J2EE/Struts/Oracle application. It is saying I don't have any more Oracle connections available. Even I am closing the result set, statement and connection, I am still running into the problem. When I use the Oracle DBA monitor tool, it shows that I have 10 'inactive' connection but then my app will give the 'no resource available' error. So it looks like somehow it is not reusing those inactive connections. Does Gabage Collection release those connections? Does anyone have this problem before? So I am looking for a better 'tool' to find out why GC doesn't release those connections or if those 10 'inactive' connections are actually available to be re-used. Can someone give me a suggestion on this tool or how to troubleshoot the problem? Thanks Stella - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Size of a stateful Bean question and OutOfMemoryError
Hi: We have a J2EE application that follows standard J2EE and Struts design pattern. We are using WebLogic 6.1, Struts 1.0 and JDK 1.3.1. Basically, we have JSPs, ActionForms with databeans to populate the JSP. Action classes call EJBs for business rules processing. EJBs call DAO to retrieve data etc. Some of the EJB's are stateful and some are stateless. We are running into a problems: "OutOfMemoryError" frequently. I dug through this user group's archive and found a suggestion about increasing the Heap size. I increase it to: -Xms512m -Xmx512m -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=8 And is still having the OutOfMemoryError problem.That should give it plenty of heap space, doesn't it? It seems like the JVM garbage collection (GC) is not doing its work.I tried to put -verbose so I can see when GC takes place. But because the application is started as an NT service so I can't see any printout. Ques#1) Running the application as an NT service, how can I print out GC detail info so I can see how much memory is being released and other kind of helpful info? Ques#2) I understand my EJB stateful beans are allocated as multiple instances to multiple clients. Do you think moving some of the code that doesn't need to be in a 'stateful' bean into a 'stateless' bean will reduce memory consumption thus alleviate the outOfMemoryError problem? Ques$3) I have a general purpose 'ActionForm' for 'Searching' purpose. It serves multiple search JSPs. So it is quite big. Do you think may be breaking up the ActionForm to multiple ones so each search JSP has its own ActionForm. By reducing the size of ActionForm, do you think it also will alleviate the memory problem. Ques#4) I thought I read somewhere before that weblogic 6.1 and JDK 1.3.1 may have a memory leak problem. Does anyone have similar problems with these versions. And if I upgrade to newer Weblogic (e.g. 7.0) and new JDK (e.g. 1.4.1) will it resolve my memory problem? Ques#5) Finally, whats the best way to debug OutOfMemoryError problem. Thanks for any suggestions and insights that you can provide... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pop-up a window on Submit
Well I have succeeded opening a window in struts-based jsp file. But the window that got opened does not contain the data I retrieved from the data. The data was set in my formBean in my Action class. I tried two different methods: Method#1: my jsp has been modified to the following <!-- function submitForm(frm) { win = window.open( "/app/report/Search","myWindow","toolbar=none"); win.resizeTo( 450, 350); return true; } //--> With method#1, my normal 'mainReport.jsp' still displayed in the original window with the result set of data that was retrieved from the database. A small window was also opened but with error 404. But I want "MainReport.jsp with the result" to be displayed in the new window. Method#2: my jsp has been modified to the following <!-- win = window.open( "","myWindow","toolbar=none"); win.resizeTo( 750, 450); //--> In my Action class, the "result' property is set to "ok" when data are retrieved from the DB successfully. With method#2, a 'blank' new window is opened. The original window didn't change, it has the search filters. But I want the result to be displayed in the new window. My struts-config file: I guess I don't know what to put as the 'url' parameter in the window.open() method in order for MainReport.jsp to be displayed in the new window with the retrieved data. As you can see, I tried using "/app/report/Search" and "". Neither one works. Any idea??? Pat -Original Message- From: Koni [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 11:26 AM To: Struts Users Mailing List Subject: RE: Pop-up a window on Submit - When you look at the html code, check if the result value (ok) is passed correctly. Otherwise it does not work. - Original Message >Subject: RE: Pop-up a window on Submit >Date: Tue, 12 Aug 2003 10:39:42 -0400 >From: Au-Yeung, Stella H <[EMAIL PROTECTED]> >Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> >To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > >Hi Koni: >I must have misunderstood what you adviced me to do because I couldn't get >it working on what you suggested. This is what I did: > >I added the logic tag in my jsp: >value="ok"> > >===> the rest of this jsp file is just a table to display my data. > > >I added a new property "result" into my formBean and also its getter and >setter. >private String result; > > >Then in my Action class I added the following call to the setter when my >data are retrieved successfully: >if (formBean.isMainReportAction()) >{ >this.validateAction(formBean, request, errors); // validate search >filters >if(errors.empty()) >{ > retrieve data for main report and display main report > formBean.setResult("ok"); // IF EVERYTHIANG IS OK, SET result="ok" >so jsp will pop up new wdw >} >else >displayed error message in the original window >} > >But when I ran this, no window is pop-up. The data is still displaying in >the original window. >Did I miss something that you tried to tell me? Thx... > >Pat > > > >-Original Message- >From: Koni [mailto:[EMAIL PROTECTED] >Sent: Tuesday, August 12, 2003 7:00 AM >To: [EMAIL PROTECTED] >Subject: Re: Pop-up a window on Submit > > >Hi Pat > >I solved the validation problem (your question 2) as described in many >examples: > >In struts-config.xml, add 'input' to your action mapping. >... > type="com.test.action.report.ReportAction" > name="SearchFormBean > scope="request" > validate="false" > input="/thePage.jsp"> // < !! >... > >MyAction.java: >... > ActionErrors errors = new ActionErrors(); > if ( ! formBean.isMainReportAction() ) > { > errors.add(ActionErrors.GLOBAL_ERROR, > new ActionError("error.my.error.message")); > } > // Report any errors we have discovered back to the original form > if (!errors.isEmpty()) > { > saveErrors(request, errors); > // go back to the input page > return new ActionForward(mapping.getInput()); > } >... > > >thePage.jsp: >Example of displaying errors in .jsp >... > > > > > > > >... > >You could solve your pop-up problem with in your .jsp! > > > > > >Hope it helps. >Koni > > >>Au-Yeung, Stella H wrote: >> Hi: >> The bottom of my Sear
RE: Pop-up a window on Submit
Hi Koni: I must have misunderstood what you adviced me to do because I couldn't get it working on what you suggested. This is what I did: I added the logic tag in my jsp: ===> the rest of this jsp file is just a table to display my data. I added a new property "result" into my formBean and also its getter and setter. private String result; Then in my Action class I added the following call to the setter when my data are retrieved successfully: if (formBean.isMainReportAction()) { this.validateAction(formBean, request, errors); // validate search filters if(errors.empty()) { retrieve data for main report and display main report formBean.setResult("ok"); // IF EVERYTHIANG IS OK, SET result="ok" so jsp will pop up new wdw } else displayed error message in the original window } But when I ran this, no window is pop-up. The data is still displaying in the original window. Did I miss something that you tried to tell me? Thx... Pat -Original Message- From: Koni [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 7:00 AM To: [EMAIL PROTECTED] Subject: Re: Pop-up a window on Submit Hi Pat I solved the validation problem (your question 2) as described in many examples: In struts-config.xml, add 'input' to your action mapping. ... // < !! ... MyAction.java: ... ActionErrors errors = new ActionErrors(); if ( ! formBean.isMainReportAction() ) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.my.error.message")); } // Report any errors we have discovered back to the original form if (!errors.isEmpty()) { saveErrors(request, errors); // go back to the input page return new ActionForward(mapping.getInput()); } ... thePage.jsp: Example of displaying errors in .jsp ... ... You could solve your pop-up problem with in your .jsp! Hope it helps. Koni >Au-Yeung, Stella H wrote: > Hi: > The bottom of my Search.jsp has two buttons. They are for displaying > different report (a Main report and a Procedure Summary): > > key="button.mainReport"/> > key="button.procedureSummary"/> > > In my Struts Action class ReportAction I do the following: > if (formBean.isMainReportAction()) > { > this.validateAction(formBean, request, errors); // validate search > filters > if(errors.empty()) > retrieve data for main report and display main report > else > displayed error message > } > else if (formBean.isProcedureSummaryAction()) > { > this.validateAction(formBean, request, errors); // validate search > filters > if(errors.empty()) > retrieve data for procedure summary report > << forward to the template "ProcSummTemplate" > else > displayed error message > } > > My struts-config file sort of like this: > > path="/app/report/ProcedureSummary.jsp"/> > > > type="com.test.action.report.ReportAction" >name="SearchFormBean" >scope="request" >validate="false"> > > > > > All the above works fine, but now I need to enhance it to do these: > - If there are no validation errors, pop-up a new window to display the > selected report (MainReport.jsp or ProcedureSummary.jsp) > - If there are validation errors, stay on the same window to display > validation messages in Search.jsp so user can reenter search filters. > My questions are: > 1) How do I pop up a new window with the tag? Since I cannot > do onSubmit()="return popUpAWindow()" inside the tags > 2) How do I force Struts to stay in the same window if there are validation > errors, otherwise do the pop-up? My validation method is in the Action class > and not a javascript function. > > Thanks in advance. > Pat > - 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]
Pop-up a window on Submit
Hi: The bottom of my Search.jsp has two buttons. They are for displaying different report (a Main report and a Procedure Summary): In my Struts Action class ReportAction I do the following: if (formBean.isMainReportAction()) { this.validateAction(formBean, request, errors); // validate search filters if(errors.empty()) retrieve data for main report and display main report else displayed error message } else if (formBean.isProcedureSummaryAction()) { this.validateAction(formBean, request, errors); // validate search filters if(errors.empty()) retrieve data for procedure summary report << forward to the template "ProcSummTemplate" else displayed error message } My struts-config file sort of like this: All the above works fine, but now I need to enhance it to do these: - If there are no validation errors, pop-up a new window to display the selected report (MainReport.jsp or ProcedureSummary.jsp) - If there are validation errors, stay on the same window to display validation messages in Search.jsp so user can reenter search filters. My questions are: 1) How do I pop up a new window with the tag? Since I cannot do onSubmit()="return popUpAWindow()" inside the tags 2) How do I force Struts to stay in the same window if there are validation errors, otherwise do the pop-up? My validation method is in the Action class and not a javascript function. Thanks in advance. Pat Regards, Stella Auyeung EDS Digital Enablement - Saginaw 6200 State Street, Suite 1 Saginaw, MI 48603 * phone: 989-497-5766 (8-399) * pager: 989-201-1030 * mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Request object Null Pointer
I thought once I store an attribute into the 'request' object, it will be available no matter how many times I iterate through the same Action class? If it doesn't do that, then how do I store data into the request object so I can use it again later in the same Action class or even in a different Action class. Thx. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 12:06 AM To: Struts Users Mailing List Subject: RE: Request object Null Pointer Well of course its null. The second time through you arent calling request.setAttribute("vehList",vehList) before calling prepareListForUpdate() -Original Message----- From: Au-Yeung, Stella H [mailto:[EMAIL PROTECTED] Sent: Thursday, 17 July 2003 10:52 To: '[EMAIL PROTECTED]' Subject: Request object Null Pointer Hi: I am getting a NULL pointer with the request object: Please see code below. I got a NULL pointer trying to access "vehList' in the request object inside the method "prepareListForUpdate". But I didn't get a NULL pointer accessing "vehList" inside the method "setScheduleList". So it looks like the 1st time it ran through the Action class, the request object is ther. But the 2nd time it ran through the Action class, either the request object is null or "vehList' is no longer in the request object. === Portion of Action class: ArrayList vehList = new ArrayList(); ==> initialize and set values for vehList here < if (formBean.isSearchAction()) // user clicks 'search' on form. Run through this Action class the 1st time { request.setAttribute("vehList",vehList); this.setScheduleList(request); // invoke another method <=== eventually "first.jsp" with an 'Update" button is displayed } else if (formBean.isBlnUpdateAction()) // user clicks 'update' in "first.jsp", Run through this Action class the 2nd time { this.prepareListForUpdate(request);// invoke another method } = Portion of method "setScheduleList": setScheduleList(javax.servlet.http.HttpServletRequest request) { // display vehList.size() AND IT PRINTED OUT OK ArrayList l = (ArrayList) request.getAttribute("vehList"); EtLog.debug(this,"in setScheduleList, vehList,size()="+l.size()); } == Portion of method "prepareListForUpdate": prepareListForUpdate(javax.servlet.http.HttpServletRequest request) { // display vehList.size() AND IT GAVE ME A NULL POINTER EXCEPTION ArrayList l = (ArrayList) request.getAttribute("vehList"); EtLog.debug(this,"in prepareListForUpdate, vehList,size()="+l.size()); } Any help will be appreciated, Newbie - 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]
Request object Null Pointer
Hi: I am getting a NULL pointer with the request object: Please see code below. I got a NULL pointer trying to access "vehList' in the request object inside the method "prepareListForUpdate". But I didn't get a NULL pointer accessing "vehList" inside the method "setScheduleList". So it looks like the 1st time it ran through the Action class, the request object is ther. But the 2nd time it ran through the Action class, either the request object is null or "vehList' is no longer in the request object. === Portion of Action class: ArrayList vehList = new ArrayList(); ==> initialize and set values for vehList here < if (formBean.isSearchAction()) // user clicks 'search' on form. Run through this Action class the 1st time { request.setAttribute("vehList",vehList); this.setScheduleList(request); // invoke another method <=== eventually "first.jsp" with an 'Update" button is displayed } else if (formBean.isBlnUpdateAction()) // user clicks 'update' in "first.jsp", Run through this Action class the 2nd time { this.prepareListForUpdate(request);// invoke another method } = Portion of method "setScheduleList": setScheduleList(javax.servlet.http.HttpServletRequest request) { // display vehList.size() AND IT PRINTED OUT OK ArrayList l = (ArrayList) request.getAttribute("vehList"); EtLog.debug(this,"in setScheduleList, vehList,size()="+l.size()); } == Portion of method "prepareListForUpdate": prepareListForUpdate(javax.servlet.http.HttpServletRequest request) { // display vehList.size() AND IT GAVE ME A NULL POINTER EXCEPTION ArrayList l = (ArrayList) request.getAttribute("vehList"); EtLog.debug(this,"in prepareListForUpdate, vehList,size()="+l.size()); } Any help will be appreciated, Newbie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]