You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Bailey, Shane C." <SH...@saic.com> on 2003/07/29 19:11:52 UTC

[OT] Is there a way to set the pageContext request object in a JS P??

 

Because JRun wraps the original request on all RequestDispatcher.forward()
calls I put the original request in a request attribute

in a subclass of ActionServlet.  Reason: The original request will return a
valid isUserInRole() and the JRun request won't.

 

Now, because the <logic:present role="Admin"> ... </logic:present> tag
consults the pageContext.getRequest() to do the role

testing, is there a way to reset the pageContext request object in a JSP?? 

 

Here is the bottom line of what I would like to do in my JSP but I know this
is not correct:

 

<%=
pageContext.setRequest((HttpServletRequest)request.getAttribute("SECURITY_RE
QUEST")) %>

 

<logic:present role="Admin"> This tag would have consulted the request
object I had in the request attribute instead </logic:present> 

 

 

Either that or I am going to have to do scriptlets:

 

<bean:define id="secReq"  name="SECURITY_REQUEST" type="..." />

 

<% if(secRq.isUserInRole(){ %>

Same code I would have within the logic:present tag above

<% } %>

 

 

Any suggestions??