Re: url rewriting
Chris, I don't know much about actions, so I can't help you too much with that. However, I can offer some hints on the EncodeURLTransformer. Basically, it has a bug. The first time you hit a page, it fails to rewrite the URLs. This works for some frameworks, in which the first page is a login page, with the form action manually rewritten in XSP, and then all subsequent pages are rewritten. Someone else posted on the mailing list a while back (http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=103241658409677w=2), but it doesn't appear to have been picked up by the Cocoon developers; it's been on my to-do list for a little while to add this to bugzilla, so I'll try to take the time to do that today. In the meantime, to fix the bug, we changed the source code for EncodeURLTransformer, compiled it, and put it in our cocoon.jar in place of the old one. I think you can also just put it in WEB-INF/classes, if you are using Tomcat, but we didn't try that. Anyway, you can use the fix suggested in the link above, or you can try ours. Ours is maybe a bit simpler, but you tend to get URLs rewritten on the first page regardless of whether the browser needs it, which doesn't hurt anything but might bother some people. Our fix is: replace: if ( request.isRequestedSessionIdFromURL()) { with: if ( request.isRequestedSessionIdFromURL() || this.session.isNew()) { in the setup() method. -Christopher hi all! i use win200, cocoon2.0.2, weblogic6.0sp2 i tried url-rewriting in my action--- Map sitemapParams = new HashMap(); Request req = ObjectModelHelper.getRequest(objectModel); Session session = req.getSession(); if (session.isNew()) { // data i want to read out in my xsp-site session.setAttribute(data, myObject); sitemapParams.put(nextpage, home); } as it is given in the documentation my sitemap looks as following -- map:match pattern=startOR map:act type=ORAction map:generate src=orneu/{nextpage}.xsp type=serverpages/ !--map:generate src=orneu/registrierung1.xsp type=serverpages/-- map:transform src=orneu/xml2html.xsl type=xslt/ map:transform type=encodeURL/ /map:act map:serialize type=html/ /map:match also i configured my weblogic, not to use cookies -- see may attached weblogic.xml but every time, i go a second time in my action, it seems that the action creates every time a new session and my session-data is lost i studied the EncodeURLTransformer, but it doesn't helped me (i don't know how to in my action use this) has someone a code-example who to write a cocoon-action with url-rewriting. what do i wrong? please help! greetings, chris - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URL Rewriting
Have you looked at EncodeURLTransformer? -Alex -Original Message- From: Christoph Stocker [mailto:chris.stocker;gmx.at] Sent: Mon 10/21/2002 12:13 PM To: [EMAIL PROTECTED] Cc: Subject: URL Rewriting hi all! i use cocoon2.0.2, winxp and weblogic6.0sp2 i use cookies for session handling, but i dont want to do use cookies. i want to use url-rewriting in my cocoon-action. has anyone code examples how to do inside the action or links to pages who to use url-rewriting in cocoon-actions. now i use the session to put information between action and my website. can i use it also with url-rewriting? another question to weblogic: how do i turn on or off in my weblogic to use cookies for session handling or not. because in http://xml.apache.org/cocoon/developing/webapps/session.html http://xml.apache.org/cocoon/developing/webapps/session.html it says, Just refer to the documentation of your servlet engine on how to turn on cookies for session handling., but i can't find how in my weblogic. greetings, chris - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] application/ms-tnef- Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL rewriting solution in FAQ does not do the trick
Why not do this in $CATALINA_HOME/conf/server.xml: Context path= docBase=cocoon debug=0 reloadable=true/ Regards, Lajos Robert Bourdeau wrote: This is more of an Apache question than a Cocoon question, but hopefully someone will know what I'm doing wrong here. Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 Goal: Eliminate cocoon from the URL Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to receive request. URL mapping has to be done per virtual host. I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite enabled, then added the followed code to my httpd.conf: VirtualHost myhost.mydomain:80 ServerName myhost.mydomain DocumentRoot /myhost.mydomain/htmls IfModule mod_rewrite.c RewriteEngine on RewriteLog /var/adm/www/rewrite.log RewriteLogLevel 9 RewriteRule ^/xml /cocoon/xml/ [R] RewriteRule ^/xml(.*) /cocoon/xml$1 [R] /IfModule WebAppConnection conn warpmyhost.mydomain:8008 WebAppDeploy cocoonconn/cocoon /VirtualHost I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap outside of the Cocoon tree. This URL works: http://myhost.mydomain/cocoon/xml/foo * Apache correctly passes the /cocoon/xml/foo address to Tomcat which then passes it to Cocoon. Output is correct This URL http://myhost.mydomain/xml/foo is redirected to http://myhost.mydomain/cocoon/xml/foo and the user sees it in the browser. Not what I wanted. I tried the single line [PT] variation shown in the FAQ, and as indicated there, this does not work at all. Thoughts? Regards, --- Bob Bourdeau - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cocoon training, consulting support galatea.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URL rewriting solution in FAQ does not do the trick
Lajos, OTOH, the adding of this context will make the Tomcat doc and Tomcat home page unreacheable. There are ways around it (like the adding of /root and /tomcat-docs contexts), but replacing the default Tomcat behaviour doesn't seem to me such a good idea; though, it may be just fine for a production environment. In my opinion the use of mod_rewrite, ugly as it may be, is still the path of least resistance (it doesn't alter the behaviour of anything). Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: Lajos Moczar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 5:57 PM To: [EMAIL PROTECTED] Subject: Re: URL rewriting solution in FAQ does not do the trick Why not do this in $CATALINA_HOME/conf/server.xml: Context path= docBase=cocoon debug=0 reloadable=true/ Regards, Lajos Robert Bourdeau wrote: This is more of an Apache question than a Cocoon question, but hopefully someone will know what I'm doing wrong here. Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 Goal: Eliminate cocoon from the URL Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to receive request. URL mapping has to be done per virtual host. I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite enabled, then added the followed code to my httpd.conf: VirtualHostmyhost.mydomain:80 ServerNamemyhost.mydomain DocumentRoot /myhost.mydomain/htmls IfModule mod_rewrite.c RewriteEngine on RewriteLog /var/adm/www/rewrite.log RewriteLogLevel 9 RewriteRule ^/xml /cocoon/xml/ [R] RewriteRule ^/xml(.*) /cocoon/xml$1 [R] /IfModule WebAppConnection conn warpmyhost.mydomain:8008 WebAppDeploy cocoonconn/cocoon /VirtualHost I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap outside of the Cocoon tree. This URL works: http://myhost.mydomain/cocoon/xml/foo * Apache correctly passes the /cocoon/xml/foo address to Tomcat which then passes it to Cocoon. Output is correct This URL http://myhost.mydomain/xml/foo is redirected to http://myhost.mydomain/cocoon/xml/foo and the user sees it in the browser. Not what I wanted. I tried the single line [PT] variation shown in the FAQ, and as indicated there, this does not work at all. Thoughts? Regards, --- Bob Bourdeau - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cocoon training, consulting support galatea.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL rewriting solution in FAQ does not do the trick
True, you are building stuff right out of the box and don't want to make configuration changes that might be overwritten when you reinstall or upgrade components. However, for production purposes, the Tomcat home and docs pages are oftentimes superfluous (just like Cocoon examples, Apache docs, etc.). At least I find them sperfluous, as do many of my clients. Hence, I typically strip off all included webapps, and make cocoon the ROOT context. Regards, Lajos Luca Morandini wrote: Lajos, OTOH, the adding of this context will make the Tomcat doc and Tomcat home page unreacheable. There are ways around it (like the adding of /root and /tomcat-docs contexts), but replacing the default Tomcat behaviour doesn't seem to me such a good idea; though, it may be just fine for a production environment. In my opinion the use of mod_rewrite, ugly as it may be, is still the path of least resistance (it doesn't alter the behaviour of anything). Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: Lajos Moczar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 5:57 PM To: [EMAIL PROTECTED] Subject: Re: URL rewriting solution in FAQ does not do the trick Why not do this in $CATALINA_HOME/conf/server.xml: Context path= docBase=cocoon debug=0 reloadable=true/ Regards, Lajos Robert Bourdeau wrote: This is more of an Apache question than a Cocoon question, but hopefully someone will know what I'm doing wrong here. Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 Goal: Eliminate cocoon from the URL Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to receive request. URL mapping has to be done per virtual host. I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite enabled, then added the followed code to my httpd.conf: VirtualHost myhost.mydomain:80 ServerName myhost.mydomain DocumentRoot /myhost.mydomain/htmls IfModule mod_rewrite.c RewriteEngine on RewriteLog /var/adm/www/rewrite.log RewriteLogLevel 9 RewriteRule ^/xml /cocoon/xml/ [R] RewriteRule ^/xml(.*) /cocoon/xml$1 [R] /IfModule WebAppConnection conn warpmyhost.mydomain:8008 WebAppDeploy cocoonconn/cocoon /VirtualHost I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap outside of the Cocoon tree. This URL works: http://myhost.mydomain/cocoon/xml/foo * Apache correctly passes the /cocoon/xml/foo address to Tomcat which then passes it to Cocoon. Output is correct This URL http://myhost.mydomain/xml/foo is redirected to http://myhost.mydomain/cocoon/xml/foo and the user sees it in the browser. Not what I wanted. I tried the single line [PT] variation shown in the FAQ, and as indicated there, this does not work at all. Thoughts? Regards, --- Bob Bourdeau - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cocoon training, consulting support galatea.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- galatea.com Cocoon training, consulting support - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URL rewriting solution in FAQ does not do the trick
From: Luca Morandini [mailto:[EMAIL PROTECTED]] Lajos, OTOH, the adding of this context will make the Tomcat doc and Tomcat home page unreacheable. $TOMCAT_HOME/bin/shutdown cd $TOMCAT_HOME/webapps mv ROOT tomcat mv cocoon ROOT $TOMCAT_HOME/bin/startup :) There are ways around it (like the adding of /root and /tomcat-docs contexts), but replacing the default Tomcat behaviour doesn't seem to me such a good idea; though, it may be just fine for a production environment. This context (ROOT) is == to the Apache's famous This host has Apache HTTP server installed, and does not have own web site developed yet. Please do not write Apache about this happy guy who managed to install Apache HTTP server and must be removed as soon as solution goes to QA, or even way before this. :) In my opinion the use of mod_rewrite, ugly as it may be, is still the path +1. It is ugly. of least resistance (it doesn't alter the behaviour of anything). -1. Why keep ugly and less performing solution while others exist? Vadim Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: Lajos Moczar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 18, 2002 5:57 PM To: [EMAIL PROTECTED] Subject: Re: URL rewriting solution in FAQ does not do the trick Why not do this in $CATALINA_HOME/conf/server.xml: Context path= docBase=cocoon debug=0 reloadable=true/ Regards, Lajos Robert Bourdeau wrote: This is more of an Apache question than a Cocoon question, but hopefully someone will know what I'm doing wrong here. Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 Goal: Eliminate cocoon from the URL Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to receive request. URL mapping has to be done per virtual host. I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite enabled, then added the followed code to my httpd.conf: VirtualHost myhost.mydomain:80 ServerName myhost.mydomain DocumentRoot /myhost.mydomain/htmls IfModule mod_rewrite.c RewriteEngine on RewriteLog /var/adm/www/rewrite.log RewriteLogLevel 9 RewriteRule ^/xml /cocoon/xml/ [R] RewriteRule ^/xml(.*) /cocoon/xml$1 [R] /IfModule WebAppConnection conn warpmyhost.mydomain:8008 WebAppDeploy cocoonconn/cocoon /VirtualHost I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap outside of the Cocoon tree. This URL works: http://myhost.mydomain/cocoon/xml/foo * Apache correctly passes the /cocoon/xml/foo address to Tomcat which then passes it to Cocoon. Output is correct This URL http://myhost.mydomain/xml/foo is redirected to http://myhost.mydomain/cocoon/xml/foo and the user sees it in the browser. Not what I wanted. I tried the single line [PT] variation shown in the FAQ, and as indicated there, this does not work at all. Thoughts? Regards, --- Bob Bourdeau -- Cocoon training, consulting support galatea.com - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL rewriting solution in FAQ does not do the trick
This is more of an Apache question than a Cocoon question, but hopefully someone will know what I'm doing wrong here. Setup: SPARC Solaris 2.7, Apache 1.3.24 w/mod_webapp (Warp), and Tomcat 4.0.1 Goal: Eliminate cocoon from the URL Constraints: Want all my custom content (XML, stylesheets, etc.) to be removed from the Cocoon tree so I can upgrade Cocoon separately. Must use Apache to receive request. URL mapping has to be done per virtual host. I looked at the FAQ, and followed the instructions. I rebuilt Apache with mod_rewrite enabled, then added the followed code to my httpd.conf: VirtualHost myhost.mydomain:80 ServerName myhost.mydomain DocumentRoot /myhost.mydomain/htmls IfModule mod_rewrite.c RewriteEngine on RewriteLog /var/adm/www/rewrite.log RewriteLogLevel 9 RewriteRule ^/xml /cocoon/xml/ [R] RewriteRule ^/xml(.*) /cocoon/xml$1 [R] /IfModule WebAppConnection conn warpmyhost.mydomain:8008 WebAppDeploy cocoonconn/cocoon /VirtualHost I also modified the Cocoon sitemap.xmap to forward the processing to a sitemap outside of the Cocoon tree. This URL works: http://myhost.mydomain/cocoon/xml/foo * Apache correctly passes the /cocoon/xml/foo address to Tomcat which then passes it to Cocoon. Output is correct This URL http://myhost.mydomain/xml/foo is redirected to http://myhost.mydomain/cocoon/xml/foo and the user sees it in the browser. Not what I wanted. I tried the single line [PT] variation shown in the FAQ, and as indicated there, this does not work at all. This is what I use (apache 1.3.24, Tomcat 4.0.4): VirtualHost www.mydomain DocumentRoot /home/sites/www.mydomain RewriteEngine On RewriteRule ^/(.*)\.jsp$ /jsp/$1.jsp [R] RewriteRule ^/(.*)\.xml$ /xml/$1.xml [R] IfModule mod_webapp.c WebAppConnection netConnection warp www.mydomain:8008 WebAppDeploy Servlets netConnection /Servlet WebAppDeploy cocoon netConnection /xml WebAppDeploy jsp netConnection /jsp /IfModule /VirtualHost (I have similar entries, with different WebAppConnections, for the other virtual hosts). This way http://www.mydomain/test.xml gets redirected to http://www.mydomain/xml/test.xml which gets passed on to cocoon (Servlets and jsp references get passed on directly to Tomcat). Make sure that the tomcat server.xml entry has a connector for each virutal host in the Tomcat-Apache Service section, e.g.: Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 address=10.9.8.7 minProcessors=5 maxProcessors=75 enableLookups=true appBase=www.mydomain_apps acceptCount=10 debug=0/ -- Dr. Everett (Skip) Carter Phone: 831-641-0645 FAX: 831-641-0647 Taygeta Scientific Inc.INTERNET: [EMAIL PROTECTED] 1340 Munras Ave., Suite 314WWW: http://www.taygeta.com Monterey, CA. 93940 - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URL rewriting solution in FAQ does not do the trick
From: Luca Morandini [mailto:[EMAIL PROTECTED]] -1. Why keep ugly and less performing solution while others exist? because I don't like altering the behaviour of Tomcat, messing around with its own servlets: I may not be the only one using Tomcat on that machine :( Then, I suppose, that's not a production box but rather some kind of dev environment, where it is not necessary to have Apache at all (up to integration testing). But when you go into production, it's better to remove these docs (do you want your customers to see Yep, Tomcat *is* working on this machine!!! when they go to the root of your server? Yes, you can hide it by giving some CPU time to URL rewriting module :) Vadim Best regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]