i am trying to run a jQuery on tomcat server and weblogic server but its not working
<html>
<head>
<script src="/WEB-INF/js/jquery-1.7.1.js" language="javascript" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("p").hide();
});
});
</script>
<link href="/WEB-INF/css/styles.css" type="text/css" rel="Stylesheet" />
<title>Dual List Box</title>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>
can any one help me ..!!
If you're deploying a war file, the contents of the WEB-INF directory won't be accessible to the public via http. Ensure your js and css directories are in the root of the war (on the same level as WEB-INF) then change your path in the html to /css/styles.css and /js/jquery-1.7.1.js in your style and script tags.
Related
When i'm trying to access the api, i'm getting the following error message:
{
"errorCode": "PARTNER_AUTHENTICATION_FAILED",
"message": "The specified Integrator Key was not found or is disabled. An Integrator key was not specified."
}
I'm using the access token that returns from this URL: https://account-d.docusign.com/oauth/token, but the url address that the documentation asks to request the list of signed envelopes is this: https://demo.docusign.net/restapi/v2.1/accounts/bf672cac-****-****-****-757e9b8ebfb3/envelopes.
If I change the beginning of the end-point domain to https://account-d.docusign.com/ I get the status 200 and an HTML, which doesn't say much about the error, follows the html:
<!doctype html>
<html ng-app="LoginAppNext.App" lang="en" class="account-server">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0">
<meta name="description" meta-description>
<title>DocuSign</title>
<link href="https://docucdn-a.akamaihd.net/olive/images/2.15.0/favicons/favicon.ico" rel="shortcut icon"
type="image/x-icon">
<base href="/">
<link rel="canonical" href="https://account-d.docusign.com/" />
<link href="/LoginAppNext/styles/olive/and/app?v=7_dKAUfFq_HQdBnGB4k7hYZKoOae-bgnT30ORlEXHEk1" rel="stylesheet" />
<!-- 21.1.2.19210 DA2DFE5 ac4fea07-f999-49e8-b450-a9bd5aa45430 -->
<!-- PAGE-TITLE DIRECTIVE MUST BE LAST INSIDE THE HEAD TAG -->
<page-title></page-title>
</head>
<body class="site-content">
<form name="fixtureForm">
<input id="fixtureInput" value="illegible value that is returned in the request">
</form>
<div ui-view></div>
<!--[if (!IE)|(gt IE 8)]><!-->
<script src="/LoginAppNext/core_via_npm?v=HmqVrseATw9A8eLx4-PxjAKYi3QSWgFzyC0R2L_sc9Q1"></script>
<!--<![endif]-->
<!--[if lte IE 8]>
<link href="/LoginAppNext/styles/legacy?v=4PA642FFntoeJCbU9Xo8MtjFl47UpOhb1wGcStBQ1UU1" rel="stylesheet"/>
<script src="/LoginAppNext/core_via_npm/legacy?v=k4d0Yt_N4blS8S0QrMQ8yybLJtbXex6uQ8SkokHHi_41"></script>
<style type="text/css">
/*
Older browsers (IE8) may interpret the new tags as having an empty XML namespace
when Angular attempts to generate them, so we need to deal with the default styling of those elements, too.
*/
\:article,
\:aside,
\:details,
\:figcaption,
\:figure,
\:footer,
\:header,
\:hgroup,
\:main,
\:nav,
\:section,
\:summary {
display: block; }
</style>
<![endif]-->
<script src="/LoginAppNext/templates?v=daF9DMXq4GIP_dsEt7fCPBYMN-A6Xk9bMZC4suEj0r01"></script>
<script src="/Scripts/app?v=lfm-G_adZ-QhT3MeHhQWFFV_fQ6ENsg6BV4q01boB6M1"></script>
</body>
</html>
Its likely that you are not passing the Authorization header in your request. In your postman request please add this in the "headers" tab just under where you enter the resource uri, in the format of Key:Authorization Value: Bearer {AccessToken}
Please have a look at our postman collection that you can easily import to see how this works: https://github.com/docusign/postman-collections
I am creating an email using Spring Boot and Apache FreeMarker. Is it possible to include CSS in the email without needing to have a huge tag in the header?
Here is an example .ftl file that I would like to link a .css file to:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Hello, world!</title>
</head>
<body>
<div class="container">
<div class="style-in-css-doc">
Some text to be styled
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
You can simply include the css file into your template by putting css code in another ftl file and then include it to your main template with include directive
<#include path>
I work with a Java/Spring project and the project structure is provided below,
I need to reference the app.css in the index.jsp file. Currently, I reference the following way in the index.jsp and the app doesn't get the CSS information's.
<%# page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Bitcoin Wallet</title>
<link href="${pageContext.request.contextPath}/resources/css/app.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
</html>
In the dispatcher-servlet.xml, I provided the resources path as below,
The page I get in the localhost clearly doesn't have the css. How to solve the issue?
To use resources in spring mvc project you have to declare mvc:resources, to map url to a physical file path location.
<mvc:resources mapping="/resources/**" location="/resources/css/"
When you use /resources/ in jsp file spring will map this url to /resources/css/.
Next you can reference css file in jsp file:
<link href="<c:url value="/resources/css/app.css" />" rel="stylesheet">
And move resources folder into webapp folder as
Here is the <head> tag of content.html:
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<script type="text/javascript" src="codemirror.js"></script>
<link rel="stylesheet" href="codemirror.css">
<script type="text/javascript" src="matchbrackets.js"></script>
<script type="text/javascript" src="closebrackets.js"></script>
<script type="text/javascript" src="expression.js"></script>
<style>
.right {
text-align: right;
}
</style>
</head>
File is loaded via:
view.getEngine().load(getClass().getResource("content.html").toExternalForm());
HTML file loads just fine, but none of the files referenced with src or href (css/js). All linked files are in the same package as HTML file. So is the class that loads it.
Ok, just tried to compile it with old 1.8_45 JDK and it works as intended, so it seems like some major fault on Orracle's side.
Update:
Bug fixed in Java 8u72 !
Internet Explorer doesn't support HTML <base> tag and even other browsers do, there are some problems when redirect takes place inservletsto some.jsppages for examplerequest dispatching.`
It's feasible to add ${pageContext.request.contextPath} with each URL
nor request.getServletPath()
JSP relative links for CSS and images with servlets forwarding may change things a lot. This link : Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP
Is there a better approach with JSP / servlets or it's just an IE issue?
Link : HTML <base> TAG and local folder path with Internet Explorer
And if it is an IE issue:
1. how to fix the IE issue as the above post is unable to give a valid answer?
2. how to solve it with JSP / servlets?
My website is now showing CSS and images.
E.g. HTML output is:
<base href="http://localhost:8080/Alpinema/" /> is not working for
<link media="all" rel="stylesheet" type="text/css" href="css/all.css">
It works in other browsers like Firefox and Chrome.
My JSP code portion:
<head>
<base href="${fn:substring(url, 0, fn:length(url) - fn:length(uri))}${req.contextPath}/" />
<meta charset="utf-8">
<title>Alpinema.com</title>
<link media="all" rel="stylesheet" type="text/css" href="css/all.css">
/css?family=Merriweather|PT+Sans:700|Nobile:400italic' rel='stylesheet' type='text/css'>
</head>
Use <c:url> tag from JSTL to reference CSS/JavaScript resources inside my JSP files. By doing so you can be sure that the CSS/JavaScript resources are referenced always relative to the application context (context path).
Example
index.jsp:
<%# page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title>Some Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<c:url value="/css/main.css" />" />
<script type="text/javascript" src="<c:url value="/js/utils.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-1.8.3.js" />"></script>
</head>
<body>
...
</body>
</html>
For even more solutions see my answer here:
Adding external resources (CSS/JavaScript/images etc) in JSP.