Hi All.

I've a problem, I use a RequestListAction that return a List and it is
used to fill a form. The problem is that the getRequest method is
called several times before showing the result (form filled).

My action:

        private Request request;

        public Collection<CommandResult> getLstCommand() {
        try {
        lstCommand = new CommandResultServiceImpl().getByIdRequest(idRequest);
        } catch (Exception e) {
        lstCommand = null;
        }
        return lstCommand;
        }

        @Override
        public String execute() throws Exception {
        return SUCCESS;
        }

        public Request getRequest() {
        try {
        request = new RequestServiceImpl().getByIdRequest(idRequest);
        } catch (Exception e) {
        request = null;
        }
        return request;
        }


My form:

<s:url id="url" action="RequestList" />
<h3>REQUEST DETAIL</h3>
<s:form action="%{url}" method="POST">
        <table>
        <tr>
        <td><s:property value="%{getText('login')}" /></td>
        <td><s:property value="request.user.login" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('country')}" /></td>
        <td><s:property value="request.user.country.fullName" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('subject')}" /></td>
        <td><s:property value="request.subject" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('description')}" /></td>
        <td><s:property value="request.description" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('fail')}" /></td>
        <td><s:property value="request.failEntity.fail.description" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('node')}" /></td>
        <td><s:property value="request.node.description" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('severity')}" /></td>
        <td><s:property value="request.severity.severity" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('siebelId')}" /></td>
        <td><s:property value="request.siebelId" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('remedyId')}" /></td>
        <td><s:property value="request.remedyId" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('paasPA')}" /></td>
        <td><s:property value="request.paasPA" /></td>
        </tr>
        <tr>
        <td><s:property value="%{getText('datetime')}" /></td>
        <td><s:property value="request.datetime" /></td>
        </tr>
        </table>

        <br>
        <s:if test="%{lstCommand != null}">
        <s:if test="%{lstCommand.size > 0}">
        <table class="ex">
        <tr>
        <th>Command</th>
        <th>Description</th>
        <th>Result</th>
        </tr>
        <s:iterator value="lstCommand" id="commands" status="cmds_stat">
        <tr>
        <td><s:property value="command.command" /></td>
        <td><s:property value="command.description" /></td>
        <td><textarea rows="7" cols="30" readonly><s:property
value="result"/></textarea> </td>
        <!--<td><s:property value="result" /></td>-->
        <s:hidden value="idCommand" />
        </tr>
        </s:iterator>
        </table>
        </s:if>
        <s:else>
        <s:label>There are not commands associated.</s:label>
        </s:else>
        </s:if>
        <br>
        <s:submit value="FINISH" align="left" />
</s:form>

My struts.xml
                <action name="ShowRequest"
                        class="org.gblx.action.tr.ShowRequestAction">
                        <result>/TR/showRequest.jsp</result>
                </action>

Any idea?

Thanks

JP

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to