• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Spring new bie problem

Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all i am doin a small web app using Sprin and Ibatis. I am facing a weird problems.
1) when i query a page.. ie say hello.jsp. It goes through the Controller But the ModelAndView("hello.jsp") is having a problem. Like its giving a http404 error. dont know what the problem is..

2) This is with respect to the Ibatis. I have an interface and the implementation. I would like to have the complete table data to be visualised . I was wondering like how to add the entire data to the Pojos. Please let me know.

Here is the code of the first problem
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- Location of the Log4J config file, for initialization and refresh checks.
- Applied by Log4jConfigListener.





my f1-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN/EN" "http://www.springframework.org/dtd/spring-beans.dtd">;

<!-- Application context defn for "f1 app" DespatcherServlet. -->
<bean id="RaceListController" class="com.blahblah.f1.controller.RaceListController"/>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<prop key="/RacesGeneralList.jsp">RaceListController</prop>


<!-- View Resolver -->
<bean id="viewReslover" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
<property name="prefix"><value>/WEB-INF/jsp/</value></property>
<property name="suffix"><value>.jsp</value></property>


I dont think there is any problem with the above two files. I have posted just for your reference.

my controller
package com.blahblah.f1.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
import org.apache.log4j.Logger;

public class RaceListController implements Controller
Logger log=Logger.getLogger(RaceListController.class);
* instance of the Request Controller.
private String page;

public RaceListController()

* handles the Request.
public ModelAndView handleRequest(HttpServletRequest httpServletRequest,HttpServletResponse httpServlet)
// I am able to see this message in the console.
System.out.println("<<<<<<<<<<<<<<<<<<<<<<in the Controller.>>>>>>>>>>>>>>>>>>>>>>>");
return new ModelAndView("RacesGeneralList");
Please let me know the soln at the earliest. i am using tomcat 5.5, jdk6, spring framework 2.1m2, eclipse 3.2 with lomboz.

Thank you
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic