struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric D Nielsen <niels...@MIT.EDU>
Subject S2: Advice on debugging jsp/action interactions..
Date Mon, 05 Jan 2009 14:59:09 GMT
This is an off-shoot of an unanswered question I posted about 10 days ago
(during the holidays, I know...)  The orginal email is repeated below, but I'm
asking a more general question now.

I've been getting very frustrated with trying to figure out why some of my jsp's
are not retrieving properties from the backing action.  I have devMode=true and
logging set to DEBUG; but there's nothing in the logs thats helping me.  Break
points inside the getters are not hit.  I've tried both OGNL-based function
calls and EL-based bean/property approaches.  95% of the time everything is
good, but I've been stuck on this jsp for about two weeks and can't figure out
why it doesn't work and I can't seem to find any diagnostic aide to figure out
where the problem is.  (The following code shows the original attempt,  I've
already tried an approach that follows bean conventions, and returns a complete
map rather that is indexed inside the JSP rather than this on-demand lookup
version.)

Can anyone offer any helpful hints for diagnosing why my function isn't getting
called?

Thank you.
Eric

-------------- Original Email ----------------

I'm working on something a little bit like a data grid. However, while the
current display is tabular, the data backing it isn't. As a result I can't use
straight map notation to access the values to display.  For now I have a
inefficient helper lookup attached to the action, but I can't seem to get it
invoked.

The relevant portion of the jsp looks like

  <s:iterator value="competition.feeCategories" id="fee">
    <tr><th><s:property value="name" /></th></tr>
    <s:iterator value="competition.sessions" id="session">
      <tr>
        <td><s:property value="name" /></td>
   <s:iterator value="competition.deadlines" id="deadline">
            <td><s:property value="#session.getDisplayPrice(#deadline,#fee)"
/></td> <!-- 1 -->
            <td><s:textfield
name="sessionMap[%{#session.id}][%{#deadline.id}][%{#fee.id}]"

value="%{getSessionMarkup(#session,#fee,#deadline).costDeltaInCents}" /></td>
<!-- 2-->
            <td>Studio Markup (%)</td>
          </s:iterator>
   </tr>
     </s:iterator>
   </s:iterator>


The action looks like:
public class ConfigurePrices extends ExcursionBase {
        public String execute() {
                return SUCCESS;
        }
        public StudioSessionPrice getSessionMarkup(Session session,
CompetitionDeadline
deadline, FeeCategory fee) {
                for (StudioSessionPrice ssp: excursion.getSessionPrices()) {
                        if
(ssp.getUnderlyingCompetitionSession().getSession().equals(session) &&
                                       
ssp.getUnderlyingCompetitionSession().getDeadline().equals(deadline) &&
                                       
ssp.getUnderlyingCompetitionSession().getFeeCategory().equals(fee))
                                return ssp;
                }
                StudioSessionPrice ssp = new StudioSessionPrice();
                ssp.setExcursion(excursion);
               
ssp.setUnderlyingCompetitionSession(session.getCSPfor(deadline,fee));
                ssp.setCostDeltaInCents(0L);
                ssp.setDeltaInPercent(0.0F);
                excursion.addSessionPrice(ssp);
                excursionRepository.save(excursion);
                return ssp;
        }
}

ExcursionBase implements ActionSupport; the jsp shown before is hooked up to the
INPUT result of the action.

The line preceding the <!-- 1 --> works properly, so I thought I knew how to
call functions with parameters in OGNL. The line around <!-- 2--> does not
work. The breakpoint just inside the function is not hit. However there are no
errors in the log. None of the iterator related objects respond to the
getSessionMarkup message and thus shouldn't be masking it from bubbling down to
the action.  What am I missing?

Thank you.

Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message