Moving controller and Model classes to a new folder in MVC in Netbeans IDE

153 views Asked by At

Earlier i haven't maintained folder arrangements for the project, i want to keep modules in seperate folders and i already maintained folder organisation for all jsp's. That's working good. But when i try the same for controller and model classes i am facing this error.

javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean: "Model.Agent.AgentEdit" on action: "/agt_ctr"
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
    org.apache.jsp.Agent_0020Mgt.Edit_0020Agent.agent_005fedit_jsp._jspService(agent_005fedit_jsp.java:324)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Earlier config file which worked is below

<action input="/Agent Mgt/Edit Agent/agent_edit.jsp" name="AgentEdit" path="/agt_ctr" scope="request" type="Controller.AgentController">
        <forward name="agtEdit" path="/Agent Mgt/Edit Agent/agent_edit_fwd.jsp"/>
    </action>

After changing config file it didn't worked, the code is here below

<action input="/Agent Mgt/Edit Agent/agent_edit.jsp" name="AgentEdit" path="/agt_ctr" scope="request" type="Controller.Agent.AgentController">
        <forward name="agtEdit" path="/Agent Mgt/Edit Agent/agent_edit_fwd.jsp"/>
    </action>

In earlier there was no folders in controller package and i created a folder "Agent" in controller and moved the servlet to this new folder. Same i did for model class too i created a new folder Agent and moved the old ones to the new folder in model package. After doing all this changes it doesn't works. Even i tried changing the name="AgentEdit" to name="Model.Agent.AgentEdit" but it didn't worked could somebody help me .

0

There are 0 answers