Re: [Velocity Tools] - Struts
Day, Michael-IBM/TT wrote: I am attempting to use velocity tools 0.9 with struts 1.1-b2 and velocity 1.3. Does anyone know how I could use a VM template for layout purposes, instead of doing #include for headers/footers/menus on each content page? For example, the login page may have a layout different from a product display page. I'd like to define this separate from the content. In the Struts/JSP world there is Tiles. Tiles is a JSP Taglib and could be described as a templating system or document assembler. You might be able to get some ideas from it for use in Velocity. It seems quite popular and successful within the Struts community. http://jakarta.apache.org/struts/userGuide/dev_tiles.html I also liked the article UI design with Tiles and Struts at http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html It's JSP-focused and therefore not directly applicable to Velocity, but it nicely present the various concepts to eliminate redudancy in web pages by using templates. It would be really great to have something like Tiles for Velocity. That would be a cool contribution... Gabe -- -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
EBJ Alternatives?
A couple weeks ago there has been an intense discussion on this list about the use of EJB. Many people were quite critical or at least cautious about EJB. I'd appreciate if some of you could share what alternative component architectures/frameworks you are using. I'm now starting on a new web project where distribution and transactions, two of EJB's main feature, are no requirements. The application is a web-based collaborative system with a rather complex application logic but little database involvement. There will be clients using HTML/HTTP and other using a SOAP- like protocol. I am planning on using Struts for the Web-tier and am looking for a component framework to implement the business logic/data tier. If feel that EJBs wouldn't be the right technology for this but am wondering what alternatives are. The things I would like to see in such a component framework are: - component life cycle support - support for component relationships - component naming and lookup - authorization mechanism - web request dispatching - subscription/notification service - logging - configuration - persistence - some modularization concept - some error handling concept How are you implementing this? Any framework you can recommend? Thanks for sharing! Gabe -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts Community Opportunity
Emaho, Ghoot wrote: Gabriel I see it's built on TWiki. Chiki has many similarities to Twiki re functionality. Obviously it's written in Java using Struts (not perl). Have you taken a look at Chiki ? I'd be interested in any feedback you might have. The current release has everything you listed (except version control which is in the next release) and more. As an experienced Wiki user I'd appreciate your feedback. Your site is a good example of how these things can be used. A Community site (using Chiki) for Struts would be a great resource. Of course it doesnt have to be Chiki (there are many Wiki's out there) but it'd be good to use something that's built on Struts. Looking forward to your feedback Ghoot, Looking into Chiki is on my to do list. I just didn't get around to do it yet (have browsed your site extensively but not looked at the implementation) In any case, for a Struts forum I think it would be nice to use Struts technolgoy even if Chiki misses some features of other Wikis at the moment. I'm sure this will change soon :-) As you might know, I am working on the Struts/Velocity integration. My personal interest in Chiki is to find out how easily it could be turned into a show case for Struts/Velocity. In any case, I'll report back once I have had a chance to spend some more time with Chiki. I certainly would voluteer to help with setting up and maintaining a Chiki-based Struts Know How forum. My experience is that like a nice garden, such a forum needs a few gardeners that are devoted to its well being. Gabe -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts Community Opportunity
keithBacon wrote: likewise - great idea, not that I know what Chiki is. I like the idea of an updateable repository of knowledge. The problem with the mail archive is that a small % of it is valuable but it is lost amidst the clutter (ie. amongst my ramblings). Hopefully you'll have a demo availble soon? Here's a Wiki demo: I just recently started to setup a semi-public Wiki site to collect resources related to web application technologies. It's a work in progress but should be enough to give you a good idea of what this Wiki stuff is. Note the following details: - Every page has an Edit button. Everyone can edit/contribute. This is a certain risk but experience shows that it works well in most communities. Try it, looks at the content, add something useful. :-) - Every Wiki word establishes automatically a topic, i.e. a sub-page. Wiki words are words smashed togehter like a AnExampleWikiWord. - A very simple markup language is used to edit the content. It takes you five minutes to learn it. - There is a build-in search feature. - You can track changes and revert to any ealier version (CVS like) http://www.teamup.com/webdev/ I've been useing Wiki for a long time, mostly company-internal, to maintain shared knowledge. I has been very useful. I support very much the idea of setting up a Wiki based Struts community tool. Note that my site uses a Perl-based Wiki. We should of course use the Struts-based Chiki for this. Gabe -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Velocity-Tools / Struts
Will Spies/Towers Perrin wrote: That's great! But how about the other way? Can I post an array in velcity up to a struts form ( via a controller ) which contains an array? Sorry, I don't get what you mean here. Can you elaborate/make an example? Gabe ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Gabriel Sidler cc: (bcc: Will Spies/Towers Perrin) sidler@teamup Subject: Re: Velocity-Tools / Struts .ch 01/21/02 04:37 PM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: It would be real helpful if this example include posting an array. Is this even doable with velstruts? You mean like creating HTML output from the content of an array? That's quite simple. Assuming you have a 'user' object with 'orders' associated with the session, the template might look like this: table #foreach ($order in $session.user.orders) tr td$order.nbr/td td$order.text/td td$order.amount/td /tr #end /table ...would create a table of all orders. Were are going to add more doc and examples. For now you find more info on the Velocity home page at jakarta.apache.org/velocity/ Gabe ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Ted Husted cc: (bcc: Will Spies/Towers Perrin) husted@apache Subject: Velocity-Tools / Struts .org 01/18/02 09:46 AM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? It hasn't made it into the release yet, but the code is already working and seems mature. It's just a matter of making the Struts elements available as standard objects that Velocity can see. Really ~very~ cool. You can download the sample application WAR here. Very much worth a look. http://husted.com/struts/resources/velstruts.zip I'll be working on adding more documentation for this, and other contributions like the Commons-Validator and Tiles to the Struts User Guide. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Velocity-Tools / Struts
Will Spies/Towers Perrin wrote: I mean your example *displays* an array. Let's say I change your example and instead of displaying an array I want to *edit* all elements in the array and post the results up to struts. Here is a JSP struts example of what we do: Velocity is a view technology like JSP, so you would use it in the exact same way you currently use your JSP templates. With Velocity your example would like this: form name=form1 action=/app/saveEmployment.act table align=center border=3 borderColor=#ff borderColorDark=#00 borderColorLight=#ff frame=void height=390 rules=rows style=HEIGHT: 190px; LEFT: 0px; TOP: 10px; WIDTH: 700px width=700 tr th align=left Employee Id /td td align=left Client Id /td td align=left Work Zip Code /td td align=left Mail code /td td align=left Delete /td /tr #set ($empForm = $employmentForm) !-- Velocity finds the variable automatically in the requests attributes --! #foreach ($row in $empForm.data.rows) #set ($i = 0) tr td align=left input type=text name=data.rows$i.empEmployeeId maxlength=10 size=10/ value=$row.empEmployeeId /td td align=left input type=text name=data.rows$i.cltClientId maxlength=10 size=10/ value=$row.cltClientId /td td align=left input type=text name=data.rows$i.workZipcode maxlength=10 size=10/ value=$row.workZipcode /td td align=left input type=text name=data.rows$i.mailcode maxlength=10 size=25/ value=$row.mailcode /td td align=left input type=checkbox name=markedForDelete$i /td /tr #set ($i = $i + 1) #end tr td align=left /td td align=left /td td align=left /td td align=left /td td align=left /td /tr /table table align=center td align=right input type=submit value=$html.message(button.save)/ /td td align=left input type=reset value=$html.message(button.reset)/ nbsp; input type=submit value=$html.message(button.cancel)/ /td /table /form On the Struts side nothing changes. When the form is submitted, it is processed the same way as today. The advantages are: - simpler syntax, easier to learn than JSP - stricter separation of the designer's and the developer's work. Gabe html:form action=/app/saveEmployment.act table align=center border=3 borderColor=#ff borderColorDark=#00 borderColorLight=#ff frame=void height=390 rules=rows style=HEIGHT: 190px; LEFT: 0px; TOP: 10px; WIDTH: 700px width=700 tr th align=left Employee Id /td td align=left Client Id /td td align=left Work Zip Code /td td align=left Mail code /td td align=left Delete /td /tr %EmploymentForm empForm=(EmploymentForm)request.getAttribute (employmentForm);% %for (int i=0; i empForm.getData().getRows().length;i++) {% tr td align=left input type=text name=data.rows[%=i%].empEmployeeId maxlength=10 size=10/ value=%=empForm.getData().getRows ()[i].getEmpEmployeeId()% /td td align=left input type=text name=data.rows[%=i%].cltClientId maxlength=10 size=10/ value=%=empForm.getData().getRows()[i].getCltClientId()% /td td align=left input type=text name=data.rows[%=i%].workZipcode maxlength=10 size=10/ value=%=empForm.getData().getRows()[i].getWorkZipcode()% /td td align=left input type=text name=data.rows[%=i%].mailcode maxlength=10 size=25/ value=%=empForm.getData().getRows()[i].getMailcode()% /td td align=left input type=checkbox name=markedForDelete[%=i%] /td /tr %}% tr td align=left /td td align=left /td td align=left /td td align=left /td td align=left /td /tr /table table align=center td align=right html:submit bean:message key=button.save/ /html:submit /td td align=left html:reset bean:message key=button.reset/ /html:reset nbsp; html:cancel bean:message key=button.cancel/ /html:cancel /td /table /html:form We go outside the struts tags here because in the 1.0 version the iterate tag does not do this properly ( but the struts engine does ). Note in the above how elements are generated as index ( [n] ) elements. The ActionForm's would contain indexed properties in order for this to work. What would the velocity equivalent of the above look like? ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Velocity-Tools / Struts
Will Spies/Towers Perrin wrote: It would be real helpful if this example include posting an array. Is this even doable with velstruts? You mean like creating HTML output from the content of an array? That's quite simple. Assuming you have a 'user' object with 'orders' associated with the session, the template might look like this: table #foreach ($order in $session.user.orders) tr td$order.nbr/td td$order.text/td td$order.amount/td /tr #end /table ...would create a table of all orders. Were are going to add more doc and examples. For now you find more info on the Velocity home page at jakarta.apache.org/velocity/ Gabe ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Ted Husted cc: (bcc: Will Spies/Towers Perrin) husted@apache Subject: Velocity-Tools / Struts .org 01/18/02 09:46 AM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? It hasn't made it into the release yet, but the code is already working and seems mature. It's just a matter of making the Struts elements available as standard objects that Velocity can see. Really ~very~ cool. You can download the sample application WAR here. Very much worth a look. http://husted.com/struts/resources/velstruts.zip I'll be working on adding more documentation for this, and other contributions like the Commons-Validator and Tiles to the Struts User Guide. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Velocity-Tools / Struts
Will, this is great feedback. Thanks a lot for hunting this down! I will make sure that the necessary changes are made to Velocity. You may want to pass this info to the Web Logic people. I believe the previous names should work. They do with all app servers I know. Gabe Will Spies/Towers Perrin wrote: On a hunch, I change the following JARs from velocity-tools-struts0.1.jar velocity-tools-view-0.3.jar velocity-1.3.dev.jar to velocity-tools-struts0-1.jar velocity-tools-view-0-3.jar velocity-1-3-dev.jar and it deployed. WebLogic must look for *.jar The other dots messed up it's scan. Re: Velocity-Tools / Struts From: Gabriel Sidler Subject: Re: Velocity-Tools / Struts Date: Sat, 19 Jan 2002 04:37:09 -0800 Will, I just downloaded the .war as well and tested it on a Tomcat 4.01 installation. Everything works flawlessly. The class that it's complaining about is included in WEB-INF/lib/velocity-tools-view-0.3.jar What is special about WebLogic 6.1SP2 that it cannot find this class? Would it find the class if it's not contained in a jar? Maybe try to unwrap velocity-tools-view-0.3.jar below WEB-INF/classes/ If anything about web development is difficult then it's these deployment issues... Gabe Will Spies/Towers Perrin wrote: I did a quick deployment of your war and got this message from WebLogic 6.1SP2 [WebAppServletContext(7817190,velstruts,/velstruts)] Error loading servlet: velocity java.lang.ClassNotFoundException: org.apache.velocity.tools.view.servlet.VelocityViewServlet at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:65) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:583) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:2221) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:2165) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:892) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:815) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:428) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:163) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209) at $Proxy37.addWebDeployment(Unknown Source) at ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Ted Husted cc: (bcc: Will Spies/Towers Perrin) husted@apache Subject: Velocity-Tools / Struts .org 01/18/02 09:46 AM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? It hasn't made it into the release yet, but the code is already working and seems mature. It's just a matter of making the Struts elements available as standard objects that Velocity can
Re: Velocity-Tools / Struts
Will, I just downloaded the .war as well and tested it on a Tomcat 4.01 installation. Everything works flawlessly. The class that it's complaining about is included in WEB-INF/lib/velocity-tools-view-0.3.jar What is special about WebLogic 6.1SP2 that it cannot find this class? Would it find the class if it's not contained in a jar? Maybe try to unwrap velocity-tools-view-0.3.jar below WEB-INF/classes/ If anything about web development is difficult then it's these deployment issues... Gabe Will Spies/Towers Perrin wrote: I did a quick deployment of your war and got this message from WebLogic 6.1SP2 [WebAppServletContext(7817190,velstruts,/velstruts)] Error loading servlet: velocity java.lang.ClassNotFoundException: org.apache.velocity.tools.view.servlet.VelocityViewServlet at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:65) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:583) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:2221) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:2165) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:892) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:815) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:428) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:163) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209) at $Proxy37.addWebDeployment(Unknown Source) at ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Ted Husted cc: (bcc: Will Spies/Towers Perrin) husted@apache Subject: Velocity-Tools / Struts .org 01/18/02 09:46 AM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? It hasn't made it into the release yet, but the code is already working and seems mature. It's just a matter of making the Struts elements available as standard objects that Velocity can see. Really ~very~ cool. You can download the sample application WAR here. Very much worth a look. http://husted.com/struts/resources/velstruts.zip I'll be working on adding more documentation for this, and other contributions like the Commons-Validator and Tiles to the Struts User Guide. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Grid
Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? Yes, it is currently in development. There is no release yet. The Velocity home page has a little more info about it http://jakarta.apache.org/velocity Gabe -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Netscape 4.7x slow with Tomcat/Struts combination!
I notice this slow performance of Netscape too, but only if Netscape and Tomcat run on the same machine (typically during development). If they run on different machines I don't see any Netscape performance problems. Do you observe the same? Gabe Struts Newsgroup (@Basebeans.com) wrote: Subject: Netscape 4.7x slow with Tomcat/Struts combination! From: [EMAIL PROTECTED] (Dalibor42) === Why is Netscape so slow when submiting to Struts running with Tomcat? Netscape 4.7x version are in question. IE is very quick but NN is few times slower. Does anyone know why? It there a way to make it faster? -- e-mail: [EMAIL PROTECTED] emajl : [EMAIL PROTECTED] ICQ # : 129068041 phone : 1ABACA@098 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Reusable/composable Struts components?
Gary, Ted, I have a very similar need. I have Struts application components that I'd like to reuse/share with others (e.g. user profile manager, adminisration tools, login, dynamic toolbar, calendar etc.) A reusable component typically consists of: - several Action classes - several ActionForm classes - several JSPs - other classes - other resources, for example, property files - some configuration code in struts-config.xml Gary, in your post you address the issue of control flow. I see some more issues: How can I package such a reusable component, transport it and make it easy for others to add it to their application? - What is a suitable file structure? - Upon installation: How is the configuration of the reusable component merged with the configuration of the main application? - How do I document such a reusable component. I think it would be a big plus for Struts to support such a concept of reusable components. Being able to easily exchange application components would give the community a boost. Has anything like this been considered, discussed, implemented? Do others agree that it would be useful? Any ideas on a good way to approach this? Gabe Sidler Software Consulting, Eivycom GmbH, Zurich, Switzerland Gary Johnston wrote: Thanks for your response, Ted. Yes, I see that inheritance can be used to capture the common code to validate the user's login status and branch (goto) accordingly. But I'm thinking of reuse in terms of components at a higher level than classes and inheritance. I'd like to be able to reuse the whole login *sequence* (which is probably at least 1 JSP, which has the userid/password fields, and a subsequent action, which validates the userid/password). Other subsequences I might like to define and use might be much more extensive. I'd like to be able to invoke a subsequence such that when it completes the application picks up just after where it was when the subsequence was invoked. Semantically, I'd like to be able to call a subsequence, rather than simply doing a goto to its first element (page, action). The problem is that forwards are, essentially, gotos. What I really want is some general mechanism that gives me the ability to call a subsequence such that when it completes (returns) my application continues on from right after where I invoked it. Using your example code, let's say I've built a subclass that displays the user's bank account balance. If the user were already logged on then the subclass would, presumably, retrieve the user's account balance and return a forward to a JSP that would display it. If the user were *not* logged on, however, then a forward to the logon page is returned. But because this is just a goto, my subclass action has no way to specify that control should return to it after the logon subsequence completes. Put another way, when coding the last action of my logon subsequence, there's no way to specify a return. I have to return a forward that, again, is essentially a goto. This could be solved in an ad hoc manner for any specific situation, of course. For example, I could code the ancestor check logon class such that if the user were not logged on it would, just before returning a forward to the logon page, put a parameter in the session that specifies the class (the currently executing subclass of the check logon class) that the logon subsequence should forward to when it completes. Then, the last action of the logon subsequence would check for this parameter and, if present, dynamically build and return a forward to it. Then, my subclass would get control back, it would notice that the user was logged on, and go its merry way. The question is, has anyone tried to generalize this kind of approach (or some other approach that achieves the same goal)? A general solution would have to involve a stack somewhere. Where should it be kept? What is really pushed? How are subsequences defined and invoked? That kind of thing. It seems to me that there is probably a reasonably good general solution to this. BTW, sorry for picking a logon scenario as an example. I should have realized that the logon topic has a lot of baggage. The problem I'm trying to solve here really has nothing to do with logon or security, per se. Gary Johnston IBM Software Group, Research Triangle Park, NC Ted Husted [EMAIL PROTECTED] To:[EMAIL PROTECTED] 09/24/2001 07:12 PMcc: Please respond to struts-user Subject:Re: Reusable/composable Struts components? People typically subclass the Action or the ActionServlet. Subclassing the Action can be advantageous when some Actions require a login and others do not. The protected Actions can share a common subclass that forward to login when someone is not logged in. The Logged-In