Hi All !
I am trying to start out with struts.
I have successfully deployed an EJB in JBOSS and want to call it from my
Struts-based web app.
My current setup:
====================================
ActionForm: GetSearchCriteriaForm extends
org.apache.struts.action.ActionForm
Action: SearchAction extends org.apache.struts.action.Action
SearchAction.execute( ... )
{
String vehicleID =
((au.com.carsales.carsales.GetSearchCriteriaForm)form).getVehicleID();
request.setAttribute( "vehicleID", vehicleID );
return( mapping.findForward("searchUsedCars" ) );
}
====================================
Effectively (from the code above), I have a form, from where the user
enters the vehicleID and set it as a session attribute.
Now, I want to call my UsedVehicleEJB's findByPrimaryKey() method with
the vehicleID as the parameter.
My Questions:
=============
1. Should I call my EJB from the execute method and set the attributes
of the UsedVehicleEJB as session variables?
1.1 Can I make the entire EJB a session variable?
2. Should I be using the bean tag library in my view
"searchUsedCars.jsp" to call my EJB ?
What I think:
=============
Given that the view should be independent of the model, I should not
call the EJB from "searchUsedCars.jsp" and hence, I should call the EJB
from the execute method.
Please comment.
TIA,
Kunal
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]