ForwardExternalContextRequestWrapper getServletRequest() always returns an empty String

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ForwardExternalContextRequestWrapper getServletRequest() always returns an empty String

Jonathan J Wright
Hi,
 
I came across this, which may be of interest to others, when debugging OPS:
 
Problem:
 
1) An Xform submits to a Struts action.
2) The action throws exception.
3) Exception handling has been configured declaratively in config.xml to use a velocity template for displaying an error page.
4) Velocity throws an excpetion because it cannot find a template called “”.

Cause:

At runtime OPS passes an instance of ExternalContextToHttpServletRequestWrapper to the Struts action. This object's getServletPath() method in turn calls getServletPath() on an member variable of type ForwardExternalContextRequestWrapper. The problem is that this method always returns an empty string. Conequentially the VelocityViewServlet handleRequest() method always fails when it tries to get the template name from the servlet path.

 

Jonathan
 
Skype: jonathan.j.wright


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: ForwardExternalContextRequestWrapper getServletRequest() always returns an empty String

Erik Bruchez
Administrator
Jonathan,

Thanks for this detailed analysis! Do you have a suggestion for how this
should be fixed?

-Erik

Jonathan J Wright wrote:

> Hi,
>  
> I came across this, which may be of interest to others, when debugging OPS:
>  
> Problem:
>  
> 1) An Xform submits to a Struts action.
> 2) The action throws exception.
> 3) Exception handling has been configured declaratively in config.xml to
> use a velocity template for displaying an error page.
> 4) Velocity throws an excpetion because it cannot find a template called “”.
>
> Cause:
>
> At runtime OPS passes an instance of
> ExternalContextToHttpServletRequestWrapper to the Struts action. This
> object's getServletPath() method in turn calls getServletPath() on an
> member variable of type ForwardExternalContextRequestWrapper. The
> problem is that this method always returns an empty string.
> Conequentially the VelocityViewServlet handleRequest() method always
> fails when it tries to get the template name from the servlet path.
>
>  
>
> Jonathan
>  
> Skype: jonathan.j.wright
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws