Setting default html lang tag in struts - struts-1

I need to add the <html lang='en'> tag to all of my pages.
I can go and modify all of the tags on each page (as below), but is there a way to configure this to be the default?
<html xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:s="/struts-tags"
lang="true">

Related

Reference twitter-bootstrap inside a Codeigniter view

I'm trying to reference the css files of bootstrap inside my views. I'm using Codeigniter as my framework. CI has a folder for the views, but I haven't been able to reference the stylesheets. This is what I'm doing right now:
<!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>
<link href="css/bootstrap.css" rel="stylesheet"/>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<title>
Login
</title>
</head>
<body>
<div class="container">
And so on... But the style is just plain html.
I know there are plenty of questions in stackoverflow regarding this, like this one, but I haven't found a solution in them. Any help would be great.
Solved my problem.
It was a mix of not putting the correct DOCTYPE and also for some reason I had to use <?php base_url();?> for the urls... If someone could explain this to me it would be great to learn more.

IE9 compatibility mode

I have an issue with a website not working properly in IE10 (some pages using iframes). In IE10, I can click on the 'Compatibility view' button and everything works fine again.
To avoid users having to do this, I tried to insert the meta tag in the header of the master page (it's a .NET website), and also in the root web.config (in the system.webserver config block). I also tried IE=9, IE-8...
Nothing works. Is the browser not properly interpreting the tag? I know it sees it because when the tag is there, the 'Compatibility view' icon disappears. What am I missing?
Ie 9 – compatibility: <meta http-equiv="X-UA-Compatible" content="IE=9">
If you want ie 8: <meta http-equiv="X-UA-Compatible" content="IE=8">
if you want both: <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;">
Try
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,requiresActiveX=true">
Reference: https://github.com/h5bp/html5-boilerplate/blob/v4.1.0/doc/extend.md#internet-explorer
Try adding
Response.Cache.SetCacheability(HttpCacheability.NoCache);
example:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralLedgerCodeListingCustomForm.aspx.cs" Inherits="xyz.GeneralLedgerCodeListingCustomForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
Response.Cache.SetCacheability(HttpCacheability.NoCache);
%>

URL fails in W3C HTML/XHTML Validation

I use the URL below in my web page in href tag and unfortunatelly whole link fails in W3C HTML/XHTML Validation.
How do I solve this problem?
http://maps.google.co.uk/maps?q=N+Z&hl=en&hnear=ABC+N4+1,+Jamaica&t=m&z=16
My page includes:
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
.
.
.
You'd have to encode the ampersand (&) in URLs with &.
So your URL should look like:
http://maps.google.co.uk/maps?q=N+Z&hl=en&hnear=ABC+N4+1,+Jamaica&t=m&z=1
See info in HTML 4.01, for example. Also there is web tool which checks for ambiguous ampersands: http://mothereff.in/ampersands
You should escape/encode the URL.

HTML5: What is the "correct" behavior for validation of unregistered <meta> tags?

The following is valid 'HTML 4.01 Transitional' according to the W3 validator:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
When transforming this code to HTML5, the meta-tag underwent some changes as documented here. Thus, the following should be valid HTML5:
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<meta name="revisit-after" content="30 days">
<meta name="DC.Title" content="Website title">
<title>Website title</title>
</head><body></body></html>
Except that it doesn't validate as apparently meta tags are supposed to be registered now.
Problem: The W3 documentation does not list restrictions on meta-tags as a new "feature" of HTML5, but they do not validate like they did previously in HTML 4.01 Transitional.
Update: While the official HTML4 documentation does indeed not restrict the field values of the name attribute, the HTML5 draft mentions the new restriction (unlike the "differences" guide). Some posters suggest to not use meta-tags at all based on SEO arguments, but there have been many public and internal uses of meta-tags for cache control, documentation and storage purposes. Should there not be a way to turn valid HTML4 code into valid HTML5 code without relying on millions of meta-parsers to rewrite themselves automagically?
Question: What should we do in practice?
In practice, just leave the meta tags as they are. Even if the validator complains, it doesn't make a single bit of difference to anyone using your website.

Firefox Addon HTML Validator showing Canvas not recognized

I'm using the HTML Validator Addon in Firefox 4 (great tool I might add).
However, I'm not sure the validation is working the way it should. I'm getting an error saying 'Canvas is not recognized'.
My doctype and html tags are set as follows:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
I believe this is supposed to be the HTML5 way for setting doctypes.
Is there something I'm missing?!
Try removing xmlns="http://www.w3.org/1999/xhtml" from the <html> element.

Resources