H
H
have_a_questions2016-08-04 23:33:20
Spring
have_a_questions, 2016-08-04 23:33:20

How to run spring web (not spring mvc) project on glassfishe or any application server?

I am writing a Spring project that loads data from a remote server to a database. You need to run it on the application server, and this should implement an automatic method call using Scheduled. How to implement? What should be written in web.xml ?
<?xml version="1.0" encoding="UTF-8"?>
contextClassorg.springframework.web.context.support.AnnotationConfigWebApplicationContextcontextConfigLocationWEB-INF/config/spring-config.xmlorg.springframework.web.context.ContextLoaderListener
<?xml version ="1.0" encoding="UTF-8"?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-08-05
@zolt85

Well, at least you need to describe the dispatcher-servlet, with mapping and other things

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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
java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
    </context-param>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

    <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question