Announcement Announcement Module
Collapse
No announcement yet.
Unable to Run Spring Based Web Application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to Run Spring Based Web Application

    I have developed a simple web project using spring 3.1 framework named "FirstSpringApp". But my problem is whenever I'm hitting the url in the browser(localhost:8087/FirstSpringApp-war),I'm getting the [B]error message
    Resource not found.

    I have followed the Spring mvc architecture throughout my project.
    I'm attaching my project herewith it is developed using NetBeans IDE-7.3.1.

    My Controller class is something like this::

    @Controller
    public class SpringWelcomeController extends AbstractController {

    @Override
    public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    ModelAndView modelAndView = new ModelAndView("helloworld");
    modelAndView.addObject("welcome_message", "Happy Programming");
    return modelAndView;
    }
    }

    This is my:welcomedispatcher-servlet.xml file

    <context:component-scan base-package="com.edifixio.spring.controller"/>
    <bean name="/index.jsp" class="com.edifixio.spring.controller.SpringWelcom eController"/>
    <bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver"
    p:viewClass="org.springframework.web.servlet.view. JstlView"
    prefix="/WEB-INF/helloworld.jsp"
    p:suffix=".jsp"/>

    and in web.xml file i have given:

    <servlet>
    <servlet-name>welcomedispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>welcomedispatcher</servlet-name>
    <url-pattern>/</url-pattern>
    </servlet-mapping>

    can any one help?????????
Working...
X