Millet, bir jsp sayfasında komut dosyası etiketleri dahil garip bir sorunla karşı karşıyayımSenaryo etiketleri
. Üç senaryonun içinde, sadece sonuncusu son sayfada yer alıyor. Burada
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
<definition extends="registration" name="register/default">
<put-attribute name="body" value="/WEB-INF/views/register/register.jspx"/>
</definition>
</tiles-definitions>
(registration.jspx)
<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
<jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<jsp:output omit-xml-declaration="true" />
<head>
<c:url var="rootUrl" value="/resources/" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<link rel="stylesheet" type="text/css" href="/resources/css/screen.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/openid.css" />
<link rel="stylesheet" type="text/css" href="/resources/css/openid-shadow.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"/>
<script type="text/javascript" src="/resources/js/openid-jquery.js"/>
<script type="text/javascript" src="/resources/js/openid-en.js"/>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
openid.init('openid_identifier');
});
//]]>
</script>
<title>Mystery Shopping</title>
</head>
<body>
<tiles:insertAttribute name="header" />
<tiles:insertAttribute name="body" />
</body>
</html>
Boby niteliktir sayfa kod: Burada şöyle ben görünümü tanımıdır düzenleri
<?xml version="1.0" encoding="UTF-8"?>
<!--$Id$ -->
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
<definition name="default" template="/WEB-INF/layouts/default.jspx">
<put-attribute name="header" value="/WEB-INF/views/header.jspx" />
<put-attribute name="submenu" value="/WEB-INF/views/submenu.jspx" />
<put-attribute name="body" value="/WEB-INF/views/body.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/footer.jspx" />
</definition>
<definition name="registration" template="/WEB-INF/layouts/registration.jspx">
<put-attribute name="header" value="/WEB-INF/views/header.jspx" />
<put-attribute name="body" value="/WEB-INF/views/body.jspx" />
</definition>
</tiles-definitions>
tanımladıktan nasıl daha sonra openid seçici ile formu içeren register.jspx adlı bir jspx sayfasında geçersiz kılındı. Ben
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<link rel="stylesheet" type="text/css" href="/resources/css/screen.css">
<link rel="stylesheet" type="text/css" href="/resources/css/openid.css">
<link rel="stylesheet" type="text/css" href="/resources/css/openid-shadow.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js">
<title>Mystery Shopping</title>
</head>
ben sayfa kaynağını görüntülemek ((Kundakçı aracılığıyla elemanlarını teftiş olduğunda) Ben aşağıdaki kodu bakın bu kayıt sayfası için url eriştiklerinde kaynaklar klasör de
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- Scans within the base package of the application for @Components to configure as beans -->
<context:component-scan base-package="vm.brands.controller" />
<mvc:resources mapping="/resources/**" location="/resources/" />
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />
</beans>
eşlenmediği Biçimlendirilmemiş) Görünür olmayan komut dosyalarını görüyorum; Ancak kaynak görünümünde diğer etiketler gibi biçimlendirilmiş görünmezler.
<html version="2.0"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><meta content="IE=8" http-equiv="X-UA-Compatible"/><link href="/resources/css/screen.css" type="text/css" rel="stylesheet"/><link href="/resources/css/openid.css" type="text/css" rel="stylesheet"/><link href="/resources/css/openid-shadow.css" type="text/css" rel="stylesheet"/><script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"/><script src="/resources/js/openid-jquery.js" type="text/javascript"/><script src="/resources/js/openid-en.js" type="text/javascript"/><script type="text/javascript">
$(document).ready(function() {
openid.init('openid_identifier');
});
Bu garip davranışın nedenleri hakkında hiçbir fikrim yok.
ÇÖZÜLDÜ: ama yeni bir soru yardım Ralph için
sayesinde açılır ; Ben
<spring:url value="/resources/js/openid-jquery.js" var="openid-jquery_url"/>
<spring:url value="/resources/js/openid-en.js" var="openid-en_url"/>
<script src="${openid-jquery_url}" type="text/javascript"><jsp:text> </jsp:text></script>
<script src="${openid-en_url}" type="text/javascript"><jsp:text> </jsp:text></script>
html kılan Öneriniz çalıştı (yine hiçbir fikirleri niçin ve ben biraz fazla ;-) bunu aramak katmanlı am)
<script src="0" type="text/javascript">
<script src="0" type="text/javascript">
ama
<c:url var="rootUrl" value="/resources/" />
<script src="${rootUrl}js/openid-jquery.js" type="text/javascript"><jsp:text> </jsp:text></script>
<script src="${rootUrl}js/openid-en.js" type="text/javascript"><jsp:text> </jsp:text></script>
çalışmak için bu formu var bu beklenen çıktıyı verir
<script src="/resources/js/openid-jquery.js" type="text/javascript">
<script src="/resources/js/openid-en.js" type="text/javascript">
bir yaylı sorundur: url etiketi veya komut dosyası etiketi hiçbir içeriğe sahipse bazı tarayıcılar sorun çünkü bir şey
bu biçimde
Bunun bir neden olduğunu düşünmüyorum; ama sunucu kaynaklarınız yerine "jquery-1.7.1.min.js" formunu farklı bir url 'http: // code.jquery.com/jquery-1.7.1.min.js' yüklediğinizi fark ettiniz mi? – Ralph
Yığın Bir jQuery sunucusunun barındırılan modundan getirme yöntemine sahip olduğumuzda, web uygulamasına bir kopyasını kaydetmenin faydası olmadığını hissettim. İlk etapta iyi bir şekilde yer aldığından beri baharı kullanmamıştım: jquery için url formatı. –