Announcement Announcement Module
Collapse
No announcement yet.
STS springMVC project how to run on tomcat application Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS springMVC project how to run on tomcat application

    hi people
    i m beginner about Spring and i want to use STS with eclipse.
    well
    i use template Springproject with STS
    i select home.jsp and click right on run on tomcat and its not working.

    can people help me ?
    web.xml
    Code:
    <?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">
    
    	<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>/WEB-INF/spring/root-context.xml</param-value>
    	</context-param>
    	
    	<!-- Creates the Spring Container shared by all Servlets and Filters -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<!-- Processes application requests -->
    	<servlet>
    		<servlet-name>appServlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    		</init-param>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    		
    	<servlet-mapping>
    		<servlet-name>appServlet</servlet-name>
    		<url-pattern>/*</url-pattern>
    	</servlet-mapping>
    
    </web-app>
    my servlet_context.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/mvc"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:beans="http://www.springframework.org/schema/beans"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
    		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    
    	<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
    	
    	<!-- Enables the Spring MVC @Controller programming model -->
    	<annotation-driven />
    
    	<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
    	<resources mapping="/resources/**" location="/resources/" />
    
    	<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
    	<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<beans:property name="prefix" value="/WEB-INF/views/" />
    		<beans:property name="suffix" value=".jsp" />
    	</beans:bean>
    	
    	<context:component-scan base-package="com.toto.java" />
    	
    	
    	
    </beans:beans>

  • #2
    Hi!

    Can you try to do this:
    - create a new fresh project from the MVC template
    - drag&drop it onto the tc Server within the Servers view
    - start that server (you can do that directly inside the Servers view)

    Does that work for you?
    (trying to figure out what the problem could be)

    HTH,
    Martin

    Comment


    • #3
      nothing happens . maybe i have to erase eclipse and download again ?

      Comment


      • #4
        Always a good idea if something seems to be completely broken...
        Is there anything related showing up in the Error Log?

        Comment


        • #5
          haha
          where is log file?

          Comment


          • #6
            not working same probleme :eek

            Comment


            • #7
              So you installed a fresh STS and followed the steps I mentioned above, right? What exactly happens?
              Do you see a tc Server instance in the Servers view? Does it start correctly without deploying an app to it just by clicking the start button in the view?

              The error log can be viewed by opening the "Error Log" view (Window -> Show View -> General -> Error Log). Maybe we can find the reason there.

              HTH,
              Martin

              Comment


              • #8
                well i erase all eclipse and i install eclipse and sts
                but now when i create new template speingMVC.
                i have some error after buiding project.
                eclipse cannot find library Springcore ....

                Comment


                • #9
                  Did you install STS 2.8.0.M2? If so, this is a know problem with the Maven integration at the moment, we are working on a solution for this.
                  Please install the latest STS 2.7.2 release, there the MVC template project should work just fine.

                  HTH,
                  -Martin

                  Comment


                  • #10
                    well i reinstall helios and i use eclipse new software and eclipse donwload 2.7.2 .
                    I will download the sts .EXE 2.7.2

                    Comment


                    • #11
                      Yes, please download the STS 2.7.2 packages from http://www.springsource.com/landing/...nterprise-java, install that package and run STS from there.

                      Comment


                      • #12
                        i cannot succes with the STS.zip i put ion the eclipsefeature an plugin but nothing happens i try to use updateeclipse.

                        Comment


                        • #13
                          that working i change workspace donwload STS 2.7.2 and click the server and click the the home page its working now tx.
                          because i click rigth on my home.jsp file and click on run tomcat vut its not working like thaht you have to run spring TC server(right click) and click the homepage.
                          that its tx martin

                          Comment

                          Working...
                          X