Re: [Mav-user] Can't get dispatcher to work
Well this is indeed a blast from the past! You seem to be missing jdom.jar from your classpath as well. There will be a version in your maverick distribution, or you can find the latest version here: http://www.jdom.org/ Are you actually contemplating Maverick or just doing research? Maverick is pretty dated, especially in an ajax-driven world. Post-Maverick I ended up developing http://tagonist.tigris.org/, which does most of what I needed from Maverick but in 500 lines of code... and now I use http://code.google.com/p/htmleasy/ + Cambridge for basic html rendering, although that tends to be fairly simple given that most data is rendered by javascript/ajax. Jeff On Mon, Jan 30, 2012 at 11:39 AM, Steven McGrew s...@urbancode.com wrote: Up for a blast from the past? I am trying to run a very basic web app using Maverick mostly to learn about the MVC framework. However, I am currently stymied by an error that I keep getting. The dispatcher refuses to load. This is the error: java.lang.ClassNotFoundException: org.jdom.JDOMException Full stack trace: http://pastebin.com/Sv4bs4r1 I get this error on both Tomcat 6 and Tomcat 4.1.30, with both JDom 1.0 and the latest version. I have maverick.jar in my WEB-INF/lib folder and I have the library added to my build path. Here are snippets from my maverick.xml and web.xml, respectively: views view id=MyView path=home.jsp /view /views commands command name=cmd controller class=controllers.MyController/ view name=success path=success.jsp / view name=error path=failure.jsp / /command servlet display-nameMaverick Dispatcher/display-name servlet-namedispatcher/servlet-name servlet-classorg.infohazard.maverick.Dispatcher/servlet-class load-on-startup2/load-on-startup /servlet servlet-mapping servlet-namedispatcher/servlet-name url-pattern*.m/url-pattern /servlet-mapping If anyone can help I'd greatly appreciate it. -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ %(real_name)s mailing list %(real_name)s@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/ -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ %(real_name)s mailing list %(real_name)s@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/
Re: [Mav-user] NoClassDefFoundError and I have all the right jar files
Without knowing what's in your modified Maverick jar, it's impossible for anyone to help :-( Find out what's at line 140 of Loader.java. Decompile the code with JD in Eclipse if you have to. Jeff On Thu, Apr 22, 2010 at 8:24 AM, Angela Day akc...@yahoo.com wrote: Thanks for the idea. I tried lowering the jdom, with no success. Any other suggestions would be really appreciated. Thanks, Angela Day National Autism Association of Central Texas http://www.naacentraltexas.org -- *From:* Angela Day akc...@yahoo.com *To:* mav-user@lists.sourceforge.net *Sent:* Wed, April 21, 2010 3:40:44 PM *Subject:* NoClassDefFoundError and I have all the right jar files I am getting the following error when I try to run my application javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net http://org.apache.tomcat.util.net.PoolTcpEndpoint.pro.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net http://org.apache.tomcat.util.net.LeaderFollowerWorkerThread.ru.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) *root cause* java.lang.NoClassDefFoundError org.infohazard.maverick.flow.Loader.loadDocument(Loader.java:140) org.infohazard.maverick.flow.Loader.init(Loader.java:88) org.infohazard.maverick.Dispatcher.reloadConfig(Dispatcher.java:239) tdhca.maverick.Dispatcher.reloadConfig(Dispatcher.java:287) org.infohazard.maverick.Dispatcher.init(Dispatcher.java:159) tdhca.maverick.Dispatcher.init(Dispatcher.java:309) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) I am running: Torque 3.3 Java 1.5 Maverick 2.2.4 Ant 1.8.0 Velocity 1.3 Tomcat 5.5.28 Eclipse 3.5.1 JSP 1.2 JDOM 1.1.1 commonts_logging 1.1 jdom 1.1.1 commons-beanutils 1.7.0 commons-collections 3.2 Any help you can give would be greatly appreciated! Thanks, Angela Day National Autism Association of Central Texas http://www.naacentraltexas.org -- ___ %(real_name)s mailing list %(real_name)s...@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/ -- ___ %(real_name)s mailing list %(real_name)s...@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/
Re: [Mav-user] NoClassDefFoundError and I have all the right jar files
There is considerable mystery here, because the NoClassDefFoundError in your stack trace was clearly thrown out of Loader.java line 140. This is not a valid line of code. You can see for yourself, line 140 is a comment: http://mav.cvs.sourceforge.net/viewvc/mav/maverick/src/java/org/infohazard/maverick/flow/Loader.java?revision=1.17view=markup I don't know how to explain this inconsistency, but I can tell you how I would solve your problem: Install the JD plugin for Eclipse: http://java.decompiler.free.fr/ You simply open the Loader class using the Type finder and you will see the decompiled source code annotated with line numbers. You can see what is *actually* at line #140 and that will hopefully provide further clue as to what classes are missing. Jeff On Thu, Apr 22, 2010 at 9:50 AM, Angela Day akc...@yahoo.com wrote: I didn't change maverick. Just pulled in the jar file, that is all. I am using it as-is maverick. The log file doesn't have any error messages but stops just before reading the maverick file. Here is the log file: 851304 2010-04-22 10:31:55,585 [http-8080-Processor23] DEBUG tdhca.maverick.Dispatcher - Database is DEV 851304 2010-04-22 10:31:55,585 [http-8080-Processor23] INFO org.infohazard.maverick.Dispatcher - Starting configuration load 851304 2010-04-22 10:31:55,585 [http-8080-Processor23] INFO org.infohazard.maverick.Dispatcher - Loading config from jndi:/localhost/alligator/WEB-INF/alligator-maverick.xml 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - Transform factory for document is org.infohazard.maverick.transform.DocumentTransformFactory 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - Transform factory for xslt is org.infohazard.maverick.transform.XSLTransformFactory 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - View factory for document is org.infohazard.maverick.view.DocumentViewFactory 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - View factory for redirect is org.infohazard.maverick.view.RedirectViewFactory 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - View factory for trivial is org.infohazard.maverick.view.TrivialViewFactory 851381 2010-04-22 10:31:55,662 [http-8080-Processor23] INFO org.infohazard.maverick.flow.MasterFactory - View factory for null is org.infohazard.maverick.view.NullViewFactory Here is the maverick.xml file ?xml version=1.0? !-- $Id: alligator-maverick.xml,v 1.250 2009/11/02 21:07:53 eturner Exp $ -- maverick version=2.0 default-view-type=document views view id=default type=redirect path=PostLogin.m/ view id=error path=common/error.vm/ /views commands !-- login, logout and change password commands -- command name=Login controller class=tdhca.common.ctl.Login/ view name=error path=/common/login.vm param name=title value=Login/ param name=focus value=userId/ /view view name=default type=redirect ref=default/ view name=success type=null/ /command command name=Logout controller class=tdhca.common.ctl.Logout/ view name=success type=redirect ref=default param name=title value=Logout/ /view /command command name=PermissionDenied controller class=tdhca.admin.ctl.PermissionDenied/ view name=success path=/common/permissionDenied.vm/ /command command name=ChangePassword controller class=tdhca.common.ctl.ChangePassword/ view name=error path=/common/changePassword.vm param name=title value=Change Password/ param name=focus value=oldPassword/ param name=system value=contract/ /view view name=default type=redirect ref=default/ view name=success path=/common/message.vm param name=title value=Change Password/ /view /command command name=FundSourceList controller class=tdhca.alligator.ctl.FundSourceList/ view name=success path=/fundsource/overview.vm param name=title value=Fund Source List/ /view /command command name=FundTree controller class=tdhca.alligator.ctl.FundTree/ view name=success path=/shared/tree.vm param name=title value=Fund Hierarchy/ /view /command command name=FundSourceContext controller class=tdhca.alligator.ctl.FundSourceTransaction/ view name=success
Re: [Mav-user] NoClassDefFoundError and I have all the right jar files
Well this is a blast from the past. It's hard to tell what's going on here since the reported line number (Loader:140) doesn't actually point at real code. Have you customized the Maverick source? Clearly there is something missing on the classpath. Perhaps JDOM had an incompatible change... try the 0.9 version? Jeff On Wed, Apr 21, 2010 at 1:40 PM, Angela Day akc...@yahoo.com wrote: I am getting the following error when I try to run my application javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) *root cause* java.lang.NoClassDefFoundError org.infohazard.maverick.flow.Loader.loadDocument(Loader.java:140) org.infohazard.maverick.flow.Loader.init(Loader.java:88) org.infohazard.maverick.Dispatcher.reloadConfig(Dispatcher.java:239) tdhca.maverick.Dispatcher.reloadConfig(Dispatcher.java:287) org.infohazard.maverick.Dispatcher.init(Dispatcher.java:159) tdhca.maverick.Dispatcher.init(Dispatcher.java:309) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) I am running: Torque 3.3 Java 1.5 Maverick 2.2.4 Ant 1.8.0 Velocity 1.3 Tomcat 5.5.28 Eclipse 3.5.1 JSP 1.2 JDOM 1.1.1 commonts_logging 1.1 jdom 1.1.1 commons-beanutils 1.7.0 commons-collections 3.2 Any help you can give would be greatly appreciated! Thanks, Angela Day National Autism Association of Central Texas http://www.naacentraltexas.org -- ___ %(real_name)s mailing list %(real_name)s...@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/ -- ___ %(real_name)s mailing list %(real_name)s...@%(host_name)s %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s Archives are available at http://www.mail-archive.com/mav-user%40lists.sourceforge.net/
Re: [Mav-user] Logging from controller
Unfortunately I'm pretty sure that's going to be far too general a question. You need to explain how your logging framework works if anyone's going to be able to help you. Does it do anything weird with classloaders? Jeff Louis Malenica wrote: Hi, I am trying to log via a standard custom logger from within the perform() method of a controller that extends ThrowawayBean2. HOwever nothing is being logged. My logging framework seems ok as it is logging elsewhere in the app. Anyone come across this before? thanks. LM Rȧ�:q�[���y�hv^y�h��i��py���z�r��!���n}�h�ꮉ�%����ފ{^���y�^r 薈2쨺��m欉�ã塧HŞm*azbq�b�t���]5m�v���!xg��x�� m���zV���ږF�����\�ОIt ӽ=n'ۭ��Z� 6 �@,��8��R=== --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid0709bid3057dat1642 [INVALID FOOTER]
Re: [Mav-user] Maverick w/Spring
Unfortunately I don't think there are many people here who are very familiar with Spring, but if you find the answer, please post it here. Thanks, Jeff wally bowles wrote: Hi Can someone help me figure out how to let Spring be the factory to instantiate the command controller objects within Maverick? I’ve used a Spring factory before on other projects to inject the collaborators that a java class needs using the Spring config xml file. Can this be done to the Maverick commands? In other words, can the Maverick 'Dispatcher' when it instantiates the 'Loader' class with the commands found in the maverick.xml file call a Spring factory to instantiate the commands instead? The goal is to inject in the class collaborators declared in a config xml file into the commands. Wally __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 [INVALID FOOTER] --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid3432bid#0486dat1642 [INVALID FOOTER]
Re: [Mav-user] Character encoding patch?
The longstanding tradition here is to grant committer access to anyone who has a change to make. Partly this is because we're lazy (and by we I mean I), and partly this is an experiment in applying limited wiki concepts to source code. Dan, want access? Jeff Dan Finkelstein wrote: Hi Peter, I had the same problem last summer and made two modifications to Maverick. My app must be able to adjust to any charset based on locale. I'm pasting in the changes I made below. If someone can commit them to the maverick source that would be even better!! Anyway, let me know how you find these changes. Good luck, Dan In AbstractTransformStep.java, change to public HttpServletResponse getResponse() throws IOException, ServletException { log.debug(Getting fake response); // Should be ok to wrap the real mccoy here. if (this.fakeResponse == null) { this.fakeResponse = new FakeHttpServletResponse(this.getTransformCtx().getRealResponse()); // added by DF 7/26/05 // allows propogating character encoding on to response fakeResponse.setContentType(text/html; charset= + getTransformCtx().getRequest().getCharacterEncoding()); } return this.fakeResponse; } In Dispatcher.java, change to public void init() throws ServletException { // Make us available in the application attribute collection this.getServletContext().setAttribute(MAVERICK_APPLICATION_KEY, this); // Get defaultRequestCharset from init parameter, null is ok // CLOWN added by DF 7/26/05 -- allows pulling default char set from app defaultRequestCharset = (String)this.getServletContext().getAttribute(INITPARAM_DEFAULT_REQUEST_CHARSET); if(defaultRequestCharset == null) { this.defaultRequestCharset = this.getInitParameter(INITPARAM_DEFAULT_REQUEST_CHARSET); } // Get limitTransformsParam from init parameter, null is ok this.limitTransformsParam = this.getInitParameter(INITPARAM_LIMIT_TRANSFORMS_PARAM); // Get reuseMaverickContext from init parameter, null is ok this.reuseMaverickContext = true.equals(this.getInitParameter(INITPARAM_REUSE_CONTEXT)); At 09:05 AM 1/5/2006, Peter Chase wrote: Is anything wrong with the following patch, to make Maverick transforms automatically pick up the character encoding? public FakeHttpServletResponse(HttpServletResponse wrapMe) { super(wrapMe); if (log.isDebugEnabled()) log.debug(Creating fake response, original buffer size is + wrapMe.getBufferSize()); this.charset = wrapMe.getCharacterEncoding(); // THIS IS THE NEW LINE } --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER] --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER] --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER]
Re: [Mav-user] how to get command name from Controller context?
Another option would be to use an xsl that creates parameters to the controller with the name of the command. Jeff Dan Finkelstein wrote: here's what I use... I hope this helps, Dan /** * retrieve the maverick command */ public String getCommand() { // - this technique was taken from Maverick's Dispatcher.extractCommandName() HttpServletRequest req = getCtx().getRequest(); String path = (String)req.getAttribute(javax.servlet.include.servlet_path); if(path == null) path = req.getServletPath(); int firstChar = 0; if(path.startsWith(/)) { firstChar = 1; } int period = path.lastIndexOf(.); String command = null; if(period 0) { command = path.substring(firstChar, period); } return command; } At 01:32 PM 12/16/2005, uone wrote: How to get command name from Controller instance context? I'm looking for easy way to get command name. Of course I can parse url query from request, or find proper command programatically in maverick.xml using controller class name, but I think there is more elegant solution. Command calls controller, contexts are passed but I can't see any simple way to get command name from Controller instance. uone --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER] --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER] --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click [INVALID FOOTER]
RE: [Mav-user] jar hell with jdom reloaded
Strange, for some reason my list delivery was disabled. I've missed the last few months of discussion. Oops. I'm +1... and I think that pretty much makes a quorum. Eelco, would you like to do the honors? Jeff --- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl [INVALID FOOTER]
[Mav-user] Re: Unit Testing Maverick
I don't know of anything - anyone else? On Fri, Nov 01, 2002 at 11:19:45AM -0800, Holt, Jack C. wrote: I'm a fan of Maverick. It seems to implement MVC without the high levels of abstraction with approaches such as Struts. I'm currently trying figure out how to unit test the maverick controllers (classes that implement Controller) which I've written. I've been looking at jakarta cactus and I think it has promise for the purpose. Could you point me to some resource on the internet that would give me some detailed examples of the best way to unit test Maverick controllers? Preferably examples that use Cactus? --- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en [INVALID FOOTER]
RE: [Mav-user] Struts/Maverick
[guess it works now] Wow, this is great... I'll look into it more next week (this weekend I'm packing up everything I own and moving to San Francisco!) but from a cursory glance, it looks like just what I had in mind. We should get opt-perl and opt-struts in CVS, and make formal releases :-) Thanks! Jeff Schnitzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -Original Message- From: jim moore Sent: Fri 6/28/2002 2:51 PM To: [EMAIL PROTECTED] Cc: Subject: Re: [Mav-user] Struts/Maverick I took a stab at the wrapping stuts with maverick. I don't know if this is exactly what you had in mind, Jeff, or how you'd go about it, but it does run the full struts-example webapp inside of maverick. Don't need to change any struts code at all or even edit the struts-config.xml file. In 4 simple steps you're off and running: 1. add maverick.jar to WEB-INF/lib 2. add opt-struts.jar to WEB-INF/lib 3. create a maverick.xml overriding all the struts command names 4. change web.xml so that *.do (or whatever you were using) points to mav's dispatcher instead of strut's ActionServlet Get it while its hot: http://www.scolamoore.com/jim/opt-struts-20020628.zip http://www.scolamoore.com/jim/opt-struts-20020628.zip There's a war file in there that is basically the default struts-example with the four steps above taken for you. I've only tested it with their example app, so there could still be some broken stuff, but its a pretty solid beginning at least. --jim --- This sf.net email is sponsored by:ThinkGeek Caffeinated soap. No kidding. http://thinkgeek.com/sf http://thinkgeek.com/sf ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user https://lists.sourceforge.net/lists/listinfo/mav-user Archives are available at http://www.mail-archive.com/ http://www.mail-archive.com/ winmail.dat
[Mav-user] RE: Re: One More Thing, Please
[list: we're moving this onto mav-user for obvious reasons :-) Included below is a brief comparison of Maverick to Struts WebWork] From: Anthony W. Marino [mailto:[EMAIL PROTECTED]] Hi Jeff, What do you think of the Struts opensource layer stxx ( http://www.openroad.ca/opencode/ )? How does this compare with Maverick's xml/xsl functionality? Meagerly :-) It looks like a crude first pass at providing the facilities that Maverick supports. Things missing from stxx that Maverick supports: . Multiple transformations. Not only does Maverick offer multiple transforms, but you can go between XML-based and text-based transformations seamlessly. . SAX input. Stxx only takes a (DOM or JDOM) Document as input. Maverick transforms can take text, DOM, or (most importantly) SAX as input. And XML-based transforms are hooked together with SAX events. Much more efficient than passing DOM trees around. . View independence. Using XSL with Maverick is no different, Java-wise, than using any other view. Our primary sample application comes in three flavors; JSP (with JSTL), Velocity, and XSL. They all use the same Controllers (Struts calls them Actions), so you can easily switch view technology method-by-method. With Stxx, your Actions have to be extend ActionStxx and call a number of special methods. . Automatic domification. Maverick will automatically convert your JavaBean model to a form that can be operated on by XSL; Stxx expects you to come up with a Document yourself (another reason their Actions are not view-independant. You could use our code (http://domify.sourceforge.net) with Stxx, but you'd have to set it up yourself. Struts was not designed from the beginning to provide transformation pipelines, so retrofitting the architecture is problematic. Jeff Schnitzer [EMAIL PROTECTED] For the list's benefit, the original conversation: I'm not very familiar with Tapestry, but all the others I have used fairly extensively: Velocity - this is not a competing framework but a templating language that works exceedingly well with Maverick. Personally, this is my favorite way to write web applications, although Maverick lets you use JSP, XSL, DVSL, or conceivably any other templating language as well (it's pluggable). Regarding WW and Struts, I'll go over it by topic: Templating technology independence -- WW and Struts have traditionally been tied to JSP, relying on custom tag libraries for data access. They're trying to claw their way out of this situation, but it's rough. WW, for example relies on an exotic concept called the ValueStack which does not map well onto anything other than their tags. You have to fight the system to use JSTL with WebWork. Maverick was templating language independent from the beginning, and I'm pretty sure that most Maverick users are using something other than JSP. We don't provide a custom tag library because the JSTL standard tag library works great with Maverick, if JSP is your taste. For both WW and Struts, rendering a view is simply a question of RequestDispatcher.forward()ing to a named document, be that blah.jsp, blah.vm, or blah.xsl. This works ok (but not great) for jsp and velocity, but is hopelessly inadequate for XSL. How do you set params? What if you want multiple transformations? How do you set custom URI resolvers? Maverick handles all of this elegantly in the sitemap file, where it belongs. And we really mean templating language independent. We provide three different versions of one of our sample applications; a JSP version, a Velocity version, and an XSL version. The java code (Controllers) are unchanged for each - only the templates and the Maverick config file change. Transformation -- The most dramatic feature that Maverick offers that WW and Struts have not even considered is the ability to hook up Cocoon-style pipelines of transformation to view rendering. Out of the box, Maverick can do stuff like this: Render the model to XML with a JSP Transform the XML with a common look-and-feel with XSL Convert to Formatting Objects with XSL Render the document to PDF with Apache FOP And you can even eliminate the rendering of XML with JSP by using a special view type called domify which automagically adapts a JavaBean graph to a DOM interface so that XSL (or DVSL) can be applied to it directly. Transformations do not have to be XML-based, they can be simple text transformations like wrapping the output of a previous step with another template (providing the data as a String in the context). This is really useful for basic look-and-feel templating in a JSP or Velocity world. You could easily build a regex text substitution transformation if you wanted to. Oh, another neat thing is that you can stop the transformation process midstream to obtain intermediate output
[Mav-user] RE: Struts/Maverick
From: Anthony W. Marino [mailto:[EMAIL PROTECTED]] I found some emails with you and Husted discussing the potential of merging with Struts ( http://www.mail-archive.com/struts-user@jakarta.apache.org/msg22749.html ). Do you see that as a potentially happening ??? Would that be much different than the Struts/stxx layering??? It would be dramatically different than the Struts/stxx layering, which is very limited and does not offer orthogonality with other view types. I'll keep poking every now and then. I would be happy to contribute the Maverick code (with integration, of course) as Struts 2.0 and continue working on it there. That may sound arrogant given that we are a small community and they are a large one, but at this point I think Maverick is pretty close to a 100% superset of Struts features, and we offer a *lot* more. That said, I doubt Maverick-as-Struts-2.0 will ever happen, simply because of Not Invented Here. There is a small chance that they might become interested as they bump into the limits of the existing Struts architecture, but it'll be a hard sell. I'm not myself an Apache committer, although I'm moderately active in some of the communities. I know some of the Jakarta people personally, but none of the Struts folk. Other than trolling on their mailing lists, I don't have any inroads. The first thing that would have to happen to at least make the sell reasonable is that I (or someone) would have to write a Struts integration layer. This would be a ControllerSingleton base class that *exactly* mimics the Struts Action API. When Struts applications run without recompilation on Maverick, that might raise some eyebrows. There is the issue of the Struts tag library, but I think that will go away as JSTL replaces it. I consider the Struts tags more or less already to be obsolete. On the other hand, it's very possible to write a Maverick ViewFactory that builds Struts views... Maybe there is a week of work here, but since I don't need it myself, and nobody has asked for it, it hasn't been done. I suppose the other question is - if it were possible to merge Struts and Maverick, would the existing Maverick community want this? There is a risk that trying to integrate with Struts could produce something that is definitely not Maverick; there is a little bit of an everything including the kitchen sink attitude in that community. The fact that they have database connection pooling code in the framework is bewildering. Why on earth... Jeff Schnitzer [EMAIL PROTECTED] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user Archives are available at http://www.mail-archive.com/
RE: [Mav-user] passing self-built XML documents
ControllerContext.setModel() is indeed how you are supposed to do it. You're setting an org.w3c.dom.Document instance? What view type are you using? Actually, nevermind, I see the problem. You're using domify, and you're trying to adapt something that is already a Node. If you want an instant fix, change your view type to trivial and you should be ok. Trivial views just hand the model off to the transform process, which is what you want. I'll fix the domify view so that it handles this case, though. Btw, 2.0 still used Controller.model(). The setModel() method is a 2.1 thing. But this bug was in 2.0, too. Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Barrie Selack [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 3:47 PM To: [EMAIL PROTECTED] Subject: [Mav-user] passing self-built XML documents In pre 2.0 there was a model() method to pass a document that the application built. In 2.0 I can't quite figure how it get's passed. I've tried the setModel() and setting model in the HttpRequest. the former has the effect of taking 100% of the cpu, the latter seems to have no effect. So how is this done now? Thanks, Barrie -- - Rockhopper Communications, Inc.[EMAIL PROTECTED] 280 Pleasant Hill Road http://www.rockhopper.com/ Lewisberry, PA 17339 717 938-1581 ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink [INVALID FOOTER] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink [INVALID FOOTER]
RE: [Mav-user] passing self-built XML documents
Ok, I made an opt-domify 2.0.1 release with this fix. For anyone using domify, unless you are trying to domify a Node (in which case you might as well use the trivial view type), the 2.0 version should be just fine. This was the only change. Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Jeff Schnitzer Sent: Friday, June 14, 2002 4:24 PM To: [EMAIL PROTECTED] Subject: RE: [Mav-user] passing self-built XML documents ControllerContext.setModel() is indeed how you are supposed to do it. You're setting an org.w3c.dom.Document instance? What view type are you using? Actually, nevermind, I see the problem. You're using domify, and you're trying to adapt something that is already a Node. If you want an instant fix, change your view type to trivial and you should be ok. Trivial views just hand the model off to the transform process, which is what you want. I'll fix the domify view so that it handles this case, though. Btw, 2.0 still used Controller.model(). The setModel() method is a 2.1 thing. But this bug was in 2.0, too. Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Barrie Selack [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 3:47 PM To: [EMAIL PROTECTED] Subject: [Mav-user] passing self-built XML documents In pre 2.0 there was a model() method to pass a document that the application built. In 2.0 I can't quite figure how it get's passed. I've tried the setModel() and setting model in the HttpRequest. the former has the effect of taking 100% of the cpu, the latter seems to have no effect. So how is this done now? Thanks, Barrie -- - Rockhopper Communications, Inc.[EMAIL PROTECTED] 280 Pleasant Hill Road http://www.rockhopper.com/ Lewisberry, PA 17339 717 938-1581 ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink [INVALID FOOTER] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=dntextlink [INVALID FOOTER] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink [INVALID FOOTER]
[Mav-user] ANN: Maverick 2.1 Released
Version 2.1 of Maverick (and version 2.0 of both opt-domify and opt-velocity) are now available for download. This version adds heterogeneous transforms, orthogonal handling of params to all the various view and transform types, and a cleaner mechanism for setting the model in controllers. Note that the config file format has changed slightly. To specify multiple transforms, use this syntax: view name=foo type=domify transform path=first.xsl/ transform path=second.xsl/ /view The old syntax for specifying multiple transformations, which involved multiple path child elements of transform, is no longer allowed. This new syntax allows a different type to be specified for every transform. Try out the new fop transform that Jim Moore has contributed! In addition, param name=foo value=bar/ elements can be applied to all controller, view, and transform nodes. The old controller base classes (Throwaway and ThrowawayBean) remain unchanged, however, if you would like to use the new controller interface which allows setting of params and a more elegant way of defining the model, extend Throwaway2 or ThrowawayBean2 instead. Since I didn't think anyone was using the FormBeanUser base class yet, I upgraded it to the new interface rather than providing a second copy. Enjoy, The Maverick Team ___ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
[Mav-user] RE: Mav params? Part III
(CC'd the mav-user list, 'cause I think this is probably of general interest) Sometimes you have commands that require nearly identical controller behavior, but only slight difference. If you don't want to create multiple classes (maybe because it's not an option in your inheritance graph), you can pass parameters to controllers like this: command name=queryAsc controller class=org.foo.Query param name=sortOrder value=asc/ /controller view ... /command command name=queryDesc controller class=org.foo.Query param name=sortOrder value=desc/ /controller view ... /command The params are available from ControllerContext.getParams(), which is a new Maverick 2.1 feature. BTW, one of the default activities of ThrowawayBean2 is to self-populate with those params. I use this feature now and then myself, but I would hesitate to build your entire application that way. Just my opinion, of course :-) Jeff Schnitzer [EMAIL PROTECTED] It's fun how pretty much anything said on a public list can be quoted in perpetuity now ;-) -Original Message- From: Tim Colson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:49 PM To: Jeff Schnitzer Subject: RE: Mav params? Part III I seem to be having a monologue with myself... and spamming you in the process grin Went on a quest at Mail-archive for mentions of using inner classes and found this thread grin http://www.mail-archive.com/struts-user@jakarta.apache.org/msg04283.html BTW - we do have the action - baseaction - myaction paradigm, and my personal aversion to many little files isn't all that strong... in some places it just sorta feels better. ;-) Thanks, Tim -Original Message- From: Tim Colson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 2:38 PM To: '[EMAIL PROTECTED]' Subject: Mav params? Just wondering... in our Struts app, we started out using one action per command... but things got messy quickly. We had say a dozen actions that each had 4 or 5 similar sub-actions. Ex. EditFoo, DeleteFoo, UpdateFoo, SortFoo, MoveFoo, AddFoo, CopyFoo We started using the 'parameter' setting in the struts-config.xml and combined all of the sub-tasks into a single command-like object CommandFoo. Is there a similar paradigm in Mav? For example, does the controller class org.foo.Query know the actual command name that fired it? commands command name=runQuery controller class=org.foo.Query/ command name=deleteFoo controller class=org.foo.Query/ Cheers, Tim ___ Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
[Mav-user] Maverick 2.1 and Jetty
FYI, the Maverick 2.1 code works great on Jetty 4. There was an issue with Jetty that was fixed in CVS a short while ago; Jetty was committing the response buffer after an include(), even if nothing was written. This caused a problem for transforms. Maverick now traps the flush() and just about anything else that could cause problems, so everything should work even without the Jetty fix. I'm planning to do the 2.1.0 release tomorrow (Monday) afternoon. The updated docs are currently on the website. Jeff Schnitzer [EMAIL PROTECTED] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
[Mav-user] Welcome new committer
Just a quick note welcoming our newest committer, Jim Moore. Since Scott is my roommate, we had a voice vote; two +1's... but from now on stuff like this will follow the Apache guidelines. Look for opt-fop coming soon to a planet near you... :-) Jeff Schnitzer [EMAIL PROTECTED] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] Problems getting 2.0 up and running....
From: Barrie Selack [mailto:[EMAIL PROTECTED]] Thanks... if there is anything I can do to help let me know. I'll document what we do under JRun 4 (and possibly Resin) That would be great! Jeff Schnitzer [EMAIL PROTECTED] ___ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] Maverick to Struts
If you're bound to using the Struts dispatcher, it's fairly painful to integrate any other tools. Basically, Struts has one and only one way of modularizing views - a RequestDispatcher.forward(). I suppose this does make it possible to use Maverick views, but it's ugly: You can forward to maverick commands. This would require maintaining both config files, although the maverick one would be very simple, defining no controllers and only one view per command. Using Domify and XSLT would be a little tricky - you would have to write your own ViewFactory. The normal DomifyView expects to get the model from the controller, but you need to obtain the model from the request attributes (where Struts places it). So basically, it can be done, but it will be a hassle. Of course, if you're working on the 1.1 JDK, maybe this isn't the biggest obstacle you've had to overcome :-) Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Ed Ward [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 8:32 AM To: Jeff Schnitzer; [EMAIL PROTECTED] Subject: Re: [Mav-user] Maverick to Struts I suppose I should have been more explicit in my previous email, which was posted in part to help me let off some steam. :-o I'm aiming at reusing the View mechanism and the controllers (with a few modifications to overcome the singleton nature of Struts). The general idea is to have the Struts actions forwarding to Maverick style views to provide the transforms etc. I've been working on an implementation that works with a servlet 2.1 API and jdk1.1.x (It's currently running in VisualAge 3.02 (urghh)). I'm using the TrivialView and Transforms along with a DispatchedView. The configuration is hard-coded rather than driven from a configuration file. I've ported the Jakarta Commons packages to the 1.1.x platform. The eventual platform will be WebSphere 4.0, so there'll be a few changes when that happens. One good thing from my point of view though, is that although the use Struts has been mandated on this project, its use is mainly as a dispatch mechanism. Use of the Struts tag libraries has been discouraged, so a Maverick style view mechanism will be really cool and will hopefully be good publicity for Maverick on other projects which will hopefully be able to make use of the view mechanism. Ed. - Original Message - From: Jeff Schnitzer [EMAIL PROTECTED] To: Ed Ward [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, April 23, 2002 1:36 AM Subject: RE: [Mav-user] Maverick to Struts The question is, which part? I can identify three discrete pieces of an MVC framework which could conceivably be mixed and matched: 1) The controller/action part, including bean population, form validation, etc. 2) The view part, including jsp taglibs and (for Maverick) transformation, etc. 3) The core, which basically covers everything else. In particular, it includes the Dispatcher/ActionServlet, the configuration file, and how the components are put together. Which parts of Maverick do you want to work with which parts of Struts? A lot of interoperability with Struts is possible if you use the Maverick core. It is even possible (although I haven't tried it yet) to use Struts Actions and Struts views (with their own JSP taglibs), getting transforms, shunting, and the flexible config file from Maverick. This would require building fairly simple implementations of the ControllerSingleton base class and ViewFactory. Struts however is not very modular, so if you need to use the Struts core (including their ActionServlet), I don't know what you can do. You're going to have a rough time with XSLT, too, because it'll be very difficult to get more than a single transform configured. Jeff Schnitzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -Original Message- From: Ed Ward Sent: Sat 4/20/2002 9:31 AM To: [EMAIL PROTECTED] Cc: Subject: [Mav-user] Maverick to Struts Hi, Hold on to your hats whilst I ask what might sound a really dumb question. How easy is it to wrap a Maverick application with Struts? The reason I ask... The client I'm working for recently made an announcement that all their future webapps will be developed with Struts :-(( I did what I could to make them see the error of their ways, but AFAIK they haven't even taken a brief look at Maverick and the lead architect hadn't even put a working Struts app together when the decision was communicated! I don't have much knowledge of Struts myself, hence the question. Suffice it to say I'd still like to rework our UI using Maverick and XSLT, but now I have to consider the implications of my client's Struts requirements. The presentation layer of the app I'm working on requires extensive rework to enable it to use either Maverick or Struts, but I've already started rewriting with Maverick
RE: [Mav-user] Field error messages and validation....
Cool! If it makes sense, and you feel like putting together a small example, we would be happy to release it as an opt package :-) Jeff -Original Message- From: Dan Finkelstein [mailto:[EMAIL PROTECTED]] Sent: Monday, April 22, 2002 6:00 PM To: [EMAIL PROTECTED] Subject: Re: [Mav-user] Field error messages and validation I'm responding to my own email in order to give some feedback on how I solved this problem. What I did was use the Apache commons validator package as a starting point. This allowed me to specify in an xml file the forms to validate, which fields, and finally some number of validations to perform on each field. Oh, and I could also specify the error messages. Then, within Maverick, I called it from the beginning of perform(). The validator package has a feature that lets you pass in extra stuff. In my case I pass in the errors Map -- then my validation methods were written to add error messages directly to the errors Map. It ended up being pretty clean. I think the validator package was originally developed with Struts in mind, but doesn't have any dependencies that I could see. Validator isn't yet a released jakarta package, it really needs to be documented before that happens, but it is pretty good. Dan At 05:03 PM 3/29/02 -0800, Dan Finkelstein wrote: I notice that there are a few methods in Maverick for attaching error messages to fields, such as addError(). These are certainly very useful, _although_ I am now realizing why you have (wisely) chosen to not include them in the core distribution of maverick. It must be because the messages are really part of the view and to have them embedded in the controller defeats the separation. So, I'm struggling with what is the correct way to approach this problem... One idea would be to embed the messages in the velocity template itself... But that seems awkward. And, really, the error messages are caught up with the concept of validation. So maybe the idea would be to abstract out the validation and error messages together. Perhaps there could be another xml file along side maverick.xml in which we specify the fields of each form, how they should be validated, and text messages. I have seen that a bit of thinking has gone into this, such as Apache Common's validator package. In particular, I was wondering how you view this problem. Do you think that the MVC layer should handle validation? Or is it a separate function? In any case, I'd be interested in how you would approach this dilemma. Thanks, Dan ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] 2.0rc works fine and a preDiscard question
I have checked in the ModelLifetime object and associated changes. I left it with a single method, discard(). Since the Controller objects are the ones that generate the model (returning this is just one possibility), it's not really possible for the framework to know when the model is set up. Let us know if you have any problems with it. Maxis is pretty neat. It's way more fun than the Yet Another Business Application companies I have worked for in the past, but I get the feeling that it's been corporatized quite a bit in the last few years. Oh well :-) Hey, whatever happened to Berkeley Systems? Jeff Schnitzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -Original Message- From: Dan Finkelstein Sent: Mon 3/18/2002 10:27 AM To: [EMAIL PROTECTED] Cc: Subject: RE: [Mav-user] 2.0rc works fine and a preDiscard question Right, I think that's the right approach. You know, the creation of the connection to the database can be handled through the current architecture using the controller's constructor. But to keep things symmetric, maybe ModelLifetime could expose two methods: something like setup() and teardown(). This notification on initialization and finalization would make clear the tasks. Thanks for your attention to this, Best, Dan PS. Have fun at Maxis. I worked for a few years at Berkeley Systems, which was a blast. :-) At 09:41 AM 3/17/02 -0800, Jeff Schnitzer wrote: Ah, I see. Something like this interface that a model can optionally implement: public interface ModelLifetime { public void discard(); } I have no objection to adding it, although be aware that this is probably an anti-pattern... usually you want to have all your data access completed by the time perform() returns. Since the RC seems to be solid, we want to build the final release of Maverick 2.0 RSN, probably tomorrow. I'll probably slip this change in anyways since it doesn't require any refactoring. Sound good? BTW, if I'm slow to respond to mail, it's because I just started a short contract at Maxis doing WebLogic development and they're keeping me occupied. That, and I'm still couch-surfing, so I'm either busy or don't have a stable net connection available :-) Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Dan Finkelstein [ mailto:[EMAIL PROTECTED]] Sent: Saturday, March 16, 2002 8:26 PM To: [EMAIL PROTECTED] Subject: RE: [Mav-user] 2.0rc works fine and a preDiscard question Hi Jeff, Let me try to explain. In my controller (which is _not_ ControllerSingleton), I have a perform() method which opens a database connection. This controller might be used by a number of templates and have methods which might be used by some and not others, methods like getPerformers(), getServices(), etc. Each of these methods uses the open database connection. I'm using JDO and like other systems, it wants me to close my database connection. So, as I understand it, the flow is something like this: 1. Mav calls perform()...and within it, I open the database connection 2. Mav processes my velocity templates, which call methods in my controller, using $model.performers 3. Mav deletes the controller object What I would like is notification between steps 2 and 3 of the pending deletion so I can close the database connection. Does this make more sense? Thanks, Dan At 07:13 AM 3/13/02 -0800, Jeff Schnitzer wrote: I'm not quite sure what you mean. Why not just at the end of your perform() method? Or are you using a ControllerSingleton, and you want to be notified when a new configuration is loaded and the old is being discarded? Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Dan Finkelstein [ mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:35 PM To: [EMAIL PROTECTED] Subject: [Mav-user] 2.0rc works fine and a preDiscard question Just a little feedback... I'm now on 2.0rc and am not having
[Mav-user] JavaOne, anyone?
Is anyone going to be in SF for JavaOne? I'm planning on being at the Jakarta gathering tomorrow evening, so if anyone is in the area, drop by! http://jakarta.apache.org/site/news.html#0322.2 Jeff Schnitzer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] jû¬z¹X§X¬´Æ¯ºÇ«+-²Ê.Ç¢¸ëa¶Úlÿùb²Û,¢êÜyú+éÞ·ùb²Û?+-wèþf¯ºÇ«
RE: [Mav-user] Howto: Getting the JSP Example Working
From: Jordan C N Chong [mailto:[EMAIL PROTECTED]] Thousand thanks for your tip. I got this error when I start up the Tomcat: log4j:ERROR No appenders could be found for category (org.infohazard.maverick.Di spatcher). log4j:ERROR Please initialize the log4j system properly. What does it mean??? It means that the logging system is not initialized :-) Scott included a link to the FAQ in his email: http://mav.sourceforge.net/maverick-manual.html#N10722 If you do not desire detailed logging information, feel free to ignore the message. And when I run the friendbook example, the following problems happened: javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:875) ... ... Root Cause: java.lang.SecurityException: sealing violation at java.net.URLClassLoader.defineClass(Unknown Source) ... ... Hmmm, sealing violations. I have heard much about these but not experienced them myself. Which exact versions of tomcat, jdk, and xslt processor (if you're using one) are you using? And what is the remainder of the Root Cause stack trace? Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] Howto: Getting the JSP Example Working
I've got to admit that that stack trace doesn't offer me any clues. You should probably upgrade to the 4.0.3 version of Tomcat, because there are some security issues with prior versions. I would also try updating to the latest version of Xalan (you are using xslt, right?). Switching to JDK1.4, of course, is an option :-) Does anyone else understand sealing violations? Jeff -Original Message- From: Jordan C N Chong [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 11:19 AM To: Jeff Schnitzer Subject: RE: [Mav-user] Howto: Getting the JSP Example Working Dear Jeff... :) I am not sure which version xalan and I am using. but tomcat is 4.0, jdk is jdk1.3.0_02 and this is the whole page of exception (man... :)) To ease the pain, do you think I should switch the whole thing to jdk1.4?? thanks. Exception Report: javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:875) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:6 21 ) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e. ja va:214) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e. ja va:215) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:236 6) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :1 64 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. ja va :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.j av a: 1005) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java: 10 98 ) at java.lang.Thread.run(Unknown Source) Root Cause: java.lang.SecurityException: sealing violation at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLo ad er .java:671) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLo ad er .java:1090) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLo ad er .java:989) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocatio ns Ca che.java:164) at org.apache.jasper.compiler.TldLocationsCache.(TldLocationsCache.java:138 ) at org.apache.jasper.EmbededServletOptions.(EmbededServletOptions.java:324) at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:265) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:856) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:6 21 ) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e. ja va:214) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72 ) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e. ja va:215) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja va :5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
[Mav-user] Fixed Xalan/Domify problem
I found the problem preventing Domify from working with Xalan 2.2 (or later); the Document node adapter was not implementing hasChildNodes(). Apparently other processors never called it, so we never implemented it. I've released a new version of Domify (1.0.1, at http://domify.sourceforge.net) and a new (b3) beta release of the opt-domify package. One thing to note is that Domify now uses Log4J and prints a whole lot of messages if you let it. I have updated the log4j.properties in maverick/tools to exclude DEBUG messages from the org.infohazard.domify package and added instructions for this to the opt-domify release notes. Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] problem with beta 2
From: jim moore [mailto:[EMAIL PROTECTED]] Maybe instead of writing a file, it would be better to be able to specify a command (similar to reloadCommand) which dumps the current config as a page. That way it isn't necessary to worry about where you can write to the filesystem, should getRealPath() be used, etc. I'm not sure. I'm thinking of situations where a developer who is unfamiliar with maverick inherits a project and has to get up to speed. While the ability to view dump the current config to a page would be useful for one developing a mav project (so yes, I am voting for this), I am not sure it precludes or replaces dumping a file. (If the new developer can find the command to do this, they are probably past the point where they are looking for the file.) Hmmm, seems to me that anyone who inherits a maverick project is going to need some minimal amount of orientation anyways, and letting them know about the currentConfig command would seem like an important step. True, it's harder to guess than a maverick-processed.xml file, but at least it's still available if you're using a WAR file. As far as where to dump the file, I would say just dump it to the same directory where you found maverick.xml. Just append -processed to the file name (or something similar), so maverick.xml becomes maverick- processed.xml, and if they renamed maverick.xml to foo.xml, then foo-processed.xml would be produced. If there is an IOException or some other problem, just log the exception to System.err or better yet, use Log4J with a warn level. You must be developing on a system by adding and editing files in a directory structure :-) I suspect that most people instead build WAR files and deploy them into their containers. Since I never actually look at the expanded version of the WARs (if they even exist), I wouldn't think to look there for a maverick-processed.xml... and I suspect most people using WAR files are in the same boat. I'm really averse to the idea of writing files, especially back into the WAR. It just seems to me that it is very likely not going to work and it's not really intuitive; nothing else I've ever seen *writes* files to the WEB-INF dir. Yeah, someone could miss the special command, but that's why I slave over the documentation :-) If people end up asking about it a lot on this list, I'll add it to the FAQ. Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] problem with beta 2
From: jim moore [mailto:[EMAIL PROTECTED]] yep--that's the problem. out of curiosity, why was it deprecated? The goal was to make it easier to add controller factories in the future without breaking backwards compatibility. One day we might want to be able to specify a type attribute on the controller element. Another thing to keep in mind is that it is currently possible to define Struts-like Actions using the SingletonController. It's necessary to use the controller element so that the child elements can be used as configuration like this: controller class=my.singleton.Controller bean class=my.form.Bean/ method name=executeThisMethod/ /controller Of course, nobody I know has actually built a base ControllerSingleton yet... though now with the possibility of xsl transformation of maverick.xml via configTransform i guess i could still do it this way and let xsl take care of it. BTW, i think the idea of allowing xsl transform on the config file is a great idea. Yup. I'm almost inclined to think it worthwhile to reexamine a number of the alternative syntaxes. I'm hesitant to force people to use the XSL mechanism, though. Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] global views
An XML structure is *definitely* preferable; I've written both yacc-based and recursive descent parsers before, and it's wy overkill for this project :-) I'm starting to get a little worried about feature creep, so I have a proposal: Lets address the issue of how to make views global in a subsequent 2.1 release. In the mean time, I'll make the name attribute default to the ref so that view ref=loginRequired/ can be used, which is a little shorter. I will also add the ability to specify an XSL for transforming the configuration before load. I'll get these features implemented RSN and launch another beta. When the manual is complete(ish), and there are no obvious outstanding bugs, we'll do the formal 2.0 release. Everything else gets slated for 2.1. Sound good? (this doesn't mean that the discussion should stop :-) Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Gerald de Jong [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 12:22 AM To: [EMAIL PROTECTED] Subject: Re: [Mav-user] global views On Thursday 14 February 2002 22:21, Gerald de Jong wrote: would you call it sloppy if we changed the word cascading into inheritance? virtually the same thing happens in your java code, so why not in the maverick.xml command hierarchy? btw, another way to represent an inheritance hierarchy in maverick.xml would be to use something resembling Ant's build.xml with its dependencies (rather than nesting the tags). with Ant you say depends=OtherTask, whereas in Java we would say extends OtherClass, so maybe.. maverick class name=root view.../ view.../ /class class name=secure extends=root view.../ command view.../ view.../ /command command../ /class /maverick -- Beautiful Code BV Rotterdam, The Netherlands http://www.beautifulcode.nl ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] skinning and mav
Dan, I hate to sound daft, but even after the second round of explanation I'm still completely confused about what you're trying to do. Care to give it a third round? I think I would understand better if you gave a chronology of how a single request was serviced. From: jim moore [mailto:[EMAIL PROTECTED]] This does raise the question of how to set up easily configurable skins in maverick though. Currently I believe it would be difficult to have multiple skins that were configurable with a single param (i.e. skinskinA/skin or skinskinBskin). This is somewhat the same problem as i18n where you want to say, if the user's language is english, use these templates. if french, use these other templates. Skins are similar. If the user has selected skinA, use these templates, if they chose skinB, use these other templates. Shunting is the mechanism to do exactly this. You can specify a mode attribute for multiple views with the same name, like this: maverick version=2.0 default-view-type=document modules shunt-factory provider=org.infohazard.maverick.shunt.LanguageShuntFactory/ /modules commands command name=welcome controller class=org.blah.Blah/ view name=success path=en/welcome.jsp/ view name=success mode=fr path=fr/welcome.jsp/ view name=success mode=de path=de/welcome.jsp/ ... /command /commands /maverick The LanguageShuntFactory configures shunts which pick mode based on Accept-Language. The view without a mode becomes the default. You can also specify a mode for a global views block, making it easy to define a separate file for the views for each language. Take a look at the maverick.xml for the shunting example: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/maverick/examples/shu nting-jsp/WEB-INF/maverick.xml?rev=1.3content-type=text/vnd.viewcvs-mar kup It is also worthwhile to look at the Shunt interface: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/maverick/src/java/org /infohazard/maverick/flow/Shunt.java?rev=1.4content-type=text/vnd.viewc vs-markup and the implementation of LanguageShuntFactory (which contains LanguageShunt as an inner class): http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/maverick/src/java/org /infohazard/maverick/shunt/LanguageShuntFactory.java?rev=1.4content-typ e=text/vnd.viewcvs-markup Note that LanguageShunt is considerably more complicated than a SkinShunt would be. Really, a SkinShunt would be nothing more than this: public View getView(HttpServletRequest request) throws NoSuitableModeException { String mode = request.getSession().getAttribute(whichSkin); // Look up this mode in a hashmap return (View)this.modes.get(mode); } Make sense? Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
[Mav-user] getResource() problems
I just backed out the changes to XSLTransform.java which load XSL files with getResourceAsStream(). Basic XSLs work, but xsl:import, xsl:include, and document() become hideously broken. Basically, without setting a custom URIResolver which feeds back into the container getResourceAsStream(), the XSLT processor will try to resolve imports et al from tomcat/bin/ (or orion/). How to make a custom URIResolver work with getResourceAsStream() is not immediately obvious. If anyone would like to take a stab at it, I'll be happy to accept patches, but otherwise I'm going to move on to other tasks. For the time being, I suggest configuring your container to expand warfiles. Jeff Schnitzer [EMAIL PROTECTED] ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: Re: [Mav-user] Maverick in Tomcat 3.3 using JSP
Oops :-) Amusingly enough, this problem was fixed last week during some refactoring. The current CVS copy of Maverick should only instantiate jaxp TransformerFactory objects when they are actually used... but then I said this before :-) When I get more documentation written I'll release another beta. As far as Tomcat 3.3 goes, I vaguely recall that it has some strange classloader issues and it's very sensitive to where you put the xalan.jar. I've never spent any serious time using Tomcat v3, so I'm not sure I can be much help beyond this. Jeff Schnitzer [EMAIL PROTECTED] -Original Message- From: Gerald de Jong [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 4:25 AM To: [EMAIL PROTECTED] Subject: Re: Re: [Mav-user] Maverick in Tomcat 3.3 using JSP On Friday 25 January 2002 09:50, Jeff Schnitzer wrote: i'll move to v2, but why would i need an xslt processor if i'm using no xslt? Because of a very silly piece of code that was long ago corrected in Maverick 2.0 :-) If you're not using xslt, you could just comment out ConfigLoader.java line 312 and everything will be fine (note you'll still need to declare the variable, just initialize it to null). Sorry about that. There really isn't any good reason. If switching to Maverick 2.0 is not an option, and putting a processor on the classpath (any processor will do) is problematic, I can send you a special build. Incidentally, even in Maverick 2.0, it is still possible to need an xslt processor even if you aren't using xslt. Maverick uses JAXP if it ever needs to serialize a DOM tree. This is pretty unlikely if you're not using xslt, but it could happen :-) Jeff Schnitzer [EMAIL PROTECTED] thanks a lot for your responsiveness, Jeff! i've moved to maverick 2.0, and i've put xalan.jar in the classpath, but strangely enough it doesn't seem to think that it's there! it works (of course) in Tomcat 4, but in the Tomcat 3.2 i'm using it doesn't. it should find org.apache.xalan.processor.TransformerFactoryImpl, but it doesn't. any idea why? here's the stacktrace: [Loader] Loading config from /opt/JBoss-2.4.3_Tomcat- 3.2.3/jboss/tmp/deploy/Default/avv.ear/web1001/WEB-INF/maverick.xml [MasterTransformFactory] Transform factory for document is org.infohazard.maverick.transform.DocumentTransformFactory [MasterTransformFactory] Transform factory for xslt is org.infohazard.maverick.transform.XSLTransformFactory [MasterViewFactory] View factory for redirect is org.infohazard.maverick.view.RedirectViewFactory [J2EE Deployer Default] Starting avv.war failed! [Default] javax.xml.transform.TransformerFactoryConfigurationError: java.lang.ClassNotFoundException: org.apache.xalan.processor.TransformerFactoryImpl [Default] at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.ja va :121) [Default] [Default] at org.infohazard.maverick.transform.NonTransform.clinit(NonTransform.jav a: 23) [Default] [Default] at org.infohazard.maverick.view.TrivialViewFactory.init(TrivialViewFactor y. java:20) [Default] [Default] at org.infohazard.maverick.flow.Loader.setupCoreModules(Loader.java:137) [Default] [Default] at org.infohazard.maverick.flow.Loader.init(Loader.java:114) [Default] [Default] at org.infohazard.maverick.flow.Loader.init(Loader.java:90) [Default] [Default] at org.infohazard.maverick.Dispatcher.reloadConfig(Dispatcher.java:149) [Default] [Default] at org.infohazard.maverick.Dispatcher.init(Dispatcher.java:86) [Default] -- Beautiful Code BV Rotterdam, The Netherlands http://www.beautifulcode.nl ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] here's an interesting maverick web app
That's really cool! I'm a *big* fan of memetics and all the implications of the idea. I'll replicate this meme to all my friends :-) Some things I find somewhat confusing: I'm not quite sure I understand how the economy works, especially cents to survive on. The two numbers to the right of a meme could use some explanation. The red/gree/blue +/- buttons could use some explanation. Jeff -Original Message- From: Gerald de Jong [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 2:39 PM To: [EMAIL PROTECTED] Subject: [Mav-user] here's an interesting maverick web app i just put this up, and people are already playing with it. http://www.fluidiom.com -- Beautiful Code BV Rotterdam, The Netherlands http://www.beautifulcode.nl ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user
RE: [Mav-user] Maverick in Tomcat 3.3 using JSP
What was the stack trace? I would expect that the class not found was HttpServletResponseWrapper, but if you're not using XSLT, I am surprised that it would come up. Is this with maverick v1 or v2? Jeff -Original Message- From: Gerald de Jong [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 11:32 AM To: [EMAIL PROTECTED] Subject: [Mav-user] Maverick in Tomcat 3.3 using JSP in the FAQ it says that the only reason Maverick needs the Servlet 2.3 API is for the pipelining (i assume this is for XSLT). is pipelining needed for JSPs as well? i tried but was unable to get Maverick working at all in Tomcat 3.3, because it had a class-not-found for something related to pipelining. is anyone using Maverick in pre-2.3 servlet engines? -- Beautiful Code BV Rotterdam, The Netherlands http://www.beautifulcode.nl ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user ___ Mav-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mav-user