XML/XSLT Question - Help!
I have a question regarding the use of XML/XSLT. Please correct me if I am wrong, but it is my understanding that XML does not directly support graphics. Apparently, a new XML standard called SVG is currently being reviewed by w3 for approval (hasn't been adopted yet) which uses scalable vector graphics to display a page, which is pretty cool, but even that doesn't directly support the use of gifs and jpgs unless you convert all the graphics to vector graphics (svg format) Is this true, or can I place graphics in XML and then define them in the XSL doc? If so, is this an acceptable technique? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
The Struts-way Problem......
I was just thinking about how the Struts-way is to have everything go through an Action class first and then redirect to a jsp. If you do this, then the following problem could occur: If you are on Page A which contains a list of users and one of the columns is Gender for example, and you leave the page to another to change the gender of user X, and then use the Browser's back button to go back back to the list page. If you then hit refresh, the user list will still show the old Gender for user X. This is because the Action is not called at this point, only the jsp is refreshed. Does anyone know of a Struts-way to fix this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Fw: The Struts-way Problem......
Does anyone know of a solution to this problem? - Original Message - From: Spencer Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 02, 2002 11:30 AM Subject: The Struts-way Problem.. I was just thinking about how the Struts-way is to have everything go through an Action class first and then redirect to a jsp. If you do this, then the following problem could occur: If you are on Page A which contains a list of users and one of the columns is Gender for example, and you leave the page to another to change the gender of user X, and then use the Browser's back button to go back back to the list page. If you then hit refresh, the user list will still show the old Gender for user X. This is because the Action is not called at this point, only the jsp is refreshed. Does anyone know of a Struts-way to fix this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Compiled JSP got too big and produced this Error/ Anyone know of a Solution/Fix?
Have any of you ever seen anything like this before? I think that compiled code for this JSP got too big. Error: 500 Location: /eCMS/CareManager/PfPatientSummaryBody.jsp Internal Servlet Error: javax.servlet.ServletException: (class: CareManager/_0002fCareManager_0002fPfPatientSummaryBody_0002ejspPfPatientSum maryBody_jsp_0, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo nse;)V) Illegal target of jump or branch at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection (Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.VerifyError: (class: CareManager/_0002fCareManager_0002fPfPatientSummaryBody_0002ejspPfPatientSum maryBody_jsp_0, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletRespo nse;)V) Illegal target of jump or branch at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java:237) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.load(JspServlet.java: 116) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe rvlet.java:154) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:164) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection (Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484)
Re: HTML:link tag
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html % *make sure above line is in your jsp page html:link page=/test.do target=_topClick Here/html:link *in order for above line to work you need to set up an action in struts-config.xml ie: !-- Handle actions for /Test -- action path=/Test.do type=com.pfizer.ecms.ws.TestAction /action - Original Message - From: Michael Skariah [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 3:23 PM Subject: HTML:link tag Hello all, I am trying to replace the following with the Struts HTML link tag. a href=test.doTest/a Could anyone help me out here\. Thanks, Michael.
Re: unable to programmatically perform a submit
// Submit the form. a href=javascript: parent.window.content.document.forms[0].submit()Submit/a We use this bit of code to trigger the submit button in the body from the top frame. - Original Message - From: Norman Timmler [EMAIL PROTECTED] To: Michelle Popovits [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 21, 2001 9:28 AM Subject: Re: unable to programmatically perform a submit hi michelle, could you please post the specific part of your source-code from your browser. this would help to resolve your problem. thanks. norman - Original Message - From: Michelle Popovits [EMAIL PROTECTED] To: Norman Timmler [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 21, 2001 4:23 PM Subject: Re: unable to programmatically perform a submit Yes, I am referencing 0 and 1 because I am running both forms on the same page (simultaneously). The 0 is for the struts form and the 1 is for the non-struts form. I can programmatically, submit no problem on the non-struts form but not on the struts form. The struts form tag in the generated html looks like this: form name=personalInfoForm method=POST action=/LAPS1/VirtualClassroomWAR/editPersonalInfo.do id=form1 the non-struts form looks like this: form id=f1 Because I can submit the second form using the index 1, this means that the page recognizes that there is something in position 0, but that it seems that it has somehow been rendered in such a way that it can't be programmatically submitted using javascript. I have also tried using the form name instead of the index and the results are the same. What has struts done to my form to make it not work? I don't know Has anyone else out there been able to make this work? Thanks, Michelle - Original Message - From: Norman Timmler [EMAIL PROTECTED] To: [EMAIL PROTECTED]; Michelle Popovits [EMAIL PROTECTED] Sent: Thursday, June 21, 2001 4:55 AM Subject: Re: unable to programmatically perform a submit hi michelle, i see a main difference between your struts version and your non-struts version. on the struts version you have forms[0] referencing your form and on the second one you have forms[1]. the secure way to talk to forms by JavaScript is to reference the form by name. document.formName.submit(); or document.formName.elementName.value = something; hope this will help you. norman - Original Message - From: Michelle Popovits [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 20, 2001 11:19 PM Subject: unable to programmatically perform a submit Hi, I am trying to get an image map working that does a submit. The image map itself works. However, when I click on the image area it complains when trying to execute the submit. Error: object doesn't support this property or method. I have tried just performing a submit without the event assignment, like so: MAP NAME=MyMap AREA SHAPE=Rect NOHREF COORDS=82,2 163,23 OnClick=document.forms[0].submit(); /MAP This works in my non-struts form version. Here is the html output: MAP NAME=MyMap AREA SHAPE=Rect NOHREF COORDS=82,2 163,23 OnClick=document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub mit(); /MAP img src=/LAPS1/VirtualClassroomWAR/images/tab1a.gif border=0 usemap=#MyMap struts version strutshtml:html strutshtml:form action=editPersonalInfo.do name=personalInfoForm type=com.bmo.ifl.laps.forms.PersonalInfoForm MAP NAME=MyMap AREA SHAPE=Rect NOHREF COORDS=82,2 163,23 OnClick=document.forms[0].event.value='SELECT_COURSE';document.forms[0].sub mit(); /MAP strutshtml:img usemap=#MyMap pageKey=page.editPersonalInfo.tabImage border=0 / ... /strutshtml:form /strutshtml:html non-struts version - this works form id=f1 MAP NAME=MyMap2 AREA SHAPE=Rect NOHREF COORDS=82,2 163,23 OnClick=document.forms[1].event.value='SELECT_COURSE';f1.submit(); /MAP img USEMAP=#MyMap2 SRC=%= request.getContextPath() %/images/tab1a.gif BORDER=0 input type=text name=event value=UPDATE_PERSONAL_INFO /form I don't believe the image map is the problem. I think that there is just some reason why it will not except a submit() programmatically. Thanks, Michelle
Re: General DATABASE programming question
Sure. Just use something like this: SELECT * FROM (Select * from sometable Order by sortcolumn) WHERE rownum=1 and rownum=10 This would return the first 1-10th rows of the query (sorted properly) If you were not interested in sorting properly, you could just do: SELECT * from sometable WHERE rownum=1 and rownum=10 Of course, normally you would use ? instead of hardcoded values... :-) Hope this helps - Original Message - From: Mindaugas Idzelis [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Sent: Friday, June 15, 2001 9:57 AM Subject: General DATABASE programming question This may be a little off topic, please forgive me. One of my webapplications displays a group of results from a database query. These can be hundreds of rows long. I would like to break these up into smaller sections to fit on a page. My problem is, I don't want to run the entire query at once and save it to memory. PostgreSQL and MySQL have the LIMIT num,offset qualifier which does exactly what I want. The problem is that I'm using MS SQL and it doesn't use the LIMIT keyword. Instead, it uses TOP and you can't supply an offset. My quetion: Is there anyway to specify an offset into a query using MS SQL Server? Thank you. --min
Out of Memory Errors?
This occurs when a very large query is performed. Anyone know of a way around this? Weblogic Output: ; nested exception is: java.lang.OutOfMemoryError: Start server side stack trace: java.lang.OutOfMemoryError
Re: Can anyone help with solving the BACK button problem, in th e browser?
Title: RE: Can anyone help with solving the "BACK" button problem, in th e browser? That won't work. I solved the problem using javascript. Javascript doesn't cache like JSP pages does, so you can get around this problem using javascript. If you want, I can send you the code I use. - Original Message - From: Thane Eisener To: '[EMAIL PROTECTED]' Sent: Thursday, June 07, 2001 10:12 AM Subject: RE: Can anyone help with solving the "BACK" button problem, in th e browser? Oops, I guess I should test before I post. It looks like newer browsers don't support this as a META tag only as a header. I added the following to one of my action classes and the perform() method was called when I pressed 'Back': response.addHeader("Pragma","no-cache"); response.addHeader("Cache-control","no-cache"); Hope it helps, Thane -Original Message- From: Peter Alfors [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 11:35 AM To: [EMAIL PROTECTED] Subject: Re: Can anyone help with solving the "BACK" button problem, in th e browser? Thane , I am using: META http-equiv="Expires" content="now" in my header, and my action is not re-executed when I use the browser back button. Is there another option I should be using? thanks, Pete Thane Eisener wrote: I seem to recall a META tag called something like pragma-no-cache that you can embed in your page which will force the page to reload (not just display a snapshot). This should enable handling the situation in scriptlets or your action class. -Original Message- From: Peter Alfors [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 9:52 AM To: [EMAIL PROTECTED] Subject: Re: Can anyone help with solving the "BACK" button problem, in the browser? Depending on which browser you use, and the data on the page, the back button may cause (or ask) the page to reload. However, some browsers (like IE) only display a snapshot of what the last page rendered to. Therefore, you cannot use scriptlets or the action class. However, you are able to kick-off javascript. If you can gaurantee that your users will have javascript enabled, you can write a simple test to see if this page was already displayed to the user. You could check a flag (hidden field) when the page loads. If the flag is true, then use the javascript to reload to your desired page. HTH, Pete "Dudley Butt@i-Commerce" wrote:Please help, When the user pushes the back button, I want the page to redirect or refresh to a different page, please, any ideas? Thanx guys and gals Dudley
Precompiling JSP Pages?
Anyone know how to precompile the JSP pages?
Re: Precompiling JSP Pages?
Definately need more info--Thanks!. Once you have all the jsp files compiled into classes, do you 1 delete all the jsp files (and tomcat will automatically use these) OR 2 is there a setting in tomcat to not auto-recompile the jsp files? Also, what is the command line for Ant to do this? - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 10:49 AM Subject: RE: Precompiling JSP Pages? I am pre-compiling all my jsps using Ant and jspc. Let me know if more info along these lines would help you. Dave Deadman, Hal [EMAIL PROTECTED] on 05/31/2001 12:59:16 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: David Hay/Lex/Lexmark) Subject: RE: Precompiling JSP Pages? If you are using Weblogic there is an Ant task that does it in the optional package. I can't vouch for how well the current version works but I am using a modified version that works fine. Tomcat has a batch file that will run Jasper on a whole directory tree full of jsps. I used it once but I never tried to run the compiled jsps. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 12:18 PM To: [EMAIL PROTECTED] Subject: Precompiling JSP Pages? Anyone know how to precompile the JSP pages?
Re: Using Javascript to cancel submit?
That is because you do not have a "return" specified on the javascript line. - Original Message - From: Steven Leija To: Struts Sent: Thursday, May 31, 2001 8:46 PM Subject: Using Javascript to cancel submit? Hello All, Currently I'm working on a form, but before submit, I have an onSubmit() in my form tag that verifies they want to submit. The problem is that with my confirmation javascript popup, whether the user selects "OK" or "Cancel", the form is still submitted. Is there a way to prevent the form from submitting if the user selects "Cancel"? Thanks in advance! Steven
Forums???
This email list server is kind of weak in terms of threads and discussion. Should be moved over to a Forums. I built a really good robust one. If I get some requests, I can implement it and host it for free. Anyone interested in moving this over to a Forums?
Serious Page Timeout Problem with findForward() method / Need HELP!
Is there a known bug with Struts 3.2? Is there a known fix for this problem? HELP! I am having a major problem in my application using Struts 3.2. The problem occurs intermittantly when calling a findForward() from my Action class. About every 5th time I call the Action which calls the Form to initialize the variables, then returns (findForwards) to my JSP to display the current values from the DB, it stalls and doesn't come back. ie. myAction.do?action=load in myAction.java: if paramAction.equals(load) { myForm.initialize();// this calls the method in myForm that makes the call to the DB and gets // the current values findForward(refresh); // this returns to the JSP } *STALL OCCURS HERE***(intermitt. goes out to lunch and doesn't come back) myPage.jsp // display the current values retrieved from the DB
Re: Does anyone have a example to generate a drop down list?
Title: Does anyone have a example to generate a drop down list? IN FORM: // Get allxxx Values for DropDown.xxxDropDown[] results = profileSession.getxxxValues();// Create the arrays for the labels and values.xxxLabels = new ArrayList();xxxValues = new ArrayList();// For each value returned...for (int i = 0; i results.length; i ++){// Add a label and a value to the corresponding list.xxxLabels.add(new String(results[i].getLabel()));xxxValues.add(new String(results[i].getValue()));} IN JSP: html:select property="selectedValue" html:options property="xxxValues" labelProperty="xxxLabels"//html:select Make sure to define the xxxLabels and xxxValues as type ArrayList and import the class. Hope this helps! :-) - Original Message - From: Joyce Tang To: '[EMAIL PROTECTED]' Sent: Friday, May 18, 2001 10:28 AM Subject: Does anyone have a example to generate a drop down list? Assuming I have a object method returning a list of values. Does anyone have a example to generate a drop down list?
Re: a small problem
%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" % Did you include the HTML tag library file in your JSP page? - Original Message - From: Tong, Tom To: '[EMAIL PROTECTED]' Sent: Monday, May 14, 2001 2:24 PM Subject: RE: a small problem Yes, I included the html:errors / tag in my jsp page inside body. Tom -Original Message-From: Jason Chaffee [mailto:[EMAIL PROTECTED]]Sent: Monday, May 14, 2001 4:44 PMTo: '[EMAIL PROTECTED]'Subject: RE: a small problem Are you using the html:errors / tag in your jsp page? -Original Message-From: Tong, Tom [mailto:[EMAIL PROTECTED]]Sent: Monday, May 14, 2001 1:03 PMTo: '[EMAIL PROTECTED]'Subject: a small problem Hello, I am new to Struts and just trying to use validate() function. I followed the struts-example and made my validation implementation. My validation is working (I cant leave my page if I gave an invalided input), however, I cant get the error message showing. Of course I have my messages in my ApplicationResources.property file. Is there anyone can give me some hints to find out my problem? Great thanks in advance, Tom
Re: Unchecking radio buttons?
I know. Struts doesn't handle unchecked boxes very well. In fact, it doesn't understand them at all. What you do is grab the current value from the DB display it, and then manually set the value to false from either a Reset() action in your FORM or directly from your JSP. If you don't manually set the value to false, it will always save as True. - Original Message - From: Eric Rasmussen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 08, 2001 12:27 PM Subject: Re: Unchecking radio buttons? Are you sure the radio buttons all have the same name? If not, they will all be treated seperately. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 08, 2001 11:42 AM Subject: Unchecking radio buttons? Hi. I have a set of radio buttons. However, if I check one of them, I am not able to uncheck it! Any ideas what I am missing? Many thanks, Dave
Re: Unchecking radio buttons?
All you really have to do is to manually set the checkbox value to false after you display the current value: ie: html:checkbox property=mycheckbox / // notice that no value is set % MyForm.setMycheckbox(false) %// do this after you display the above line in same JSP where: protected boolean mycheckbox;// mycheckbox is of type boolean (small b) and you're in business. If the checkbox is already checked it will still be checked when you do a submit, because it will read the value on the page. If you uncheck it though, it will be false which is correct too. :-) - Original Message - From: Laine Donlan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 08, 2001 2:30 PM Subject: RE: Unchecking radio buttons? Here is some code that I submitted to the dev list a while back. It might be useful as it solves the problem of the 'unchecked' checkbox submit. Hope it helps. Laine - In order to capture the act of a user unchecking checkboxes and to initialize the checkbox as checked/unchecked with non boolean values I made a couple of changes to the org.apache.struts.taglib.html.CheckboxTag. Basically the changes consisted of: 1) Using the supplied value attribute to match against the bean property value and generating the 'checked' attribute accordingly. If the value is not supplied then the previously implemented method of checking 'on', 'true', or 'yes' is performed. So I do not think that default behavior should be affected. 2) Added support for two new attributes - submitUnchecked (boolean) and uncheckedValue (String). Neither of these attributes are required and the submitUnchecked defaults to 'false'. If a user chooses to submit unchecked values then two form inputs will be generated that facilitate this function. See below for an example: Tag notation - html:checkbox name=bean property=indexedBean.property submitUnchecked=true uncheckedValue=0 value=1/ Generated HTML - input type=checkbox name=indexedBean.property_checkBox value=1 onclick=(this.checked?this.form['indexedBean.property'].value='1':this. form['indexedBean.property'].value='0') input type=hidden name=indexedBean.property value=0/ (where 0 is the current value of the bean property) So in this scenario the actual checkbox param in the request will be ignored and the hidden input will be used to maintain the bean property that the user wishes. In the case where the user does not provide the two new attributes the html will be generated as it is today with the exception of the determination of the checked or unchecked mentioned above. I could not see how this functionality was present in the current checkbox tag without explicitly declaring two tags and adding javascript to the checkbox tag. Even then some scripting may be required to differentiate between the two inputs and to initialize the hidden one. If I missed something could someone point me in the right direction. I have attached the CheckboxTag.java file for review and use if anyone is interested. Thanks. Comments would be appreciated. Laine -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 5:12 PM To: [EMAIL PROTECTED] Subject: Re: Unchecking radio buttons? thanks for the replies. Yes, I need the checkbox capabilities, not radio buttons. Question with these, though - is there an equivalent to the checked attribute in HTML reference speck? I am creating checkbox with the following: html:checkbox property=notFolders value=true/, and underlying value of notFolders is false. Would therefore expect checkbox to appear as unchecked, and True to be submitted is checkbox is clicked. Showing up as already checked, however. Would appreciate any help... Dave
Re: Strut Books
Don't I wish! - Original Message - From: "Marty Fisher" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 09, 2001 12:36 PM Subject: Strut Books Hello, Are there any decent books on the market now that give you a detailed account of how to modify/extend/use the strut classes ? Thanks, Marty
Question/Problem using Multiple Select Options
Help! Unable to send back muliple select options. // Define the Array protected String[] geography; // Get the Array public String[] getGeography() { return (geography); } // Set the Array public void setGeography(String[] geography) { { this.geography = geography; } } Code In JSP Page ** html:select property="geography" multiple="true" size="2" html:options collection="cmProviderTypes" property="value" labelProperty="label" / /html:select This is only returning 1 value??? Has anyone done this successfully? I would really appreciate some help. Thanks in advance, Spencer
Re: double submission of forms
I'm not sure about fixing that server side, but here is some javascript to stop people from doing this: Double Posting Fix: script language="JavaScript" !-- numberoftimes = 0; function checkform(){ numberoftimes += 1; if (numberoftimes 1) var themessage = "Please be patient while your message is posted. You have already submitted this form."; if (numberoftimes == 3) { themessage = "Do no press post multiple times. Your message will be posted shortly."; } alert(themessage); return false; } } /script For the form's onsubmit value: form name="postform" action="post.cfm" enctype="multipart/form-data" method="post" onsubmit="return checkform()" - Original Message - From: Nanduri, Amarnath [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 02, 2001 1:35 PM Subject: double submission of forms Hi all, Will struts be able to handle the double posting of forms ? For example if a user submits a form, and when the processing is taking place on the server, he submits information again (or uses the back button of browser to submit information). Will struts be able to ignore the second posting of form ? Thanks alot. cheers, Amar..
Forwarding Question
How can I make a Action object that forwards to 1 of 2 pages based upon success or failure of the validation rules. Ex. If validation for *this Form fails, stay on Page 2. or if validation is successful, save data and forward to Page 1.
html:select multiple=true Problems
Has anyone sucessfully implemented the multiple="true" using struts? html:select multiple="true" property="fieldName"/ I read the Struts docs and it says to make the getter and setter an Array ex. protected String[] fieldName; The problem is that I don't know the size of the Array because it is dynamically being created through fields in the DB. Any ideas?
Re: POST and GET method
That's a good question. If you guys find out let me know and I will do the same. I actually have to deal with that today in a multi-part form. I am not sure, but I think the answer is by adding struts hidden form fields. I'll let you know later today. - Original Message - From: kiatkin To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 12:05 AM Subject: POST and GET method Hi, Anyone know how to setan action class to process the POST request only. So that when user try toaccess www.abc.com/action.do?action=doGET. It can redirect user toerror page.Or put in this way, how do action classreact differently for each doGet and doPost request? regards, Kiat Kin
Re: Drop-down list
This is how we do it...(I think the work simple should be ommitted) Get the content at the top of the JSP page. %pageContext.setAttribute("nameSuffixTypes", getServletContext().getAttribute("nameSuffixTypes"));% Place this where you want the Drop Down List on the JSP page. html:select property="suffix" html:options collection="nameSuffixTypes" property="value" labelProperty="label" //html:select - Original Message - From: Kyle Robinson To: '[EMAIL PROTECTED]' Sent: Thursday, March 01, 2001 8:42 AM Subject: Drop-down list What is the simplest way to dynamically create a drop-down list (select) that pulls values from a database? Is there a specific tag I should use? Iterator? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Drop-down list
Do you guys know how to define the Multiple attribute in a select drop down list for Struts? - Original Message - From: "Peter Alfors" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 11:29 AM Subject: Re: Drop-down list When adding options to a select that are stored in a database, we have the action class look-up the necessary information, store it in a bean, place the bean in the request / session, and then use a taglib on the page that specifies the source (the bean) and the property (database column) that should be used to populate the select. This gaurentees that the data in the select list is up to date. HTH, Pete "Deadman, Hal" wrote: Does this assume that you have loaded a Collection of LabelValueBeans in the application scope? Do you really need that scriplet at the top of the page? I thought html:options could reference the collection where it is in the servlet context, without copying the reference to the page context. Hal -Original Message----- From: Spencer Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: Drop-down list This is how we do it...(I think the work simple should be ommitted) Get the content at the top of the JSP page. % pageContext.setAttribute("nameSuffixTypes", getServletContext().getAttribute("nameSuffixTypes")); % Place this where you want the Drop Down List on the JSP page. html:select property="suffix" html:options collection="nameSuffixTypes" property="value" labelProperty="label" / /html:select - Original Message - From: Kyle mailto:[EMAIL PROTECTED] Robinson To: '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' Sent: Thursday, March 01, 2001 8:42 AM Subject: Drop-down list What is the simplest way to dynamically create a drop-down list (select) that pulls values from a database? Is there a specific tag I should use? Iterator? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Drop-down list
Trying to use Multiple="true" attribute for html:select Help! O.k. so I declare it like so: protected String[] providerName; Then I get it: public String[] getProviderName() { return (providerName); } Then I set it: public void setProviderName(String providerName[]) { { this.providerName = providerName; } } What am I missing? - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 12:02 PM Subject: Re: Drop-down list Add the attribute to your tag like so: html:select ... multiple="true" ... and make sure the corresponding property in your form bean is an array of values. See the docs for more details: http://jakarta.apache.org/struts/struts-html.html#select Hope this helps. -- Martin Cooper Tumbleweed Communications At 11:44 AM 3/1/01 -0800, Spencer Smith wrote: Do you guys know how to define the Multiple attribute in a select drop down list for Struts? - Original Message - From: "Peter Alfors" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 11:29 AM Subject: Re: Drop-down list When adding options to a select that are stored in a database, we have the action class look-up the necessary information, store it in a bean, place the bean in the request / session, and then use a taglib on the page that specifies the source (the bean) and the property (database column) that should be used to populate the select. This gaurentees that the data in the select list is up to date. HTH, Pete "Deadman, Hal" wrote: Does this assume that you have loaded a Collection of LabelValueBeans in the application scope? Do you really need that scriplet at the top of the page? I thought html:options could reference the collection where it is in the servlet context, without copying the reference to the page context. Hal -Original Message- From: Spencer Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: Drop-down list This is how we do it...(I think the work simple should be ommitted) Get the content at the top of the JSP page. % pageContext.setAttribute("nameSuffixTypes", getServletContext().getAttribute("nameSuffixTypes")); % Place this where you want the Drop Down List on the JSP page. html:select property="suffix" html:options collection="nameSuffixTypes" property="value" labelProperty="label" / /html:select - Original Message - From: Kyle mailto:[EMAIL PROTECTED] Robinson To: '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' Sent: Thursday, March 01, 2001 8:42 AM Subject: Drop-down list What is the simplest way to dynamically create a drop-down list (select) that pulls values from a database? Is there a specific tag I should use? Iterator? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Drop-down list
Provide Name(s)nbsp; html:select property="providerName" multiple="true" size="2" html:options collection="cmProviderTypes" property="value" labelProperty="label" / /html:select Like this, correct? - Original Message - From: "Spencer Smith" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 1:02 PM Subject: Re: Drop-down list Trying to use Multiple="true" attribute for html:select Help! O.k. so I declare it like so: protected String[] providerName; Then I get it: public String[] getProviderName() { return (providerName); } Then I set it: public void setProviderName(String providerName[]) { { this.providerName = providerName; } } What am I missing? - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 12:02 PM Subject: Re: Drop-down list Add the attribute to your tag like so: html:select ... multiple="true" ... and make sure the corresponding property in your form bean is an array of values. See the docs for more details: http://jakarta.apache.org/struts/struts-html.html#select Hope this helps. -- Martin Cooper Tumbleweed Communications At 11:44 AM 3/1/01 -0800, Spencer Smith wrote: Do you guys know how to define the Multiple attribute in a select drop down list for Struts? - Original Message - From: "Peter Alfors" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 11:29 AM Subject: Re: Drop-down list When adding options to a select that are stored in a database, we have the action class look-up the necessary information, store it in a bean, place the bean in the request / session, and then use a taglib on the page that specifies the source (the bean) and the property (database column) that should be used to populate the select. This gaurentees that the data in the select list is up to date. HTH, Pete "Deadman, Hal" wrote: Does this assume that you have loaded a Collection of LabelValueBeans in the application scope? Do you really need that scriplet at the top of the page? I thought html:options could reference the collection where it is in the servlet context, without copying the reference to the page context. Hal -Original Message- From: Spencer Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: Drop-down list This is how we do it...(I think the work simple should be ommitted) Get the content at the top of the JSP page. % pageContext.setAttribute("nameSuffixTypes", getServletContext().getAttribute("nameSuffixTypes")); % Place this where you want the Drop Down List on the JSP page. html:select property="suffix" html:options collection="nameSuffixTypes" property="value" labelProperty="label" / /html:select - Original Message - From: Kyle mailto:[EMAIL PROTECTED] Robinson To: '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' Sent: Thursday, March 01, 2001 8:42 AM Subject: Drop-down list What is the simplest way to dynamically create a drop-down list (select) that pulls values from a database? Is there a specific tag I should use? Iterator? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Drop-down list
Thanks for the help, but it didn't work :( - Original Message - From: "Kyle Robinson" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 1:14 PM Subject: RE: Drop-down list I'd remove all the square brackets. If you want to keep them, the parameter type in setProviderName should be String[]. I don't know for sure though. -Original Message----- From: Spencer Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 13:02 To: [EMAIL PROTECTED] Subject: Re: Drop-down list Trying to use Multiple="true" attribute for html:select Help! O.k. so I declare it like so: protected String[] providerName; Then I get it: public String[] getProviderName() { return (providerName); } Then I set it: public void setProviderName(String providerName[]) { { this.providerName = providerName; } } What am I missing? - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 12:02 PM Subject: Re: Drop-down list Add the attribute to your tag like so: html:select ... multiple="true" ... and make sure the corresponding property in your form bean is an array of values. See the docs for more details: http://jakarta.apache.org/struts/struts-html.html#select Hope this helps. -- Martin Cooper Tumbleweed Communications At 11:44 AM 3/1/01 -0800, Spencer Smith wrote: Do you guys know how to define the Multiple attribute in a select drop down list for Struts? - Original Message - From: "Peter Alfors" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 01, 2001 11:29 AM Subject: Re: Drop-down list When adding options to a select that are stored in a database, we have the action class look-up the necessary information, store it in a bean, place the bean in the request / session, and then use a taglib on the page that specifies the source (the bean) and the property (database column) that should be used to populate the select. This gaurentees that the data in the select list is up to date. HTH, Pete "Deadman, Hal" wrote: Does this assume that you have loaded a Collection of LabelValueBeans in the application scope? Do you really need that scriplet at the top of the page? I thought html:options could reference the collection where it is in the servlet context, without copying the reference to the page context. Hal -Original Message- From: Spencer Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 01, 2001 11:39 AM To: [EMAIL PROTECTED] Subject: Re: Drop-down list This is how we do it...(I think the work simple should be ommitted) Get the content at the top of the JSP page. % pageContext.setAttribute("nameSuffixTypes", getServletContext().getAttribute("nameSuffixTypes")); % Place this where you want the Drop Down List on the JSP page. html:select property="suffix" html:options collection="nameSuffixTypes" property="value" labelProperty="label" / /html:select - Original Message - From: Kyle mailto:[EMAIL PROTECTED] Robinson To: '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' Sent: Thursday, March 01, 2001 8:42 AM Subject: Drop-down list What is the simplest way to dynamically create a drop-down list (select) that pulls values from a database? Is there a specific tag I should use? Iterator? Kyle Robinson Systems Consultant Pangaea Systems Inc. (250) 360-0111
Re: Validating bean properties (WAS: Re: Stupd question aboutStruts and EJB.)
Help! Question: Is there a simple way to set an index for an error message so that I can vary it's placement on my JSP Page? // In Action // old code errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("caremanager.mp.error.phoneFormat")); // new code (preferredDayPhone is my field name) errors.add("preferredDayPhone", new ActionError("caremanager.mp.error.phoneFormat")); // In JSP font color="#ff"eCMS:preferredDayPhone.errors//font ??? - Original Message - From: "Craig R. McClanahan" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, February 28, 2001 8:06 PM Subject: Re: Validating bean properties (WAS: Re: Stupd question aboutStruts and EJB.) Nick Pellow wrote: I was considering an approach where coders wrote validation code in Java (we all know java!) yet the Struts framework executed it. You would extend or implement a common java class/interface defining a single method, public ValidationErrors validate(); say. That is then mapped to the form field in an xml file somewhere. Struts, however could ship all the standard validations (such as Strings to ints) together. It is something I have not given much thought to yet, but would be interested in exploring further. Beyond the thinking expressed so far on this thread, I've had two additional ideas for functionality that should be included here: * Optional generation of client-side JavaScript code to do the kinds of validations that make sense (required fields, number formats, etc.) closer to the user. * The JavaBeans spec includes the concept of a PropertyEditor, which lets you define a custom conversion between String and a bean data type. JSP 1.2 supports this when doing attribute conversions -- we should look at whether it can help us in the conversion/validation arena as well. Craig McClanahan
Re: Volunteer for Validation Framework
I have a lot of experience using validation. I am of the opinion that if possible validation should be done client-side using javascript. Is there a way to implement this by extending Struts? If so, I would be very interested in helping. Currently, I am working on expanding Struts Custom Tag Library. I've added Pattern, IsRequired, and errorMessage to Struts-html.tld and modified the Struts source files to accomodate for this. It uses pattern because I am using Perl5 regular expressions to send the validation parameterss to the Form bean. Spencer - Original Message - From: David Winterfeldt [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, February 25, 2001 5:35 PM Subject: Volunteer for Validation Framework I'd like to volunteer to help on client and server side validation listed on the Struts 1.1 To Do list. I added some basic support for constants (global and on the Locale level). I also made the validations more configurable. You can define what class and method should do a type of validation. I added a depends attribute to the validation definitions so you could say that checking for an integer shouldn't be done until required validations are done. It's probably needs some work on the logic, but it seems to be working on the basics. Also a number of objects could be created and cached somewhere. I also started on some methods to do basic type checking. It's just some numeric primitives right now and a date. I added an example page to the sample webapp doing the type checking. The code and sample web app is on my site. I have a basic explanation, but I think it's lacking since I've added so much, but the examples should help. http://home.earthlink.net/~dwinterfeldt/ David __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/