Annotation @Get does not work on the controller

0

I'm trying to customize my url with @Get in Vraptor 4, but it's not recognized,

Follow the controller:

    @Controller
    public class OlaController {
       @Inject Result result;

       @Get("/ola")
       public void digaOla(){
         result.include("mensagem", "Olá, VRaptor 4!");
       }
    }

In the browser appears error 404, but without the annotation the page is displayed normally, is there any library or something that I did not care about?

Here's my pom:

 <dependency>
        <groupId>br.com.caelum</groupId>
        <artifactId>vraptor</artifactId>
        <version>4.2.0-RC3</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
        <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>7.0</version>
        <scope>provided</scope>
    </dependency>

Follow my web.xml:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
 version="3.1">
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>

I'm using the wildfly server.

    
asked by anonymous 07.10.2016 / 16:46

1 answer

0

In order to customize your URL in Vraptor you need to set the path in the annotation @Path

Example:

@Get
@Path("/listar")
public void listar() {..}

Further explanations about Path :

Javadoc Vraptor

    
07.10.2016 / 16:50