ingo schuster wrote:
>
> Hi, (I think this one goes primarily to John McNally)
>
> some questions/remarks regarding the JSPService:
>
> 0.a) I'm really happy that you checked this in!
> 0.b) I didn't try to understand all your code, just tried to get it running
> and adapt it for my purposes...
>
> 1.) In order to be consistent with the naming of the other Turbine
> services, shouldn't the service be called "TurbineJspService" instead of
> simply "JspService?"
I think the other services should drop the Turbine prefix in their
String defined in the service interface. This helps prevent confusion
with the actual implementation class (of which there could be several,
but the default or first one implemented is usually given the Turbine
prefix.) This was suggested by someone else and I think it passed the
vote, but I assume no one has undertaken the effort. I was just trying
it out while creating the JspService and if I was wrong about the
results of the vote it can be changed to match the others.
>
> 2.) In your examples (jsp_examples.txt, section default.jsp) an attribute
> called "contextRelevant" is used for the screen tag, however the respective
> screenTag bean doesn't define it.
I came up what I consider a better name "staticContent". But this did
not work when I first implemented it using the "contextRelevant" name,
so the conversion to "staticContent" is probably incomplete. If it
suits your purpose please help fix it up. "staticContent" is opposite
in meaning to "contextRelevant" => staticContent == !contextRelevant
>
> 3.) In ScreenPlaceHolder, the error/log message is wrong: you forgot to
> change it when you copied it from the NavigationPlaceHolder. ;)
>
Fixed. Thanks.
> 4.) This is the most important one for me. The initJsp method in
> TurbineJspService doesn't make sense to me: You take the path to the
> templates and if it starts with a slash, the slash is stripped of. At the
> end however, you check wether the the path ends with a slash. If not, you
> add one.
I think I started with the code from the other template services and
modified things so that Tomcat was finding my sample jsp templates. It
is certainly possible that it is not optimum, but it is working. I
think the best way is to have it work regardless of whether a starting
slash or ending slash is given in the props file, which is what I think
the code you are discussing may be doing.
The path should of course be relative to the document root for the
webapp. Beyond that you are welcome to modify it as long as it works
the same or adds more functionality. Try to keep in mind the other
template systems as I like to keep them as symmetric as possible.
> Firstly, the templates are usually stored somewhere below the webserver's
> document root, aren't they? In this case, I definitely _need_ the path to
> start with a slash!
> Secondly, I set the services.JspService.templates key to "/templates/jsp"
> and my default layout page to "/default.jsp". This is how it is suggested
> by the services.TurbineTemplateService.default.layout.template key. If you
> do it like this, there shouldn't be a slash at the end of the template path.
> In short: I would rather do it the other way round - make sure there is a
> slash at the beginning and none at the end. (Or just leave the two ifs out,
> so that everybody can use the style he/she wants to).
>
> ingo
>
> P.S.: The method like I currently use it.
> =============================
> /**
> * This method sets up the template cache.
> */
> private void initJsp(ServletConfig config)
> throws Exception
> {
> ServletContext context = config.getServletContext();
> Properties props = getProperties();
>
> path = props.getProperty("templates", "");
> if (path.startsWith("/"))
> {
> // why?? path = path.substring(1);
> }
> if (path.length() > 0 && !path.endsWith("/"))
> {
> // why?? path += "/";
> }
>
> bufferSize = Integer.parseInt(props.getProperty("buffer.size",
> "2000000"));
> }
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]