Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [jsp] intestazione header x-html

    Una domanda veloce.
    Devo creare un sito in Java MVC 2, su Tomcat; e deve essere convalidato in X-HTML.
    Dato che Java è molto suscittibile a conflitti di linguaggio, sono perplesso per quello che riguarda l'intestazione
    codice:
    <%@ page language="java"%>
    
    <!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">
    
    <%
    response.setContentType("text/html; charset=iso-8859-1");
    response.setHeader("Cache-Control", "no-store"); //HTTP 1.1
    response.setHeader("Pragma", "no-cacher"); //HTTP 1.0
    response.setDateHeader("Expires", 0); //prevent caching at the proxy
    %>
    cosa ne pensate? Mi creerà conflitti o va bene?
    Grazie ciao

  2. #2
    Utente di HTML.it L'avatar di Fox82
    Registrato dal
    Feb 2002
    Messaggi
    459
    Prova, se dovesse darti problemi incapsuli tutto dentro una stringa (con gli opportuni backslash) ed esegui una stampa sul flusso di uscita...

    Linux user number 403381

    Stop TCPA!

  3. #3
    ho fatto una prova per vedere se per lo meno me lo riusciva a convalidare. E non lo ha fatto.
    Questo è il contenuto della mia pagina index.jsp
    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ page language="java"%>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>test - </title>
    <%
    response.setHeader("Cache-Control", "no-store"); //HTTP 1.1
    response.setHeader("Pragma", "no-cacher"); //HTTP 1.0
    response.setDateHeader("Expires", 0); //prevent caching at the proxy
    %>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    
    <body>
    
    <h4>test W3C</h4>
    </body>
    </html>
    Il messaggio di errore del sito della W3C dice:

    Sorry, I am unable to validate this document because its content type is application/octet-stream, which is not currently supported by this service.

    The Content-Type field is sent by your web server (or web browser if you use the file upload interface) and depends on its configuration. Commonly, web servers will have a mapping of filename extensions (such as ".html") to MIME Content-Type values (such as text/html).

    That you recieved this message can mean that your server is not configured correctly, that your file does not have the correct filename extension, or that you are attempting to validate a file type that we do not support yet. In the latter case you should let us know that you need us to support that content type (please include all relevant details, including the URL to the standards document defining the content type) using the instructions on the Feedback Page.
    Le pagine jsp possono essere convalidate vero?? :master:

  4. #4
    ok, tutto a posto.
    Non riesce a convalidarlo solo se si prova con l'upload. Ma attraverso quello on-line funziona.
    Ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.