Topic
  • 1 reply
  • Latest Post - ‏2013-05-28T09:34:07Z by arzetry
helloicap
helloicap
2 Posts

Pinned topic Why can't I visit html page under webcontent root when I try to add something to helloworld java application?

‏2013-05-28T06:26:35Z |

I install Icap plugin successfully,  create a ICAP java project with JAX-RS template, and select to generate sample code.

Then I open project overview and click "Run in Cloud",  I can run it successfully and visit the helloicap service.

 

Then I create a simple index.html page under webcontent folder and restart the app.

I use http://localhost:port/contextroot/index.html to visit, but it returns 404 errors. 

 

I don't understand, anyone can help? 

 

  • arzetry
    arzetry
    11 Posts

    Re: Why can't I visit html page under webcontent root when I try to add something to helloworld java application?

    ‏2013-05-28T09:34:07Z  

    Hi,

    First please check your application's URL Pattern from project overview, the default value is /*. also you can switch to web.xml window from project overview panel, will see below configuration.

     

    <servlet-mapping>
    <servlet-name>com.ibm.cloudapp.sample.MyApplication</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>

    From above, you will get that all the request will be intercepted by this servlet and that's why your single html page can not be resolved rightly. 

    Consider modify URL Pattern to /test/*, then use the same url http://localhost:port/contextroot/index.html to access you html, it will work. Good luck.