You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Gordon <ad...@readytalk.com> on 2006/08/11 17:45:38 UTC
Getting maxFileSize from Controller in a JSP
Is there a way to reference the controller for a module from within a
JSP? Specifically, I'd like to ask the controller what the max file
size is set to. There's a method on the ControllerConfig class to get
the max file size and the Javadocs say it's a JavaBean so I suspect it
might available from within a JSP, I just don't know the name
(controller?) of the bean to reference in the JSP.
Anyone know?
thanks,
-- adam
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Getting maxFileSize from Controller in a JSP
Posted by David Durham <dd...@vailsys.com>.
Adam Gordon wrote:
> Is there a way to reference the controller for a module from within a
> JSP? Specifically, I'd like to ask the controller what the max file
> size is set to. There's a method on the ControllerConfig class to get
> the max file size and the Javadocs say it's a JavaBean so I suspect it
> might available from within a JSP, I just don't know the name
> (controller?) of the bean to reference in the JSP.
There's a module config that's stored as a request attribute. THe key
is in the Globals class, I think it's MODULE_KEY. It has a reference to
a controller config. Little utility method to find what's in request
attributes:
public static void debugRequestAttributes(HttpServletRequest request) {
Enumeration<String> attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String a = attributeNames.nextElement();
log.debug(a + ": " + request.getAttribute(a));
}
}
-Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org