You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arne Brutschy <ma...@studserv.uni-leipzig.de> on 2003/11/03 12:29:11 UTC
Re[2]: EL Expression in html:hidden tag
Hello,
Thursday, October 30, 2003, 3:53:39 PM, you wrote:
RB> Is ${pageContext.request.servletPath} returning anything?
Yes, it is returning the right path.
RB> Try something like
RB> <html:hidden property="requestedPage"><c:out
RB> value="${pageContext.request.servletPath}"/></html:hidden>
I already tried this, it does not work. Basically, it should be the
same as
<html:hidden property="requestedPage">
${pageContext.request.servletPath}
</html:hidden>
or
<html:hidden property="requestedPage" value="${pageContext.request.servletPath}"/>
which are both not working. Is this some stutsbug? Why is the
html:hidden tag marked in the tld file with a rtexpressions=false?
Regards,
Arne
RB> Arne Brutschy wrote:
>>Hello,
>>
>>I'm having a problem with the html:hidden tag. What I'm trying to do is:
>>
>>On every page, there is a logout button included. When the user hits
>>the button, the request will be send to an logoutAction. Afterwards,
>>the request should be redirected back to the page where the user was
>>before he hit the button. My problem is, that the including page is
>>every time another one. So I tried to get it by
>>${pageContext.request.servletPath}. This works, but I cannot use it as
>>value in the html:hidden tag. I've seen people on this list doing
>>this, but my html-el.tld permits it. Does anyone know why? I'm using
>>struts 1.1 with the standard taglib ea 1.1, tomcat 5.0.12.
>>
>>Here is my jsp include:
>>
>> <%@ taglib
>> uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
>> .
>> .
>> .
>> <html:form action="login.do">
>> <html:hidden property="dispatch" value="logout"/>
>> <html:hidden property="requestedPage"
>> value="${pageContext.request.servletPath}"/>
>> <html:submit><bean:message
>> key="login.button.logout"/></html:submit>
>> </html:form>
>>
>>
>>and the action:
>>
>> public ActionForward logout(ActionMapping mapping, ActionForm
>> form, HttpServletRequest request,
>> HttpServletResponse response) throws Exception {
>>
>> // get session and loginForm
>> HttpSession session = request.getSession(true);
>> DynaActionForm loginForm = (DynaActionForm)form;
>>
>> // remove the user from the session
>> session.removeAttribute("user");
>> .
>> .
>> // stay on this page
>> String requestedPage =
>> loginForm.get("requestedPage").toString();
>> response.sendRedirect(requestedPage);
>>
>> return null;
>> }
>>
>>
>>Regards,
>>Arne Brutschy
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re[3]: EL Expression in html:hidden tag
Posted by Arne Brutschy <ma...@studserv.uni-leipzig.de>.
Hello,
I got it, a simple
<input type="hidden" name="requestedPage" value="${pageContext.request.servletPath}">
did the trick. I guess I shouldn't try to use struts tags too hard...
Thanks,
Arne
Monday, November 3, 2003, 12:29:11 PM, you wrote:
AB> I already tried this, it does not work. Basically, it should be the
AB> same as
AB> <html:hidden property="requestedPage">
AB> ${pageContext.request.servletPath}
AB> </html:hidden>
AB> or
AB> <html:hidden property="requestedPage"
AB> value="${pageContext.request.servletPath}"/>
AB> which are both not working. Is this some stutsbug? Why is the
AB> html:hidden tag marked in the tld file with a rtexpressions=false?
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org