Discussions

Web tier: servlets, JSP, Web frameworks: Accessing page GET variables with struts

  1. Accessing page GET variables with struts (3 messages)

    Hi All,

    I'm trying to use the struts logic tags within a JSP page to determine loading of different flash .swf objects.

    My URL is "../pages/Main.jsp?subMap=3" for example. How do I access the subMap GET variable and determine which subMap to load using the logic:equal tags?

    It seems like this should be a very easy thing to do, but a proper implementation of this method is somewhat less than obvious.

    Thanks,

    Graeme
  2. Those variables such as subMap are HttpSession parameters. In the logic:equal tag, you specify a parameter with the 'parameter' attribute, as follows:

    <logic:equal parameter="subMap" value="3">
       <!-- do a .swf object -->
    <logic:equal parameter="subMap" value="4">
       <!-- do some other .swf object -->

    Keep in mind that the 'parameter' attribute is case-sensitive.
  3. that works. much appreciated!
  4. That works, but I think those are HttpRequest parameters.
    Someone correct me if I'm wrong
    Greetings