Re: prepopulating jsp page
Hi, Did you put the new form into session or into whatever-the-scope-of-the-form-must-be ? If not, the error may come from that Regards, Cedric [EMAIL PROTECTED] wrote: 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 html:form action=/updateClient 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: html:form action=/updateClient and my struts config.xml : action path=/updateClient type=com.medina.web.action.UpdateClientAction name=createClientForm scope=session parameter=update input=/editClient.jsp forward name=failure path=/jsp/failure.jsp/ forward name=success path=/jsp/success.jsp/ /action 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]
Re: prepopulating jsp page
It seems I need to reformulate my answer. You need to CREATE a form with data for your NEXT page for populating the fields. You can't retrieve the form from the actionForm parameter of the action. So you create in the execute function a form like this : CreateClientForm updateForm = new CreateClientForm(); updateForm.setClientName(...); // bla bla bla and request.getSession().setAttribute(createClientForm, updateForm); normally, it works, Cedric Cedric Levieux wrote: Hi, Did you put the new form into session or into whatever-the-scope-of-the-form-must-be ? If not, the error may come from that Regards, Cedric [EMAIL PROTECTED] wrote: 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 html:form action=/updateClient 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: html:form action=/updateClient and my struts config.xml : action path=/updateClient type=com.medina.web.action.UpdateClientAction name=createClientForm scope=session parameter=update input=/editClient.jsp forward name=failure path=/jsp/failure.jsp/ forward name=success path=/jsp/success.jsp/ /action 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]
Re: use bean:message tag for configurable parameters?
Your problem is a tricky one, so don't worry bean:define id=selectboxSizebean:message key='selectbox.size'//bean:define html:select property=filter.topicId size='%=selectboxSize%' html:optionsCollection name=topicsList value=id label=name/ /html:select Cedric Raghu Kanchustambham wrote: Hi, When I use the following line...it prints a 4 on the screen. { selectbox.size has been defined as 4 in application.properties file } bean:message key='selectbox.size'/ However, the following code doesnt seem to work. Can somebody explain what is wrong with this? I want a select box of size 4 here. The intent is to 'externalize' the size of the select box so that I can configure the size of any select box through out the application at one place. Also if someone has a better way of solving it, please suggest. html:select property=filter.topicId size='bean:message key= selectbox.size/' html:optionsCollection name=topicsList value=id label=name/ /html:select Thanks much. Regards, Raghu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: automatic periodic execution of code
Thanks for the Quartz project, I'll try it. for the moment I've got my own Thread Management system but using standard is for me a better thing. I hope that whan I'll stop tomcat Quatrz will shutdown too in a short time. Thx, Cedric - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, February 16, 2005 6:54 AM Subject: Re: automatic periodic execution of code I think Quartz has been the general consensus most times this has been debated on the list. Sng Wee Jim wrote: Hi, What would be the recommended way to execute some code periodically on tomcat/appserver? Should I 1. start a thread (not recommended in appserver and tomcat?) and do it in the run method 2. use third party tool like Quartz 3. or is there existing struts plugin to do it? - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.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: [ANN] Free JSP Editor for Eclipse
I follow what you give me and the order id / serial id is not valid I don't want to give up but the tool wants me to ... Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, February 04, 2005 1:43 AM Subject: RE: [ANN] Free JSP Editor for Eclipse Cedric, After the installation, when you run NitroX, if you previously installed a trial some time ago, it should have prompted you and provided a link to activate. I'm not sure why it didn't. I'll check with QA. In the meantime, you can go here: https://devclub.m7.com/startLogin.do and click on Activate JSP Editor button. Fill out the form, and you will receive via email, an activation key that will enable the JSP Editor. Note that if you've previously installed a trial version of NitroX, the Struts capabilities won't be enabled for - only the JSP Editor. I hope this helps. Sorry for the inconvenience. -Carlos -Original Message- From: Cedric Levieux [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 12:46 AM To: Struts Users Mailing List Subject: Re: [ANN] Free JSP Editor for Eclipse I download the JSP editor free license, the html server doesn't ask me for an email so how can i receive a lice / serial ID ? ^^ I use Eclipse 3.0 RC1 Hope it will help, Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, February 03, 2005 4:11 AM Subject: RE: [ANN] Free JSP Editor for Eclipse Cedric, On the second point, can you elaborate a bit more? It's asking you for a serial? Which version did you download? (JSP Editor, JSP IDE, Struts IDE?) Did you get an activation key via email? Thanks, -Carlos -Original Message- From: Cedric Levieux [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 02, 2005 2:40 PM To: Struts Users Mailing List Subject: Re: [ANN] Free JSP Editor for Eclipse Two things: First, my Eclipse has its name changed and I'm a bit angry with that Second, does it ask me for a serial when I launch my Eclipse and it has a lot of problem to be launched ? Regards, Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List struts-user@jakarta.apache.org Sent: Wednesday, February 02, 2005 11:09 PM Subject: [ANN] Free JSP Editor for Eclipse Dear Java Developer, For a limited time, M7 is offering the NitroX JSP Editor for Eclipse for FREE!* Download: http://www.m7.com/free NitroX has received top scores from industry reviewers such as SD Magazine, CRN, JavaBoutique, and is officially a finalist for the upcoming Jolt Product Excellence Award for Best Web Development Tool of the Year. The NitroX JSP Editor provides the following features: * Professional JSP source editor * Simultaneous 2-way source and visual JSP editors * JSP 2.0 (including EL) - Unequaled! * JSTL * Grapical editor for TLDs * Graphical editor for web.xml * Code completion * Custom tag library support * + much more * and it's FREE! Act now because this offer is available only for a limited time. Thank you, M7 Team * Restrictions apply; please see license agreement for details. FREE = No cost, gratuit, gratis, frei, libero...ok, there is a catch; this offer is only for a limited time. ;-) - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANN] Free JSP Editor for Eclipse
I download the JSP editor free license, the html server doesn't ask me for an email so how can i receive a lice / serial ID ? ^^ I use Eclipse 3.0 RC1 Hope it will help, Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, February 03, 2005 4:11 AM Subject: RE: [ANN] Free JSP Editor for Eclipse Cedric, On the second point, can you elaborate a bit more? It's asking you for a serial? Which version did you download? (JSP Editor, JSP IDE, Struts IDE?) Did you get an activation key via email? Thanks, -Carlos -Original Message- From: Cedric Levieux [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 02, 2005 2:40 PM To: Struts Users Mailing List Subject: Re: [ANN] Free JSP Editor for Eclipse Two things: First, my Eclipse has its name changed and I'm a bit angry with that Second, does it ask me for a serial when I launch my Eclipse and it has a lot of problem to be launched ? Regards, Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List struts-user@jakarta.apache.org Sent: Wednesday, February 02, 2005 11:09 PM Subject: [ANN] Free JSP Editor for Eclipse Dear Java Developer, For a limited time, M7 is offering the NitroX JSP Editor for Eclipse for FREE!* Download: http://www.m7.com/free NitroX has received top scores from industry reviewers such as SD Magazine, CRN, JavaBoutique, and is officially a finalist for the upcoming Jolt Product Excellence Award for Best Web Development Tool of the Year. The NitroX JSP Editor provides the following features: * Professional JSP source editor * Simultaneous 2-way source and visual JSP editors * JSP 2.0 (including EL) - Unequaled! * JSTL * Grapical editor for TLDs * Graphical editor for web.xml * Code completion * Custom tag library support * + much more * and it's FREE! Act now because this offer is available only for a limited time. Thank you, M7 Team * Restrictions apply; please see license agreement for details. FREE = No cost, gratuit, gratis, frei, libero...ok, there is a catch; this offer is only for a limited time. ;-) - 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: Avoid resubmit
By using the Token system - Original Message - From: Kalluru Uma. Maheswar [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, February 03, 2005 12:42 PM Subject: Avoid resubmit Hi, I have a form with a simple text box and a text area. The user enters some information in the boxes and presses submit button. The information is inserted into the database and I show a confirmation page to the user. Now when the user refreshes the page, the information is resubmitted into the database. How do I avoid this? I am using form-bean name=myForm type=org.apache.struts.validator.DynaValidatorForm form-property name=subject type=java.lang.String/ form-property name=summary type=java.lang.String/ /form-bean action path=/myForm forward=/test/report.jsp / action path=/reportForm type=test.ReportAction name=myForm scope=request validate=true input=/test/report.jsp forward name=success path=/test/report_thanks.jsp/ /action Any idea on how to refresh the page but do not submit the data second time to the database? Uma - 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: Avoid resubmit
You can have in your own page a js code that active a boolean after your first submit and disable your submit button. Just my 2 cents, Cedric - Original Message - From: Anthony Hong [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, February 03, 2005 3:28 PM Subject: Re: Avoid resubmit I count a problem when use Struts Token. When I submit a form, Action class will check token, get data and response to customer. But If I click more than one time during Action processing request, It will send request one by one after each response. That seams, IE put my click even in a queue and send it to server one by one. How to handle this problem? I want to send warning message during one request is processing. On Thu, 03 Feb 2005 07:39:57 -0500, Brandon Mercer [EMAIL PROTECTED] wrote: Kalluru Uma. Maheswar wrote: What is this Token System? How to use it? Two lines of code really! When you create the form you'll do public ActionForward yourForm( final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) throws Exception { /* the money maker right here */ saveToken(request); /* back to your old regular stuff */ HttpSession session = request.getSession(); ... Then when you go to process this form, you'll need to add this line to your action class isTokenValid(request, true)) { /* do some stuff with your form */ return mapping.findForward(success); } else { return mapping.findForward(resubmit); } Hope this helps! Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Anthony Hong - 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: [ANN] Free JSP Editor for Eclipse
Two things: First, my Eclipse has its name changed and I'm a bit angry with that Second, does it ask me for a serial when I launch my Eclipse and it has a lot of problem to be launched ? Regards, Cedric - Original Message - From: Carlos Chang [EMAIL PROTECTED] To: Struts Users Mailing List struts-user@jakarta.apache.org Sent: Wednesday, February 02, 2005 11:09 PM Subject: [ANN] Free JSP Editor for Eclipse Dear Java Developer, For a limited time, M7 is offering the NitroX JSP Editor for Eclipse for FREE!* Download: http://www.m7.com/free NitroX has received top scores from industry reviewers such as SD Magazine, CRN, JavaBoutique, and is officially a finalist for the upcoming Jolt Product Excellence Award for Best Web Development Tool of the Year. The NitroX JSP Editor provides the following features: * Professional JSP source editor * Simultaneous 2-way source and visual JSP editors * JSP 2.0 (including EL) - Unequaled! * JSTL * Grapical editor for TLDs * Graphical editor for web.xml * Code completion * Custom tag library support * + much more * and it's FREE! Act now because this offer is available only for a limited time. Thank you, M7 Team * Restrictions apply; please see license agreement for details. FREE = No cost, gratuit, gratis, frei, libero...ok, there is a catch; this offer is only for a limited time. ;-) - 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: struts and java script and jsp
Hi, You have this JavaScript code cause you ask into the htm:form tag the ability to focus on a form field. But btw I don't understand why the javascript code didn't work :p Regards, Cedric - Original Message - From: Nadia Kunkov [EMAIL PROTECTED] To: Struts help (E-mail) user@struts.apache.org Sent: Tuesday, January 25, 2005 5:20 PM Subject: struts and java script and jsp Hi, I'm not sure if this question is really about struts even though it occures in my struts application. My apologies if this is a bit off topic. I have a jsp logon page with two input fields userId' and password I of course have a corresponding ActionForm with the same attributes. When I open my Logon page in Mozilla I have no problem whatosever. When I open it in IE it's done with errors on page and I have the following message: document.forms[logonForm].elements[username].type is null or not an object When I looked at the page source I saw the following javascript added: script language=javascript !-- if (document.forms[logonForm].elements[username].type != hidden document.forms[logonForm].elements[username].focus() //-- /script I'm wondering why this javascript is being added and does it have anything to do with struts? Also, could the problem be that it refers to element[username] that does not exist in my jsp, since I have userId? Then, where does it come up with username? How do I get around it? Should I change my form to have username? - 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: Regarding LOGIC tags
and that's why I have my own tags to make this kind of tests between my beans :p - Original Message - From: Kishore Senji [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 27, 2005 7:55 AM Subject: Re: Regarding LOGIC tags On Thu, 27 Jan 2005 10:48:47 +0530, Krishna Mohan Radhakrishnan [EMAIL PROTECTED] wrote: Hi all, I have a very simple doubt on struts equal tag. The tag is like this logic:equal name=planModel property=plandesc1 value=planDesc2 /logic:equal Here is one way: bean:define id=planDesc2 name=planModel property=planDesc2/ logic:equal name=planModel property=plandesc1 value=%=planDesc2% /logic:equal Here planDesc1 and planDesc2 are both beans of the same class planModel. Can I have a comparison with 2 beans of the same class. I heard that logic equal comparison has to be done to a constant valu. Any other method to do this. Regards, Krishna Mohan - 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: Advise How to set alternative raow background color
Personnaly for this kind of stuff i've got my own tag that have the hability to iterate and to cycle over given values. - Original Message - From: Kishore Senji [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 27, 2005 8:26 AM Subject: Re: Advise How to set alternative raow background color On Thu, 27 Jan 2005 12:49:00 +0530, senthil Kumar [EMAIL PROTECTED] wrote: Hi all. I am getting more than 100 regards from database and print in a JSP by 15 regards per Page. Its is working fine. Now i want to set alternative Row background color. I print all the rows between the logic:iterator in Struts. any one help me. Here i am putting my code also. welcome anyone to give correct code also, logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList tr bgcolor=#c2c2c2 logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList indexId=index tr bgcolor='%=index.intValue()%2==0?#c2c2c2:#d2d2d2%' td align=left a href=ShowThread.do?messageId=bean:write name=collection property=messageId/ bean:write name=collection property=topic/ /a /td td align=center bean:write name=DFThreadForm property=projectName/ /td td align=centerbean:write name=collection property=enteredDate//td /tr /logic:iterate Thanks in Advance Regs., senthil - 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: PlugIn and the base URL
My Struts app contains an Axis-based SOAP service. The Struts app initializes the call dispatcher for the SOAP service. This dispatcher needs to know the URL of itself. This is a requirement of the semantics of the SOAP service (outside of my control). So a Listener or a Plug In appear to be the only way to try to determine the URL before the SOAP service is open for business. I don't understand this point in fact, cause in ones of my working struts applications there are some axis-soap web services and I didn't need to give my url path to axis-soap. So i'm very confuse in fact .. Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] a java question
public MyClass { private boolean isInitialzed = false; private static String data; public static String getData() { return data; } public static setData(String input) { if (! isInitialzed) { data = input; isInitialzed = true; } } } - Original Message - From: Ashish Kulkarni [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 26, 2005 8:15 PM Subject: Re: [OT] a java question so it will be some thing like this public MyClass { private static String data; public static String getData() { return data; } public static setData(String input) { data = input; } } this will work, but how to make sure that setData is called only from initalization class, and no one else calls this method , how to protect this method from being called by other classes Ashish --- PA [EMAIL PROTECTED] wrote: On Jan 26, 2005, at 20:08, Ashish Kulkarni wrote: how do i protect it from updated by any other class. Just don't. Use a static accessor method instead. Cheers -- PA http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 - 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: Reloading plugin
Hi, Go to the manager tomcat system and you can stop/start/restart application by application ... but it need to stop the application. The other possibility is to implement your own web admin system for configuring your plugins, replacing the values inside by setters. Hope it can help, Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 2:27 PM Subject: Reloading plugin Hi, I have an web apllication, using several plugins that I've made, and I want to be able to change the plugin configuration without stopping the Tomcat. Does anyone knows if it's possible ? Thanx, Ovidiu - 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 table on a form from a List of Lists
Hi, There is a way : table logic:iterate id=row name=myForm proprties=listOfRows tr logic:iterate id=myField name=row proprties=listOfFields td bean:write name=myField/ /td /logic:iterate /tr /logic:iterate /table Regards, Cedric - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Hubert Rabago [EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 3:25 PM Subject: Re: A table on a form from a List of Lists the method did not work, i think its because the nested tags deal with beans nested in beans but this deals with lists in a list in a bean (like a 2 dimensional array), i was hoping if i code the property like property[row][col], if will call my getter method String getProperty(int row, int col) since it calls String getProperty(int index) for property specified as property[index]. all the methods i have used either comes up with the erron no gettter method for this or that or null attribute. i am begining to think there is no way to get/set a two dimentional array type of data in a form bean other than to make the property also beans. i would really appreciate any help because i want to keep my property as a list of lists. the form bean is like: public class myBean extends ActionForm{ private List table = new ArrayList(); /// other propeties that are of type string public List getTable(){ return table; } public List getRow(int row){ return (List)table.get(row); } public String getField(int row, int col){ return (String)((List)table.get(row)).get(col); } and corresponding setter methods i wrote the acessor methods this way so i can specify different property to get different componentof the bean's property. the problem i have is how to code a jsp to call the getter/setter methods with two int arguments, i dont know very much about the bean specification. can anyone tell me how to code my jsp or ActionForm to get the third accessor methods called, to populate an html:text or set the ActionForm property from html:text - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 24, 2005 4:18 PM Subject: Re: A table on a form from a List of Lists Take a look at the nested tags. In your case, your code may end up looking like: nested:form action=/myAction table nested:iterate property=listOfRows tr nested:iterate property=listOfFields td nested:text property=myField /td /nested:iterate tr/ /nested:iterate /table /nested:form Hubert On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi [EMAIL PROTECTED] wrote: Hi, i have been trying to create a table on my form from a single property in my actionForm. the property is a List (actually an ArrayList) containg the rows of the table, each element (i.e row on the table) is represented by a List of Strings representing the fields of the list. i can code my JSP page to display the contents of the proprety in a table but i cant get it to set the values of the property from the page on submit. all the efforts has failed, i my latest effort, i coded the property as property[row][col] but i get an error that dia is no getter method for property[0][0]. i wrote the access methods like String getProperty(int row, int col){ return (String)((List)property.get(row)).get(col); } it did not work, any ideas will be apreciated. - 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: Reloading plugin
why in database ? public class XxxPlugIn implements PlugIn { private static Log log = LogFactory.getLog(ForumPlugIn.class); private static XxxPlugIn INSTANCE = null; // Other plugin properties public static XxxPlugIn getInstance() { return INSTANCE; } public void init(ActionServlet actionServlet, ModuleConfig moduleConfig) throws ServletException { // bla bla bla INSTANCE = this; } } by this way you can get your plugin from everywhere and can change the configuration by accessors. Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 3:49 PM Subject: Re: Reloading plugin This could be a solution if I stored the plugin configurations in the database. Thanx. On Tue, 25 Jan 2005 15:45:45 +0100, Cédric Levieux [EMAIL PROTECTED] wrote: What about, like I said, a Web Administration Page for your plugin and change the plugins configuration with that ? Cedric On Tue, 25 Jan 2005 16:42:14 +0200, Ovidiu EFTIMIE [EMAIL PROTECTED] wrote: The thing is that the application must be running without any interupption. I was thinking about a plugin that watches over the other ones inspecting the struts-config file from time to time and compare the plugin configurations with the ones alredy loaded. Any ideas ? Ovidiu On Tue, 25 Jan 2005 14:31:05 +0100, Cedric Levieux [EMAIL PROTECTED] wrote: Hi, Go to the manager tomcat system and you can stop/start/restart application by application ... but it need to stop the application. The other possibility is to implement your own web admin system for configuring your plugins, replacing the values inside by setters. Hope it can help, Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 2:27 PM Subject: Reloading plugin Hi, I have an web apllication, using several plugins that I've made, and I want to be able to change the plugin configuration without stopping the Tomcat. Does anyone knows if it's possible ? Thanx, Ovidiu - 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: Reloading plugin
No they won't but like anything else it's your job to keep track of your change with a database or writing file. In my point of view accessors are the best thing to change a value withing asking the value in the database. But you can store the new value in view of keeping the same configuration when you restart the server after a release ... or a crash :p Regards, Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 3:58 PM Subject: Re: Reloading plugin But what happens if the server dies ? I will lose the configuration ? Will the accessors modify my struts-config.xml ? I don't think they will . Ovidiu On Tue, 25 Jan 2005 15:54:44 +0100, Cedric Levieux [EMAIL PROTECTED] wrote: why in database ? public class XxxPlugIn implements PlugIn { private static Log log = LogFactory.getLog(ForumPlugIn.class); private static XxxPlugIn INSTANCE = null; // Other plugin properties public static XxxPlugIn getInstance() { return INSTANCE; } public void init(ActionServlet actionServlet, ModuleConfig moduleConfig) throws ServletException { // bla bla bla INSTANCE = this; } } by this way you can get your plugin from everywhere and can change the configuration by accessors. Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 3:49 PM Subject: Re: Reloading plugin This could be a solution if I stored the plugin configurations in the database. Thanx. On Tue, 25 Jan 2005 15:45:45 +0100, Cédric Levieux [EMAIL PROTECTED] wrote: What about, like I said, a Web Administration Page for your plugin and change the plugins configuration with that ? Cedric On Tue, 25 Jan 2005 16:42:14 +0200, Ovidiu EFTIMIE [EMAIL PROTECTED] wrote: The thing is that the application must be running without any interupption. I was thinking about a plugin that watches over the other ones inspecting the struts-config file from time to time and compare the plugin configurations with the ones alredy loaded. Any ideas ? Ovidiu On Tue, 25 Jan 2005 14:31:05 +0100, Cedric Levieux [EMAIL PROTECTED] wrote: Hi, Go to the manager tomcat system and you can stop/start/restart application by application ... but it need to stop the application. The other possibility is to implement your own web admin system for configuring your plugins, replacing the values inside by setters. Hope it can help, Cedric - Original Message - From: Ovidiu EFTIMIE [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 2:27 PM Subject: Reloading plugin Hi, I have an web apllication, using several plugins that I've made, and I want to be able to change the plugin configuration without stopping the Tomcat. Does anyone knows if it's possible ? Thanx, Ovidiu - 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 table on a form from a List of Lists
And by this way ? html:form action=/myAction table logic:iterate id=row name=myForm proprties=listOfRows tr logic:iterate id=myField name=row proprties=listOfFields td html:text name=myField/ /td /logic:iterate /tr /logic:iterate /table /html:form but the problem is that you didn't know which row is the parent of a field - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 5:02 PM Subject: Re: A table on a form from a List of Lists if this works, it will take care of writing the table to the jsp but i need an html input type of field so i can also set the properties of the ActionForm by editing the fields and submiting the form. - Original Message - From: Cedric Levieux [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Hubert Rabago [EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 3:36 PM Subject: Re: A table on a form from a List of Lists Hi, There is a way : table logic:iterate id=row name=myForm proprties=listOfRows tr logic:iterate id=myField name=row proprties=listOfFields td bean:write name=myField/ /td /logic:iterate /tr /logic:iterate /table Regards, Cedric - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Hubert Rabago [EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 3:25 PM Subject: Re: A table on a form from a List of Lists the method did not work, i think its because the nested tags deal with beans nested in beans but this deals with lists in a list in a bean (like a 2 dimensional array), i was hoping if i code the property like property[row][col], if will call my getter method String getProperty(int row, int col) since it calls String getProperty(int index) for property specified as property[index]. all the methods i have used either comes up with the erron no gettter method for this or that or null attribute. i am begining to think there is no way to get/set a two dimentional array type of data in a form bean other than to make the property also beans. i would really appreciate any help because i want to keep my property as a list of lists. the form bean is like: public class myBean extends ActionForm{ private List table = new ArrayList(); /// other propeties that are of type string public List getTable(){ return table; } public List getRow(int row){ return (List)table.get(row); } public String getField(int row, int col){ return (String)((List)table.get(row)).get(col); } and corresponding setter methods i wrote the acessor methods this way so i can specify different property to get different componentof the bean's property. the problem i have is how to code a jsp to call the getter/setter methods with two int arguments, i dont know very much about the bean specification. can anyone tell me how to code my jsp or ActionForm to get the third accessor methods called, to populate an html:text or set the ActionForm property from html:text - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 24, 2005 4:18 PM Subject: Re: A table on a form from a List of Lists Take a look at the nested tags. In your case, your code may end up looking like: nested:form action=/myAction table nested:iterate property=listOfRows tr nested:iterate property=listOfFields td nested:text property=myField /td /nested:iterate tr/ /nested:iterate /table /nested:form Hubert On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi [EMAIL PROTECTED] wrote: Hi, i have been trying to create a table on my form from a single property in my actionForm. the property is a List (actually an ArrayList) containg the rows of the table, each element (i.e row on the table) is represented by a List of Strings representing the fields of the list. i can code my JSP page to display the contents of the proprety in a table but i cant get it to set the values of the property from the page on submit. all the efforts has failed, i my latest effort, i coded the property as property[row][col] but i get an error that dia is no getter method for property[0][0]. i wrote the access methods like String getProperty(int row, int col){ return (String)((List)property.get(row)).get(col); } it did not work, any ideas will be apreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: A table on a form from a List of Lists
So if row is a list try this html:form action=/myAction table logic:iterate id=row name=myForm properties=listOfRows tr logic:iterate id=myField name=row td html:text name=myField/ /td /logic:iterate /tr /logic:iterate /table /html:form directly - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 5:37 PM Subject: Re: A table on a form from a List of Lists the second iterate will treat row like a bean and will try to retrieve the value of property called list of fields and it will result in an erroe because the row is actually a List and not a bean and it does not have a property called listofFields. and i dont think html:text works without a property attribute - Original Message - From: Cedric Levieux [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 5:27 PM Subject: Re: A table on a form from a List of Lists And by this way ? html:form action=/myAction table logic:iterate id=row name=myForm proprties=listOfRows tr logic:iterate id=myField name=row proprties=listOfFields td html:text name=myField/ /td /logic:iterate /tr /logic:iterate /table /html:form but the problem is that you didn't know which row is the parent of a field - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 25, 2005 5:02 PM Subject: Re: A table on a form from a List of Lists if this works, it will take care of writing the table to the jsp but i need an html input type of field so i can also set the properties of the ActionForm by editing the fields and submiting the form. - Original Message - From: Cedric Levieux [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Hubert Rabago [EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 3:36 PM Subject: Re: A table on a form from a List of Lists Hi, There is a way : table logic:iterate id=row name=myForm proprties=listOfRows tr logic:iterate id=myField name=row proprties=listOfFields td bean:write name=myField/ /td /logic:iterate /tr /logic:iterate /table Regards, Cedric - Original Message - From: Olasoji Ajayi [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Hubert Rabago [EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 3:25 PM Subject: Re: A table on a form from a List of Lists the method did not work, i think its because the nested tags deal with beans nested in beans but this deals with lists in a list in a bean (like a 2 dimensional array), i was hoping if i code the property like property[row][col], if will call my getter method String getProperty(int row, int col) since it calls String getProperty(int index) for property specified as property[index]. all the methods i have used either comes up with the erron no gettter method for this or that or null attribute. i am begining to think there is no way to get/set a two dimentional array type of data in a form bean other than to make the property also beans. i would really appreciate any help because i want to keep my property as a list of lists. the form bean is like: public class myBean extends ActionForm{ private List table = new ArrayList(); /// other propeties that are of type string public List getTable(){ return table; } public List getRow(int row){ return (List)table.get(row); } public String getField(int row, int col){ return (String)((List)table.get(row)).get(col); } and corresponding setter methods i wrote the acessor methods this way so i can specify different property to get different componentof the bean's property. the problem i have is how to code a jsp to call the getter/setter methods with two int arguments, i dont know very much about the bean specification. can anyone tell me how to code my jsp or ActionForm to get the third accessor methods called, to populate an html:text or set the ActionForm property from html:text - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 24, 2005 4:18 PM Subject: Re: A table on a form from a List of Lists Take a look at the nested tags. In your case, your code may end up looking like: nested:form action=/myAction table nested:iterate property=listOfRows tr nested:iterate property=listOfFields td nested:text property=myField /td