Re: XInclude in faces-config file
Stephen Faustino wrote: I'm attempting to modularize one of the xml files by using XInclude under Tomcat 5.5.9. The application starts, but at the point in time when the beans should get instantiated I get a NullPointerException in the ManagedBeanFactory. In the example below, I'm trying to include file2.xml in file1.xml, but it appears that the include directive is being ignored. Note that if I insert the contents of file2.xml directly into file1.xml, everything works as expected. Can anyone offer any insight in what I'm doing wrong? Assuming you are using Xerces as you XML parser, have you set the system property: org.apache.xerces.xni.parser.XMLParserConfiguration = org.apache.xerces.parsers.XIncludeParserConfiguration best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Registering my own protocol in Tomcat
Martin Peter wrote: Hi, Is there a possibility to get tomcat working with my own ASCII based protocol (instead of HTTP). Is there a possibility to register a protocol-handler or something similar to handle the requests of my protocol with a servlet? Hi, Check out: http://java.sun.com/developer/onlineTraining/protocolhandlers/ best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Disabling empty-element tag generation in jsp (pre)compilation
Hi, You could do: script ...///script So the parser won't see an empty element. (and you will see your XHTML rendered in the browser) best, -Rob Taimo Peelo wrote: Hi, i am using Jasper coming with tomcat 4.1.31 for precompilation of some jsps. It generates empty-element tags where generation of start-tag followed by immediate end-tag would be needed/preferred. For example there are includes like: jsp:include page=includes/scripts.jsp/ where scripts.jsp contains the lines like script type=text/javascript src=lib/whatever.js /script. Precompiled jsps output these in their shortened form: script type=text/javascript src=lib/whatever.js/. How do i tune that behaviour - jasper options, jsps themselves, xml parser? thanks, Taimo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Desperate: trying to get Tomcat working through IIS
Hi, If you define: /*=tomcat then *everything* goes to tomcat even if you define: !/*.asp=tomcat This seems to be a bug. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 where is a hard-copy dtd reference?
David Smith wrote: 2.4 doesn't use a DTD -- it uses a schema so order doesn't matter anymore. Using the schema does not necessarily mean order is not important. It is just the way it was designed. One thing that is strange is that the key/keyref constraints for servlet/filter names for definitions and mappings have been removed (they were there in earlier versions (though the version has not changed)). Anybody know why you can have a servlet or filter name in a mapping that has not been defined and yet have a valid web.xml? best, -Rob --David Scott Purcell wrote: Hello, Is there a quick reference, or somewhere one can go to get a listing of the element order for the 2.4 dtd? I already have a bunch of elements in my web.xml and I want to add a listener but I forgot where it goes and I can't seem to google it up today? Anyone know? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS TC 5.5.9 - welcome files (index.html) not found
Hi, I am using IIS and tomcat together for the first time and have one little problem... Even though I have a /web-app/welcome-file-list/welcome-file='index.html' in my web.xml and the IIS server has index.html set as a default index page in the IIS manager, it seems that IIS does not recognize index.html as an index page. In other words, I get an IIS 404 when trying to hit something like: 'http://server.com/some/folder/'. The uriworkermap.properties has *.html set to be served from tomcat. Has anybody seen this? When I run tomcat standalone everything works as expected, but we need IIS for some other pages/services that our client is running. I have tried changing the index.html to index.htm, default.html, default.htm (all of which are set in IIS to be index pages) with no luck. Any ideas? thanks for any help, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IIS TC 5.5.9 - welcome files (index.html) not found
Mikolaj Rydzewski wrote: Robert Koberg wrote: it seems that IIS does not recognize index.html as an index page. In other words, I get an IIS 404 when trying to hit something like: 'http://server.com/some/folder/'. The uriworkermap.properties has *.html set to be served from tomcat. Has anybody seen this? It's probably because http://server.com/some/folder/ doesn't match *.html pattern. Maybe you should try something like /context/* ? Thanks. I need to check the latest uriworkermap, but I think this has been done. I will give that a try when the client gets in (they are on the west coast of the US - I am on the east coast...). best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IIS TC 5.5.9 - welcome files (index.html) not found
Mikolaj Rydzewski wrote: Robert Koberg wrote: it seems that IIS does not recognize index.html as an index page. In other words, I get an IIS 404 when trying to hit something like: 'http://server.com/some/folder/'. The uriworkermap.properties has *.html set to be served from tomcat. Has anybody seen this? It's probably because http://server.com/some/folder/ doesn't match *.html pattern. Maybe you should try something like /context/* ? Hi again, I wonder if there might be a feature enhancement here... Perhaps in the uriworkermap.properties there could be an entry like: welcome-file-list=ajp13w or !welcome-file-list=ajp13w which would tell IIS to either pass /wh/ate/ver/* to tomcat in the first instance or handle it itself in the second. Worthwhile? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation stricter at tomcat startup than XML Schema
Hi, I just noticed that the schema: http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd allows //filter-mapping/filter-name's that have not been defined in a //filter/filter-name At tomcat startup however, there is a validation error (of course). I would say the SUN schema is wrong. best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Win32: tomcat is there, how to make it a service?
Hi, I have installed tomcat (by copying it) to a windows server. Is there some way to make it a serevice so that on restarts it resstarts (and as a particular user)? Should tomcat be installed from the .exe for windows to get the service installed? thanks, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Win32: tomcat is there, how to make it a service?
Marius Hanganu wrote: Hi, You can use the service.bat script provided in the bin directory. Executing service install from the command line will install Tomcat as a service (you will find it under the name Apache Tomcat in the list of Windows services). Thanks! Will try asap. -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
invalid web.xml - mime-mappng is not facet-valid with regard to the '+' char
I don't think I have tried to ever validate the $CATALINA_HOME/conf/web.xml before, but I am trying to track down a bug and found the web.xml to be invalid (according to XML Schema validation). For example it fails on: ... mime-mapping extensionmathml/extension mime-typeapplication/mathml+xml/mime-type /mime-mapping ... It seems to be failing on the plus (+) character. Anybody know what's up? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
forwarding (and adding to) a request to another server
Hi, I have a secure webapp (main portal) in Tomcat that calls webservices for authentication. There are other *existing* apps on different servers. All users log in to all apps through my app (single sign on). When a user clicks a link in my app that is to go to another secure app, I need to call a web service to get authentication info for that particular app. Then, POST the authentication info to the other server and have the requested page show in the browser. Is there some way to: 1. get the request in a Filter 2. call the webservice and get auth info 3. redirect/forward/open-a-url-conn to POST the auth info as form data to another app 4. finally, have the other app's page show in the user's browser ? Anybody done anything like this? Any ideas? Is it possible? I could do this with JavaScript by building the form for each page that have these secure link types. But, it complicates things a great deal because I would need to call the webservice and put the auth info (encrypted strings) on the page even though the user may never click the link. any ideas, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding (and adding to) a request to another server
Warren Taylor wrote: Please take me off your mailing list. I don't know what the hell you are talking about. I got on this mailing list by error and it is way beyond my comprehension. Can you read the bottom of the post to this mail list? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Application-level control of web-resources
QM wrote: (snip :) : to know your thoughts regarding pregenerating JSP or velocity templates : such that the decoration (and content inclusion) happens prior to runtime. I don't think I understand what you're after here, but it's a little early in the morning for me =) Please, explain again. : For example, we use XSLT to pregenerate the pages (managed through our : CMS) so that as much as possible exists in the page/template. This : leaves only what is *required* to be dynamic for runtime. Thoughts? (I : can take it :) I suppose what I don't understand is, what is dynamic here? Are you talking a menu that's regenerated at each request (in case new menu items have been added) or something else? (Perhaps I should have changed the subject line) Are you familiar with apache Forrest? You know how they generate a static site, right? Well, think of that, but instead generating XHTML it generates Velocity or JSP pages to be used on a live site (after going through a QA site first, of course :). In a way, it is a cache. (Our CMS does the similar things as Forrest) In the case of new menu items being added, it is done through the CMS (or by hand) and all of the appropriate pages that need to contain that item are re-pre-generated. For example, we have a web app that has quite a few (80-90%) content heavy pages where the only thing that needs to be dynamic is the user's username displaying and that user's particular choice of CSS files. Instead of 'decoratorating' at runtime, it is already decorated, the content already exists on the page and the only dynamic things are minor. XSLT is used for decoration prior to runtime. At runtime (I guess a term left over from my CDROM days), no XSLT is used, rather the pregenerated Velocity page/templates (or JSP, but angle brackets tend to make for more work with regard to XSLT/XML). best, -Rob -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
pregenerating dynamic pages - Re: Application-level control of web-resources
Here is an example of a poll. Given a poll content piece like: ?xml version=1.0 encoding=UTF-8? poll id=pollUID question p[ Question 1 ]/p /question answer id=a1UID pAgree/p /answer answer id=a2UID pDisagree/p /answer /poll This is used to populate the Poll feature/data in Jive Forums webapp. The authorized author does not use the Jive admin interface, rather, they stay in the CMS to create the poll content piece and assign it to a page. The XSL below is used for providing runtime Velocity code for: a.) adding the poll to the Jive DB at runtime if it does not exist b.) display the poll form if the user has not taken it, or c.) display the results if the user has taken it (the $xmlpoll is a Velocity request scoped Tool) ?xml version=1.0 encoding=UTF-8? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 !-- -- xsl:template match=answer mode=addOptionsToDb xsl:text$xmlpoll.addOption(/xsl:text xsl:value-of select=normalize-space(.)/ xsl:text)/xsl:text /xsl:template !-- -- xsl:template match=answer mode=setOptionsToDb xsl:text$xmlpoll.setOption(/xsl:text xsl:value-of select=position() - 1/ xsl:text, /xsl:text xsl:value-of select=normalize-space(.)/ xsl:text)/xsl:text /xsl:template !-- -- xsl:template match=poll xsl:param name=xml_id select=''/ xsl:variable name=poll_md select=document(concat('metadata/content/', $xml_id, '.xml'))/s:md-content/ xsl:comment #set ($pollName = xsl:value-of select=$xml_id/) #set ($poll = $xmlpoll.getPoll($pollName)) #if ($poll) #if ($xmlpoll.isModified(xsl:value-of select=$poll_md/@modified/)) $xmlpoll.setDescription(xsl:value-of select=question/simpleText/) xsl:apply-templates select=answer mode=setOptionsToDb/ #end #else #set ($poll = $xmlpoll.createPoll($pollName)) $xmlpoll.setDescription(xsl:value-of select=question/simpleText/); xsl:apply-templates select=answer mode=addOptionsToDb/ #end /xsl:comment div class=section xmlns=http://www.w3.org/1999/xhtml; h2Poll/h2 xsl:comment #if ($isMember) #if (!$xmlpoll.hasUserVoted($pageUser)) #if ($request.getParameter(doSave)) #set ($answer = $request.getParameter(qxsl:value-of select=$xml_id/)) $xmlpoll.addUserVote($answer, $pageUser) #else /xsl:comment form action={$lsb_focus_nodeset/@name} method=post id=form_{$xml_id} xsl:if test=boolean(@bg_img) xsl:attribute name=style xsl:textbackground-image:/images//xsl:text xsl:value-of select=@bg_img/ /xsl:attribute /xsl:if xsl:apply-templates select=question mode=not_saved xsl:with-param name=mc_id select=$xml_id/ /xsl:apply-templates xsl:apply-templates select=answer mode=not_saved xsl:with-param name=mc_id select=$xml_id/ /xsl:apply-templates input type=submit value=Vote name=doSave/ input type=hidden name=quiz_id id=quiz_id value={$xml_id}/ /form xsl:comment #end #end #end /xsl:comment xsl:comment #if ($xmlpoll.hasUserVoted($pageUser) || !$isMember) /xsl:comment xsl:apply-templates select=question mode=not_saved xsl:with-param name=mc_id select=$xml_id/ /xsl:apply-templates xsl:comment #if (!$isMember) /xsl:comment pemOnly members can vote in polls./em/p xsl:comment #end #set ($results = $xmlpoll.getResults()) #foreach ($result in $results) /xsl:comment div${result.num}. ${result.question} - ${result.voteCount} votes ${result.percentage}%/div xsl:comment #end #end /xsl:comment /div /xsl:template !-- -- /xsl:stylesheet Robert Koberg wrote: QM wrote: (snip :) : to know your thoughts regarding pregenerating JSP or velocity templates : such that the decoration (and content inclusion) happens prior to runtime. I don't think I understand what you're after here, but it's a little early in the morning for me =) Please, explain again. : For example, we use XSLT to pregenerate the pages (managed through our : CMS) so that as much as possible exists in the page/template. This : leaves only what is *required* to be dynamic for runtime. Thoughts? (I : can take it :) I suppose what I don't understand is, what is dynamic here? Are you talking a menu that's regenerated at each request (in case new menu items have been added) or something else? (Perhaps I should have changed the subject line) Are you familiar with apache Forrest? You know how they generate a static site, right? Well, think of that, but instead generating XHTML it generates Velocity or JSP pages to be used on a live site (after going through a QA site
Re: Application-level control of web-resources
QM wrote: On Sat, Apr 09, 2005 at 06:35:51PM +0200, Morten Sabroe Mortensen wrote: : This would open up for e.g. creating a wiki-like application, where each : wiki-page is a valid JSP-page, which is created dynamically and stored : elsewhere than within the deployed WAR-file. Why use real pages? Those are a pain to manage, especially in Java webapps (which are supposed to be sealed applications). Hi QM, I know what you say is the prevailing wisdom. But, I would be interested to know your thoughts regarding pregenerating JSP or velocity templates such that the decoration (and content inclusion) happens prior to runtime. For example, we use XSLT to pregenerate the pages (managed through our CMS) so that as much as possible exists in the page/template. This leaves only what is *required* to be dynamic for runtime. Thoughts? (I can take it :) best, -Rob Many such systems (think blogs) stash the content in a database (or some other data store) and map URIs to those entries. In turn, accessing a URL merges the content and a static template at runtime. The end-user doesn't know they're hitting a virtual resource and, quite frankly, they shouldn't care. Read up on the Front Controller, Page Controller, and Decorator design patterns for insight. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can you use Tomcat when you are not on line?
Do you have a 'hosts' file? It should be located in $WINDOWS/system32/drivers/etc If you don't have one, create it and put in a line like: 127.0.0.1 localhost Note, you can also use this file for dev purposes. For example, say you are working on 127.0.0.1 tomcat.apache.org best, -Rob Walter Lee wrote: Thanks for responding. I always use the complete path, I just forgot to put it in my posting. Wally - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bug? invalid url-pattern - 'schemas/content.xsd'
Hi, Tomcat-5.5.4 on jdk1.5, windows xp I have a schema validated web.xml (that is valid) that throws an error at startup saying this is invalid: sevlet-mapping servlet-namecontent-schema/servlet-name servlet-mappingschemas/content.xsd/servlet-mapping /sevlet-mapping Why would this be invalid? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bug? invalid url-pattern - 'schemas/content.xsd'
Parsons Technical Services wrote: Try changing the name of the servlet. From content-schema To content_schema Or contentschema I know there are some restrictions on what characters you can use and where in the name you can use them. Can't find the reference at the moment. Thanks, but changing the name did not work (and I have others with a dash that work). I made a copy/paste error below (of course...). Should have been: sevlet-mapping servlet-namecontentSchema/servlet-name url-patternschemas/content.xsd/url-pattern /sevlet-mapping and I should have added that right below it (error line plus 1) I have: sevlet-mapping servlet-namecontentSchema/servlet-name url-patternschemas/content_extended.xsd/url-pattern /sevlet-mapping Starting up tomcat says the error is on the line that has /sevlet-mapping for the first mapping. Before the servlet-name change it did say the problem was the url-pattern. Now it just tells the line number. best, -Rob Doug - Original Message - From: Robert Koberg [EMAIL PROTECTED] To: tomcat-user@jakarta.apache.org Sent: Wednesday, January 19, 2005 9:04 PM Subject: bug? invalid url-pattern - 'schemas/content.xsd' Hi, Tomcat-5.5.4 on jdk1.5, windows xp I have a schema validated web.xml (that is valid) that throws an error at startup saying this is invalid: sevlet-mapping servlet-namecontent-schema/servlet-name servlet-mappingschemas/content.xsd/servlet-mapping /sevlet-mapping Why would this be invalid? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bug? invalid url-pattern - 'schemas/content.xsd'
Caldarale, Charles R wrote: From: Robert Koberg [mailto:[EMAIL PROTECTED] Subject: Re: bug? invalid url-pattern - 'schemas/content.xsd' sevlet-mapping /sevlet-mapping Do you really have sevlet in the tags, or is your r-key a little sticky? ufff... I have been working too long today... Yes, I have servlet not sevlet. The web.xml is valid according to the public web-app_2_4.xsd. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Does Tomcat 5 users java.nio?
Thanks for your excellent explanation! This may stray off topic for tomcat, but I have been wondering how this (nio) would play out in XSL transformations in a servlet container. Are you familiar with using custom URIResolvers [see below for an example scenario] in XSL transformations? -- Briefly, you can assign a resolver to TransformerFactory which will resolve xsl:import/includes. Then you derive and cache a Templates object off of that, so nio might not give much advantage since building the Templates object grabs files once and it gets cached. -- You can also set a resolver on the Transformer object (which is derived from the cached Templates object). The Transformer object is unique for each transformation and it resolves calls from the XSL document function. We (an ASP content management system) use the Transformer resolver to gather (/aggregate/) content pieces and metadata files to be used in the transformation. In some case there can be large number of document() calls to gather XML files. I haven't had a chance to get into nio yet and was wondering if you (all) had opinions on this? thanks, -Rob [example] A source XML might look like: regions region nameref=wideMiddle content idref=piece1.xml/ content idref=piece2.xml/ /region /regions An example XSL would look like: !-- page wrapper stuff -- xsl:apply-templates select=/regions/region/content/ !-- page wrapper stuff -- xsl:template match=content mode=aggregator xsl:apply-templates select=document(@idref)/*/ /xsl:template An example resolver might look like: private static final String FNF = fnf/; private Project project; public TemplatesResolver(Project proj) { this.project = proj; } public Source resolve(String href, String base) throws TransformerException { File file = this.project.getContentFile(href); if (file != null) { return new StreamSource(file); } else { return new StreamSource(new StringReader(FNF)); } } Will Hartung wrote: From: Vy Ho [EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 3:03 PM I checked this document: http://www-106.ibm.com/developerworks/library/j-nioserver/ and it talks about how wonderful new io could help server to serves higher number of connections and less error/drop connections. Is it true in practice? Does Tomcat 5 uses new io of just io? If not, do they plan to move to this? The dillema is that the Servlet Model as defined in the specification doesn't work well in the kind of environment provided by NIO, so it's difficult to say whether something that handled the semantics of a Servlet written using NIO would actually be any faster at all. Now, technically, if one were so inclined, you could implement that bits that handle static content with Tomcat to, perhaps, use the nio model and maybe get a bonus for a pure Tomcat, yet static heavy, site. But since most folks simply Don't Do That (i.e. if they're distinguishing static content at all, odds pretty good that they're fronting Tomcat with Apache anyway...), there's little motivation to engineer Tomcat to support NIO for simply static content. Servlets are pretty much thread based, being as they can perform arbitrary calculations. Also, Servlets can, technically, access the input and output streams of the request directly. Many servlets don't need that kind of direct access. For example, most simply use the request headers and parameters rather than the input stream itself. NIO based servers are essentially event driven, with the sockets and IO channels being a dominant source of the events. The NIO server repeatedly checks the two ends of a request (the source and the sink, for example, the input stream and server logic). When the source has data ready to read and the sink is ready to take data, the NIO server grabs a chunk from the source and feeds it to the sink, and then moves on to the other sources/sinks within its queue. The main thread of an NIO server can NOT block waiting for something to come ready, as it will stall the entire server (because none of the other requests will get serviced). If you're simply moving data from disk to a socket, this works fine because OS's offer asynchronous IO calls and make available routines which an NIO server can use to see who's waiting and needs servicing. But exposing that is it ready interface to arbitrary logic like that within a servlet is difficult. If the code is very short, it's no problem at all. The code is always ready and essentially returns immediately. But if it's doing anything more than that (say, contacting a database), then things get more ugly very quickly. The IO drivers of the system are asynchronous without directly using a user level mechanism like threads, so they're asynchronous for free. But if you want user written logic to have an asynchronous behavior, we typically turn to threads to provide that for us. But, the strength of the NIO model is that the requests it manages within its internal queue have simple state than a
Re: [Somewhat OT] Content vs. Programming
Anthony E. Carlos wrote: Hello, folks! Based on my readings, it seems that most people running Tomcat on dedicated boxes. Unfortunately, I'm in a shared environment running multiple instances of Tomcat, one for each client. My problem is that some clients like to update their own static content via ftp, while letting me, the programmer, handle the more complex stuff. What stinks is that if they ftp content to the server, then I've got to merge their new and changed stuff into my development box because when I deploy my war file (I'm developing in a separate environment), it overwrites all of their stuff. My content providers aren't technically savvy, so I can't expect them to learn to use CVS. They're probably using some GUI program like Dreamweaver to create their pages. Does anyone have a suggestion to help streamline the battle of content providers versus programmers? I've thought of having them upload to a alternate directory and then running some ant script to copy new and changed files into the Tomcat directories, but that still won't help with the merging process. To make things even more complicated, and we're also using Tiles so my content providers have to ask me to add entries into struts-config.xml and tiles-defs.xml when they create a new page. Is anyone else dealing with this kind of inefficiency, or do you all work with just other programmers? Don't war it and update the server with your changes via cvs. Then you can check if there are updates on the server, if so commit them and then update locally. best, -Rob Thanks for your opinions, -Anthony Carlos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLT parser alternatives
David Aleksanyan wrote: Hi everyone, I'm relatively new to Tomcat and am looking for some direction to solve a performance issue. We have an app that does XSLT transformation after creating the XML in the JSP. Right now we're using XALAN for XSLT transform with Tomcat and it's terribly slow. I've searched the net and it seems to me that the only thing available is open source is XT which is I think not supported any more. I couldn't find a sample to make a transformation and see if it's any better. After further research I found out that if I could precompile the XSL stylesheets with XSLTc then I would notice improvement. But again I wasn't able to find any samples on using XALAN for this and finally decided to ask you. Did you have any experience with this and could you recommend anything? maybe another library that accomplishes this or maybe a sample of doing XSLTc precompilation. Are you caching your Templates object (you should not cache the Transformer object)? Anyway, you could 'pre' compile them in a servlet's init method with load-on-startup=1 (or some other value). However, I don't think you will get validation errors until you run source through the stylesheets. You might want to check out Caucho's Resin which also compiles the XSL. It is open source, but not free. best, -Rob Thanks, David Aleksanyan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSLT parser alternatives
Shapira, Yoav wrote: Hi, If you haven't read this already, I suggest http://xml.apache.org/xalan-j/xsltc/xsltc_performance.html. And The only thing I disagree with in the above page is avoiding keys. Perhaps it is a good practice for xsltc, but keys can greatly improve transformation speed and ease xpath statements. You *should* use keys if you have to jump around the source frequently. While using compiled stylesheets reduces memory usage, I find using a cached Templates object (using Saxon) the best way to go, especially when building the Templates object in the init method. This because if you have any XSL validity errors you will see them immediately. best, -Rob http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPXSLT3.html. Yoav Shapira Millennium Research Informatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reducing network traffic for rollover images
Robert Hunt wrote: To clarify: Watching the Tomcat access log and using permutations of CSS and the FrankZ/jscript-caching-strategy to achieve the rollover effects, I've found that the background image is requested: IExplore 6.0Netscape 7.2 - -- CSSeach mouseover once per page(1) JS once per page(2) once per page(2) each mouseover (1) upon first hover/mouseover (2) when the jscript executes I have been hoping someone would offer some innovative solution, but there really isn't one... You have to perform some ugly hack. Check http://alistapart.com for some solutions. For example, you could provide the image with both (3?) states and adjust the margin to show the correct state: a href=boo class=hoverLink normal onmouseover=this.className='hoverLink hover' onmouseout=this.className='hoverLink normal'boo/a With the image looking like: - | normal state | 30px in ht - | hover state | 30px in ht - .hoverLink { background: url(images/states.gif); } .normal { margin-top: 0px; } .hover { margin-top: -30px; } something like that... :( best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using XInclude in tomcat's config files
Shankar Unni wrote: Shankar Unni wrote: Is it possible to configure Tomcat to be able to use XInclude to include fragments of XML into Tomcat's own configuration files (server.xml, the various webapp web.xml's, etc.)? Bump? No one's tried this yet? Haven't tried it, but have you set the: org.xml.sax.parser=org.apache.xerces.parsers.XIncludeParserConfiguration ? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP XML syntax - was -Re: JSP Compiler produces huge HTML files with whitespace
Hi, If you use the XML syntax you can handle whitespaces nicely. There are times when you want/need whitespace to remain, so managing it with the XML syntax is better, imho. Are people using the XML syntax? best, -Rob Shapira, Yoav wrote: Hola, I'm not a Jasper expert, my guess is for two reasons: - It's a slight performance hit - There's a slight change of bugs or sub-optimal behavior. For example a subtle one was pointed out the other day: with trimSpaces on, ${something} followed by a space becomes just ${something} without a space after it. But for some HTML tags, e.g. img, and some browsers, this causes different display behavior. Yoav Shapira Millennium Research Informatics -Original Message- From: Brad Neuberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 1:45 PM To: Tomcat Users List Subject: RE: JSP Compiler produces huge HTML files with whitespace Yoav, thanks; this works. One question; why isn't this true by default? Brad At 09:56 AM 9/8/2004, you wrote: Hi, trimSpaces at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html. Yoav Shapira Millennium Research Informatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Real problem posting Euro symbol from jsp page, using TC 5.0
Ben Bookey wrote: Hi , You meta element: META NAME=GENERATOR CONTENT=test page for encoding http-equiv=Content-Type content=text/html charset='utf-8' seems wrong. You kind of have two content attributes, but still looks wrong. Can you try: meta http-equiv=Content-Type content=text/html; charset=utf-8 ? best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ampersand problem in JSP document
Hi, (jumping in late) Have you tried: jsp:directive.page contentType=text/xml / and perhaps: jsp:output doctype-root-element=html doctype-public=-//W3C//DTD XHTML 1.0 Transitional//EN doctype-system=http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/ best, -Rob Andreas Schildbach wrote: Shapira, Yoav wrote: Does it happen if you have a proper JSP XML page, e.g. jsp:root xmlns:jsp=http://java.sun.com/JSP/Page; version=1.2 jsp:text![CDATA[html body center h1Hello World/h1 /center /body /html]]/jsp:text /jsp:root It happens with the following small jspx: jsp:root version=2.0 xmlns:jsp=http://java.sun.com/JSP/Page; hrefmyurl?param1=value1amp;param2=value2/href /jsp:root - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: web.xml pointing to other xml files?
Woodchuck wrote: actually i'm using Ant too. i'm pre-compiling using the jspc task and it generates a file containing servlet and servlet-mapping tags. that's exactly what i need to do really, is to merge this file with my web.xml file. if you can show me how you're doing it that would be great, thanks! i didn't look into doing this right away because i thought it would be simpler to just have web.xml point to this file... :p You could use XSL and output a file from something like: xsl:variable name=otherDescriptor select=document('_web.xml')/*/ xsl:template match=/ xsl:apply-templates select=//filter/ xsl:apply-templates select=$otherDescriptor//filter/ xsl:apply-templates select=//filter-mapping/ xsl:apply-templates select=$otherDescriptor//filter-mapping/ xsl:apply-templates select=//servlet/ xsl:apply-templates select=$otherDescriptor//servlet/ xsl:apply-templates select=//servlet-mapping/ xsl:apply-templates select=$otherDescriptor//servlet-mapping/ /xsl:template best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp:directive.include behavior
I have the same problem (expanded entities). It works the same in Resin. I posted a question about this a week or so ago. Maybe we should ask on Dev? Is the XML syntax being used? best, -Rob William M. Shubert wrote: Hello, I'm having a little trouble with the way that jsp:directive.include works in Tomcat 5 (5.0.19 to be exact). I've read the JSP 2.0 spec, and it's confusing enough that I may well be misunderstanding it, but the way that the spec reads and the behavior I get from tomcat don't match at all! Here's the issue: My files are all XML-style JSP documents. I expect from the spec that adding jsp:directive.include file=xxx.jspf/ into my JSP document should give me a result as if xxx.jspf had been cut and pasted into the master JSP document. This isn't what is happening though. Instead, it seems like xxx.jspf is skipping a processing step, or being processed as a non-XML JSP file. In the master jsp file, all comments like !-- -- are stripped out, and all character elements are processed a bit, so if I want an ampersand in the final XHTML document, I need to say amp;amp;. In the included xxx.jspf file, though, !-- -- comments are left in (and make it all the way to the client), and character elements are left alone as if they were inside CDATA blocks. This is annoying, especially the comments; the comments are being treated as character data when tags are evaluated, so tags that aren't supposed to have character data like c:choose give errors unless I move all comments outside the c:choose or inside an inner c:when tag. Furthermore, a lot of the comments are notes to myself, and I would prefer that they not make it to the end users. So can somebody explain the rationale here? If I could understand why things act this way, I could probably live with it, instead of getting annoyed every time that I stumble across another include-related issue. Even better, is there some way to get the behavior I expect - to process an included JSP fragment exactly as if it were part of the original XML-style JSP file. Thank you. Bill Shubert ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Porting from Resin to Tomcat
Worley Brent - bworle wrote: Does this WEB-INF folder (in its lib directory obviously) contain servlet.jar, servlet-api.jar, jsp-api.jar, any jasper jars (e.g. jasper-compiler.jar), or any other jars that are also packaged with tomcat in its common/lib directory/ No, it doesn't. Just checked. It will tell you some problems, but not all, and likely not to tell you more information than the stack traces you posted. Automated tools can do very little to help you resolve jar file version conflicts. Ok. I will try it once, see what is says, and then start digging through the specs to see what is different. Thanks! Have you validated your web.xml? Resin allows many configuration shortcuts and order differences. best, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Porting from Resin to Tomcat
Worley Brent - bworle wrote: Have you validated your web.xml? Resin allows many configuration shortcuts and order differences. No, but I would appreciate any more information you have on this. You can use a doctype at the top of your document (see some of the example web.xml's): !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; The easiest thing to do if you are inexperienced with this type of thing is to download a GUI app like oXygen (http://oxygenxml.com) and click the validate button. best, -Rob Brent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XML syntax for JSP
Hi, I am currently using Caucho's Resin as my servlet container, but now starting to check out other containers. I would like to ask a quick question before jumping into Tomcat. (I have to do quite a bit of configuration changes as I unfortunately used some shortcuts that resin allows) First some background: We have a CMS that pregenerates JSPs using XSL and XML. To keep things clean I output to the XML syntax. The JSP renders to well-formed HTML. The JSP I output also includes a processing instruction that instructs the JSP to do an XSL transformation (to XHTML or HTML) after it renders itself. jsp:directive.page contentType=x-application/xsl/ The problem is that I cannot have another processing instruction that tells it to render truly well-formed HTML, the main problem being that it expands entities before the XSL transformation (a resin bug). So I need to do an ugly hack in the source XML. Where I would like something like: a href=page.jsp?a=bamp;c=dboo/a I have to do: a href=page.jsp?a=bamp;amp;c=dboo/a . My question is, if I use Tomcat with the above scenario, will the JSP render truly well-formed XML for the final transformation? Thanks for any information, -Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Xalan Redirect for multiple output from Web Page
h3a href={@file}Exercise xsl:value-of select=.//a/h3 redirect:write file=ccrap.html I think you might want (I assume the @file is a relative path, otherwise provide the full system path): h3a href={@file}Exercise xsl:value-of select=.//a/h3 redirect:write select=@file but, there is an XSL list which I believe is at mullberrytech.com - Original Message - From: Ruairi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 05, 2001 3:47 AM Subject: Xalan Redirect for multiple output from Web Page Hi, I need to generate a few html files from one request. I have tried xt:document with little success, so I am now trying Xalan's Redirect. I run the following XSL through Cocoon and get no error messages. However no extra files are generated on the server. Is this a directory permissions issue? BTW, Is this a question for the users list, or the developers list? Thanks in advance. -Ruairi XSL File: ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:lxslt=http://xml.apache.org/xslt; xmlns:redirect=org.apache.xalan.xslt.extensions.Redirect extension-element-prefixes=redirect xmlns:xlink=http://www.w3.org/1999/xlink; exclude-result-prefixes=xlink xsl:output method=html/ xsl:template match=*[@xlink:type = 'simple' and @xlink:href] lia href={@xlink:href} onmouseover=xsl:apply-templates//a/li /xsl:template xsl:template match=course htmlbody h2Exercise Links/h2 xsl:for-each select=solutions|originals h3a href={@file}Exercise xsl:value-of select=.//a/h3 redirect:write file=ccrap.html html titlexsl:value-of select=.//title body h2Exercise xsl:value-of select=.//h2 ul xsl:apply-templates select=*/ /ul a href=xlink.xmlCase Study - Home/a /body/html /redirect:write /xsl:for-each Course by a href={author/@xlink:href}xsl:value-of select=author//a /body/html /xsl:template /xsl:stylesheet XML file: ?xml version=1.0? ?xml-stylesheet href=ex52b.xsl type=text/xsl? ?cocoon-process type=xslt? course xmlns:xlink=http://www.w3.org/1999/xlink; author xlink:href=http:/www.rutlands.com xlink:type=simpleRuairi O'Donnell/author solutions file=soultions.html tpye=html exercise xlink:href=http:/localhost/solutions/ex11/ xlink:type=simple xlink:title=Ex1.1Description/exercise exercise xlink:href=http:/localhost/solutions/ex12/ xlink:type=simple xlink:title=Ex1.2Description/exercise /solutions originals file=originals.html tpye=html exercise xlink:href=http:/localhost/start/ex11/ xlink:type=simple xlink:title=Ex1.1Description/exercise exercise xlink:href=http:/localhost/start/ex12/ xlink:type=simple xlink:title=Ex1.2Description/exercise /originals /course Regards, -Ruairi