Eclipse, Basic JSP and Apache Tomcat - html

I am well versed with the servlet thingy.
I am trying to make a project with the help of jsp. I made a web project on eclipse named website and then I copied some commands like jsp:include. At first it ran properly showing all the context, but after that it just gave errors like:
Http page not found
I don't know what I am doing wrong. Also I did not make changes in the web.xml file. I don't know if any change is required in that file.
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Yo</title>
<jsp:include page="Header.html"/>
</head>
<body>
<!--<div id="header" style="background-color:orange;width:1360px;height:120px">
<h1><style="margin-bottom:0;"><font size="72px" color="white" ><center>
UTTAR PRADESH TECHNICAL UNIVERSITY
</center></font></h1>
</div>-->
WebSite under contruction.
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="15%"> <jsp:include page="LeftPanel.html" flush="true"/>Left Panel </td>
<td width="70%" class="alignment">
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr><td><jsp:include page="Header.html" flush="true"/></td>
</tr>
</table>
</td>
<!--<td width="15%"> <jsp:include page="RightPanel.html" flush="true"/>Right Panel</td>-->
</tr>
</table>
</body>
This is the version I made but it's not working and even the simple code like below is not getting deployed properly.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Watch Initial D live Online Free</title>
<jsp:include page="Header.html"/>
</head>
<body>
Hey Whats Up just Testing..
</body>
</html>

i found out the reason why it got clashed and stopped responding .
it was conflicting with the oracle 10g server at the port 8080
so i switched the port to 80 of my apache tomcat server .
now it works properly .

Related

SpringBoot, Thymeleaf

Can somebody explain me what's going on?
I'm using thymeleaf and springboot
i got template file
out.html
<html lang="en" xmlns:th="http:www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>SAD</title>
<link th:href="#{/css/style.css}" rel="stylesheet"/>
</head>
<body>
<h1>sad</h1>
<div class="container">
<div th:if="${not #lists.isEmpty(list)}">
<h2>People to deport</h2>
<table class ="table table-striped">
<tr>
<th>Name</th>
<th>Surname</th>
<th width="100px">Age</th>
</tr>
<tr th:each = "people :${list}">
<td th:text="${people.name}"></td>
<td th:text="${people.surname}"></td>
<td th:text="${people.age}"></td>
</tr>
</table>
</div>
</div>
<p th:text="#{hello}">text</p>
</body>
</html>
I got request mapping on it in my controller. It works correctly. But as you see i used resource bundle and my default language is russian. (it has displayed '?' signs) on that place.
<p th:text="#{hello}">text</p>
So i wanted to display russian language content on my page . I changed charset from UTF-8 to UTF-16 and everything crashed. Actually codding type is not matter cause i tried to do that with charset=ISO-8859-1
Server starts, displays other templates. But that one does not work even if i turn back UTF-8 charset back and restart server.
I solved it like:
1. I copied my html from it;
2.Delete the file and create new named also out.html;
3.Put that html in the file and it works.
So can somebody explain what is going on?

vertical gap between 2 image in outlook 2013 when HTML as a text

i created mailing but there is a vertical gap between 2 images and i read all solutions about this problem and not solved.
last chance is typing this portal and ask you guys :(
first i open below code on notepad++ and change it then outlook 13 attach file => as a text => then boom vertical gap showing up.
here is my code
<html>
<head>
<title>mailing</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="1">
<a href="mailto:info#ygtur.com">
<img src="http://yucel.ygtur.com/mailing/erkenrez/images/mailing_12.jpg" style="display: block;"></a></td>
<td colspan="1" rowspan="1">
<a href="http://www.ygtur.com/">
<img src="http://yucel.ygtur.com/mailing/erkenrez/images/mailing_13.jpg" style="display: block;"></a></td>
</tr>
</table>
</body>
</html>
here is the picture of the problem
You could try using css to style the table instead of using border= cellpadding= etc. In fact you already tagged the question as css, so I guess you saw it coming :-)
Perhaps Outlook adds its own css if it does not find any, or the view engine that it uses may apply defaults that you are not expecting.
EDIT:
You have whitespace between the <a href> and <img> tags. You should remove that, it may be the cause of your problem. It wouldn't be a problem if the link had just text, but now it has text(whitespace) + an image, and both will show.

how to show the doc, xls, pdf and txt file in iframe?

Using "frame" of html for showing the files but only show the PDFs and text file in "frame", doc and x ls files are downloaded instead of showing.
Following is the sample code:
<html>
<head>
<meta name="generator"
content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
<title>Open Word in Iframe</title>
</head>
<body>
<div align="center">
<table border="1" cellspacing="1" cellpadding="1" width="100%">
<tr>
<td width="25%" align="left" valign="top">
Doc 1
<br />
Doc 2
<br />
Doc 3
</td>
<td width="75%" align="center" valign="top">
<iframe name="awindow" frameborder="2" width="580" height="440" src="doc.txt"></iframe>
</td>
</tr>
</table>
</div>
</body>
</html>
You need to configure MIME types for your web server in order to avoid downloading of those file types, when the remote client requests them directly (i.e. not through your web scripts).
.doc and .xls file types are probably not configured by default, so they default to a MIME type which is simply downloaded instead of displayed in the browser. Btw, the standard browsers don't know by default how to display Microsoft-specific file types, so you might need an extension/plugin/flash object to display it properly.
To display Word/Excell/PDF etc. file without plugins, use the Google Drive Viewer.
Instead of <iframe src="https://your-url.com/file.doc"> use <iframe src="https://docs.google.com/viewer?url=https://your-url.com/file.doc"> and the files will load.

Strange behavior of HTML link tag

We came across a strange behavior while using html tag. Actually the issue was because of improper usage of the tag. As a result of that, the page was getting submitted 3 times in Mozilla Firefox and 2 times in IE7. Here is the issue.
<link rel="stylesheet" type="text/css" title="Style" href=''/css/image.css'>
This was the code that we were using in one of our J2EE application. When we inspected the request and response (using HTTP Watch), we found out that the page was requested 3 times from the server. We found out that the additional "quote" after href= is causing the problem. We were not able to find out the reason why this was causing multiple page submissions. Is it because, the additional quote makes the href empty and because of that browser tries to load the styleclass from the same URL that loaded the page?
Can someone please help to find out the reason why this is happening? Any help will be greatly appreciated.
this explanation came from this article on Yahoo Developer site. Section Avoid Empty Image src:
When an empty string is encountered as a URI, it is considered a relative URI and is resolved according to the algorithm defined in section 5.2. This specific example, an empty string, is listed in section 5.4.
Although it still not clear whether this behavior affect href or not (the article mainly concerned on empty src). But looks like it does:
Hopefully, browsers will not have this problem in the future. Unfortunately, there is no such clause for <script src=""> and <link href="">. Maybe there is still time to make that adjustment to ensure browsers don't accidentally implement this behavior.
note: I never encounter such behavior so it's just theoretical answer :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
</head>
<body>
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="mainOutterTable">
<tbody>
<tr>
<td>
<table class="layoutColumn" cellpadding="0" cellspacing="0">
<tr>
<td style="width:100%;" valign="top">
<table class="layoutRow" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="910">
<table class="layoutColumn" cellpadding="0" cellspacing="0">
<tr>
<td style="width:100%;" valign="top">
<table class="layoutRow" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" width="294">
<table class="layoutColumn" cellpadding="0" cellspacing="0">
<tr>
<td style="width:100%;" valign="top">
<a name="7_N1K8HIC0GOO780I2B1KASD3047"></a>
<div class="wpsPortletBody">
This is a sample textf 3.
<link rel="stylesheet" type="text/css" title="Style" href=''/>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>
I was able to reproduce the problem on a test page.
This is mentioned in Section 5.2 of http://www.apps.ietf.org/rfc/rfc3986.html#sec-5.2
If the Relative path is empty, then the target URI is the base path.
if (R.path == "") then
T.path = Base.path;

Why html frame behave differently in Firefox and IE8?

I use html frame on my webiste, it's been running for I while, usually I only use Firefox to surf the net, my site looks and functions ok, but today I suddenly found IE8 has a problem with the frame on my site, if I click on the top menu items, it's supposed to display the content in the lower part of the frame, it does this correctly in Firefox, but in IE8, it displays the content in the upper part of the frame and replaces the menu items.
In order to give more details, I'll include a simplified version of my html pages, at the top level there are two items, an index.html page and a file directory, all the pages except the index.html are in the directory, so it looks like this :
index.html
Dir_Docs
00_Home.html
00_Install_Java.html
00_Top_Menu.html
01_Home_Menu.html
01_Install_Java_Menu.html
10_Home_Welcome.html
10_How_To_Install_Java.html
[ index.html ]
<Html>
<Head><Title>Java Applications : Tv_Panel, Java_Sound, Biz Manager and Web Academy</Title></Head>
<Frameset Rows="36,*" Border=5 Bordercolor=#006B9F>
<Frame Src=Dir_Docs/00_Top_Menu.html Frameborder=YES Scrolling=no Marginheight=1 Marginwidth=1>
<Frame Src=Dir_Docs/00_Home.html Name=lower_frame Marginheight=1 Marginwidth=1>
</Frameset>
</Html>
[ 00_Home.html ]
<Html>
<Head><Title>NMJava Application Development</Title></Head>
<Frameset Cols="217,*" Align=center BorderColor="#006B9F">
<Frame Src=01_Home_Menu.html Frameborder=YES Name=side_menu Marginheight=1 Marginwidth=1>
<Frame Src=10_Home_Welcome.html Name=content Marginheight=1 Marginwidth=1>
</Frameset>
</Html>
[ 00_Install_Java.html ]
<Html>
<Head>
<Title>Install Java</Title>
</Head>
<Frameset Cols="217,*" Align=center BorderColor="#006B9F">
<Frame Src=01_Install_Java_Menu.html Frameborder=YES Name=side_menu Marginheight=1 Marginwidth=1>
<Frame Src=10_How_To_Install_Java.html Name=content Marginheight=1 Marginwidth=1>
</Frameset>
</Html>
[ 00_Top_Menu.html ]
<Html>
<Head>Top Menu</Head>
<Body>
<Center>
<Base target=lower_frame>
<Table Border=1 Cellpadding=3 Width=100%>
<Tr>
<Td Align=Center Bgcolor=#3366FF><A Href=00_Home.html><Font Size=4 Color=White>Home</Font></A></Td>
<Td Align=Center Bgcolor=#3366FF><A Href=00_Install_Java.html><Font Size=4 Color=White>Install Java</Font></A></Td>
</Tr>
</Table>
</Center>
</Body>
</Html>
[ 01_Home_Menu.html ]
<Html>
<Head><Title>Home Menu</Title></Head>
<Base Target=content>
<Body Bgcolor=#7799DD>
<Center>
<Table Border=1 Width=100%>
<Tr><Td Align=center Bgcolor=#66AAFF><A Href=10_Home_Welcome.html>Welcome</A></Td></Tr>
</Table>
</Center>
</Body>
</Html>
[ 01_Install_Java_Menu.html ]
<Html>
<Head><Title>Install Java</Title></Head>
<Base Target=content>
<Body Bgcolor=#7799DD>
<Center>
<Table Border=1 Width=100%>
<Tr><Td Align=Center Bgcolor=#66AAFF><A Href=10_How_To_Install_Java.html>How To Install Java ?</A></Td></Tr>
</Table>
</Center>
</Body>
</Html>
[ 10_Home_Welcome.html ]
<Html>
<Head><Title>NMJava For Software Development</Title></Head>
<Body>
<Center>
<P>
<Font Size=5 Color=blue>Welcome To NMJava For Software Development</Font>
<P>
</Center>
</Body>
</Html>
[ 10_How_To_Install_Java.html ]
<Html>
<Head>
<Title>Install Java</Title>
</Head>
<Body>
<Center>
<Br>
<Font Size=5 Color=#0022AE><A Href=http://java.com/en/download/index.jsp>How To Install Java ?</A></Font>
<Br>
<P>
<Table Width=90% Cellspacing=5 Cellpadding=5>
<Tr><Td><Font Color=#0022AE>
You need JRE 6 (Java Runtime Environment) to run the programs on this site. You may or may not have Java already installed on your PC, you can find out by going to the following
site, if you don't have the latest version, you can install/upgrade it, it's free from Sun/Oracle at :<Font Size=4> <A Href=http://java.com/en/download/index.jsp>http://java.com/en/download/index.jsp</A></Font>.<P>
</Font></Td></Tr>
</Table>
</Center>
</Body>
</Html>
What's wrong with them, why the two browsers behave differently, and how to fix this ?
My site is at : http://nmjava.com , in case you want to see more details.
Frank
<Body>
<Center>
<Base target=lower_frame>
That's your specific problem. <base> is only allowed inside <head>, not as part of <body>. Previous versions of IE let you get away with it; IE8 doesn't. It ignores the misplaced-base and so leaves links targeted at the current frame.
You are likely to have more odd problems, though, as your markup is invalid in a variety of really basic ways, beyond the frames being merely inadvisable.
Your HTML isn't valid, and IE is known to trip up on invalid html, causing weird behaviors. And to be honest, it's a little hard to figure out whats going on in your code since it's so non-standard. You should familiarize yourself with html best practices - a list apart is a good resource (http://www.alistapart.com/) as is w3 (w3.org) and you may find their validator useful (validator.w3.org). To start with, any attributes in your html tags need to be in quotes, and html tags should be all lowercase.
Also, to target another frame, your anchor tag should look like <a href="myurl.html" target="_frameName" />
You can force IE8 into behaving like IE7 with this in your HEAD.
<meta http-equiv="X-UA-Compatible" content="IE=7" />
While this does not explain the problem, it is often a quick fix.
In IE8, press F-12 for the debugging window. It can help you find the problem in your HTML. See which document mode your page is in. If it's in "quirks mode", you're in trouble.
What Quoo says is true, rethink your design without the use of frames.
(source: moveable.com)