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

spring boot jsp 404 Whitelabel Error Page with 1.5.0 #14493

Closed
godpit opened this issue Sep 17, 2018 · 11 comments
Closed

spring boot jsp 404 Whitelabel Error Page with 1.5.0 #14493

godpit opened this issue Sep 17, 2018 · 11 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@godpit
Copy link

godpit commented Sep 17, 2018

spring boot 1.4.0.RELEASE: Realpath=null, it is ok
wx20180917-214329 2x

spring boot 1.5.10.RELEASE:Realpath=/private/var/folder/....
the path is not found in my OS, so that it is 404 with Whitelabel Error Page
wx20180917-214727 2x

However, how i could solve this problem?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 17, 2018
@bclozel
Copy link
Member

bclozel commented Sep 17, 2018

Given this description, I don't understand the issue here.
Could you provide a small application that reproduces the issue and describe 1) what you're trying to achieve, 2) what you've tried, 3) what you expected as a result and 4) what you got instead.

Thanks!

@bclozel bclozel added the status: waiting-for-feedback We need additional information before we can continue label Sep 17, 2018
@godpit
Copy link
Author

godpit commented Sep 17, 2018

spring boot 1.4.0 + jsp, the jar of package is ok ,but spring boot 1.5.10, it is error with Whitelabel Error Page.
the above image is diff with debug.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 17, 2018
@godpit
Copy link
Author

godpit commented Sep 17, 2018

Both of them could go into the method of controller, but it is error with Whitelabel Error Page in spring boot 1.5.10. So, i found that it is different between 1.4.0 and 1.5.10 in org.apache.jasper.servlet.JspServlet .

@godpit
Copy link
Author

godpit commented Sep 17, 2018

I build that it is a package of jar package ,not a war. And i use the command of 'java -jar ....'

@wilkinsona
Copy link
Member

wilkinsona commented Sep 17, 2018

We do not support JSPs with jar packaging. If you want to use JSPs you must use war packaging. Given that it's not clear that this is a bug in Spring Boot, I'm going to close this one. If it doesn't work with war packaging, please provide a sample that reproduces the problem and we can re-open the issue.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Sep 17, 2018
@godpit
Copy link
Author

godpit commented Sep 17, 2018

why is it ok with spring boot 1.4.0?

@godpit
Copy link
Author

godpit commented Sep 17, 2018

jsp-1.4.0.zip

this is a simple example.

I add the node in the pom :

<resources>
           <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/webapp</directory>
                <targetPath>META-INF/resources</targetPath>\
            </resource>
</resources>
spring.mvc.view.prefix=/WEB-INF/
spring.mvc.view.suffix=.jsp

it is ok with spring boot 1.4.0.

@godpit
Copy link
Author

godpit commented Sep 17, 2018

I want to know the reason for that, please help me! Thanks a lot!

@godpit godpit changed the title spring boot jsp 404 Whitelabel Error Page spring boot jsp 404 Whitelabel Error Page with 1.5.0 Sep 17, 2018
@godpit
Copy link
Author

godpit commented Sep 17, 2018

@wilkinsona I add the zip of the example. please help me, thanks a lot!

@wilkinsona
Copy link
Member

wilkinsona commented Sep 17, 2018

Your sample is using jar packaging which is not supported. If it's working, it's only doing so by accident. Unfortunately, I can't afford to spend time figuring out why it appears to work in your case for two reasons.

  1. We only support JSPs with war packaging.
  2. 1.4.0 is no longer supported.

The 1.4.0 reference documentation already state that you should use war packaging if you want to use JSPs: https://docs.spring.io/spring-boot/docs/1.4.0.RELEASE/reference/htmlsingle/#boot-features-jsp-limitations. This recommendation still stands with 1.5.x and 2.0.x which are the two currently supported versions.

@godpit
Copy link
Author

godpit commented Sep 17, 2018

@wilkinsona I'm so sorry for troubling you. but 1.4.0, it is ok with jar packaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants