You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jakob Flierl <fl...@fmi.uni-passau.de> on 2001/06/22 09:26:06 UTC

dynamic help s for every page

Hi,

Im trying to dynamically include some help messages in my JSP pages, e.g. I
want to write:

 <html:link page="<%=request.getServletPath()%>?help=true">Hilfe</html:link>

on every page, so I can include the parameter "help = true" in my current
request. Therefore I've put this into my footer template JSP:

--- "include/footer.jsp" ---:

[...]

 <logic:equal name="request" property="help" value="false">
   <html:link page="<%= request.getServletPath() + \"?help=true\" %>">help
   </html:link>
 </logic:equal>
 <logic:notEqual name="request" property="help" value="false">
   <html:link page="<%= request.getServletPath() + \"?help=false\" %>">no help
   </html:link>
 <logic:notEqual>

[...]

---

But there's one problem with that solution: I've there's e.g. a registration
form, and the user presses the "help" link, the currently filled in form field
data get lost.

I know, that there's a solution to pass all currently set page parameters with
the <html:link> tag. However I wasn't able to get that work.

Could someone give me a short JSP code snippet on how to get all parameters
of the JSP into a Hashmap and additionally pass the "help=true" param to the
same JSP?

Thanks

 Jakob F.