Making peace between Struts logic iterate and Ed Hill's display tag...
Last month a fellow by the name of Rick Ruemann [[EMAIL PROTECTED]] posted a reply to an email inquiry of mine, turning me on to Ed Hill's marvelous display tag library (Hi Rick!). It turns out that Ed's web site URL is actually http://edhill.its.uiowa.edu/display-0.8/ (implying that Ed might have even a newer version of the tag library now, but I digress...) : From: Rick Reumann [[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 8:02 PM To: Struts Users Mailing List Subject: Re: Ideas for doing a spreadsheet-styled tables using Struts tags On Thursday, October 10, 2002, 7:55:21 PM, David wrote: DM I am currently looking for ideas on ways to display potentially DM large amounts of data in a spreadsheet format using Struts. Check out using this display tag: http://edhill.its.uiowa.edu/display/ I couldn't live without it:) (Even will provide a link that you can click on to export the display to Excel). Excellent tag. -- Rick mailto:maillist;reumann.net Since then, with Rick's help (and Rick deserves a lot of credit for figuring out how to use this display tag library by the way), I have managed to implement the display tag in my Struts based application and it seems to work just fine. The problem? My code is ugly as sin! It's so bad, that after glancing over my shoulder the other day, one of my best friends at work (Hi Russ!) has already warned me that it will undoubtedly fail the upcoming code review. He's got a point too - it is Coyote Ugly Code! The reason is that neither Rick nor I have figured out a way to make Ed Hill's display tag live peacefully with Struts logic iterate tags. As a result, I have JSP code which looks something like the following : % FooBarBean FooBarBean = (FooBarBean)request.getAttribute(FooBarBean.LOOKUP_KEY); % display:table name=FooBarBean property=fundList cellspacing=1 cellpadding=0 border=0 width=569 styleClass=DataTableBorder scope=request !-- display : table name=FooBarBean cellpadding=4 property=fundList width=550 scope=request -- trtd class=FooBarTableTitle height=20nbsp;Beautiful Looking Spreadsheet in the Broswer Brought to you by Hideously Ugly Looking Code/td/tr display:setProperty name=basic.show.header value=true / display:column property=fundCode align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=FooBar Code / % if (FooBarBean.isExistingColumn(0)) { % display:column property=stuff01 align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=Stuff 01 / % } if (FooBarBean.isExistingColumn(1)) { % display:column property=stuff02 align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=Stuff 02 / % } if (FooBarBean.isExistingColumn(2)) { % display:column property=stuff03 align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=Stuff 03 / ...etc., etc... % } if (FooBarBean.isExistingColumn(29)) { % display:column property=stuff30 align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=Stuff 30 / % } % display:column property=fundTotal align=right styleClass=FooBarStyle headerStyleClass=FooBarDataHeader title=FooBar Total / /display:table ... and Java code to support this which is simply to hideous looking to post in front of a family audience... (Russ happened to catch me desparately trying to prettify the most hideous looking class of the bunch! There are some things which simply no combination of comments can help :-). So please, just shoot me already! Either that, or help me with this agonizing problem which is causing me to lose sleep (normally I sleep late on Saturday mornings if I stay up late the night before). Of course, it doesn't help that in this case, I have variable columns which may or may not appear (causing the need for the additional if (FooBarBean.isExistingColumn(x)) scriptlet code. Even without that problem though, it seems that I would still end up having to in line my display columns with silly looking class properties like stuff00, stuff01, stuff02, etc., all the way to stuff29 for each of my 30 possible data columns when I would normally write a much sexier loop through an array (or even sexier - a collection) - all because Struts logic:iterate tags don't seem to want to play with the display:column tags! We have tried asking Ed Hill about this problem, but Ed has been pretty busy lately (either that, or it is entirely possible that our emails to him at his email address posted on his web site are being lost in mountains of junk mail - which is the problem I am faced with on one of my more well known web site email accounts - making useful correspondence with me almost impossible to that email address). Ed, are you still with us? Anyway, as my code review approaches, I thought I'd try one last time to spare this otherwise extremely powerful display tag library from the hungry jaws of the code reviewers at work. Of course, I could just rip out the display
RE: Any Web Development Environments that incorporate Struts?
Out of curiosity, what version of Together are you using? I've seen the product, but the version that was demo'd for us a while back was way to expensive for a small shop like ours to afford. I am still using version 6.0+ (build 1762) of Together, which I got hooked on earlier this summer. There are likely newer versions available with even better features, but I haven't yet found any real need to upgrade. Prior to that, I was using version 5, which was also excellent, but version 6 had some major improvements to the Editor, and made J2EE development a breeze. I must admit that you are correct on the price, but sometimes you get what you pay for. -dav0 -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Ideas for doing a spreadsheet-styled tables using Struts tags
I am currently looking for ideas on ways to display potentially large amounts of data in a spreadsheet format using Struts. The form is a fairly simple maximum 30 column by maximum 5000 or so row table, which needs to be dynamically filled with data. Most usages would probably fall into the 8 by 30 range, but I need to plan for more in unusual cases. The array is only sparsely filled with data, so I currently plan to send an ArrayList of ArrayLists for the row by column data: where each row would have a list of column instances which skip over unused instances (if data for a given cell doesn't exist, then I plant a 0 for the data in that cell and move on). Another twist to this is that if a column doesn't exist at all in the spreadsheet, I am supposed to collapse the column altogether and not display it to save screen space. A typical (small) display might look like this: Xname Ynamex1 x2 x5 x6 x15 x24 Total foo1 00 10 002030 foo2 12 500 20 037 foo60 15 10 20 0 035 Anyway, I figured I'd probably use one logic:iterate tag to iterate over each row, and another one to iterate over each row's column, and that I'd proceed to dump all of this data one cell at a time (or not - for those cells which are skipped). The fact that I need to check each column item to see whether it is skipping, as well as the fact that not all columns might even be displayed means that there will potentially be a fair amount of additional [undesirable] scriptlet code I will need to explain away at my code review. It just seems like this is such a common thing to have to do that before I go reinventing another wheel, I thought I ought to at least check to see it there might be a more standardized way of doing this? Thanks Dave McLure -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Developing Struts Apps using Together Control Center
I have updated the information on developing Struts-based J2EE web applications in Together Control Center, which was originally provided by James Banks at TogetherSoft Inc. In addition to a couple of bug fixes, the latest version of this web-based tutorial includes a key workaround needed when deploying to the bundled Tomcat on TCC 6+ (build 1762). The information can be accessed at the following home page : http://www.mclures.net. Either click on Struts Info from the above mentioned home page, or type in the full URL directly : http://www.mclures.net/java/struts/Together/Getting_Started_with_Struts_and_Together.html Enjoy! David McLure Principle Consultant Software Engineer/ Developer Fidelity Investments -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts and Together CC
Has anyone try to deploy a struts app on Together CC 6.0 with struts plugin? When doing it, my ApplicationResource.properties file does not get place in the WAR file. any ideas? thanks in advanced. -gus Not sure which plugin you are referring to, but I've been using Together 6.+ (build 1762) to develop my Struts apps all summer with no problems. The only trick I've found is that you need to completely remove the old Struts webapp prior to redeploying each time (I have a little script I run to do this as a part of my development cycle). The trick is getting your app set up the first time. I learned this by following the instructions provided by James Banks, a TogetherSoft support tech. I have posted these instructions (along with a few minor modifications and bug fixes, etc.) here for convenience. Enjoy! Dave McLure Fidelity Investments -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts and Together CC
I wanted to make sure I properly posted the link to these instructions (my web link may not have worked previously) : http://www.mclures.net/java/struts/Together/index.html David McLure wrote: Has anyone try to deploy a struts app on Together CC 6.0 with struts plugin? When doing it, my ApplicationResource.properties file does not get place in the WAR file. any ideas? thanks in advanced. -gus Not sure which plugin you are referring to, but I've been using Together 6.+ (build 1762) to develop my Struts apps all summer with no problems. The only trick I've found is that you need to completely remove the old Struts webapp prior to redeploying each time (I have a little script I run to do this as a part of my development cycle). The trick is getting your app set up the first time. I learned this by following the instructions provided by James Banks, a TogetherSoft support tech. I have posted these instructions (along with a few minor modifications and bug fixes, etc.) here for convenience. Enjoy! Dave McLure Fidelity Investments -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Beta 03 Build Problem
Any idea why I am consistently getting an org.apache.tools.ant.taskdefs.optional.TraXLiason ClassNotFoundException when trying an ant dist build of jakarta-struts-1.0-b3-src using Ant 1.3 on both NT and Linux? I have what seem to be the only required jars in my path: xalan.jar and jaxp.jar from jaxp-1_1.zip, and jdbc2_0-stdext.jar, with jdk1.3.1? Thanks David McLure __ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/ Script started on Thu Jun 7 23:01:33 2001 May need to do the following... /sbin/route add default gw 192.168.1.1 [root@skye jakarta-struts-1.0-b3-src]# env|grep PATH CLASSPATH=.:/home/jak/jdbc2_0-stdext.jar:/home/jak/jaxp-1.1/xalan.jar:/home/jak/jaxp-1.1/jaxp.jar PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/ant/bin [root@skye jakarta-struts-1.0-b3-src]# ant dist Buildfile: build.xml init: [echo] - jakarta-struts 1.0-b1 - [echo] [echo] java.class.path = .:/home/jak/jdbc2_0-stdext.jar:/home/jak/jaxp-1.1/xalan.jar:/home/jak/jaxp-1.1/jaxp.jar::/usr/local/ant/lib/ant.jar:/usr/local/ant/lib/jaxp.jar:/usr/local/ant/lib/parser.jar:/usr/java/jdk1.3.1/lib/tools.jar [echo] java.home = /usr/java/jdk1.3.1/jre [echo] user.home = /root prepare.dist: prepare.library: compile.library: [style] Transforming into /home/jak/jakarta-struts-1.0-b3-src/target/library BUILD FAILED /home/jak/jakarta-struts-1.0-b3-src/build.xml:188: java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison --- Nested Exception --- java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at org.apache.tools.ant.taskdefs.XSLTProcess.setProcessor(XSLTProcess.java:229) at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:137) at org.apache.tools.ant.Target.execute(Target.java:153) at org.apache.tools.ant.Project.runTarget(Project.java:898) at org.apache.tools.ant.Project.executeTarget(Project.java:536) at org.apache.tools.ant.Project.executeTargets(Project.java:510) at org.apache.tools.ant.Main.runBuild(Main.java:421) at org.apache.tools.ant.Main.main(Main.java:149) Total time: 8 seconds [root@skye jakarta-struts-1.0-b3-src]# ls [00m[00mINSTALL[00m [00mWhoWeAre[00m [00mbuild-webapps.xml[00m [01;32mbuild.xml[00m* [01;34mdoc[00m/ [01;34mweb[00m/ [00mLICENSE[00m [00mbuild-tests.xml[00m [00mbuild.properties[00m [01;34mconf[00m/ [01;34msrc[00m/ [00mREADME[00m [00mbuild-webapp.xml[00m [00mbuild.properties.sample[00m [01;34mdist[00m/ [01;34mtarget[00m/ [m[root@skye jakarta-struts-1.0-b3-src]# c exit exit Script done on Thu Jun 7 23:02:19 2001 build.properties