css - Changes not shown after commit (Heroku Java) -


i working on java project on spring framework. project cloned heroku site. encountered 2 issues...

  1. i have created jsp file (testing.jsp) , committed + pushed heroku. created in src/main/webapp/web-inf/jsp/testing.jsp

    <servlet-name>spring</servlet-name> <url-pattern>/people/*</url-pattern> <url-pattern>/testing/*</url-pattern> 

    i have edited in web.xml file , pushed heroku. however, when tried view in browser, shows me same interface default people.jsp page.

my web.xml file: https://skydrive.live.com/redir?resid=2fc5994fbeb75cc5!174&authkey=!apyqgwzbkhkoaym

  1. i have created css file , pushed heroku. have added following...

    <link href="/imagecss.css" rel="stylesheet">

    when view in browser, shows "http status 404 - /imagecss.css"

    i new , can't seem google useful helps me in issue.

you need to:

  1. add mvc:resources config in applicationcontext.xml following:

    <mvc:resources mapping="/resources/**" location="/resources/" />  
  2. create folder css under src/main/webapp/resources/, resources 1 if haven't it.

  3. link ccs stylesheet in jsp following:

    <link rel="stylesheet" href="<c:url value="/resources/css/imagecss.css" />">

  4. remember include jstl taglig in page:

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

for point 1, can't add multiple <url-pattern> single <servlet-mapping>. should have this:

<servlet-mapping>     <servlet-name>spring</servlet-name>     <url-pattern>/people/*</url-pattern> </servlet-mapping> <servlet-mapping>     <servlet-name>spring</servlet-name>     <url-pattern>/testing/*</url-pattern> </servlet-mapping> 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -