RE: chaining actions i think!!
Thanks! As Frank sayes if I can use the action as a normal class then I am comfortable with writing a method to or using the execute method. If I use the execute method what would I pass in as my action mapping?? For the actionForm I can pass my form which I hold in the session. -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: 05 October 2005 15:17 To: Shoukat,F,Faisal,JPGA8Y C Cc: user@struts.apache.org Subject: Re: chaining actions i think!! I am unsure if you want to chain actions as this would not conform to Action1->ActionForward1 where the design is meant to handle one action at a time store it as session variable and access it later Action... execute(... HttpSession session = request.getSession(); session.setAttribute("username", username); test for presence of session.getAttribute("username") and result if not null prepopulate your form with the value Anyone else ? Martin- - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, October 05, 2005 6:47 AM Subject: chaining actions i think!! Hi, Is there a way that I can call another action from within a action class. Is it as simple as just calling the execute method of the other action or another method of the action class as is required.? My scenario is as follows: A user searches on a client and is returned a number of results. He then chooses to edit one of the results and goes to the edit jsp. After editing the user has the option of returning back to the search results. To show the record that has been edited I am making another trip to the DB as I don't have a cache. To return back to the results the user clicks on his button and is forwarded to the edit Action class. It is from this action class that I want to call the search Action class passing in the search form which is held in the session. This will then go to the DB and return to the appropriate search jsp. Any one any views on this Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: encoding the session
yes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 05 October 2005 13:47 To: Struts Users Mailing List Cc: user@struts.apache.org Subject: Re: encoding the session are you using struts framework <[EMAIL PROTECTED]> 05/10/2005 18:12 Please respond to "Struts Users Mailing List" To cc Subject encoding the session Hi, Can anyone advise on how to encode the session Id so that a user cannot just type in the URL and get to the jsp? For example my user can create a client form creatClient.jsp but can also go straight to the editClient.jsp by adding it to the URl and I want to stop this Thanks - 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]
encoding the session
Hi, Can anyone advise on how to encode the session Id so that a user cannot just type in the URL and get to the jsp? For example my user can create a client form creatClient.jsp but can also go straight to the editClient.jsp by adding it to the URl and I want to stop this Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: chaining actions i think!!
Maybe it is because I am new to struts but I don't see the benefit of writing one action class to handle a lot of mappings. For maintainablitity and the way my application is written I have multiple action classes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 05 October 2005 11:57 To: Struts Users Mailing List Cc: user@struts.apache.org Subject: Re: chaining actions i think!! Faisal, Why are you making different action classes for Search and Edit functionality. You can have these method in one Action class itself and then you can call the 'search action mapping' from 'edit action mapping' defined in struts-config.xml. If you want more detail that how to do it, let me know. Sunil <[EMAIL PROTECTED]> 05/10/2005 16:17 Please respond to "Struts Users Mailing List" To cc Subject chaining actions i think!! Hi, Is there a way that I can call another action from within a action class. Is it as simple as just calling the execute method of the other action or another method of the action class as is required.? My scenario is as follows: A user searches on a client and is returned a number of results. He then chooses to edit one of the results and goes to the edit jsp. After editing the user has the option of returning back to the search results. To show the record that has been edited I am making another trip to the DB as I don't have a cache. To return back to the results the user clicks on his button and is forwarded to the edit Action class. It is from this action class that I want to call the search Action class passing in the search form which is held in the session. This will then go to the DB and return to the appropriate search jsp. Any one any views on this Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
chaining actions i think!!
Hi, Is there a way that I can call another action from within a action class. Is it as simple as just calling the execute method of the other action or another method of the action class as is required.? My scenario is as follows: A user searches on a client and is returned a number of results. He then chooses to edit one of the results and goes to the edit jsp. After editing the user has the option of returning back to the search results. To show the record that has been edited I am making another trip to the DB as I don't have a cache. To return back to the results the user clicks on his button and is forwarded to the edit Action class. It is from this action class that I want to call the search Action class passing in the search form which is held in the session. This will then go to the DB and return to the appropriate search jsp. Any one any views on this Thanks
RE: reset form in session scope
To do it the way you have shown then I would have to have a reset button/link next to the edit/delete link at the bottom of the page. Is that right? -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: 30 September 2005 15:52 To: Struts Users Mailing List Subject: Re: reset form in session scope Faisal, Are you saying you want to do it on client side? Using the 'normal' HTML reset? If so, I don't see how. That's why I assumed you're submitting for reset. The reset button only resets your form elements; and you can use javascript to call reset on more than one forms. But I don't see how can you get rid of results shown. Submitting for reset and claring sesion data would be easiest way. You can also use DHTML to remove results table from the current document if you absolutely want to do without a submit. I hope this helps. ATTA On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The reset button from the search form does not go to the > actionclientaction class. Maybe I have explained it badly. > > My jsp has some search fields and the user enters criteria into these > then clicks submit. > > This returns a table of results further down the page with checkboxes > associated with each line of result. And a edit or delete link at the > bottom. The user can select multiple checkboxes then edit or delete the > results. > > Next to the submit button below the search criteria is a reset button. > How would I blank the search criteria and get rid of the results > displayed below by clicking on reset. > > At the moment I have > > > > > > > > > > > > > in my jsp and in my form I have a blank reset method. But this does not > get called. > > > > -Original Message- > From: atta-ur rehman [mailto:[EMAIL PROTECTED] > Sent: 30 September 2005 15:30 > To: Struts Users Mailing List > Subject: Re: reset form in session scope > > in the actionClient action class, on reset button click: > > ActionForm form = (ActionForm) session.getAttribute("searchClientForm"); > if (form != null) { > form.reset(...); > } > > only if I understood your question correctly and search form is not > doing > anything with mapping and/or request in it's reset() method! > > ATTA > > On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have a search.jsp which contains two forms search form and a action > > form. > > > > The search form submits all the search criteria to the action class > > which queries the DB then returns a result. The action form then > > decides which action to do with what result. > > > > The problem I have is how do I reset the search form and the action > form > > with one button. > > > > I have two buttons on the search form, submit and reset. When I press > > reset I want to reset the search criteria and clear all the results > > which are being displayed. > > > > My struts config is as follows: > > > > > type="com.medina.web.action.SearchClientAction" > > name="searchClientForm" > > scope="session" > > input="/searchClient.jsp" > > validate="true"> > > > > > > > > > type="com.medina.web.action.ActionClientAction" > > name="actionClientForm" > > scope="request" > > input="/searchClient.jsp" > > validate="true"> > > > > > > > > > > > > I have the search form in the seesion scope so when the results are > > validated they are still displayed and do not disappear. > > > > > > - > 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: reset form in session scope
The reset button seems to work fine before I do a search. Once I have returned some results the reset button does not seem to do anything -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 30 September 2005 15:42 To: user@struts.apache.org; [EMAIL PROTECTED] Subject: RE: reset form in session scope The reset button from the search form does not go to the actionclientaction class. Maybe I have explained it badly. My jsp has some search fields and the user enters criteria into these then clicks submit. This returns a table of results further down the page with checkboxes associated with each line of result. And a edit or delete link at the bottom. The user can select multiple checkboxes then edit or delete the results. Next to the submit button below the search criteria is a reset button. How would I blank the search criteria and get rid of the results displayed below by clicking on reset. At the moment I have in my jsp and in my form I have a blank reset method. But this does not get called. -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: 30 September 2005 15:30 To: Struts Users Mailing List Subject: Re: reset form in session scope in the actionClient action class, on reset button click: ActionForm form = (ActionForm) session.getAttribute("searchClientForm"); if (form != null) { form.reset(...); } only if I understood your question correctly and search form is not doing anything with mapping and/or request in it's reset() method! ATTA On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a search.jsp which contains two forms search form and a action > form. > > The search form submits all the search criteria to the action class > which queries the DB then returns a result. The action form then > decides which action to do with what result. > > The problem I have is how do I reset the search form and the action form > with one button. > > I have two buttons on the search form, submit and reset. When I press > reset I want to reset the search criteria and clear all the results > which are being displayed. > > My struts config is as follows: > > type="com.medina.web.action.SearchClientAction" > name="searchClientForm" > scope="session" > input="/searchClient.jsp" > validate="true"> > > > > type="com.medina.web.action.ActionClientAction" > name="actionClientForm" > scope="request" > input="/searchClient.jsp" > validate="true"> > > > > > > I have the search form in the seesion scope so when the results are > validated they are still displayed and do not disappear. > > - 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: reset form in session scope
The reset button from the search form does not go to the actionclientaction class. Maybe I have explained it badly. My jsp has some search fields and the user enters criteria into these then clicks submit. This returns a table of results further down the page with checkboxes associated with each line of result. And a edit or delete link at the bottom. The user can select multiple checkboxes then edit or delete the results. Next to the submit button below the search criteria is a reset button. How would I blank the search criteria and get rid of the results displayed below by clicking on reset. At the moment I have in my jsp and in my form I have a blank reset method. But this does not get called. -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: 30 September 2005 15:30 To: Struts Users Mailing List Subject: Re: reset form in session scope in the actionClient action class, on reset button click: ActionForm form = (ActionForm) session.getAttribute("searchClientForm"); if (form != null) { form.reset(...); } only if I understood your question correctly and search form is not doing anything with mapping and/or request in it's reset() method! ATTA On 9/30/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a search.jsp which contains two forms search form and a action > form. > > The search form submits all the search criteria to the action class > which queries the DB then returns a result. The action form then > decides which action to do with what result. > > The problem I have is how do I reset the search form and the action form > with one button. > > I have two buttons on the search form, submit and reset. When I press > reset I want to reset the search criteria and clear all the results > which are being displayed. > > My struts config is as follows: > > type="com.medina.web.action.SearchClientAction" > name="searchClientForm" > scope="session" > input="/searchClient.jsp" > validate="true"> > > > > type="com.medina.web.action.ActionClientAction" > name="actionClientForm" > scope="request" > input="/searchClient.jsp" > validate="true"> > > > > > > I have the search form in the seesion scope so when the results are > validated they are still displayed and do not disappear. > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reset form in session scope
Hi, I have a search.jsp which contains two forms search form and a action form. The search form submits all the search criteria to the action class which queries the DB then returns a result. The action form then decides which action to do with what result. The problem I have is how do I reset the search form and the action form with one button. I have two buttons on the search form, submit and reset. When I press reset I want to reset the search criteria and clear all the results which are being displayed. My struts config is as follows: I have the search form in the seesion scope so when the results are validated they are still displayed and do not disappear.
RE: prepopulating jsp page
Yes, the flow is like this: My struts config has this action for the search page: This sends the actionclientForm to the actionclientaction class. This class goes to the db gets the information then forwards to editClient.jsp which has the action mapped: > > > type="com.medina.web.action.UpdateClientAction" > > > > name="createClientForm" > > > > scope="session" So when I tried to re cast it it threw a class cast because I was trying to cast actionClientForm to createClientForm. The bean named createCleintForm is of class createClientForm which is mapped in the form beans of config.xml. Does the same still apply? Thanks -Original Message- From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] Sent: 29 September 2005 11:02 To: 'Struts Users Mailing List' Subject: SV: prepopulating jsp page Ok, so you have a different formbean coming in to this action: > > > > > > > type="com.medina.web.action.UpdateClientAction" > > > > name="createClientForm" > > > > scope="session" The bean named createClientForm is NOT of class CreateClientForm? If you have a bean class other than the one mapped to the executing action that you want to populate and later display in the success-form, then you have to: 1 create the bean 2 populate it 3 put it in page/request/session scope 4 return from action 5 in jsp, get the bean from the scope you put it in > -Ursprungligt meddelande- > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Skickat: den 29 september 2005 11:55 > Till: user@struts.apache.org > Ämne: RE: prepopulating jsp page > > I cannot do the following > > CreateClientForm updateForm = (CreateClientForm)actionForm; > > Because the action is called from a search page and has a > different form coming in. Thus when I try to reassign it I > get a class cast exception. > > I also tried the first way you mentioned, but that did not > populate the form either. > > > -Original Message- > From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] > Sent: 29 September 2005 10:46 > To: 'Struts Users Mailing List' > Subject: SV: prepopulating jsp page > > I seen to be very fast and erronous today, try this: > > > > public ActionForward execute( > ActionMapping actionMapping, > AtionForm actionForm, > HttpServletRequest httpServletRequest, > HttpServletResponse httpServletResponse) throws Exception > > CreateClientForm updateForm = (CreateClientForm)actionForm; > > // populate the bean here > updateForm.setXXX( ); > updateForm.setYYY( ); > > > > > -Ursprungligt meddelande- > > Från: Ekberg Mats KONSULT > [mailto:[EMAIL PROTECTED] > > Skickat: den 29 september 2005 11:41 > > Till: 'Struts Users Mailing List' > > Ämne: SV: prepopulating jsp page > > > > > > > > > -Ursprungligt meddelande- > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Skickat: den 29 september 2005 11:38 > > > Till: user@struts.apache.org > > > Ämne: RE: prepopulating jsp page > > > > > > Do this in your action: > > > > > >CreateClientForm updateForm = new CreateClientForm(); > > >// populate the bean here > > > > > >// then > > >form = updateForm; > > > > > > When you say > > > > > > form = updateForm; > > > > > > what is my variable form of type? > > > > Form is the variable you got in your actions execute method: > > > > public ActionForward execute(ActionMapping actionMapping, > > ActionForm > > actionForm, HttpServletRequest httpServletRequest, > HttpServletResponse > > httpServletResponse) throws Exception > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: Ekberg Mats KONSULT > > [mailto:[EMAIL PROTECTED] > > > Sent: 29 September 2005 10:34 > > > To: 'Struts Users Mailing List' > > > Subject: SV: prepopulating jsp page > > > > > > > > > > > > > -Ursprungligt meddelande- > > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > > Skickat: den 29 september 2005 11:26 > > > > Till: user@struts.apache.org > > > > Ämne: prepopulating jsp page > > > > > > > > Hi, > > > > > > > > I am trying to pre-populate my JSP page with the values > > > returned from > > > > the database when a user edits a client. I have just > > > recently upgraded > > > > to Struts download 1.2.4. > > > > > > > > This is what I did before which worked: > > > > > > > > In my action class I created the form then populated it with > > > > the values > > > > from the DB. > > > > > > > > CreateClientForm updateForm = new CreateClientForm(); > > > > > > Do this in your action: > > > > > >CreateClientForm updateForm = new CreateClientForm(); > > >// populate the bean here > > > > > >// then > > >form = updateForm; > > > > > > > > > > > > > > > > > > My struts config sent the response to the jsp page where I > > > > displayed the > > > > values as follows > >
RE: prepopulating jsp page
Again doing this I think will throw a class cast exception. localvariable = (CreateClientForm)form I already have the form beans elements in my config.xml -Original Message- From: Vijaya S [mailto:[EMAIL PROTECTED] Sent: 29 September 2005 10:49 To: Struts Users Mailing List Subject: RE: prepopulating jsp page In your struts-config.xml, add a section Then in your action, if (form != null) { localvariable = (CreateClientForm)form } now you can build your form bean properties as localvariable.set metods. Vijaya -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 29, 2005 2:56 PM To: user@struts.apache.org Subject: prepopulating jsp page Hi, I am trying to pre-populate my JSP page with the values returned from the database when a user edits a client. I have just recently upgraded to Struts download 1.2.4. This is what I did before which worked: In my action class I created the form then populated it with the values from the DB. CreateClientForm updateForm = new CreateClientForm(); My struts config sent the response to the jsp page where I displayed the values as follows However in this new download the html tag library does not have a tag for name. Thus I cannot add the name tag to the html:form tag. So my jsp now looks ike this: and my struts config.xml : Can anyone please advise what I need to do to get these values into the jsp page as it appears empty. How do I get around this name tag? Thanks - 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: prepopulating jsp page
I cannot do the following CreateClientForm updateForm = (CreateClientForm)actionForm; Because the action is called from a search page and has a different form coming in. Thus when I try to reassign it I get a class cast exception. I also tried the first way you mentioned, but that did not populate the form either. -Original Message- From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] Sent: 29 September 2005 10:46 To: 'Struts Users Mailing List' Subject: SV: prepopulating jsp page I seen to be very fast and erronous today, try this: public ActionForward execute( ActionMapping actionMapping, AtionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception CreateClientForm updateForm = (CreateClientForm)actionForm; // populate the bean here updateForm.setXXX( ); updateForm.setYYY( ); > -Ursprungligt meddelande- > Från: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] > Skickat: den 29 september 2005 11:41 > Till: 'Struts Users Mailing List' > Ämne: SV: prepopulating jsp page > > > > > -Ursprungligt meddelande- > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Skickat: den 29 september 2005 11:38 > > Till: user@struts.apache.org > > Ämne: RE: prepopulating jsp page > > > > Do this in your action: > > > >CreateClientForm updateForm = new CreateClientForm(); > >// populate the bean here > > > >// then > >form = updateForm; > > > > When you say > > > > form = updateForm; > > > > what is my variable form of type? > > Form is the variable you got in your actions execute method: > > public ActionForward execute(ActionMapping actionMapping, > ActionForm > actionForm, HttpServletRequest httpServletRequest, HttpServletResponse > httpServletResponse) throws Exception > > > > > > > > > > > > -Original Message- > > From: Ekberg Mats KONSULT > [mailto:[EMAIL PROTECTED] > > Sent: 29 September 2005 10:34 > > To: 'Struts Users Mailing List' > > Subject: SV: prepopulating jsp page > > > > > > > > > -Ursprungligt meddelande- > > > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Skickat: den 29 september 2005 11:26 > > > Till: user@struts.apache.org > > > Ämne: prepopulating jsp page > > > > > > Hi, > > > > > > I am trying to pre-populate my JSP page with the values > > returned from > > > the database when a user edits a client. I have just > > recently upgraded > > > to Struts download 1.2.4. > > > > > > This is what I did before which worked: > > > > > > In my action class I created the form then populated it with > > > the values > > > from the DB. > > > > > > CreateClientForm updateForm = new CreateClientForm(); > > > > Do this in your action: > > > >CreateClientForm updateForm = new CreateClientForm(); > >// populate the bean here > > > >// then > >form = updateForm; > > > > > > > > > > > > > My struts config sent the response to the jsp page where I > > > displayed the > > > values as follows > > > > > > > > name="createClientForm" > > > type="com.medina.web.forms.CreateClientForm"> > > > > > > However in this new download the html tag library does not > > have a tag > > > for name. Thus I cannot add the name tag to the html:form tag. > > > > > > So my jsp now looks ike this: > > > > > > > > > > > > and my struts config.xml : > > > > > > > > type="com.medina.web.action.UpdateClientAction" > > > name="createClientForm" > > > scope="session" > > > parameter="update" > > > input="/editClient.jsp"> > > > > > > > > > > > > > > > Can anyone please advise what I need to do to get these > > > values into the > > > jsp page as it appears empty. How do I get around this name tag? > > > > > > Thanks > > > > > > > > > > > - > > 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: prepopulating jsp page
Do this in your action: CreateClientForm updateForm = new CreateClientForm(); // populate the bean here // then form = updateForm; When you say form = updateForm; what is my variable form of type? -Original Message- From: Ekberg Mats KONSULT [mailto:[EMAIL PROTECTED] Sent: 29 September 2005 10:34 To: 'Struts Users Mailing List' Subject: SV: prepopulating jsp page > -Ursprungligt meddelande- > Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Skickat: den 29 september 2005 11:26 > Till: user@struts.apache.org > Ämne: prepopulating jsp page > > Hi, > > I am trying to pre-populate my JSP page with the values returned from > the database when a user edits a client. I have just recently upgraded > to Struts download 1.2.4. > > This is what I did before which worked: > > In my action class I created the form then populated it with > the values > from the DB. > > CreateClientForm updateForm = new CreateClientForm(); Do this in your action: CreateClientForm updateForm = new CreateClientForm(); // populate the bean here // then form = updateForm; > > > My struts config sent the response to the jsp page where I > displayed the > values as follows > >name="createClientForm" > type="com.medina.web.forms.CreateClientForm"> > > However in this new download the html tag library does not have a tag > for name. Thus I cannot add the name tag to the html:form tag. > > So my jsp now looks ike this: > > > > and my struts config.xml : > > type="com.medina.web.action.UpdateClientAction" > name="createClientForm" > scope="session" > parameter="update" > input="/editClient.jsp"> > > > > > Can anyone please advise what I need to do to get these > values into the > jsp page as it appears empty. How do I get around this name tag? > > Thanks > > - 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]
prepopulating jsp page
Hi, I am trying to pre-populate my JSP page with the values returned from the database when a user edits a client. I have just recently upgraded to Struts download 1.2.4. This is what I did before which worked: In my action class I created the form then populated it with the values from the DB. CreateClientForm updateForm = new CreateClientForm(); My struts config sent the response to the jsp page where I displayed the values as follows However in this new download the html tag library does not have a tag for name. Thus I cannot add the name tag to the html:form tag. So my jsp now looks ike this: and my struts config.xml : Can anyone please advise what I need to do to get these values into the jsp page as it appears empty. How do I get around this name tag? Thanks
using html:option tag
Hi All, I am using the html option tag embedded within the html select tag to select a value from a drop down list as follows: Mr Mrs This works fine and I can save the correct value to the database. The question I have is how do I display the same option tag when updating the user and the details are returned from a database. So in plain English after the user has saved the client to the db he then wants to update the record. A search is done but how do I display on the JSP page the selected option with the option of seleting something else from the drop down list. Thanks in advance
RE: Sending value from popup to parent window
Has anybody any advice on this at all...? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 13 June 2005 11:33 To: user@struts.apache.org Subject: Sending value from popup to parent window Hi, I am a bit stuck on implementing the following so all help is appreciated. I open up a search page as a pop up window. The user implements the search options and is returned a number of rows. The user then selects one of these rows using a check box which I have defined as a multibox in my jsp. The problem I have is populating the field on the parent window with the value of the multibox? In the JSP i define my multibox as such The link to close this page and send the value is as follows: Add Client The javascript function: function sendValue(s) { var selvalue = s out.println("variable = " + selvalue"); window.opener.document.createClnForm.clientId.value = selvalue; window.close(); } If I put a value of 1 in the link where i call the javascript it works fine and puts 1 into the correct field on the parent window. Add Client However what i want to send back is the of the selected multibox. i tried using bean define but that did not seem to work. The property resourceIds of the actionClientForm is a collection. Anyone know how to do this? thanks fez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sending value from popup to parent window
Hi, I am a bit stuck on implementing the following so all help is appreciated. I open up a search page as a pop up window. The user implements the search options and is returned a number of rows. The user then selects one of these rows using a check box which I have defined as a multibox in my jsp. The problem I have is populating the field on the parent window with the value of the multibox? In the JSP i define my multibox as such The link to close this page and send the value is as follows: Add Client The javascript function: function sendValue(s) { var selvalue = s out.println("variable = " + selvalue"); window.opener.document.createClnForm.clientId.value = selvalue; window.close(); } If I put a value of 1 in the link where i call the javascript it works fine and puts 1 into the correct field on the parent window. Add Client However what i want to send back is the of the selected multibox. i tried using bean define but that did not seem to work. The property resourceIds of the actionClientForm is a collection. Anyone know how to do this? thanks fez
RE: using html link to submit form and params
The href="javascript:document.{Form Name}.submit();" will allow me to submit the form but how would I send the request parameter through which the forward allows me to send. Eg: for this particular link I am also sending action=edit as a request param Thanks -Original Message- From: Marsh-Bourdon, Christopher [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:23 To: 'Struts Users Mailing List' Subject: RE: using html link to submit form and params Get rid of the forward, I tend to use just HTML tags for this, but it should work if you lop off the forward, as the form handles the POST. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:21 To: user@struts.apache.org Subject: RE: using html link to submit form and params Would I use the href tag in addition to using the forward tag within the link? -Original Message- From: Marsh-Bourdon, Christopher [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:16 To: 'Struts Users Mailing List' Subject: RE: using html link to submit form and params If set your href of the link to be something like this: href="javascript:document.{Form Name}.submit();" Then the form will be submitted and your form values will not be set to null. Christopher Marsh-Bourdon www.marsh-bourdon.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:12 To: user@struts.apache.org Subject: using html link to submit form and params I have a search page which allows the user to perform multiple actions. i.e The user can select a returned row and then he can edit or delete via a link. However if I use the following link tag in my jsp: This is encompassed within a form tag. The struts config has the following: and: If I do it this way the actionform values are null when retrieved from the action class. What is the best way to submit a form using a link and at the same time pass a request parameter through to identify which link has been clicked so that the appropriate action can be carried out in the action class. This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - --- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3167 - --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - --- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3166 - ---
RE: using html link to submit form and params
Would I use the href tag in addition to using the forward tag within the link? -Original Message- From: Marsh-Bourdon, Christopher [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:16 To: 'Struts Users Mailing List' Subject: RE: using html link to submit form and params If set your href of the link to be something like this: href="javascript:document.{Form Name}.submit();" Then the form will be submitted and your form values will not be set to null. Christopher Marsh-Bourdon www.marsh-bourdon.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 12 May 2005 11:12 To: user@struts.apache.org Subject: using html link to submit form and params I have a search page which allows the user to perform multiple actions. i.e The user can select a returned row and then he can edit or delete via a link. However if I use the following link tag in my jsp: This is encompassed within a form tag. The struts config has the following: and: If I do it this way the actionform values are null when retrieved from the action class. What is the best way to submit a form using a link and at the same time pass a request parameter through to identify which link has been clicked so that the appropriate action can be carried out in the action class. This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - --- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3167 - --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using html link to submit form and params
I have a search page which allows the user to perform multiple actions. i.e The user can select a returned row and then he can edit or delete via a link. However if I use the following link tag in my jsp: This is encompassed within a form tag. The struts config has the following: and: If I do it this way the actionform values are null when retrieved from the action class. What is the best way to submit a form using a link and at the same time pass a request parameter through to identify which link has been clicked so that the appropriate action can be carried out in the action class. This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:muttibox tag help
I tried the below and the value of String [] resourceIds in my action form is still null. I have looked through many examples on using the multibox and just cannot see as to why the resourceIds array is not being populated. Help! -Original Message- From: Rafael Taboada [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 14:14 Cc: user@struts.apache.org Subject: Re: Html:muttibox tag help Which object belongs resourceIds??? which form??? Let's suppose is searchForm so Try this: -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Html:muttibox tag help
Can u specify a bit further please. I thought I had already specified the object by the property value in the tag as below. Where resourceIds is the field in the actionclient form and the value to write to this object is the resourceId of the clientVO. -Original Message- From: Rafael Taboada [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 13:45 To: Struts Users Mailing List Subject: Re: Html:muttibox tag help U need to specify which object belongs resourceIds in ur html:multibox -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Html:muttibox tag help
Hi, I need some help with the html:multibox tag. I have the following situation where I do a search for some clients and the search.jsp displays displays a number of rows each with a checkbox associated with it. The user can then click one or many checkboxes and click submit. The submit passes the data onto the next action which should pull the data out of the array which holds the checkbox values and go and retrieve there remaining data. The problem I have is that the action gets called but the actionForm field which holds the array of checkboxes is null. In my jsp I have the following: the results property of searchClientform holds a list of clientVOs. The clientVO has a field resourceId. please note that clientVO has filed resourceID and action client form has field resourceIds. The actionclientform is as follows: private String [] resourceIds = {}; /** * @return Returns the resourceIds. */ public String[] getResourceIds() { return resourceIds; } /** * @param resourceIds The resourceIds to set. */ public void setResourceIds(String[] resourceIds) { this.resourceIds = resourceIds; } my struts config action mapping is as follows: The error thrown is: java.lang.NullPointerException com.medina.web.action.ActionClientAction.execute(ActionClientAction.java:44) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcess or.java:484) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) javax.servlet.http.HttpServlet.service(HttpServlet.java:697) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) The code throws a null pointer on the following line: ActionClientForm clntForm = (ActionClientForm)actionForm; System.out.println("resource Id = " + (clntForm.getResourceIds()).length); So can anyone tell mewhat I am doing wrong and how to pass the value to my action class. After debugging the clntForm is not null. It is the resourceIds array which is null. thanks in advance This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]