Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect @RequestMapping with path defined as constant instead of literal string #281

Closed
aaguilera opened this issue Apr 29, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@aaguilera
Copy link

commented Apr 29, 2019

It seems that Navigation (cmd+6) cannot detect @RequestMapping-annotated methods when the URL is defined as a constant instead of a literal string.
For example:

public class MyPaths {
    public static final String RESOURCE_PATH = "/somepath/resource";
}

@Controller
public class MyController {
    @RequestMapping(MyPaths.RESOURCE_PATH)
    public String method() {
        ... 
    }
}

In STS4, if I press Ctrl+6 (I'm using Eclipse-based STS4 on Linux) and start typing something like "@/some", the results list does not include the mapping for "/somepath/resource".

It would be nice if STS4 implemented such detection.

@martinlippert

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

There is a CI build available that includes the implementation for this, if you want to give it an early try and provide feedback: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

@spring-issuemaster

This comment has been minimized.

Copy link

commented May 1, 2019

(comment in Pivotal Tracker added by Martin Lippert:)

Tested this again, works in general, but not for constants defined in the same source file as the request mapping. Will file a separate issue for that.

@aaguilera

This comment has been minimized.

Copy link
Author

commented May 2, 2019

There is a CI build available that includes the implementation for this, if you want to give it an early try and provide feedback: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

I have tested spring-tool-suite-4-4.2.2.CI-B1732-e4.12.0-linux.gtk.x86_64.tar.gz and it works perfectly. Kudos to the team for such a quick response!

@martinlippert

This comment has been minimized.

Copy link
Member

commented May 3, 2019

Great to hear that it works for you and thanks for reporting this in the first place. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.