Notes from Ian Boston

Notes from Ian Boston

----Original Message----
From: Ian Boston ian@caret.cam.ac.uk
Sent: Wednesday, April 26, 2006 11:01 AM
To: Zeckoski, Aaron
Subject: Re: CSS inclusion in JSF

You need to map you servlet to a URL that isnt picked up in the reques
dispatch

eg
<servlet-mapping>
<servlet-name>sakai.search</servlet-name>
<url-pattern>/search/*</url-pattern>
</servlet-mapping>
Does not cause a cycle

<servlet-mapping>
<servlet-name>sakai.search</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

Does since the
RequestDispatcher dispatcher
getServletContext().getRequestDispatcher("/main.jsp");

ends up going through the same servlet again.

Direct access can then be achieved pre-pending with /search

Remember the request dispatcher goes through the same URL processing as
a real request coming in from the outside. If it ends up in the same
place you will get recursion until you get a stack overflow.

Does that make sense?

Ian

Zeckoski, Aaron wrote:
Our web.xml file is here: https://source.sakaiproject.org/contrib/programmerscafe/trunk/cafe2/tool
/src/webapp/WEB-INF/web.xml

Our servlet is here (the code is commented out right now): https://source.sakaiproject.org/contrib/programmerscafe/trunk/cafe2/tool
/src/java/org/sakaiproject/tool/tasklist/TasklistTool.java

This is the forwarding code:
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("/main.jsp");
dispatcher.forward(req, res);

We call the jsp directly and it goes into an infinite loop. Any idea
what we are doing wrong? Our example is even simpler than what you guys
have but maybe it is too simple...
-AZ


Aaron Zeckoski (aaronz@vt.edu)
Lead Developer - Learning Technologies - Virginia Tech

>----Original Message----
>From: Ian Boston ian@caret.cam.ac.uk
>Sent: Wednesday, April 26, 2006 10:23 AM
>To: Zeckoski, Aaron
>Subject: Re: CSS inclusion in JSF

>Are you doing a request.sendRedirect or a RequestDispatcher.forward

>In the RequestDispatcher.forward you should be able to name your jsp
>file directly.

>see
>https://source.sakaiproject.org/svn/search/trunk/search-
>tool/tool/src/java/org/sakaiproject/search/tool/ControllerServlet.java

>for a simple example

>HTH
>Ian

Zeckoski, Aaron wrote:
Ian,
Speaking of using plain old JSP, we get into an infinite loop when
we try to get plain JSPs to work in Sakai. The sakai.request servlet
redirects to our servlet which tries to redirect to JSP but the
redirect gets captured by the sakai.request servlet and viola, infinite loop.

How do you guys get around this? Between Zach, Mark and I, we have
not made much progress.

Here is what we are trying: http://bugs.sakaiproject.org/confluence/display/BOOT/JSP+Sakai+Tool

-AZ

----Original Message----
From: Ian Boston ian@caret.cam.ac.uk
Sent: Wednesday, April 26, 2006 10:06 AM
Cc: sakai-dev
Subject: Re: CSS inclusion in JSF

Wiki uses simple old JSP not JSF, so its much easier, to get 100%
valid xhtml (but we dont some of the time)
the web.xml is just a config setting, rather than putting it into
the code or jsps. Is is mainly there to allow deployers to add Maths
support without having to open up the jsp files. We could have put it in
sakai.properties.... but that looked like overkill at the time.?

Ian