Hi All,

I am writing a simple application, in which in the JSP page, if I use
bean in scripplet it works fine. For example <%=
courseBean.getCourseName%> works fine and gives me result.

If I replace this piece of code with bean write or html: text nothing
comes. I have tried putting bean in session, used bean:define tag but
nothing
works.


Here is my example code


Struts Config File


    <action path="/modifyCourse"
type="com.nyiso.lc.admin.ModifyCourseAction"  name="courseFormBean"
scope="request">
      <forward name="success" path="/public-html/modifyCourse.jsp" />
    </action>


JSP Code  - modifyCourse.jsp


<bean:define id="courseBean1" name="courseBean" toScope="session"
type="com.nyiso.lc.CourseBean"//>


<html:form action="maintainCourse.do?action=<%=LCDAO.UPDATE_STP%>"
focus="courseName" >


<html:text property="courseName" size="30" maxlength="100"/>
<bean:write name="courseBean1" property="courseName"/>
<bean:write name="courseBean1" property="CourseName"/>
</html:form>


ActionClass

public class ModifyCourseAction extends Action {
  public ActionForward execute(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response)
      throws Exception {


        HttpSession session = request.getSession();


        CourseFormBean courseFormBean = (CourseFormBean) form;

    CourseDAO courseDAO = new CourseDAO(request);
    CourseBean courseBean =  (CourseBean)
courseDAO.hydrate(LCDAO.SELECT_SINGLE_STP, courseFormBean);
    session.setAttribute("courseBean", courseBean);


    return (mapping.findForward(LCConstants.ACTION_SUCCESS));
  }




I don't know why my course Bean using tags is empty and if I use
request.getAttribute and then use coursebean.get..., gives me value.

What am I missing.

Any help is very much appreciated.

Thanks,
Jill.

Reply via email to