Re: struts not reading properties file
Agreed, but not the case. - Original Message - From: "Dan Miser" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 11:13 PM Subject: Re: struts not reading properties file Most likely you have a copy of struts.jar somewhere on your CLASSPATH. It only belongs in WEB-INF/lib. -- Dan Miser http://www.distribucon.com - Original Message - From: G.L. Grobe To: [EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 10:27 PM Subject: struts not reading properties file 500 Internal Server Error javax.servlet.jsp.JspException: Missing message for key main.title at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java, Compiled Code) at /index.jsp._jspService(/index.jsp.java, Compiled Code) at
autocomplete attribute for html form tag
Hi, Just wondering has anyone manage to turn off the autocomplete feature in IE thru Stuts form tag? Currently I am using the Struts html form tag to come up with the login form. As far as I know, we can have an attribute autocomplete='off' in the normal form tag to turn this feature off. However, the Struts form tag does not support this attribute. I am not sure will this attribute will be added into the Struts form tag in any future release of Struts? Or anyone has done it in another way? Thanks in Advance. Eric
maxFileSize and file upload the second
Hi, I found time to do a bit more testing on file upload. with version 1.0-b1 the parameter maxFileSize is recognised and a exception is. With the nightly build from 2001-04-17 it doesn't work any more. Obviously something changed in the mean time. Another problem is that that with version 1.0-b1 a temporary file remains in the tmp directory. Am I supposed to catch the exception and to deleted the file manually? In struts-upload example is a small bug in UploadAction. The input stream 'stream' is never closed explicitly. So the temporary file remains in the tmp directory after upload. It's easy to fix by just calling the close method to every stream used after we are finished with it. Hope that helps to get it a bit cleaned up. Soeren == I love deadlines. I especially like the whooshing sound they make as they go flying by.
Using a collection as a bean with the logic tags
Hi all, I'm having trouble using the logic taglib (specifically greaterEqual/lessThan) with a bean of type java.util.Map. I need to do varying logic based on the size of the map, but am having trouble making the value of .size() available to the tags. I'd like to do something along these lines, but with as few scriptlets as possible (I know this won't work): jsp:useBean id="items" scope="session" type="java.util.Map"/ ... ... logic:greaterEqual property="%=items.values().size()%" value="1" ... ...stuff ... /logic:greaterEqual logic:lessThan property="%items.values().size()%" value="1" ... ...other stuff ... /logic:lessThan Like I say, I know what's written above won't work for all the various reasons, but can anyone suggest something that might? One idea I had was to use bean:define to open the size up to page scope and then using the assigned id for it as the property in the logic tags, but I can't make that work either. Can anyone help me out? Thanks in advance Dave The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, 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 ***
datasource and jndi
Hi, I want to use a datasource in a Struts based application but I also want to lookup this dataSource in objects that do not have an action or a servlet object in their scope, f.e. DAO's. In this case, using the struts-config.xml dataSource description doesn't seem the best of sollutions to me, I would prefer to do a jndi lookup for a dataSource that has been defined in the server.xml file. Am I right and if so how do I describe this dataSource in server.xml (resource? resource-ref?) I'm using tomcat 4.0-b1. Thanks, Jef
No ActionForm Bean Required
Hi all, Let's say I have a link that allows a user to empty his/her shopping cart. The link to empty the cart points to "/empty.do". I do not believe this requires an ActionForm bean (PLEASE, correct me if I am wrong). Nonetheless, I have specified an ActionForm Bean because it is required: action path="/empty" type="EmptyAction" name="buyBean" scope="request" forward name="success" path="/viewcart.jsp"/ /action The bean is NOT used and has nothing to do with emptying the shopping cart. Do I just accept that it works? Or am I designing the program wrong? Please help. Thanks in advance, Stanley Tan
RE: autocomplete attribute for html form tag
Hi Eric, Currently I am using the Struts html form tag to come up with the login form. As far as I know, we can have an attribute autocomplete='off' in the normal form tag to turn this feature off. However, the Struts form tag does not support this attribute. There's no autocomplete attribute in the "official" HTML 4.01 specification, although it works in IE (don't know which versions). [ http://www.w3.org/TR/html401/interact/forms.html#h-17.4 ] You could ask on the dev-list but I personally don't think that Struts should support one of these fancy IE-specific tags ;)) regards, Tobias Meyer
RE: autocomplete attribute for html form tag
Title: RE: autocomplete attribute for html form tag I think it would be a good idea to have this property on all tags as this means that the system is able to cope with those demands that are needed as things change. I get quite frustrated when using systems that don't offer this sort of function as you then have to find highly creative ways to get around the restriction - which then create other problems. An idea like this puts less stress on getting release out quickly as things can then be easily extended if there is some urgency from the developer but can be included more formally in future releases. Al -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 11:24 AM To: [EMAIL PROTECTED] Subject: Re: autocomplete attribute for html form tag Something we could consider in the 1.1 timeframe is a generic options property that would just render non-standard options verbatim. So in this case we might have something like options=autocomplete=off in the Struts tag, and then the tags would just append that to the tag properties, no questions asked. But I don't know how you would do this now, unless the property can also be changed via Java or VB script that you could call with one of the event handlers, or when the form loads. Eric Wang wrote: Hi, Just wondering has anyone manage to turn off the autocomplete feature in IE thru Stuts form tag? Currently I am using the Struts html form tag to come up with the login form. As far as I know, we can have an attribute autocomplete='off' in the normal form tag to turn this feature off. However, the Struts form tag does not support this attribute. I am not sure will this attribute will be added into the Struts form tag in any future release of Struts? Or anyone has done it in another way? Thanks in Advance. Eric -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ --- This mail has been certified to be free of viruses Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.248 / Virus Database: 121 - Release Date: 11/04/2001
Shopping Cart Example
Hi all, I am building a shopping cart example using the struts framework for beginner's like myself. So far, I have a pretty simple shopping cart that connects to a database. Because I am new to this, I was wondering if any experienced programmer is willing to review my work and help me improve the example. This example will be made available for newbies to the struts framework so your help would be greatly appreciated. Thanks, Stanley Tan
Re: Using a collection as a bean with the logic tags
It is possible to use the bean:size tag to expose the size of a collection: bean:size name="items" property="values" id="itemsSize" scope="session"/ ... ... logic:greaterEqual name="itemsSize" value="1" ... ...stuff ... /logic:greaterEqual logic:lessThan name="itemsSize" value="1" ... ...other stuff ... /logic:lessThan Jean-Noel - Original Message - From: Firmin David [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 11:17 AM Subject: Using a collection as a bean with the logic tags Hi all, I'm having trouble using the logic taglib (specifically greaterEqual/lessThan) with a bean of type java.util.Map. I need to do varying logic based on the size of the map, but am having trouble making the value of .size() available to the tags. I'd like to do something along these lines, but with as few scriptlets as possible (I know this won't work): jsp:useBean id="items" scope="session" type="java.util.Map"/ ... ... logic:greaterEqual property="%=items.values().size()%" value="1" ... ...stuff ... /logic:greaterEqual logic:lessThan property="%items.values().size()%" value="1" ... ...other stuff ... /logic:lessThan Like I say, I know what's written above won't work for all the various reasons, but can anyone suggest something that might? One idea I had was to use bean:define to open the size up to page scope and then using the assigned id for it as the property in the logic tags, but I can't make that work either. Can anyone help me out? Thanks in advance Dave The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, 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 ***
Re: switching between SSL and non-SSL
Any luck with this Eric? I'd like to do the same thing, a la auctions.yahoo.com Everything works if I hardcode the references, but then you end up stuck in SSL. I started a SSL FAQ, and would like to include how to do this too. http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayOneTopic/action/SetAll/project_id/2/faq_id/36/topic_id/213 -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Eric Wang wrote: Hi, Has anyone done switching between SSL and non-SSL using Struts? My login page is using SSL. After successful logins, it suppose to route to a page that is non-SSL. Is there any example available for reference? Thanks in advance. Eric
Re: Another bean:iterate question
I've received that error before when I forgot to include the taglib directive for the logic library. That would prevent the "field" bean from being created and result in the error you're seeing. "Brett G. Palmer" wrote: I've been working on this bean:iterate ... problem for some time now. I finally had to use a scriplet to get it to work. I am trying to get a list of FieldTypes from a record controller (PrimaryServer below) which implement an AbstractField object (this may be the entire problem ... let me know if Abstract objects will cause problems). The controller has a method called getFieldList which returns an Iterator of these AbstractField objects. I then want to get the name of each field using the property getFielName(). The following is a snippet of my Jsp page. Tomcat always returns with an error saying it "can't find bean 'field' in scope null". logic:iterate id="field" name="PrimaryServer" property="fieldList" type="com.iic.dbsync.IntField" tr td align="center" jsp:getProperty name="PrimaryServer" property="fieldList"/ bean:write name="field" property="fielName"/ /td td html:text property="field2" size="100" //td /tr /logic:iterate Here is the scriplet that I wrote to finally get the results that I wanted. % Iterator iter = PrimaryServer.getFieldList(); while( iter.hasNext() ) { AbstractField field = (AbstractField) iter.next(); String fieldName = field.getFieldName(); % tr td align="center" %=fieldName% /td td html:text property="field2" size="100" //td /tr %} % The iterator tag still trips me up from time to time. If anyone has any suggestions I would appreciate them. I have enjoyed reading the previous postings concerning the iterator tag. Thanks again, Brett
How to run Struts in VAJ
Hi I studied the documentation and now I like to run Struts in VAJ 3.5.3. I would also like to run the Test Enviroment since I use EJB's. I found a lot of mails in this mailing-list, but I did not found a installation guide. Can somebody help me ? Does anybode know if there is such a guide or just which projects I have to install on VAJ? Thanks for help Andy *** PLEASE NOTE *** This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help. **
Re: How to run Struts in VAJ
If you mean VAJ 3.5.2 (3.5.3 has NOT been released yet) then the following instructions should work. This is from an upcoming article on this subject that I'm going to submit to the VisualAge developer domain website. Warning! This is a work in progress -- in particular I have NOT validated that EJB's work as advertised... Also, I obviously haven't attached my application -- you'll have to wait on the article for that. Finally, PLEASE do not post this to other websites! Keep this on the mailing list only. However, I do welcome comments on the instructions. Using Struts in VisualAge for Java 3.5.2 Since one of the requirements for using Struts is a JSP 1.1/Servlet 2.2 compliant Servlet engine, if you want to use Struts in VisualAge for Java 3.5.2 you must use the Apache Test Environment. This can be downloaded for free from VADD at http://www7.software.ibm.com/vad.nsf/Data/Document4290?OpenDocumentp=1BCT=3Footer=1 (note that you must register for VADD (free) to obtain this download). After running the Apache Tomcat Test Environment installation program, you must load the Apache Test Environment Feature using the FileQuick Start dialog. NOTE: I have NOT validated that EJB's work after you do this. That's on my to-do list for today Note that it is not possible to have both the WebSphere Test Environment's servlet engine and the Apache Test Environment co-reside in the same VisualAge workspace. The following set of instructions (provided by Sean Sundberg from the IBM WebSphere Services group) detail how to allow both EJB development using the WebSphere Test Environment and Servlet/JSP development using the Apache Test Environment: 1. Start from a workspace that does not contain the Apache Tomcat Test Environment. 2. Add the 'Websphere Test Environment' feature. 3. Delete the 'Servlet API' project from the workspace. 4. Add the 'Apache Tomcat Test Environement' feature. 5. Select 'Options...' from the 'Window' menu. 6. Select the 'Resources' menu option from the pane on the left. 7. Press the 'Edit...' button from the pane on the right. 8. Press the 'Add Jar/Zip' button. 9. Browse to the 'project_resources\Apache_Tomcat_Test_Environment\lib'. 10. Select 'servlet.jar' and press 'OK'. (This is required to generate the EJB code. The WTE requries some properties files from the servlets.jar file.) 11. Press the 'OK' button to commit the resource changes. The Persistent Name Server and EJB server can then be started to access EJBs. Servlets can now be accessed using the Apache Tomcat Test Environment Note that this procedure is also covered in the IBM Redbook by Bill Moore, et.al., " Migrating WebLogic Applications to WebSphere Advanced Edition", SG24-5956, available from http://www.redbooks.ibm.com.. Once you have verified that Tomcat is successfully installed and that you can serve pages from http://localhost:8080, then you are ready to proceed with the Struts installation. /NOTE Struts will require not only that you have a compliant servlet engine on your classpath, but that also you have a recent version of Xerxes in your classpath as well. You can either download these files from the Apache website, or you can simply install them from the VisualAge repository file that accompanies this article. Note that Xerxes cannot co-exist with the version of the IBM XML Parser for Java that ships with VisualAge for Java. You will have to remove it from the workspace as well before you import Xerxes (I often import Xalan as well). Likewise, you will need to either download and install the Struts framework from the Apache website, or load it from the accompanying repository file. The current version (1.0-beta2) seems to be more than stable enough for most uses ? there are several production sites currently using it. If you choose to load the projects from the accompanying repository file, be certain that you have loaded all of the following projects: (1) ApacheStruts 1.0-b2 (2) Xerxes 1.2.2 (3) Struts Experiments [For VADD] 1.0 Next, you will need to take the employeelist.zip file that accompanies this article and unzip it into the VAJ install root/ide/project_resource/Apache Test Environment/webapps directory. This will place the JSP, resource and XML files where Apache Tomcat expects to find them. If you make changes to these files, you should be sure to create an open edition of the Apache Test Environment project and release these files into the project ? that will ensure that you can obtain your files even in the case of a crash. For more information on using this feature, see [Sahu] or consult the VisualAge documentation. In real development, of course, Resource, JSP and XML files should be managed externally in Websphere Studio and published to the Tomcat /webapps directory as a publication stage. Finally, you will need to configure the Apache Tomcat Runner to find the appropriate directories and jar files. First, open the Properties dialog for the
RE: No ActionForm Bean Required
Hi, What do you mean by "it is required". Is that your requirement or struts. I have a similar thing called reset which is just action path="/reset" type="a.b.c.ResetAction"/ Cheers Kris. -Original Message- From: Stanley Tan [mailto:[EMAIL PROTECTED]] Sent: 17 April 2001 10:43 To: [EMAIL PROTECTED] Subject: No ActionForm Bean Required Hi all, Let's say I have a link that allows a user to empty his/her shopping cart. The link to empty the cart points to "/empty.do". I do not believe this requires an ActionForm bean (PLEASE, correct me if I am wrong). Nonetheless, I have specified an ActionForm Bean because it is required: action path="/empty" type="EmptyAction" name="buyBean" scope="request" forward name="success" path="/viewcart.jsp"/ /action The bean is NOT used and has nothing to do with emptying the shopping cart. Do I just accept that it works? Or am I designing the program wrong? Please help. Thanks in advance, Stanley Tan
radio buttion checked
Hello. How do I define the following radio button using htlm:radio tag. I don't find the checked attribute In html:radio tag. input type="radio" name="fd" value="" checked Thank regards sundaram
Re: getting size of a collection
- Original Message - From: Sundaram Ramasamy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 3:14 PM Subject: getting size of a collection Hi I have collection like this. %java.util.ArrayList list = new java.util.ArrayList(); list.add("First"); list.add("Second"); list.add("Third"); list.add("Fourth"); list.add("Fifth"); pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE); % Before processing this collection, I want to compare the collection item grater than 1. how will I do this. Can I use like this. bean:size name="list" property="size" id="itemsSize" scope="session"/ Yes you can, but you don't have to put " property="size'' ". The tag knows how to get the size of an Array, a Collection and a Map. Jean-Noel
RE: getting size of a collection
Thanks, it defined like this bean:size name="list" id="itemsSize" scope="page"/ its working. -Original Message- From: Jean-Noel Ribette [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 9:32 AM To: [EMAIL PROTECTED] Subject:Re: getting size of a collection - Original Message - From: Sundaram Ramasamy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 3:14 PM Subject: getting size of a collection Hi I have collection like this. %java.util.ArrayList list = new java.util.ArrayList(); list.add("First"); list.add("Second"); list.add("Third"); list.add("Fourth"); list.add("Fifth"); pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE); % Before processing this collection, I want to compare the collection item grater than 1. how will I do this. Can I use like this. bean:size name="list" property="size" id="itemsSize" scope="session"/ Yes you can, but you don't have to put " property="size'' ". The tag knows how to get the size of an Array, a Collection and a Map. Jean-Noel
why is init method of actionservlet being called twice?
Hi, I have subclassed actionservlet. In the init method of my subclass I have called super.init(); For some reason as I step through my code the init method of my subclass is being run through twice. Any idea why? my web.xml file is as follows: !-- Action Servlet Configuration -- servlet servlet-nameaction/servlet-name servlet-classcom.myCompany.rd.pwActionServlet/servlet-class init-param param-nameapplication/param-name param-valuecom.myCompany.rd.reqPro.ApplicationResources/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup2/load-on-startup /servlet Regards Alex
Re: How to run Struts in VAJ
Hi Andreas, I am running VAJ 3.5 enterprise with tomcat 3.1 as testing env. I found this mail to be extrememly helpful, which guide you through the installation and setup process. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg00019.html Besides, you can download the Apache Tomcat Test Environment for VAJ3.5 at http://www7.software.ibm.com/vad.nsf/Data/Document4290?OpenDocumentp=1BCT=3Footer=1 -Fei Xie From: "Andreas Dejung" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: How to run Struts in VAJ Date: Wed, 18 Apr 2001 14:55:11 +0200 Hi I studied the documentation and now I like to run Struts in VAJ 3.5.3. I would also like to run the Test Enviroment since I use EJB's. I found a lot of mails in this mailing-list, but I did not found a installation guide. Can somebody help me ? Does anybode know if there is such a guide or just which projects I have to install on VAJ? Thanks for help Andy *** PLEASE NOTE *** This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients. If this message has reached you in error, kindly destroy it without review and notify the sender immediately. Thank you for your help. ** _ Get your FREE download of MSN Explorer at http://explorer.msn.com
RE: Handling File Upload Failures
Mike, I just added two new exceptions to be thrown when the content length or maximum length is exceeded, they will be the root cause of the ServletException thrown. Is this good enough to be able to elegantly handle the problem for you? -Original Message- From: Rack, Mike [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 17, 2001 7:36 PM To: '[EMAIL PROTECTED]' Subject: Handling File Upload Failures Is there an elegant way of handling file upload errors when the file size is too large? I want to display an error page that indicates that the file is too large to upload. Currently I can only get a second exception to display. For example if I restrict the file size to be 500K and someone attempts to send a 1Mb file a ServletException with the message "Multipart data size exceeds the maximum allowed post size" is thrown but execution continues until another ServletException is thrown. This second exception wraps an IOException with the message " IOException while reading file element: ioe.getMessage()" (Note the small bug with the message generated!) . It is the second error message that comes through in the implicit exception object to my jsp error page. It seems that the real error is masked by the second exception. Why does execution continue after the first ServletException is thrown? - mike Full Stack Trace: 2001-04-17 06:02:36 - Ctx( ): Exception in: R( + /upload.do + null) - javax.servlet.ServletException: Multipart data size exceeds the maximum allowed post size at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:484) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387) at org.apache.tomcat.core.Handler.service(Handler.java:263) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74 9) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:207) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) 2001-04-17 06:02:37 - Ctx( ): Exception in: R( + /upload.do + null) - javax.servlet.ServletException: IOException while reading file element: ioe.getMessage() at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:205) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387) at org.apache.tomcat.core.Handler.service(Handler.java:263) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74 9) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:207) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Root cause: java.io.IOException: end of stream before boundary found! at org.apache.struts.upload.MultipartValueStream.init(MultipartValueStream.ja va:65) at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:469) at
RE: maxFileSize and file upload the second
Soeren, with version 1.0-b1 the parameter maxFileSize is recognised and a exception is. With the nightly build from 2001-04-17 it doesn't work any more. Obviously something changed in the mean time. This was just recently fixed. Another problem is that that with version 1.0-b1 a temporary file remains in the tmp directory. Am I supposed to catch the exception and to deleted the file manually? This was even more recently just fixed, thanks for bringing it to my attention. In struts-upload example is a small bug in UploadAction. The input stream 'stream' is never closed explicitly. So the temporary file remains in the tmp directory after upload. It's easy to fix by just calling the close method to every stream used after we are finished with it. Also taken care of, thanks again. Mike
RE: Handling File Upload Failures
The new upload code still does not work under ATG Dynamo. In the upload example, it still hangs just after the actual file is uploaded, and the trailing fields are being processed. I have tried it with all the popular browsers and different JDK's on the server. Anyone else out there using file upload with ATG? -Original Message- From: Schachter, Michael [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 9:29 AM To: '[EMAIL PROTECTED]' Subject: RE: Handling File Upload Failures Mike, I just added two new exceptions to be thrown when the content length or maximum length is exceeded, they will be the root cause of the ServletException thrown. Is this good enough to be able to elegantly handle the problem for you? -Original Message- From: Rack, Mike [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 17, 2001 7:36 PM To: '[EMAIL PROTECTED]' Subject: Handling File Upload Failures Is there an elegant way of handling file upload errors when the file size is too large? I want to display an error page that indicates that the file is too large to upload. Currently I can only get a second exception to display. For example if I restrict the file size to be 500K and someone attempts to send a 1Mb file a ServletException with the message "Multipart data size exceeds the maximum allowed post size" is thrown but execution continues until another ServletException is thrown. This second exception wraps an IOException with the message " IOException while reading file element: ioe.getMessage()" (Note the small bug with the message generated!) . It is the second error message that comes through in the implicit exception object to my jsp error page. It seems that the real error is masked by the second exception. Why does execution continue after the first ServletException is thrown? - mike Full Stack Trace: 2001-04-17 06:02:36 - Ctx( ): Exception in: R( + /upload.do + null) - javax.servlet.ServletException: Multipart data size exceeds the maximum allowed post size at org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator .java:484) at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:201) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387) at org.apache.tomcat.core.Handler.service(Handler.java:263) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74 9) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:207) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) 2001-04-17 06:02:37 - Ctx( ): Exception in: R( + /upload.do + null) - javax.servlet.ServletException: IOException while reading file element: ioe.getMessage() at org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator. java:205) at org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti partRequestHandler.java:70) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19 10) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387) at org.apache.tomcat.core.Handler.service(Handler.java:263) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74 9) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:695) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:207) at
Update on caching lists.
Hi so far my list caching is going well, I have set up a thread to monitor database changes and to update the lists stored in the servlet context. Unfortunately, although my program is noticing the change in the database and it is recompiling the data and putting the new data into the context under the same name, the lists are not being updated. I place lists in the servletcontext via: context.setAttribute("storeroomList",storerooms ); When the lists change I recall my cachelist method and the above line is repeated. I thought that would replace the present list with the new one but that is not occurring. Is there another way I am supposed to be replacing attributes? To test I opened up a web page populated with my list and then went to the database and changed some values in the list. My program then caught these changes, and repopulated the lists and then placed them in the context again. I then opened up another window and the page was populated with the old data. Any help in this matter is appreciated. Alex
Update on caching lists.
Oh, I thought about using removeAttribute() and then setting the attribute of the list again but I am worried about pulling a list out of the servletcontext just as a person might be accessing a page that needs that list. Regards Alex
RE: Update on caching lists.
A couple of possibilities: 1) Are you storing the list or a reference to it in session as well as servlet context? It may be that you still have a reference to the old list somewhere. 2) Are you calling context.getAttribute() again to replace your reference with one to the new list? 3) Sanity check: Is the page loading from browser cache? -Original Message- From: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 9:56 AM To: [EMAIL PROTECTED] Subject: Update on caching lists. Hi so far my list caching is going well, I have set up a thread to monitor database changes and to update the lists stored in the servlet context. Unfortunately, although my program is noticing the change in the database and it is recompiling the data and putting the new data into the context under the same name, the lists are not being updated. I place lists in the servletcontext via: context.setAttribute("storeroomList",storerooms ); When the lists change I recall my cachelist method and the above line is repeated. I thought that would replace the present list with the new one but that is not occurring. Is there another way I am supposed to be replacing attributes? To test I opened up a web page populated with my list and then went to the database and changed some values in the list. My program then caught these changes, and repopulated the lists and then placed them in the context again. I then opened up another window and the page was populated with the old data. Any help in this matter is appreciated. Alex
How to access Action Mapping instance if session expires
Hi, How can I access the action mapping instance if session is expired? I have a global forward in struts-config.xml which points to logon page global-forwards forward name="logon" path="/logon.jsp"/ /global-forwards in session expires I need to forward to logon page something likeif ( session == null ) mapping.findForward(logon); Is the ActionMapping object kept in session scope or application scope? Thanks Puneet
html:link only uses the last param* attributes
When I do this html:link page="/editLoginInfo.do" paramId="srcAction" paramName="personalInfoForm" paramProperty="personal" paramId="action" paramName="personalInfoForm" paramProperty="action" paramId="personnelID" paramName="personalInfoForm" paramProperty="personnelID" bean:message key="loginInfo.title"/ /html:link The rendered URL is a href="http://192.168.0.190:8082/mm06/editLoginInfo.do?personnelID=1"Login Information/a If I change the order of the paramId's the rendered query string only contains the last parameter specified. I know I can use a hashtable of parameters, but I'm trying to get it to work this way. Cheers Peter
what's the attribute name for a FormBean?
Hi, all, If I want to use bean:define to retrieve one property of current form bean as a JSP bean(an attribute accessible to the remainder of the current page), how can specify the attribute name of the form bean? I have tried the name from struts-config.xml where I define the form bean, it is still saying: "No bean found for attribute key xxx"(the name appearing in the xml file). How do all the html form tags know the form bean where they find "their properties"? Finally I have to use jsp.useBean to introduce the form bean before the defining. Thanks in advance! Weining
Re: Template tags
Maybe your browser doesn't render correctly your page, due to a problem with generated html tags. Check the source code of the resulting page : do you see evidence of "missing" parts ? Cedric Olivier Houyoux wrote: Hi, I'm using the template library to create a dynamic template for index pages that share the same format (see below). One of the pages (menu.jsp) that compose the template has a form which validation is handled by two components : the associated ActionForm object for the simple validation and the associated Action object for specific business logic validation. If a validation error occurs, the request is redirected to the calling page automatically by the ActionForm (I suppose) or manually by my Action object (return new RedirectingActionForward("/index.jsp")). Unfortunately, a part of the index page content is then lost : only the page with the form (menu.jsp) is correctly displayed, the other parts (header.jsp, body.jsp and footer.jsp) seem to be ignored. What's wrong ? Is that a context relative path problem ? Any idea on how to fix it ? Here is my 'index.jsp' page : %@ taglib uri="/WEB-INF/tlds/struts-template.tld" prefix="template" % template:insert template="/template.jsp" template:put name="header" content="/header.jsp" / template:put name="menu" content="/menu.jsp" / template:put name="body" content="/body.jsp" / template:put name="footer" content="/footer.jsp" / /template:insert Regards, Olivier.
How to display odd/even rows using iterator
Hello, I have the following code to build the table: == logic:iterate id="exchangeRate" name="cache" property="displayRates" tr td class="td0" align="middle" bean:write name="exchangeRate" property="currency" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rate" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rateType" filter="true"/ /td /tr /logic:iterate == I would like to set different colors for odd/even rows. How do I do this? Thanks, Mark. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers Inc. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
RE: iPlanet and Struts Error: 400 SC_BAD_REQUEST
problem solved. my struts-config action didn't match the .do action on my link. duh. thanks for all who gave it thought. :) jessica -Original Message- From: Anderson, Jessica [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 10:36 AM To: '[EMAIL PROTECTED]' Subject: iPlanet and Struts Error: 400 SC_BAD_REQUEST iPlanet users: I've built my WAR file to include content, action classes, controller and config files (I also have struts.jar, parser.jar, and jaxp.jar in WEB-INF\lib), but i am getting the following error when clicking a link with a .do?[some parameters] extension. Error:400 SC_BAD_REQUEST null Maybe I am missing something? Servlet 2.0 javadocs says that this error is thrown from service method: "This method looks whether the request is a POST, GET, etc method, and then calls the appropriate doPost, doGet, whatever method. If the request method is something it can't handle it sends a HttpServletResponse.SC_BAD_REQUEST error through the response." Is there some reason the service method of ActionServlet couldn't handle my request? The actual request looks like this: [18/Apr/2001:09:51:24 -0500] "GET /NASApp/bestTestWAR/district/jsp/maintainDemographics.do?action=maintainDemo graphics HTTP/1.0" 400 i have the alias set up in the DD and it looks correct. I have successfully deployed the same example on tomcat and am trying to convert to iPlanet. thanks in advance for your help. :) Jessica
Re: Update on caching lists.
Then don't call removeAttribute. Just call setAttribute to replace the value of your key. Your app server's session implementation will (or should) manage synchronization. Of course, one or two of your clients might get a slightly stale list, but you can't help that. At least, they'll never get a null pointer. Alex Colic wrote: Oh, I thought about using removeAttribute() and then setting the attribute of the list again but I am worried about pulling a list out of the servletcontext just as a person might be accessing a page that needs that list. Regards Alex
RE: Oracle Servlet Engine
Actually it may work. According to the documentation the Oracle Servlet Engine (which is different to JServ) is Servlet 2.2 compliant so should be able run Struts-based applications. If anybody does get something working I would be interested in details of how they did it. -Original Message- From: Rob Leland [mailto:[EMAIL PROTECTED]] Sent: 16 April 2001 06:27 To: [EMAIL PROTECTED] Subject: Re: Oracle Servlet Engine No, And it will not work with 9i either. Both use JServ which is a JSP 1.0, Servlet 2.0 container. However, I know 9i uses Apache which could then be modified to use tomcat. Oracle 8i may also use Apache but I am not sure. -Rob Michael Schommer wrote: Hi, we work with Oracle (8.1.7) in our company. Now, I want to know if Struts works with the Oracle ApplicationServer. If anyone has any know-how with the Oracle Servlet Engine and Struts or the Oracle 8i ApplicationServer I will be very happy for every information send directly to my eMail-address. Bye Michael
Re: How to display odd/even rows using iterator
I used a simple java/jsp hack to do this for something similar (multiple columns for one resultset), but maybe there's a better way. One thing I noticed is that bean:define didn't seem to like an integer primitive as opposed to a String. % int rowCount= 0; int columnMod = 0; % logic:iterate id="rowX" name="data" property="aCollection" % columnMod = rowCount% 2; rowCount++; % bean:define id="col2Flag" value="%= String.valueOf(columnMod) %"/ logic:notEqual value="1" name="col2Flag"tr/logic:notEqual td id="textsmall"bean:write name="rowX" property="someVal"//td logic:equal value="1" name="col2Flag"/tr/logic:equal /logic:iterate logic:notEqual value="1" name="col2Flag" td/td /tr /logic:notEqual chris At 12:00 PM 4/18/2001 -0400, Zeltser, Mark wrote: Hello, I have the following code to build the table: == logic:iterate id="exchangeRate" name="cache" property="displayRates" tr td class="td0" align="middle" bean:write name="exchangeRate" property="currency" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rate" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rateType" filter="true"/ /td /tr /logic:iterate == I would like to set different colors for odd/even rows. How do I do this? Thanks, Mark. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers Inc. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
RE: How to display odd/even rows using iterator
Hi, try extending the iterate tag and modify it to take in 2 (or however many you want) stylesheet parameters. Say styleGrey and styleWhite. While iterating through your collection use the different stylesheet attributes and apply them to every other row. I've got something that works similar to this so if you can't figure it out let me know and I'll send it on. Thanks, Christine Robb Programmer/Analyst Pangaea Systems PH: (250) 360-0111 FX: (250) 381-4306 www.pangaeainc.com [EMAIL PROTECTED] -Original Message- From: Zeltser, Mark [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 9:01 AM To: [EMAIL PROTECTED] Subject: How to display odd/even rows using iterator Hello, I have the following code to build the table: == logic:iterate id="exchangeRate" name="cache" property="displayRates" tr td class="td0" align="middle" bean:write name="exchangeRate" property="currency" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rate" filter="true"/ /td td class="td0" align="middle" bean:write name="exchangeRate" property="rateType" filter="true"/ /td /tr /logic:iterate == I would like to set different colors for odd/even rows. How do I do this? Thanks, Mark. -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers Inc. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
Re: what's the attribute name for a FormBean?
The form bean is created by the html:form tag, or by an Action class, under the attribute name given in the config file. Are you looking for it before it is created? But, given that the flow has passed the html:form tag, or returned from the action, and given something like form-bean name="logonForm" type="org.wxxi.gavel.action.LogonForm"/ then bean:define id="username" name="logonForm" property="username"/ should expose the property logonForm.getUsername() as a scripting variable for the page. Weining Qi wrote: Hi, all, If I want to use bean:define to retrieve one property of current form bean as a JSP bean(an attribute accessible to the remainder of the current page), how can specify the attribute name of the form bean? I have tried the name from struts-config.xml where I define the form bean, it is still saying: "No bean found for attribute key xxx"(the name appearing in the xml file). How do all the html form tags know the form bean where they find "their properties"? Finally I have to use jsp.useBean to introduce the form bean before the defining. Thanks in advance! Weining -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Setting Select value= dynamically?
Hi. Am aware that you can set value= on html:select tag, as "the value to compare with for marking an option selected". For example, in the code below, to display "08" when jsp loads bean:define id="dayList" name="LogFilterForm" property="days"/ html:select property="day" value="08" html:options collection="dayList" property="value" labelProperty="label"/ /html:select Before this jsp, I am filtering some records and want to set the day to the earliest one found. How do I do this? I set the value of "day" in my FormBean to the one found, but how do I get this one selected when jsp displayed? Do I need to use some kind of scriplet? Many thanks, Dave
Required vs. optional name attribute
I apologize in advance if this topic has come up before, but ... I'm building a Struts JSP page containing a form. I've noticed that the HTML tags typically do not require the specification of a "name" attribute in order to retrieve property values from a bean. If the name isn't specified, the property value is retrieved from the bean associated with the form. However, logic tags require the use of the name attribute in order to retrieve a property. Isn't there some way that the logic tags could look to see if there is a bean "in scope" and use that bean to retrieve property values from if no name attribute is specified? The problem I have is this, I have a portion of a form which is common to more than one form. I would like to factor out the common stuff into an include file of some sort. However, the common stuff makes use of a logic tag (notEqual). I can't factor out this code because I have to explicitly reference a specific bean name in order for this code to work. However, my various forms have different bean names associated with them. It's not a terribly big deal, but it seems as if the name attribute shouldn't have to be required if some sort of "default" bean is available for the page. Thanks.
Error in comps-tutorial.war (Struts + Components + Orion)
Folks, Anyone using components on top of struts? I got a problem when I tried to execute comps-tutorial.war (tutorial from components) within orion. Any ideas? Pls c the attachment for error. P.S. I already moved the dtd files from struts.jar into the classes directory. Thanks in advance! Chris = Error = javax.servlet.jsp.JspException: Error - tag.useAttribute : attribute 'componentsList' not found in context. Check tag syntax at s1.struts.taglib.component.UseAttributeTag.doStartTag(UseAttributeTag.java:1 28) at /layout/vboxLayout.jsp._jspService(/layout/vboxLayout.jsp.java:43) (JSP page line 10) at com.orionserver.http.OrionHttpJspPage.service(JAX) at com.evermind.server.http.HttpApplication.xu(JAX) at com.evermind.server.http.JSPServlet.service(JAX) at com.evermind.server.http.d4.s3(JAX) at com.evermind.server.http.d4.include(JAX) at com.evermind.server.http.EvermindPageContext.include(JAX) at s1.struts.taglib.component.InsertTag$InsertHandler.doEndTag(InsertTag.java:6 50) at s1.struts.taglib.component.InsertTag.doEndTag(InsertTag.java:291) at /layout/classicLayout.jsp._jspService(/layout/classicLayout.jsp.java:67) at com.orionserver.http.OrionHttpJspPage.service(JAX) at com.evermind.server.http.HttpApplication.xu(JAX) at com.evermind.server.http.JSPServlet.service(JAX) at com.evermind.server.http.d4.s3(JAX) at com.evermind.server.http.d4.include(JAX) at com.evermind.server.http.EvermindPageContext.include(JAX) at s1.struts.taglib.component.InsertTag$InsertHandler.doEndTag(InsertTag.java:6 50) at s1.struts.taglib.component.InsertTag.doEndTag(InsertTag.java:291) at /index.jsp._jspService(/index.jsp.java:35) at com.orionserver.http.OrionHttpJspPage.service(JAX) at com.evermind.server.http.HttpApplication.xu(JAX) at com.evermind.server.http.JSPServlet.service(JAX) at com.evermind.server.http.d4.s3(JAX) at com.evermind.server.http.d4.s1(JAX) at com.evermind.server.http.eg.s9(JAX) at com.evermind.server.http.eg.dr(JAX) at com.evermind.util.f.run(JAX)
Newbie Question - Troubles Running Struts on Tomcat
Hi, people! I am beginning in JSPs, Tomcat and Struts now: please, be pacient. ;) What I do: Copy *.war files from struts distribuition into webapps tomcat directory Copy * from struts .\lib dir into tomcat .\lib dir Modify server.xml from tomcat to comunicate with apache. and try this: darkness# ../bin/startup.sh Guessing TOMCAT_HOME from tomcat.sh to ../bin/.. Setting TOMCAT_HOME to ../bin/.. Using classpath: ../bin/../classes:.:../bin/../lib/ant.jar:../bin/../lib/jasper.jar:../bin/../lib/mysql_comp.jar:../bin/../lib/mysql_uncomp.jar:../bin/../lib/servlet.jar:../bin/../lib/struts-bean.tld:../bin/../lib/struts-config_1_0.dtd:../bin/../lib/struts-form.tld:../bin/../lib/struts-html.tld:../bin/../lib/struts-logic.tld:../bin/../lib/struts-template.tld:../bin/../lib/struts.jar:../bin/../lib/struts.tld:../bin/../lib/web-app_2_2.dtd:../bin/../lib/web-app_2_3.dtd:../bin/../lib/webserver.jar:../bin/../lib/xml.jar darkness# Starting tomcat. Check logs/tomcat.log for error messages java.lang.NoClassDefFoundError: java/util/Map at org.apache.struts.action.ActionServlet.init(ActionServlet.java:236) at org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java:298) at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:276) at org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:132) at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:227) at org.apache.tomcat.core.ContextManager.init(ContextManager.java:201) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163) darkness# ? Doesn't works. I am missed something. Can anyone send me some lights? I didn't found a troubleshotting in no place Thanks for any help CUL8R,[]s Jim Bruno Goldberg [EMAIL PROTECTED]
Re: Setting Select value= dynamically?
Have created a hack to do this, using bean:define id="thisDay" name="LogFilterForm" property="day"/ html:select property="day" value="%=(String)thisDay%" html:options collection="dayList" property="value" labelProperty="label"/ /html:select Surely there is a cleaner way to do it than this?! Not least as I have to do it for month, year, hour and minute as well! Seems like I already have "day" right there, but can't figure out how to access it w/o another bean define. What am I missing? Thanks, Dave -- Forwarded by David Hay/Lex/Lexmark on 04/18/2001 02:04 PM --- David Hay 04/18/2001 12:54 PM To: [EMAIL PROTECTED] cc: Subject: Setting Select value= dynamically? (Document link: David Hay) Hi. Am aware that you can set value= on html:select tag, as "the value to compare with for marking an option selected". For example, in the code below, to display "08" when jsp loads bean:define id="dayList" name="LogFilterForm" property="days"/ html:select property="day" value="08" html:options collection="dayList" property="value" labelProperty="label"/ /html:select Before this jsp, I am filtering some records and want to set the day to the earliest one found. How do I do this? I set the value of "day" in my FormBean to the one found, but how do I get this one selected when jsp displayed? Do I need to use some kind of scriplet? Many thanks, Dave
Iterate...
Can anyone help? See code below. It's a very simple iterate. I have an html:hidden form item called 'id'. I want to set itemName (in the submitRollo tag) to the value of that id. (it's a submit button tag) Keep in mind this is in an iterate tag and that there will be many buttons all with the same action and name. Can I do something like '%= formBean.getter().nestedGetter() %' I swear I've tried every combo and nothing works. All I want is the primary key of the record. Any ideas? logic:iterate id="notes" name="clientNotesListForm" property="notesResults" tr tdbean:write name="notes" property="id"//td html:hidden name="notes" property="id" / tdcom:submitRollo fileName="button.viewNote1" itemName="%= I want this to be the value of the hidden 'id' form item%" formName="clientNotesListForm" action="viewNote" statusLine="status.viewNote"//td /tr /logic:iterate Thanks! Christine Robb Programmer/Analyst Pangaea Systems PH: (250) 360-0111 FX: (250) 381-4306 www.pangaeainc.com [EMAIL PROTECTED]
Feature request
I'm using the bean:write tag to add parameters to a dynamically generated URL used by some javascript on my JSP page. The problem with bean:write is that it doesn't URL encode the result. In general, this is probably a good thing. However, there are times when it would be nice to have the value encoded. Would it be possible to add an additional optional tag to WriteTag which would indicate whether the result was to be URLEncoded? The default would be false which would not require any changes in current code. Also, if there is an alternative way to get this functionality, please let me know. Unfortunately I can't use the "link" tag in this circumstance. Basically I have a line in my file which looks like this: input type="button" ... onClick="self.location="foo.do?key='bean:write ...'" In other words, I'm building up the parameters to the location URL based on property values in a particular bean. Thanks.
Problems setting form in session
I am trying to set a form bean in session so it can be used accross Action classes. Specifically, I am trying to get the form bean to remember a value so it can repopulate the jsp page accordingly when that page appears again (if the user hits 'cancel'). My assumption: that setting actionname="testForm" scope="session" ... would put the form bean referenced by 'testForm' into session scope. This assumption is either wrong, or there is a bug in struts, or I am doing something else wrong. My struts config: form-bean name="testForm" type="[path].TestForm"/ action path="/test1" type="[path].Test1Action" name="testForm" scope="session" validate="true" input="/[path]/test1.jsp"[forwards] /action action path="/test2" type="[path].Test2Action" name="[another form]" scope="request" validate="true" input="/[path/test2.jsp"[forwards] forward name="cancel" path="/[path]/test1.jsp"/ /action Action test1.do loads first. A submit button loads Action test2.do, and it is in Test2Action that I attempt to recieve the form (testForm) that was supposedly put into session from test1.do. I failed to figure out the name the form was given in the session, so I output all of the types of objects currently in session. Here is my code (in Test2Action): System.out.println("*** AttributeName List: ***"); for(Enumeration e = request.getSession().getAttributeNames(); e.hasMoreElements(); ) { System.out.println("*** e.nextElement()=" + e.nextElement() + " ***"); } And here is the output: *** AttributeName List: *** *** e.nextElement()=user *** *** e.nextElement()=org.apache.struts.action.LOCALE *** As you can see, the form bean was not put into session by the struts-config file (user we explicitely put into session). Either that, or I am misunderstanding something (it happens). Could someone give me some advice on this? Thanks, - eric
how to use a select option with a property from the form bean?
I would like to configure a form bean with a property that contains a collection to be rendered as a select statement, but I can't get it to work. If the options collection attribute is not specified, the docs say that you can specify just the property: "The value of this attribute is the name of a property of the ActionForm bean associated with our form, which will return the collection." What should this collection look like? Can anyone point me at an example? Thanks, Roxie
Re: Required vs. optional name attribute
James Howe wrote: It's not a terribly big deal, but it seems as if the name attribute shouldn't have to be required if some sort of "default" bean is available for the page. The original designers were probably trying not to couple the logic tags to the html tags, or to struts itself. The name of the current form I believe is kept in the request variable org.apache.struts.action.BEAN so you can always confidently reference that for your logic 'name' value. Thanks.
Re: Problems setting form in session
Eric Rasmussen wrote: I am trying to set a form bean in session so it can be used accross Action classes. Specifically, I am trying to get the form bean to remember a value so it can repopulate the jsp page accordingly when that page appears again (if the user hits 'cancel'). As you can see, the form bean was not put into session by the struts-config file (user we explicitely put into session). Either that, or I am misunderstanding something (it happens). Before a form is reused it's reset() method is called. If your form has a reset method it will get called before it is reused in the next request. I usually rename my reset to resetNow(), and manually do a resetNow() for a clean form. Could someone give me some advice on this? Thanks, - eric
Re: Problems setting form in session
Yes, I thought of that, but reset() is not being called (I put a println to see). Rather, a brand new form is being passed (which is correct if it was at request level). This is why I wanted to keep the old one in session. - Original Message - From: "Rob Leland" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 12:11 AM Subject: Re: Problems setting form in session Eric Rasmussen wrote: I am trying to set a form bean in session so it can be used accross Action classes. Specifically, I am trying to get the form bean to remember a value so it can repopulate the jsp page accordingly when that page appears again (if the user hits 'cancel'). As you can see, the form bean was not put into session by the struts-config file (user we explicitely put into session). Either that, or I am misunderstanding something (it happens). Before a form is reused it's reset() method is called. If your form has a reset method it will get called before it is reused in the next request. I usually rename my reset to resetNow(), and manually do a resetNow() for a clean form. Could someone give me some advice on this? Thanks, - eric
Actions forwarding to Actions
I think I found a bug or, as Larry Wall might say, it would be difficult to interpret it as a feature. :-) I have an Action that occasionally needs to forward its request to another Action. So the forward element in its corresponding action element has a path with a suffix of "do" instead of "jsp". The associated form bean classes for each action's form have a "name" property, though this is purely coincidental. They have no real relationship. Oddly enough, when Action X forwards to Action Y, the name property for Y's form bean is initialized to the name from X's form bean! Is this a bug? Thanks.
Re: How to run Struts in VAJ
VAJ 3.5.3 will be released next week. http://www7.software.ibm.com/vad.nsf/data/document4541 And WTE will implement Servlet 2.2 and JSP 1.1, so it will work with Struts. - Original Message - From: "Kyle Brown" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 3:08 PM Subject: Re: How to run Struts in VAJ If you mean VAJ 3.5.2 (3.5.3 has NOT been released yet) then the following instructions should work. This is from an upcoming article on this subject that I'm going to submit to the VisualAge developer domain website. Warning! This is a work in progress -- in particular I have NOT validated that EJB's work as advertised... Also, I obviously haven't attached my application -- you'll have to wait on the article for that. Finally, PLEASE do not post this to other websites! Keep this on the mailing list only. However, I do welcome comments on the instructions. Using Struts in VisualAge for Java 3.5.2 Since one of the requirements for using Struts is a JSP 1.1/Servlet 2.2 compliant Servlet engine, if you want to use Struts in VisualAge for Java 3.5.2 you must use the Apache Test Environment. This can be downloaded for free from VADD at http://www7.software.ibm.com/vad.nsf/Data/Document4290?OpenDocumentp=1BCT= 3Footer=1 (note that you must register for VADD (free) to obtain this download). After running the Apache Tomcat Test Environment installation program, you must load the Apache Test Environment Feature using the FileQuick Start dialog. NOTE: I have NOT validated that EJB's work after you do this. That's on my to-do list for today Note that it is not possible to have both the WebSphere Test Environment's servlet engine and the Apache Test Environment co-reside in the same VisualAge workspace. The following set of instructions (provided by Sean Sundberg from the IBM WebSphere Services group) detail how to allow both EJB development using the WebSphere Test Environment and Servlet/JSP development using the Apache Test Environment: 1. Start from a workspace that does not contain the Apache Tomcat Test Environment. 2. Add the 'Websphere Test Environment' feature. 3. Delete the 'Servlet API' project from the workspace. 4. Add the 'Apache Tomcat Test Environement' feature. 5. Select 'Options...' from the 'Window' menu. 6. Select the 'Resources' menu option from the pane on the left. 7. Press the 'Edit...' button from the pane on the right. 8. Press the 'Add Jar/Zip' button. 9. Browse to the 'project_resources\Apache_Tomcat_Test_Environment\lib'. 10. Select 'servlet.jar' and press 'OK'. (This is required to generate the EJB code. The WTE requries some properties files from the servlets.jar file.) 11. Press the 'OK' button to commit the resource changes. The Persistent Name Server and EJB server can then be started to access EJBs. Servlets can now be accessed using the Apache Tomcat Test Environment Note that this procedure is also covered in the IBM Redbook by Bill Moore, et.al., " Migrating WebLogic Applications to WebSphere Advanced Edition", SG24-5956, available from http://www.redbooks.ibm.com.. Once you have verified that Tomcat is successfully installed and that you can serve pages from http://localhost:8080, then you are ready to proceed with the Struts installation. /NOTE Struts will require not only that you have a compliant servlet engine on your classpath, but that also you have a recent version of Xerxes in your classpath as well. You can either download these files from the Apache website, or you can simply install them from the VisualAge repository file that accompanies this article. Note that Xerxes cannot co-exist with the version of the IBM XML Parser for Java that ships with VisualAge for Java. You will have to remove it from the workspace as well before you import Xerxes (I often import Xalan as well). Likewise, you will need to either download and install the Struts framework from the Apache website, or load it from the accompanying repository file. The current version (1.0-beta2) seems to be more than stable enough for most uses ? there are several production sites currently using it. If you choose to load the projects from the accompanying repository file, be certain that you have loaded all of the following projects: (1) ApacheStruts 1.0-b2 (2) Xerxes 1.2.2 (3) Struts Experiments [For VADD] 1.0 Next, you will need to take the employeelist.zip file that accompanies this article and unzip it into the VAJ install root/ide/project_resource/Apache Test Environment/webapps directory. This will place the JSP, resource and XML files where Apache Tomcat expects to find them. If you make changes to these files, you should be sure to create an open edition of the Apache Test Environment project and release these files into the project ? that will ensure that you can obtain your files even in the case of a crash. For more information on using this feature, see [Sahu] or consult the VisualAge documentation. In
Re: How to display odd/even rows using iterator
I like Christine's answer better, but here's a simple solution using (ugh) a scriptlet. tr % int i = 0; % logic:iterate id="lot" name="rows" % i++; if ( i % 2 == 0) { % tr bgcolor="#EE" % } else { % tr bgcolor="#FF" % } % td { columns } /td /tr /logic:iterate What I would really like to see (before I write it myself) is code for using iterate as a pager. The hooks seem to be there. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
Re: Error in comps-tutorial.war (Struts + Components + Orion)
Yes, but I haven't tried it with Orion. [EMAIL PROTECTED] wrote: Anyone using components on top of struts? I got a problem when I tried to execute comps-tutorial.war (tutorial from components) within orion.
Re: Newbie Question - Troubles Running Struts on Tomcat
You probably * don't * want to copy anything over from Struts except for the WARs. Having the struts.jar on your classpath while running your container is problematic (since it is also loaded from the WAR). http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayQuestionAnswer/action/SetAll/project_id/2/faq_id/36/topic_id/203/question_id/776 Jim Bruno Goldberg wrote: Hi, people! I am beginning in JSPs, Tomcat and Struts now: please, be pacient. ;) What I do: Copy *.war files from struts distribuition into webapps tomcat directory Copy * from struts .\lib dir into tomcat .\lib dir Modify server.xml from tomcat to comunicate with apache. and try this:
RE: How to display odd/even rows using iterator
I'm sure I'll get to this in my project. Why not make it a read property of the bean? protected String rowColor = "#FF" ; public String getRowColor ( ) { return this.rowColor ; } public void setRowColor ( String value ) { this.rowColor = value ; } Then all you need is a way to change that value at the top of the logic:iterate block by detecting the current state with a couple logic:equal tag. Anthony -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Re: How to display odd/even rows using iterator I like Christine's answer better, but here's a simple solution using (ugh) a scriptlet. tr % int i = 0; % logic:iterate id="lot" name="rows" % i++; if ( i % 2 == 0) { % tr bgcolor="#EE" % } else { % tr bgcolor="#FF" % } % td { columns } /td /tr /logic:iterate What I would really like to see (before I write it myself) is code for using iterate as a pager. The hooks seem to be there. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/
PAGE LINKING
Is there any simple example that shows how i can link page from one page to another page. e.g. I have one jsp that shows user list USER IDUSE NAMELOCATION PHONE === == == 1TAHIR IQBAL TORONTO 416-246-7831 edit / delete 2CRISTINA ZANG NEW YORK 915-575-2356 edit / delete I want when i click on edit the control should goes to editUser.jsp and populate all the fields with the information. I look at strut mailing example but that is to compleated for me to understand specially Linksubscription / Linkuser tags. Anyone can have good idea how i can accomplish this with simplest solution. Thanks, TAHIR IQBAL
Re: How to run Struts in VAJ
I agree that VAJ 3.5.3 will be released next week -- in fact I'm working with an IBM internal beta now. It should work with Struts, however, that does not necessarily mean it will work with Struts :) I'm going to remain commentless until I prove that it works. I'm working on moving Struts over to VAJ 3.5.3 now... Kyle Brown BTW, It has been pointed out that the part I had not validated (the WTE/EJB instructions I reveived from another source) conflicts with the instruction to replace the IBM XML Parser with Xerces. If you do that, EJB's (actually the Persistent Naming Service) do not work. We think there is a way around this that we're working on now... "Bazoud Olivier" [EMAIL PROTECTED] on 04/18/2001 04:07:10 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: How to run Struts in VAJ VAJ 3.5.3 will be released next week. http://www7.software.ibm.com/vad.nsf/data/document4541 And WTE will implement Servlet 2.2 and JSP 1.1, so it will work with Struts. - Original Message - From: "Kyle Brown" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 3:08 PM Subject: Re: How to run Struts in VAJ If you mean VAJ 3.5.2 (3.5.3 has NOT been released yet) then the following instructions should work. This is from an upcoming article on this subject that I'm going to submit to the VisualAge developer domain website. Warning! This is a work in progress -- in particular I have NOT validated that EJB's work as advertised... Also, I obviously haven't attached my application -- you'll have to wait on the article for that. Finally, PLEASE do not post this to other websites! Keep this on the mailing list only. However, I do welcome comments on the instructions. Using Struts in VisualAge for Java 3.5.2 Since one of the requirements for using Struts is a JSP 1.1/Servlet 2.2 compliant Servlet engine, if you want to use Struts in VisualAge for Java 3.5.2 you must use the Apache Test Environment. This can be downloaded for free from VADD at http://www7.software.ibm.com/vad.nsf/Data/Document4290?OpenDocumentp=1BCT = 3Footer=1 (note that you must register for VADD (free) to obtain this download). After running the Apache Tomcat Test Environment installation program, you must load the Apache Test Environment Feature using the FileQuick Start dialog. NOTE: I have NOT validated that EJB's work after you do this. That's on my to-do list for today Note that it is not possible to have both the WebSphere Test Environment's servlet engine and the Apache Test Environment co-reside in the same VisualAge workspace. The following set of instructions (provided by Sean Sundberg from the IBM WebSphere Services group) detail how to allow both EJB development using the WebSphere Test Environment and Servlet/JSP development using the Apache Test Environment: 1. Start from a workspace that does not contain the Apache Tomcat Test Environment. 2. Add the 'Websphere Test Environment' feature. 3. Delete the 'Servlet API' project from the workspace. 4. Add the 'Apache Tomcat Test Environement' feature. 5. Select 'Options...' from the 'Window' menu. 6. Select the 'Resources' menu option from the pane on the left. 7. Press the 'Edit...' button from the pane on the right. 8. Press the 'Add Jar/Zip' button. 9. Browse to the 'project_resources\Apache_Tomcat_Test_Environment\lib'. 10. Select 'servlet.jar' and press 'OK'. (This is required to generate the EJB code. The WTE requries some properties files from the servlets.jar file.) 11. Press the 'OK' button to commit the resource changes. The Persistent Name Server and EJB server can then be started to access EJBs. Servlets can now be accessed using the Apache Tomcat Test Environment Note that this procedure is also covered in the IBM Redbook by Bill Moore, et.al., " Migrating WebLogic Applications to WebSphere Advanced Edition", SG24-5956, available from http://www.redbooks.ibm.com.. Once you have verified that Tomcat is successfully installed and that you can serve pages from http://localhost:8080, then you are ready to proceed with the Struts installation. /NOTE Struts will require not only that you have a compliant servlet engine on your classpath, but that also you have a recent version of Xerxes in your classpath as well. You can either download these files from the Apache website, or you can simply install them from the VisualAge repository file that accompanies this article. Note that Xerxes cannot co-exist with the version of the IBM XML Parser for Java that ships with VisualAge for Java. You will have to remove it from the workspace as well before you import Xerxes (I often import Xalan as well). Likewise, you will need to either download and install the Struts framework from the Apache website, or load it from the accompanying repository file. The current version (1.0-beta2) seems to be more than stable enough for most uses ? there are several production sites currently using it. If
RE: How to display odd/even rows using iterator
Although I don't like to place Java code in my JSP pages, this is how I accomplished this: strutlogic:iterate id="row" name="list" % if(index%2==0) { % TR class="rowoff" % } else { % TR class="rowon" % } % index++; /strutlogic:iterate --- Anthony Martin [EMAIL PROTECTED] wrote: I'm sure I'll get to this in my project. Why not make it a read property of the bean? protected String rowColor = "#FF" ; public String getRowColor ( ) { return this.rowColor ; } public void setRowColor ( String value ) { this.rowColor = value ; } Then all you need is a way to change that value at the top of the logic:iterate block by detecting the current state with a couple logic:equal tag. Anthony -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Re: How to display odd/even rows using iterator I like Christine's answer better, but here's a simple solution using (ugh) a scriptlet. tr % int i = 0; % logic:iterate id="lot" name="rows" % i++; if ( i % 2 == 0) { % tr bgcolor="#EE" % } else { % tr bgcolor="#FF" % } % td { columns } /td /tr /logic:iterate What I would really like to see (before I write it myself) is code for using iterate as a pager. The hooks seem to be there. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ = ~~~ Scott __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: How to run Struts in VAJ
It is true that patch 3 does not speak about change of version of XML parser or the introduction of JAXP in WTE. Maybe patch 4 :-) - Original Message - From: "Kyle Brown" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 10:55 PM Subject: Re: How to run Struts in VAJ I agree that VAJ 3.5.3 will be released next week -- in fact I'm working with an IBM internal beta now. It should work with Struts, however, that does not necessarily mean it will work with Struts :) I'm going to remain commentless until I prove that it works. I'm working on moving Struts over to VAJ 3.5.3 now... Kyle Brown BTW, It has been pointed out that the part I had not validated (the WTE/EJB instructions I reveived from another source) conflicts with the instruction to replace the IBM XML Parser with Xerces. If you do that, EJB's (actually the Persistent Naming Service) do not work. We think there is a way around this that we're working on now... "Bazoud Olivier" [EMAIL PROTECTED] on 04/18/2001 04:07:10 PM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: How to run Struts in VAJ VAJ 3.5.3 will be released next week. http://www7.software.ibm.com/vad.nsf/data/document4541 And WTE will implement Servlet 2.2 and JSP 1.1, so it will work with Struts. - Original Message - From: "Kyle Brown" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 18, 2001 3:08 PM Subject: Re: How to run Struts in VAJ If you mean VAJ 3.5.2 (3.5.3 has NOT been released yet) then the following instructions should work. This is from an upcoming article on this subject that I'm going to submit to the VisualAge developer domain website. Warning! This is a work in progress -- in particular I have NOT validated that EJB's work as advertised... Also, I obviously haven't attached my application -- you'll have to wait on the article for that. Finally, PLEASE do not post this to other websites! Keep this on the mailing list only. However, I do welcome comments on the instructions. Using Struts in VisualAge for Java 3.5.2 Since one of the requirements for using Struts is a JSP 1.1/Servlet 2.2 compliant Servlet engine, if you want to use Struts in VisualAge for Java 3.5.2 you must use the Apache Test Environment. This can be downloaded for free from VADD at http://www7.software.ibm.com/vad.nsf/Data/Document4290?OpenDocumentp=1BCT = 3Footer=1 (note that you must register for VADD (free) to obtain this download). After running the Apache Tomcat Test Environment installation program, you must load the Apache Test Environment Feature using the FileQuick Start dialog. NOTE: I have NOT validated that EJB's work after you do this. That's on my to-do list for today Note that it is not possible to have both the WebSphere Test Environment's servlet engine and the Apache Test Environment co-reside in the same VisualAge workspace. The following set of instructions (provided by Sean Sundberg from the IBM WebSphere Services group) detail how to allow both EJB development using the WebSphere Test Environment and Servlet/JSP development using the Apache Test Environment: 1. Start from a workspace that does not contain the Apache Tomcat Test Environment. 2. Add the 'Websphere Test Environment' feature. 3. Delete the 'Servlet API' project from the workspace. 4. Add the 'Apache Tomcat Test Environement' feature. 5. Select 'Options...' from the 'Window' menu. 6. Select the 'Resources' menu option from the pane on the left. 7. Press the 'Edit...' button from the pane on the right. 8. Press the 'Add Jar/Zip' button. 9. Browse to the 'project_resources\Apache_Tomcat_Test_Environment\lib'. 10. Select 'servlet.jar' and press 'OK'. (This is required to generate the EJB code. The WTE requries some properties files from the servlets.jar file.) 11. Press the 'OK' button to commit the resource changes. The Persistent Name Server and EJB server can then be started to access EJBs. Servlets can now be accessed using the Apache Tomcat Test Environment Note that this procedure is also covered in the IBM Redbook by Bill Moore, et.al., " Migrating WebLogic Applications to WebSphere Advanced Edition", SG24-5956, available from http://www.redbooks.ibm.com.. Once you have verified that Tomcat is successfully installed and that you can serve pages from http://localhost:8080, then you are ready to proceed with the Struts installation. /NOTE Struts will require not only that you have a compliant servlet engine on your classpath, but that also you have a recent version of Xerxes in your classpath as well. You can either download these files from the Apache website, or you can simply install them from the VisualAge repository file that accompanies this article. Note that Xerxes cannot co-exist with the version of the IBM XML Parser for Java that ships with VisualAge for Java. You will have to
action.xml
Hi, I am new to struts and was going thru the documentation for struts 1.0-b1. I found that action.xml file is no more necessary in version 1.0. Could anyone please clarify with this. The docuementation says that this file has been deprecated. I am confused. Thanx for the information. sampath __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: action.xml
it's now called struts-config.xml sampath kanakaraju wrote: Hi, I am new to struts and was going thru the documentation for struts 1.0-b1. I found that action.xml file is no more necessary in version 1.0. Could anyone please clarify with this. The docuementation says that this file has been deprecated. I am confused. Thanx for the information. sampath __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: action.xml
It has been replaced by struts-config.xml -Deep. Hi, I am new to struts and was going thru the documentation for struts 1.0-b1. I found that action.xml file is no more necessary in version 1.0. Could anyone please clarify with this. The docuementation says that this file has been deprecated. I am confused. Thanx for the information. sampath __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: Newbie Question - Troubles Running Struts on Tomcat
At 16:24 18/04/01 -0400, you wrote: You probably * don't * want to copy anything over from Struts except for the WARs. Having the struts.jar on your classpath while running your container is problematic (since it is also loaded from the WAR). http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayQuestionAnswer/action/SetAll/project_id/2/faq_id/36/topic_id/203/question_id/776 I try it, but doesn't work: darkness# /usr/local/tomcat/bin/startup.sh Guessing TOMCAT_HOME from tomcat.sh to /usr/local/tomcat/bin/.. Setting TOMCAT_HOME to /usr/local/tomcat/bin/.. Using classpath: /usr/local/tomcat/bin/../classes:.:/usr/local/tomcat/bin/../lib/ant.jar:/usr/local/tomcat/bin/../lib/jasper.jar:/usr/local/tomcat/bin/../lib/mysql_comp.jar:/usr/local/tomcat/bin/../lib/mysql_uncomp.jar:/usr/local/tomcat/bin/../lib/servlet.jar:/usr/local/tomcat/bin/../lib/webserver.jar:/usr/local/tomcat/bin/../lib/xml.jar darkness# Starting tomcat. Check logs/tomcat.log for error messages java.lang.NoClassDefFoundError darkness# I delete all struts.jar on structure. :((( Any idea? Thanks again. Jim Bruno Goldberg wrote: Hi, people! I am beginning in JSPs, Tomcat and Struts now: please, be pacient. ;) What I do: Copy *.war files from struts distribuition into webapps tomcat directory Copy * from struts .\lib dir into tomcat .\lib dir Modify server.xml from tomcat to comunicate with apache. and try this: CUL8R,[]s Jim Bruno Goldberg [EMAIL PROTECTED]
How to represent a table of select inputs in the ActionForm and in the corresponding HTML?
Is there a good example that I can use, to represent a table of select inputs ? I tried using a two dimensional array without much success. thanks Venkata Allamsetty
Re: How to display odd/even rows using iterator
What are you suggesting when you mention having iterate work like a pager? Do you mean having the iterate tag call a method on a bean before or after it iterates? If the interface gave the bean a handle on the environment then it could even a create a variable that could have the row color. David --- Ted Husted [EMAIL PROTECTED] wrote: I like Christine's answer better, but here's a simple solution using (ugh) a scriptlet. tr % int i = 0; % logic:iterate id="lot" name="rows" % i++; if ( i % 2 == 0) { % tr bgcolor="#EE" % } else { % tr bgcolor="#FF" % } % td { columns } /td /tr /logic:iterate What I would really like to see (before I write it myself) is code for using iterate as a pager. The hooks seem to be there. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: How to display odd/even rows using iterator
Sorry for the confusion. My aside was off-topic and not directly related to the odd/even question (though I ~would~ need to do both in the end result). I meant using iterate instead of something like http://jsptags.com/tags/navigation/pager/ David Winterfeldt wrote: What are you suggesting when you mention having iterate work like a pager? Do you mean having the iterate tag call a method on a bean before or after it iterates? If the interface gave the bean a handle on the environment then it could even a create a variable that could have the row color. David
RE: Shopping Cart Example
Hi Stanley, I was thinking of doing exactly the same. Although I am a struts newbie, I myself am dabbling with such a task. I'd like to help in any way I can. Cheers, Joseph. -Original Message- From: Stanley Tan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 18 April 2001 9:14 PM To: [EMAIL PROTECTED] Subject: Shopping Cart Example Hi all, I am building a shopping cart example using the struts framework for beginner's like myself. So far, I have a pretty simple shopping cart that connects to a database. Because I am new to this, I was wondering if any experienced programmer is willing to review my work and help me improve the example. This example will be made available for newbies to the struts framework so your help would be greatly appreciated. Thanks, Stanley Tan _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
html:form always wants form bean
Hi, I am having a strange problem. I have an action nmapping defined as action path="/viewadminconfig" type="..." forward name="success" path="/XDIViewAdminConfigForm.jsp" / /action And then in my XDIViewAdminConfigForm.jsp, I have the following : html:form onsubmit="..." action="/viewadminconfig.do" /html:form When I request this, I get the following exception : "javax.servlet.jsp.jSpException : Cannot retrieve definition for form bean null at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:708) Do I always have to associate a form bean with a form. Vimal __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: autocomplete attribute for html form tag
I think it is a good idea to have a generic attrbitue for the tag too. Do anyone has any idea when when will this feature be in Struts? Regards Eric Alastair Briggs wrote: I think it would be a good idea to have this property on all tags as this means that the system is able to cope with those demands that are needed as things change. I get quite frustrated when using systems that don't offer this sort of function as you then have to find highly creative ways to get around the restriction - which then create other problems. An idea like this puts less stress on getting release out quickly as things can then be easily extended if there is some urgency from the developer but can be included more formally in future releases. Al -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 18, 2001 11:24 AM To: [EMAIL PROTECTED] Subject: Re: autocomplete attribute for html form tag Something we could consider in the 1.1 timeframe is a generic "options" property that would just render non-standard options verbatim. So in this case we might have something like options="autocomplete=off" in the Struts tag, and then the tags would just append that to the tag properties, no questions asked. But I don't know how you would do this now, unless the property can also be changed via Java or VB script that you could call with one of the event handlers, or when the form loads. Eric Wang wrote: > > Hi, > > Just wondering has anyone manage to turn off the autocomplete feature in IE thru > Stuts form tag? > > Currently I am using the Struts html form tag to come up with the login form. > As far as I know, we can have an attribute autocomplete='off' in the normal form > tag to turn this feature off. > However, the Struts form tag does not support this attribute. > > I am not sure will this attribute will be added into the Struts form tag in any > future release of Struts? > Or anyone has done it in another way? > > Thanks in Advance. > Eric -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ --- This mail has been certified to be free of viruses Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.248 / Virus Database: 121 - Release Date: 11/04/2001
Re: Shopping Cart Example
same here. I would like to get involved in this also [EMAIL PROTECTED] wrote: Hi Stanley, I was thinking of doing exactly the same. Although I am a struts newbie, I myself am dabbling with such a task. I'd like to help in any way I can. Cheers, Joseph. -Original Message- From: Stanley Tan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 18 April 2001 9:14 PM To: [EMAIL PROTECTED] Subject: Shopping Cart Example Hi all, I am building a shopping cart example using the struts framework for beginner's like myself. So far, I have a pretty simple shopping cart that connects to a database. Because I am new to this, I was wondering if any experienced programmer is willing to review my work and help me improve the example. This example will be made available for newbies to the struts framework so your help would be greatly appreciated. Thanks, Stanley Tan _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: switching between SSL and non-SSL
Hi Ted, I did a redirect instead of forward in the perform method of Action class. String url = aMapping.findForward("somepath").getPath(); ActionForward fwd = new ActionForward( url, true ); return fwd; Regards Eric Ted Husted wrote: Any luck with this Eric? I'd like to do the same thing, a la auctions.yahoo.com Everything works if I hardcode the references, but then you end up stuck in SSL. I started a SSL FAQ, and would like to include how to do this too. http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayOneTopic/action/SetAll/project_id/2/faq_id/36/topic_id/213 -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 737-3463. -- http://www.husted.com/about/struts/ Eric Wang wrote: Hi, Has anyone done switching between SSL and non-SSL using Struts? My login page is using SSL. After successful logins, it suppose to route to a page that is non-SSL. Is there any example available for reference? Thanks in advance. Eric
i18n and performance
I have a project where internationalization was a requirement. For the most part, the page display speed is pretty fast. However, I have one page where there are several bean:message tags and html:text tags etc. This page tends to be slow when it is rendering. It is compounded if I open more than one browser and try to hit the this page. Has anyone else ran into this? Does anyone have any suggestions on methods to speed this page up? Thanks, -- Jason Smith [EMAIL PROTECTED]
Re: Actions forwarding to Actions
Forgive me for replying to myself, but I think I may have figured out what's going on: the second bean is not populated from the first bean as I mistakenly assumed -- it's populated from the request! So, just as the first bean got its name from the request parameter, the second get its name from there, too. Jim Crossley wrote: I think I found a bug or, as Larry Wall might say, it would be difficult to interpret it as a feature. :-) I have an Action that occasionally needs to forward its request to another Action. So the forward element in its corresponding action element has a path with a suffix of "do" instead of "jsp". The associated form bean classes for each action's form have a "name" property, though this is purely coincidental. They have no real relationship. Oddly enough, when Action X forwards to Action Y, the name property for Y's form bean is initialized to the name from X's form bean! Is this a bug? Thanks.
Re: Newbie - Digester/Sax Parsing Error
You have to prefix the path to your DTD with "file:" to make it a valid URL. -- Martin Cooper - Original Message - From: "Trevor Griffiths" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 03, 2001 9:26 AM Subject: Newbie - Digester/Sax Parsing Error Hi, I'm doing some simple tests and set up with Digester to get familiar with it before starting in for real. The following xml produces a java.net.MalformedURLException error when digester.parse attempts to parse it. ?xml version="1.0" encoding="ISO-8859-1"? !DOCTYPE request SYSTEM "C:\Documents and Settings\tgriffiths\Desktop\DigesterTest\digesterTest.dtd" request fruitorange/fruit vegcarrot/veg /request I've tried it with and without the DOCTYPE definition. I have digestor.setValidating(false). I haven't used digester.register. Any suggestions, corrections, etc. Thanks Trev...
Re: What is 'text' field for in html:option?
There isn't a 'text' attribute for the html:option tag. If it is referenced somewhere, that would be a documentation bug - please let us know where you are seeing this. The documentation says: "The text displayed to the user comes from either the body of this tag, or from a message string looked up based on the 'bundle', 'locale', and 'key' attributes." -- Martin Cooper - Original Message - From: "Shamdasani Nimmi-ANS004" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 03, 2001 7:08 PM Subject: What is 'text' field for in html:option? The struts document says that 'text' field is for: The message text to be displayed to the user for this tag (if any) I tried to use the tag but it gives me error:"Attribute text invalid according to the specified TLD" This is how I used the tag: html:option value="USER" text="User"/html:option Is my understanding of 'text' field wrong? -Nimmi
Best practices
What issues are there if i give access to all the jsp pages in an application only through the action servlet? Is this a good practise to follow? Is there any collection of struts best practices somewhere? TIA. Ajit
input and output form in Action
Newbie question. Is the form parameter in the perform method meant to be used both for input values and output values (from the Action)? If not how do I specify the output form? :-)
Re: Iterating through a hashtable of objects
You don't need the import, or the scriptlet, or the 'type' attribute in the logic:iterate tag, and you should be able to use the 'name' and 'property' attributes instead of the 'collection' attribute with a scriptlet. That is, given what you said about your 'floorplan' object, the following should be all you need: logic:iterate name="floorplan" property="hotSpots" id="hotspot" The top is bean:write name="hotspot" property="top" / The width is bean:write name="hotspot" property="width" / The height is bean:write name="hotspot" property="height" / The left is bean:write name="hotspot" property="left" / /logic:iterate Hope this helps. -- Martin Cooper - Original Message - From: "Narasimhan, Shyamala" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 05, 2001 7:02 AM Subject: Iterating through a hashtable of objects Hi I am trying to iterate through the values of a Hashtable hotspots... below is the code that i am using to do this. I have floorplan in session scope and floorplan.getHotSpots() returns the hot spots. I know that i need to have HotSpotInfo bean in page scope but i am not sure that i am doing it right. kindly tell me what my mistake is. thanks in advance %@page import="com.data.HotSpotInfo" % . % { /// this is just a place holder in order to set hotspot in page scope. this is not the actual value in iteration...i know that this is not the right way to do it. HotSpotInfo hotspot = new HotSpotInfo(2, 400, 400, 30, 70, "green",""); pageContext.setAttribute("hotspot", hotspot, PageContext.PAGE_SCOPE); } % . logic:iterate collection="%= floorplan.getHotSpots() %" id="hotspot" type="com.data.HotSpotInfo" The top is bean:write name="hotspot" property="top" / The width is bean:write name="hotspot" property="width" / The height is bean:write name="hotspot" property="height" / The left is bean:write name="hotspot" property="left" / /logic:iterate i find that it doesnt iterate thro the collection and only prints the single value i created earlier in the page.