Changes not shown after commit (Heroku Java)
I am working on a Java project on Spring framework. The project is cloned from the Heroku site. I encountered two issues…
I have created a JSP file (testing.jsp) and committed + pushed to Heroku. I created it in src/main/webapp/WEB-INF/jsp/testing.jsp
- GitHub Organization Pages without named repository
- twitter bootstrap rails CSS not loading after cloning project on new machine
- Adding custom fonts to GitHub pages
- How to color text in github's flavoured markdown?
- Git diff to show changes in CSS block across commits
- Github superproject shows changes when submodule updates?
<servlet-name>spring</servlet-name> <url-pattern>/people/*</url-pattern> <url-pattern>/testing/*</url-pattern>
I have edited it in web.xml file and pushed to Heroku. However, when I tried to view it in my browser, it shows me the same interface as the default people.jsp page.
My web.xml file: https://skydrive.live.com/redir?resid=2FC5994FBEB75CC5!174&authkey=!APyQGWZbKhkoAyM
I have created a css file and pushed to Heroku. I have added the following…
<link href="/imageCSS.css" rel="stylesheet">
When I view in browser, it shows “HTTP Status 404 – /imageCSS.css”
I am new to this and I can’t seem to google anything useful that helps me in my issue.
2 Solutions collect form web for “Changes not shown after commit (Heroku Java)”
You need to:
mvc:resourcesconfig in your
<mvc:resources mapping="/resources/**" location="/resources/" />
Create a folder
src/main/webapp/resources/, even the
resourcesone if you haven’t it.
Link the ccs stylesheet in your jsp as following:
<link rel=”stylesheet” href=”<c:url value=”/resources/css/imageCSS.css” />”>
Remember to include also the JSTL taglig in your page:
<%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core”%>
For the point 1, you can’t add multiple
<url-pattern> to a single
You should have something like 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>
I managed to solve my first issue. I don’t really know where the exact problem lies on but I believe it is either I didn’t map the request correctly in my controller class initially or I didn’t implement out the methods and model class for that controller in order for everything to function properly.
Thanks for all the helps, really appreciate.