Here is the action class
public class RequestViewDetailAction extends ActionBase
{
public ActionForward execute( ActionMapping mapping, ActionForm frm,
HttpServletRequest request, HttpServletResponse response )
{
ActionMessages messages = new ActionMessages();
RequestManager manager = this.getManager( request );
Vector downlinkData = new Vector();
ActionErrors errors = new ActionErrors();
int i = 0;
if ( request.getParameter( "requestID" ) != null )
{
i = Integer.parseInt( request.getParameter( "requestID" ) );
}
String action = mapping.getParameter();
Image image = null;
if ( "view".equalsIgnoreCase( action ) )
{
image = (Image) manager.getOpportunities().elementAt( i );
downlinkData = image.getParameters().getDownlinkEvents();
}
else if ( "viewDb".equalsIgnoreCase( action ) )
{
EventBO eventBO = new EventBO();
ImageBO imageBO = new ImageBO();
try
{
image = imageBO.findByKey( i );
}
catch ( BusinessObjectException e1 )
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
Collection downlinks;
try
{
downlinks = eventBO.getDownlinks( image );
if ( downlinks != null )
{
downlinkData = new Vector( downlinks );
}
}
catch ( BusinessObjectException e )
{
e.printStackTrace();
}
}
else if ( "edit".equalsIgnoreCase( action ) )
{
image = (Image) manager.getOpportunities().elementAt( i );
downlinkData = image.getParameters().getDownlinkEvents();
ImageForm form = new ImageForm( image );
form.setId( String.valueOf( i ) );
request.setAttribute( "parameters", form );
}
else if ( "save".equalsIgnoreCase( action ) )
{
ImageForm form = (ImageForm) frm;
int index = Integer.parseInt( form.getId() );
image = (Image) manager.getOpportunities().get( index );
updateImage( image, form );
downlinkData = image.getParameters().getDownlinkEvents();
Collection opportunities = manager.getOpportunities();
Collection conflicts = manager.getConflicts();
Collection selected = manager.getCart().getLineItems();
if ( (opportunities != null) && !opportunities.isEmpty() )
{
request.setAttribute( "opportunities", opportunities );
}
if ( (conflicts != null) && !conflicts.isEmpty() )
{
request.setAttribute( "conflicts", conflicts );
}
if ( (selected != null) && !selected.isEmpty() )
{
request.setAttribute( "selected", selected );
}
ActionMessage msg = new ActionMessage( "msg.image.request.updated", image
.getkeyTimeDisplay() );
messages.add( ActionMessages.GLOBAL_MESSAGE, msg );
}
Double offsetPercent = new Double( 100 * image.getParameters()
.getAlongTrackOffset() );
if ( !messages.isEmpty() )
{
saveMessages( request, messages );
}
request.setAttribute( "downlink", downlinkData );
request.setAttribute( "opportunity", image );
request.setAttribute( "offsetPercent", offsetPercent.toString() );
return mapping.findForward( Constants.SUCCESS );
}
Regards
Gokul
On Wed, 05 Apr 2006 Gary Feidt wrote :
>Still not enough to analyze - I think your Struts-Config file looks ok.
>We will probably need some snippets of your
>co.ui.action.RequestViewDetailAction before we can determine what is
>wrong.
>
>Gary
>
> >>> [EMAIL PROTECTED] 4/5/2006 10:17:12 AM >>>
>Thanks Krishna,
>
>Thats the chunk from the struts-config file.
><action
> path="/secure/image/save"
> roles="User,Operator"
> type="co.ui.action.RequestViewDetailAction"
> name="iForm"
> scope="request"
> validate="true"
> parameter="save"
> input="/WEB-INF/pages/request/RequestDetail.jsp">
> <forward name="success"
> path="/WEB-INF/pages/request/RequestList.jsp"/>
> </action>
>
>i'm afraid it still doesnt work. when errors are present it displays
>the errors on the RequestList.jsp page instead of the RequestDetail.jsp.
>
>
>As i said I tried to think, but in vain. any ideas folks?
>
>Cheers
>Gokul
>
>
>+
>On Wed, 05 Apr 2006 Krishna,Mattam(M.) wrote :
> >Hi,
> >Errors are displayed on the page , based on ur input attribute in the
> ><action ...> tag.
> >Check the below sample ,bold........
> >Any doubts send a mail..
> >
> >Sample:
> >------
> ><action path="/employeePortfolioPost"
> >type="com.ford.hr.cdf.careerdevelopment.presentation.actions.EmployeePor
> >tfolioPostAction"
> > name="EmployeePortfolioForm" scope="session"
> > parameter="method" validate="true"
> > input="page.employeePortfolio"
> > roles="Employee Portfolio">
> >
> > <forward name="addExperience"
>path="page.employeePortfolio"></forward>
> >
> ></action>
> > ///\\
> > (@ @)
> >+-----oOO----(_)----Ooo-----+
> >| |
> >| Thanks and Regards, |
> >| Krishna Mattam |
> >| Team Member - CDF Toolset |
> >| Contact:044-22548575 |
> >| Email: [EMAIL PROTECTED] |
> >+---------------------------+
> > |__|__|
> > || ||
> > ooO Ooo
> >
> >
>
>__________________________________
>
>Confidentiality Statement:
>This email/fax, including attachments, may include confidential and/or
>proprietary information and may be used only by the person or entity to which
>it is addressed. If the reader of this email/fax is not the intended recipient
>or his or her agent, the reader is hereby notified that any dissemination,
>distribution or copying of this email/fax is prohibited. If you have received
>this email/fax in error, please notify the sender by replying to this message
>and deleting this email or destroying this facsimile immediately.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>