Here is my spring context file. Please let me know if anything is
missing here :
********************************************************************************************************
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:component-scan base-package="com.ak.loginapp" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
</beans>
********************************************************************************************************
This is my web.xml file below.
*********************************************************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-
class>org.springframework.web.context.ContextLoaderListener</listener-
class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-
class>org.springframework.web.servlet.DispatcherServlet</servlet-
class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
</web-app>
*********************************************************************************************************
Regards
AK
On Dec 21, 8:15 am, "AK - The Emperor !" <anoopkamma...@gmail.com>
wrote:
> Hi there,
>
> Its been a long time and I finally have something I need to ask
> here :)
> My question is for people who have or know how to built web
> applications in Spring MVC 2.5 from scratch.
>
> Heres the problem. I am trying to configure Spring in my webapp to use
> Spring's Annotated controllers. I am using netbeans as my IDE.
> As a result of some googling, I got a lot of examples and steps on how
> to go about configuring the springs context, etc. But the problem is
> that none of them actually works here
>
> I gave the @Controller and @RequestMapping("/login/*") in my
> controller class and @RequestMapping(value = "dologin",
> method=RequestMethod.GET) for my method I need to get executed when
> the action path of my request is "/login/dologin.htm", where *.htm is
> the url pattern configured in my Dispatcher Servlet.
> As for the spring context, I have the viewResolver defined as the
> InternalResourceViewResolver with prefix as "/WEB-INF/jsp/" and
> postfix as ".jsp".
> I have also used the <context:component-scan base-
> package="com.ak.loginapp"> in my spring context file. The classes are
> available within the basepackage, inside sub packages called
> controller, service, etc. ie, my LoginController is inside <base-
> package>.controller.
>
> My project is getting built, but on execution, I keep getting 404
> errors and when I tried debugging, I found that the execution control
> is not even reaching the controller method. I have tried all examples
> that I found from the internet and for all of them I keep getting
> this.
> I use JDK6 with Spring 3.0.6 library, which is already available
> within Netbeans. I did try replacing them with the jars I downloaded
> from Springsource.
>
> So, any ideas on what might be wrong here?
--
You received this message because you are subscribed to the Google Groups "Programmer's Avenue" group.
To post to this group, send email to progav@googlegroups.com
To unsubscribe(which is not recomended at all) from this group, send email to progav-unsubscribe@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/progav
P.S : In case of any grievances/issues/comments/suggestions regarding this group, please contact the group owner.


0 comments:
Post a Comment