Unable to load css/js files in a spring project - spring

I have tried 2 ways to load external css or js files in my spring project but neither of them is working fine.
Home.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%#taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%#taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css"
href="/resources/css/font-awesome.min.css" />//NOT LOADING
<link rel="stylesheet" href="<c:url value="resources/css/style.css"/>" />//Not loading Method tried 1
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="/resources/css/style.css">//Not loading Method tried 2
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"> </script>

Related

JSP is not parsing page directive

JSP is not getting parsed on browser. Instead show the directive directly.
Can anyone help me out
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
Sample
</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<button id="generateTicket">Generate Ticket</button>
<div id='ticket'></div>
<script>
$("#generateTicket").click(
function(){
console.log("Generate ticket");
$("#ticket").load("generateTicket");
});
</script>
</body>
</html>
below is the image of pom.xm

Recently DELETE and PUT API of default magento 2 was not working, are these the permission issue?

I call API through Postman.
API - PUT rest/V1/customers/144 was not working , It was successfully work on my Local but not on test environment, After some time I came to know that all PUT and DELETE APIs are not working.
Ii displays Error 404:Not found.
<!doctype html><html xmlns="http://www.w3.org/1999/xhtml" ><head>
<title>Error 404: Not Found</title>
<base href="http://shoppingtest.eduqfix.com/pub/errors/default/" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="robots" content="*"/><link rel="stylesheet" href="css/styles.css" type="text/css" /><link rel="icon" href="images/favicon.ico" type="image/x-icon" /><link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
<main class="page-main">
<h1>404 error: Page not found.</h1>
</main>
</body>
</html>

jqGrid is not a function

I'm trying to use jqgrid 5.1.1 and I got this error: $('#gridMain').jqgrid is not a function.
I don't know what to do solve the problem.
Please help me!!
Here is my code
<%# page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My First Grid</title>
<link rel="stylesheet" type="text/css" media="screen" href="/jqgrid_5.1.0/css/ui.jqgrid.css" />
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="/jqgrid_5.1.0/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="/jqgrid_5.1.0/js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="/jqGrid_5.1.0/js/i18n/grid.locale-kr.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function (){
console.log("aa");
$('#gridMain').jqGrid({});
});
</script>
</head>
<body>
<h2>jqGrid test</h2>
<table id="gridMain"></table>
</body>
</html>
enter image description here
I solved the problem.
The cause was a wrong path.
Thank you for your commnet!!!
<link rel="stylesheet" type="text/css" media="screen" href="jqgrid_5.1.0/css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="jqgrid_5.1.0/css/custom.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="jqgrid_5.1.0/css/ui.jqgrid-bootstrap.css" />
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="jqgrid_5.1.0/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="jqgrid_5.1.0/js/i18n/grid.locale-kr.js" type="text/javascript"></script>

unable to pass variables between jsp templates

I'm unable to pass variables from a.jsp to b.jsp, following is what I tried and the output. Can someone please help? Thanks.
a.jsp
start including
<jsp:include page="b.jsp">
<jsp:param name="somevar" value="zzzz" />
</jsp:include>
stop including
b.jsp
${somevar}
${param.somevar}
<%=request.getParameter("somevar")%>
output
start including
null
stop including
You have to set your param before include.
start including
<jsp:params>
<jsp:param name="somevar" value="zzzz" />
</jsp:params>
<jsp:include page="b.jsp">
</jsp:include>
stop including
And can u try this in b.jsp:
<%=request.getParameter("somevar");%>
What is output?
Try the following code:
home.jsp
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%# page session="false"%>
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>Hello world!</h1>
<jsp:include page="b.jsp">
<jsp:param name="something" value="something" />
</jsp:include>
<h1>Bye World</h1>
</body>
</html>
In the b.jsp page use the following code.
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSP Param example</title>
</head>
<body>
<h1>
<c:out value="${param.something}" />
</h1>
</body>
</html>
The output must be
Hello world!
something
Bye World
Try to avoid java code in JSP pages as it is not advisable. For more details, have a look at this answer How to avoid Java Code in JSP-Files?

Visual Studio 2005 - asp.net image display problem

I can see background images in design time. But can't see images in run time. I am running my application from asp.net development server.
I am applying background images by using css.
What is the solution?
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="BackgroundImageTest._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<link rel="stylesheet" href="Stylesheet1.css" type="text/css" media="screen" />
</head>
<body>
<form id="form1" runat="server">
<div>
abcdef
</div>
</form>
</body>
</html>
div
{
background-image:url(App_LocalResources/database.1.jpg);
width:400px;
height:400px;
}
Did you check if the PATH is still there in runtime ?

Resources