Hi Guys,

I've been trying to get webflow to do what I want, but it doesn't seem to want to cooperate. How can I get an attribute that is available to every single CAS JSP at all times? I simply want to set a debugMode attribute, so that if I want, I can dump out all session/request attributes, as well as all http parameters and headers.

I tried this in the on-start element in login-webflow.xml, which works fine for most JSPs involved in the views. It does not work for the logout JSP, and referencing it using ${debugMode} within the JSP does nothing. Apparently by doing this in on-start, and using conversationScope, the debugMode gets put in the request attributes; except for the logout. I'm guessing CAS doesn't use spring webflow for everything, am I right?
<set name="conversationScope.debugMode" value="true"/>


Also, I would highly recommend this ability for CAS stock; it helps a lot with writing your own actions. All I do is this...

<c:if test="${debugMode}">
  <div class="debug">
    <h2>Form Parameters</h2>
    <table class="border debugtable">
      <tr>
        <th>Attribute</th>
        <th>Value</th>
      </tr>
      <c:set var="even" value="false"/>
      <c:forEach var="name" items="${param}">
        <tr class="${even?'even':'odd'}">
          <td> ${name.key} </td>
          <td>${fn:escapeXml(name.value)}&nbsp;</td>
        </tr>
        <c:set var="even" value="${!even}"/>
      </c:forEach>
    </table>

    <h2>Request Attributes</h2>
    <table class="border debugtable">
      <tr>
        <th>Attribute</th>
        <th>Value</th>
      </tr>
      <c:forEach var="name" items="${requestScope}">
        <tr class="${even?'even':'odd'}">
          <td> ${name.key} </td>
          <td>${fn:escapeXml(name.value)}&nbsp;</td>
        </tr>
        <c:set var="even" value="${!even}"/>
      </c:forEach>
    </table>

    <h2>Session Attributes</h2>
    <table class="border debugtable">
      <tr>
        <th>Attribute</th>
        <th>Value</th>
      </tr>
      <c:forEach var="name" items="${sessionScope}">
        <tr class="${even?'even':'odd'}">
          <td> ${name.key} </td>
          <td>${fn:escapeXml(name.value)}&nbsp;</td>
        </tr>
        <c:set var="even" value="${!even}"/>
      </c:forEach>
    </table>

    <h2>HTTP Headers</h2>
    <table class="border debugtable">
      <tr>
        <th>Attribute</th>
        <th>Value</th>
      </tr>
      <c:forEach var="name" items="${header}">
        <tr class="${even?'even':'odd'}">
          <td> ${name.key} </td>
          <td>${fn:escapeXml(name.value)}&nbsp;</td>
        </tr>
        <c:set var="even" value="${!even}"/>
      </c:forEach>
    </table>
  </div>
</c:if>

And add CSS like this...
.debugtable tr td:first-child {
  white-space: nowrap;
}
table.border {
  border: 1px solid #CCCCCC;
  border-collapse: collapse;
  padding: .2em .2em .2em .2em;
}

table.border td {
  border: 1px solid #CCCCCC;
  border-collapse: collapse;
  padding: .2em .2em .2em .2em;
  text-align: left;
}

table.border th {
  border: 1px solid #CCCCCC;
  background-color: #EEE;
  border-collapse: collapse;
  padding: .2em .2em .2em .2em;
}

.even {
  background-color: #FFFFFF;
}

.odd {
  background-color: #EFEFEF;
}

--
Trenton D. Adams
Senior Systems Analyst/Web Software Developer
Navy Penguins at your service!
Information Technology, Athabasca University
(780) 675-6195
:wq!

--
   This communication is intended for the use of the recipient to whom it
   is addressed, and may contain confidential, personal, and or privileged
   information. Please contact us immediately if you are not the intended
   recipient of this communication, and do not copy, distribute, or take
   action relying on it. Any communications received in error, or
   subsequent reply, should be deleted or destroyed.
---

--
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to