struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Brutschy <mai01...@studserv.uni-leipzig.de>
Subject Re[2]: EL Expression in html:hidden tag
Date Mon, 03 Nov 2003 11:29:11 GMT
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


Mime
View raw message