1

I m doing work in WCS7.0 framework.I have to do exception handling of some EJB's code, eg if finder exception occurs i have to show a message on corresponding jsp "Data not Found".

below is EJB code

                  TypedProperty delParam = new TypedProperty();
        String shipid = rspProp.getString("shipid");
        String addrId=rspProp.getString("addrId");
        AddressAccessBean address = new AddressAccessBean();
        address.setInitKey_AddressId(addrId);
        try {
            if((address.getMemberId().equals(memberid)) &&          address.getAddressField3().equals(shipid)){
                address.getEJBRef().remove();

                }
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (CreateException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (FinderException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (RemoveException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } 

what will i do to show message on jsp.

Zuned Ahmed
  • 1,287
  • 6
  • 27
  • 55

2 Answers2

0

I would recommend to read the first tutorial from IBM Websphere commerce 7 infocenter "Createing business logic" http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/index.jsp

tutorials > programming model > Creating business logic

It explains how to bind actions and jsp pages using struts.

Lama
  • 146
  • 1
  • 2
  • 7
0

You could either return it as a response property to show on your JSP view.

or

Throw an application exception to show the error on an generic error page.

throw new ECApplicationException(e);

Daniel Persson
  • 596
  • 6
  • 17