Today I created a web app but I forgot to copy the template directory to my context root but
what I noticed is that I didn't get any error messages at all so this could be quite a difficult problem to solve without them. Of course I didn't get any HTML for my ui tags so that's a bit of a giveaway really.

I'm wondering

If you can expect IncludeTag's include method to throw an exception.

I'm guessing that RequestDispatcher isn't always going to return null if the path isn't found.

What about rd.include ... what exceptions will it throw in the event the path isn't found?

I think the framework should do a better job of handling this situation.

if you rename your template directory run your webapp you will not get servlet exception or an ioexception.

public static void include(String aResult, PageContext aContext)
throws ServletException, IOException
{
String resourcePath = getContextRelativePath(aContext.getRequest(), aResult);
RequestDispatcher rd = aContext.getRequest().getRequestDispatcher(resourcePath);

if (rd == null)
throw new ServletException("Not a valid resource path:" + resourcePath);

PageResponse pageResponse = new PageResponse((HttpServletResponse) aContext.getResponse());
// Include the resource
rd.include((HttpServletRequest)aContext.getRequest(), pageResponse);

//write the response back to the JspWriter, using the correct encoding.
String encoding = getEncoding();
if (encoding != null)
{
//use the encoding specified in the property file
pageResponse.getContent().writeTo(aContext.getOut(), encoding);
}
else
{
//use the platform specific encoding
pageResponse.getContent().writeTo(aContext.getOut(), null);
}
}



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

Reply via email to