After moving my web project from Tomcat / directory to subfolder /WebApp I get an error GET http://localhost:8080/partials/view-worker-apps-used.html 404 (Not Found)
This is my project structure:
- WebApp
- partials
- view-worker-details.html
- view-worker-apps-used.html
- js
- controlers.js
- services.js
- index.html
First I load http://localhost:8080/WebApp/#/screen2
which is view-worker-details.html injected into index.html by $routeProvider
In loaded view-worker-details.html screen there is
<div ng-include="/partials/view-worker-apps-used.html"></div>
I prefer to not put WebApp prefix into path of ng-include.
How I can fix this problem?
You can take one of following approach.
Approach 1: If you are sure that your contextpath will not change then use following path in ng-include.
<div>
<div ng-include="/WebApp/#/screen2/partials/view-worker-apps-used.html"> </div>
</div>
Note: Remove single quote; it's not require so remove it to avoid confusion
Approach 2: If you think that your context name may change in future then I will suggest to re verify the location of following files.
a. First try by removing extra single quote
b. Verify the location of view-worker-apps-used.html file using following URL
/WebApp/#/screen2/partials/view-worker-apps-used.html
c. Verify the location of file in which you have added following line of code and make sure that relative path you have used as "partials/view-worker-apps-used.html" is valid.
<div>
<div ng-include="'partials/view-worker-apps-used.html'"> </div>
</div>
I hope it may help.
Related
I've deployed Test.war file on Openshift and my application test-sliwa.rhcloud.com/Test run OK. When I deploy ROOT.file application test-sliwa.rhcloud.com doesn't run in right way - first page is ok, but when I try to link to other pages I have 404 error.
The problem was in source code in links declared. It's better to declare domain-relative URL like:
<a href="<%= response.encodeUrl(request.getContextPath() + "/Controller?action=login") %>">
instead of:
<a href="Test/Controller?action=login")">}
in index.jsp file.
I am trying to get a view.jsp file to display another .jsp file as a popup however I keep getting resource not found errors. Both files reside in the same directory in an Eclipse workspace. I was told that I need to use the files render path. I'm not sure how to find/create a render path for a file. The code activating the popup looks like this:
<a href="popupex.jsp" onclick="return popitup('RenderPathGoesHere.jsp')">
<input type="submit" value="Single Issue Upload" name="SingleIssueUpload"><br>
</a>
I'm kinda new to portlet development so any advice would be appreciated.
Thanks!
You can create portlet render url to redirect to jsp
i.e
<portlet:renderURL var="varName">
<portlet:param name="mvcPath" value="/html/foldername/RenderPathGoesHere.jsp" />
</portlet:renderURL>
And you can call like this
Click
HTH
I'm working on a web project using java/ jsp/ servlets/ html/ css in eclipse tomcat, where everything is in the WebContent folder.
In my jsp files... When I try to include other jsp files (using a link like "/fileName.jsp" in jsp include directive) I can do that successfully.
But When I try to include image files (using a link like "/fileName.jpg" in the <img src=""> tag) nothing happens.
Nothing happens because instead of looking in the WebContent folder for image file it looks in the tomcat home directory, i.e.
Instead of looking at "http ://localhost:port/projectName/..." it looks at "http: //localhost:port/..."
Why does it look at the wrong location only with <img src=""> tags but not in <%# /> tag.
A workaround for this is that I start giving absolute paths "/projectName/..." However doing this means I'm hardcoding project name everywhere. This is what I do not want.
Don't include binary content in an ascii output. Why not just use the img tag? If you need to do something to produce a jpeg, I would use a Servlet.
Because the jsp-Links in the website are getting processed and the image links not. Either change the image path or develop an filter that changes the images'links.
Yes Templar, that could have been a way to solve my problem.
However, I simply changed the Context Root of my project from "Project Name" to "/" in Eclipse. This solved my problem.
I`m using spring + hibernate.
Yesterday all has been working, I even added few users via "register.jsp". Saved project and ran it again today, something crashed:/
I`m using forms like those:
<form:form action="add.htm" commandName="user">
<ul>
<li>Login:</li>
<li><form:input path="username" /></li>
<li><span style="color:red" style="font-size:10px"><c:out value="${usernameError}"/></span></li>
</ul>
<ul>
<li>Hasło:</li>
<li><form:password path="password" /></li>
<li><span style="color:red" style="font-size:10px"><c:out value="${passwordError}"/></span></li>
</ul>
</form:form>
on my site and after running my Eclipse today I have an exception:
SEVERE: Servlet.service() for servlet
[jsp] in context with path [/Muzycy]
threw exception [The absolute uri:
http://www.springframework.org/tags/form
cannot be resolved in either web.xml
or the jar files deployed with this
application] with root cause
org.apache.jasper.JasperException: The
absolute uri:
http://www.springframework.org/tags/form
cannot be resolved in either web.xml
or the jar files deployed with this
application
Moreover, mapping .jsp to .htm stopped to work to.
Thanks in advance for help
Are you using maven? If so, try a full clean and build.
mvn clean install
If that doesn´t work, try to clean the jsp, removing all references to taglibs and just place a simple html to test if the view resolver is working. Then add the tags one by one, maybe you have one missing dependency if using maven, or a missing taglib in your deployment directory.
Do you have an entry of this kind in your web.xml?
<jsp-config>
<taglib>
<taglib-uri>http://www.springframework.org/tags/form</taglib-uri>
<taglib-location>spring-form.tld</taglib-location>
</taglib>
</jsp-config>
this effectively gives an alias for a tld file as the url that is being complained about.
If this is the case then tld is now missing. Why it should have been present yesterday and missing today I can't speculate, but check out your build procedures. Look to see whether there's something that should be getting that file from the Spring release you're using.
it definitely has something to do with one of these possibilities:
missing jar file in WEB-INF/lib
conflicting library version of jar file in WEB-INF/lib and tomcat's lib folder, e.g: you have spring-1.1.jar in WEB-INF/lib, but you also have spring-1.0.jar in common/lib
Please, help me, how I can use html files in my appengine application for Java environment (Java SDK)?
When I open it in my browser I got error: HTTP ERROR 404
Problem accessing /myapp/. Reason: NOT_FOUND
I think it depends on what you intend to do :
If you want to serve a static page inside your app :
import (or create) the html page in the folder : YourProject/war
Then you can call it with a relative link in your application:
<a href = 'MyPage.html'> My link </a>
If you want to start the app with a static page, then you must declare it in : YourPRoject/war/WEB-INF/web.xml file, by adding somthing like this this :
<welcome-file-list>
<welcome-file>sign.html</welcome-file>
</welcome-file-list>
I hope it helps !
Have you had a look through the Getting Started documentation?
I added the following to the app.yaml file and it worked for me. This declaration needs to be made right after app_version. Please note that I have placed my html files in the main directory itself.
handlers:
- url: /(.*\.html)
static_files: \1
upload: (.*html)