reset password
Author Message
shahana
Posts: 11
Posted 15:49 May 03, 2009 |

I followed every step and checked many times but still getting 404 error when clicking on Blogs.

Please help

cysun
Posts: 2935
Posted 15:58 May 03, 2009 |

Be more specific.

shahana
Posts: 11
Posted 16:34 May 03, 2009 |

1) Created BlogDao in csns.model.blog.dao

2) Creaded BlogDaoImpl in csns.model.blog.dao.hibernate

3) Updated spring-date.xml in conf 

<bean id="blogDao" parent="abstractTxnDefinition">

        <property name="target">

            <bean class="csns.model.blog.dao.hibernate.BlogDaoImpl">

                <property name="sessionFactory" ref="sessionFactory" />

            </bean>

        </property>

    </bean>

4) Created ViewAllBlogsController in csns.spring.conroller.blog

5) Created Jsp page in Web-INF>blog (folder) allBlogs2.jsp

6) Updated spring-servlet.xml in conf folder

 <!--=======================-->

    <!-- controllers - blogs -->

    <!--=======================-->

     <bean name="/blog/allBlogs2.html"

        class="csns.spring.controller.blog.ViewAllBlogsController">

        <property name="blogDao" ref="blogDao" />

     </bean>

 

Refreshed CSNS project and made sure that csns-data.xml and csns-servlet.xml have respective entries.....

 

Right click on csns and select RUN ON Server

When I click on Blogs (under resources)....

Control going to http://localhost:8080/csns/blog/allBlogs2.html

and getting The webpage cannot be found

 

LOG File has no related error (please see attched log file).

 

Thanks for your help



Attachments:
cysun
Posts: 2935
Posted 16:47 May 03, 2009 |

Check the "return new ModelAndView" statement in your ViewAllBlogsController class. It should be something like:

    return new ModelAndView("blog/allBlogs2");

Note that it should be the view name, not the path to the JSP file.

Last edited by cysun at 16:48 May 03, 2009.
shahana
Posts: 11
Posted 17:08 May 03, 2009 |

I tried:

 return new ModelAndView ("blog/allBlogs2").addObject("blogs", blogs);

and 

 return new ModelAndView ("blogs").addObject("blogs", blogs);

 

But still same error....

cysun
Posts: 2935
Posted 17:16 May 03, 2009 |

Make sure your jsp really is called "allBlogs2.jsp" - sometimes there might be leading/trailing white spaces.

cysun
Posts: 2935
Posted 17:19 May 03, 2009 |
shahana wrote:

...

5) Created Jsp page in Web-INF>blog (folder) allBlogs2.jsp

... 

allBlogs2.jsp should be under /WEB-INF/jsp/blog, not /WEB-INF/blog.

shahana
Posts: 11
Posted 17:21 May 03, 2009 |

I think it started working :)

HTTP Status 500 error now....but atleast its reading the page.....

Thanks for your quick replies...