Discussions

Web tier: servlets, JSP, Web frameworks: struts mapping problem

  1. struts mapping problem (3 messages)

    Hi all,

    I m new in struts.
    when i run the ActionForward function, it returns
    return mapping.findforward("somthing");
    then struts will search the struts-config.xml to find my forward path.

    but if i want to add some parameter in the path,
    such as when i return the mapping.findforward("sth");
    it will redirect to the path with some parameter (such as "login.jsp?msg=fail")
    how to define the msg and its valus in mapping?

    thanks

    Regards,

    Kin

    Threaded Messages (3)

  2. hi[ Go to top ]

    I think, you can press request.setAttribute("msg","fail");
    you can get this paramete in login.jsp.
  3. append a query-string[ Go to top ]

    Try appending a query-string in your struts-confin.xml, for action-mapping.

    For example:
    <forward name="success" path="/login.jsp?msg=fail"/>
  4. append a query-string[ Go to top ]

    Try appending a query-string in your struts-confin.xml, for action-mapping.For example:<forward name="success" path="/login.jsp?msg=fail"/>
    Thanks..

    But what about adding the variable in the forward path

    <forward name="success" path="/login.jsp?msg=fail?login_name=xx"/>