Unable to display index.html in jax rs with spring boot












0















I am trying to create a simple app with jax rs, springboot, angular.



I have placed the index.html in static folder, but while hitting the url localhost:8080/index.html or localhost:8080 it's throwing 404 not found error through the custom exception handler. I have added index.html as welcome-file-list.



I have a controller class but i have not written any specific method to handle it.



Also i want to display error specific page with message details.



Definitely i am missing something but not getting any pointer to find it out. Please help.



Do i need to configure web.xml explicitly for this?










share|improve this question

























  • stackoverflow.com/a/29670751/2587435

    – Paul Samsotha
    Jan 1 at 17:13











  • @Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

    – Rajarshi
    Jan 3 at 5:53











  • Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

    – Paul Samsotha
    Jan 3 at 5:57













  • Did you follow the directions in the link? And do you have the dependency in the below answer?

    – Paul Samsotha
    Jan 3 at 6:00











  • Yes all dependencies are there. I will see if i can upload it in github and will share the link.

    – Rajarshi
    Jan 3 at 6:06
















0















I am trying to create a simple app with jax rs, springboot, angular.



I have placed the index.html in static folder, but while hitting the url localhost:8080/index.html or localhost:8080 it's throwing 404 not found error through the custom exception handler. I have added index.html as welcome-file-list.



I have a controller class but i have not written any specific method to handle it.



Also i want to display error specific page with message details.



Definitely i am missing something but not getting any pointer to find it out. Please help.



Do i need to configure web.xml explicitly for this?










share|improve this question

























  • stackoverflow.com/a/29670751/2587435

    – Paul Samsotha
    Jan 1 at 17:13











  • @Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

    – Rajarshi
    Jan 3 at 5:53











  • Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

    – Paul Samsotha
    Jan 3 at 5:57













  • Did you follow the directions in the link? And do you have the dependency in the below answer?

    – Paul Samsotha
    Jan 3 at 6:00











  • Yes all dependencies are there. I will see if i can upload it in github and will share the link.

    – Rajarshi
    Jan 3 at 6:06














0












0








0


1






I am trying to create a simple app with jax rs, springboot, angular.



I have placed the index.html in static folder, but while hitting the url localhost:8080/index.html or localhost:8080 it's throwing 404 not found error through the custom exception handler. I have added index.html as welcome-file-list.



I have a controller class but i have not written any specific method to handle it.



Also i want to display error specific page with message details.



Definitely i am missing something but not getting any pointer to find it out. Please help.



Do i need to configure web.xml explicitly for this?










share|improve this question
















I am trying to create a simple app with jax rs, springboot, angular.



I have placed the index.html in static folder, but while hitting the url localhost:8080/index.html or localhost:8080 it's throwing 404 not found error through the custom exception handler. I have added index.html as welcome-file-list.



I have a controller class but i have not written any specific method to handle it.



Also i want to display error specific page with message details.



Definitely i am missing something but not getting any pointer to find it out. Please help.



Do i need to configure web.xml explicitly for this?







java rest spring-boot jersey jax-rs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 12:27







Rajarshi

















asked Jan 1 at 12:01









RajarshiRajarshi

231113




231113













  • stackoverflow.com/a/29670751/2587435

    – Paul Samsotha
    Jan 1 at 17:13











  • @Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

    – Rajarshi
    Jan 3 at 5:53











  • Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

    – Paul Samsotha
    Jan 3 at 5:57













  • Did you follow the directions in the link? And do you have the dependency in the below answer?

    – Paul Samsotha
    Jan 3 at 6:00











  • Yes all dependencies are there. I will see if i can upload it in github and will share the link.

    – Rajarshi
    Jan 3 at 6:06



















  • stackoverflow.com/a/29670751/2587435

    – Paul Samsotha
    Jan 1 at 17:13











  • @Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

    – Rajarshi
    Jan 3 at 5:53











  • Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

    – Paul Samsotha
    Jan 3 at 5:57













  • Did you follow the directions in the link? And do you have the dependency in the below answer?

    – Paul Samsotha
    Jan 3 at 6:00











  • Yes all dependencies are there. I will see if i can upload it in github and will share the link.

    – Rajarshi
    Jan 3 at 6:06

















stackoverflow.com/a/29670751/2587435

– Paul Samsotha
Jan 1 at 17:13





stackoverflow.com/a/29670751/2587435

– Paul Samsotha
Jan 1 at 17:13













@Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

– Rajarshi
Jan 3 at 5:53





@Paul Samsotha i am a novice so really dont have too much knowledge about these configurations, though i followed but didn't help. So i have removed the web.xml and springboot configure it. I can in log that it's detecting the index page but while hitting the url it is redirecting to my custom exception handler and throwing 404 error. As i saw some comments that springboot will automatically find these static pages and serve. I am not sure as i am using jax rs with springboot so may be i need to do something else.

– Rajarshi
Jan 3 at 5:53













Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

– Paul Samsotha
Jan 3 at 5:57







Do you have GitHub? If you do, can you post a link to the repo? I can look at it.

– Paul Samsotha
Jan 3 at 5:57















Did you follow the directions in the link? And do you have the dependency in the below answer?

– Paul Samsotha
Jan 3 at 6:00





Did you follow the directions in the link? And do you have the dependency in the below answer?

– Paul Samsotha
Jan 3 at 6:00













Yes all dependencies are there. I will see if i can upload it in github and will share the link.

– Rajarshi
Jan 3 at 6:06





Yes all dependencies are there. I will see if i can upload it in github and will share the link.

– Rajarshi
Jan 3 at 6:06












1 Answer
1






active

oldest

votes


















0














Add



    <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>


To your pom.xml file, spring boot auto configure all the rest.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995257%2funable-to-display-index-html-in-jax-rs-with-spring-boot%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Add



        <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>


    To your pom.xml file, spring boot auto configure all the rest.






    share|improve this answer




























      0














      Add



          <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      </dependency>


      To your pom.xml file, spring boot auto configure all the rest.






      share|improve this answer


























        0












        0








        0







        Add



            <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        To your pom.xml file, spring boot auto configure all the rest.






        share|improve this answer













        Add



            <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        To your pom.xml file, spring boot auto configure all the rest.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 1 at 13:55









        Itsik MauyhasItsik Mauyhas

        1,45222058




        1,45222058
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53995257%2funable-to-display-index-html-in-jax-rs-with-spring-boot%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Mossoró

            Error while reading .h5 file using the rhdf5 package in R

            Pushsharp Apns notification error: 'InvalidToken'