Hi,

the solution I sent you was not a good solution. The configuration of the 
apache was ok, but the changes in Shell weren't good. This worked only with 
Apache 1.3.20. Later we tried Apache 1.3.23 and Apache 2.0 and found out 
that this solution does not work, because then the apache host is not in 
the 'Referer'-field of the header anymore. Instead you find it in the 
'Via'-field', which you have to parse to find out the apache server url. 
What I suggest now is to delegat the building of the base url  from the 
Shell to the SimpleEngine or it's subclass. In SimpleEngine it could be the 
way you wrote it. In my subclass of the engine I have now implements 
buildBaseURL like this:

public String buildBaseURL(IRequestCycle cycle) {
                String url;
                RequestContext context = cycle.getRequestContext();
                String via = context.getRequest().getHeader("Via");
                if (via == null)
                        url = super.buildBaseURL(cycle);
                else {
                        int startIndexOfHost = via.indexOf(" ") + 1;
                        int endIndexOfHost = via.indexOf(" ", startIndexOfHost);
                        url =
                                "https://";
                                        + via.substring(startIndexOfHost, 
endIndexOfHost)
                                        + cycle.getEngine().getServletPath();
                }
                DaedalosLibraryServlet.category.debug("URL: " + url);
                return url;
        }

This is working, but I don't like it very much, it is quite ugly. Because I 
could not found out whether the url of the apache server is https or http, 
I hard coded it here. This code does not work without https. So it is just 
a solution for my application and my environement. Maybe there is no 
genereal solution. Therefore I'd like to have it in the engine class to be 
able to adjust it to my requirements. Then it would be possible to read the 
base url  out of a configuration file for example.

Best regards,

  Christian Noack


Daedalos Consulting GmbH
www.daedalos.com
[EMAIL PROTECTED]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to