有谁在tomcat6中运行成功过jsf1.2吗?

时间:2021-04-23 20:10:39
各位大侠,为什么生成的页面的文件类型浏览器不认识,而谈出对话狂要下载.用的是jsf自带的guessNumber事例.

11 个解决方案

#1


下载后保存的文件的代码如下:
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!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" lang="en" xml:lang="en"><head><title>Hello</title></head><body bgcolor="white">
<form id="helloForm" name="helloForm" method="post" action="/jsf-guessNumber/guess/greeting.jsp;jsessionid=633742E96DC6EA45EDF77E561F9A7746" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="helloForm" value="helloForm" />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAAK1XXWwURRyfu35SlPQDoSjgFdCCtntfLWALqbS05fCuNb22CiQe07u53tb9GGZnu1uJBEyURKLBqA9GjERNfIEXfVEf/IgPJiSQSKIPmhhCTIyJ+GBIUB/Umb3dvd3rLTWEfdibufnPb/7z+//+/5m9cAM06AR0HEkvwEUoSFCZFybnFlCeDp698vS7rdoOKQyAiQEAzRoBybwqC5quCEWYR5oAMZbEPKSiqghZCinKQAXOI5KSsbRtmiA0oRbQzeJnn1+MjX9xD8cx9gL+RPhqpo3CMLGqIIUKM6lZERlTqkrBfQs5sZBb0HAuvivRl3xs5+7E7lzM1I6BEyBs9FkoW2ujlKgsCQfYa0wlMlhVQpKk8qYzeYxNDYEdK0ye1CnW6TQyA3xJ3F24pAM3YME9ugLcOIG4JOZTMqMbNBlwEaXkeQdipwWxfQWIlOI41KhriEyofg96Vpg+osoyVArDOqWqAho1fU4WqQPRb0E8vAJEBmma5T8iRCVa3NT5bP6E3VZzpcX012apVKciA4BaKQNxQ9MPX3297ui3dSA8BlokFRbGYJ6qJAVW0RJBWkmVCiYeetyCaDSaORBfgIJtXu8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fdR9NKZn2/1vRq2C8V+Iwni/zMGtvPIqklb/DWpeh1elE6fH/r0mQ9vTjpFSTW2gPuDUUH9oioWXOXU0eovAXYfMKkwxnsj5Q4754I+FkacNq0tBBP7YkzBau5XpOxYWZ+Rk8yNGhlSFXO/WVDubK5xvFoJ7dFj+fDnozFvPrd791i+U2PsTSTFiIDNVUFM9OyKsyBqep7N0njEHrp9xNIiRQRK1xveTo7Hf7xSCdoDoMlGWc6kGy1gml4yG7PWVlYuM50+4mJB7LUGsecph/ZNiQ8nvPR1eOmzPyuwm/SVNC6/HOcoYHdcSSUDEYIKg5EiE1xvEcqitDQQ6Z5ARmSEaUsnS5FsvsQu3XOq+mx3T4RJSCza1hpdktBARJ2TxGM6GoxwwfYWUF4l1q2MjbA7jSQqyM+ERcF/aWmKX3sPAAA=" />
<h2>Hi. My name is Duke. I'm thinking of a number from
            <span xml:lang="en_US">1</span>
            to
            10
            . Can you guess
            it?
        </h2><img id="helloForm:waveImg" src="/jsf-guessNumber/wave.med.gif;jsessionid=633742E96DC6EA45EDF77E561F9A7746" alt="" /><input id="helloForm:userNo" type="text" name="helloForm:userNo" /><input id="helloForm:submit" type="submit" name="helloForm:submit" value="Submit" /><p/>
</form><p><a href="http://validator.w3.org/check?uri=referer"><img width="88" height="31" alt="Valid XHTML 1.0!" src="http://www.w3.org/Icons/valid-xhtml10"/></a></p></body></html>

#2


控制台上也有输出的随机数

#3


该回复被版主删除

#4


是不是你Tomcat的问题~~

#5


帮顶

#6


我也碰到这问题了,到现在没解决.不过试了另外一个例子,成功的.怪事.楼主也试试?

#7


jsf1.2下的web.xml配置采用的servlet 2.5 的。可以改为2.3
<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

修改为
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

#8


我的开发工具是netbeans6.0可以用,没有你说的问题

#9


没遇到过

#10


没遇到过

#11


up

#12


友情帮顶

#1


下载后保存的文件的代码如下:
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!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" lang="en" xml:lang="en"><head><title>Hello</title></head><body bgcolor="white">
<form id="helloForm" name="helloForm" method="post" action="/jsf-guessNumber/guess/greeting.jsp;jsessionid=633742E96DC6EA45EDF77E561F9A7746" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="helloForm" value="helloForm" />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAAK1XXWwURRyfu35SlPQDoSjgFdCCtntfLWALqbS05fCuNb22CiQe07u53tb9GGZnu1uJBEyURKLBqA9GjERNfIEXfVEf/IgPJiSQSKIPmhhCTIyJ+GBIUB/Umb3dvd3rLTWEfdibufnPb/7z+//+/5m9cAM06AR0HEkvwEUoSFCZFybnFlCeDp698vS7rdoOKQyAiQEAzRoBybwqC5quCEWYR5oAMZbEPKSiqghZCinKQAXOI5KSsbRtmiA0oRbQzeJnn1+MjX9xD8cx9gL+RPhqpo3CMLGqIIUKM6lZERlTqkrBfQs5sZBb0HAuvivRl3xs5+7E7lzM1I6BEyBs9FkoW2ujlKgsCQfYa0wlMlhVQpKk8qYzeYxNDYEdK0ye1CnW6TQyA3xJ3F24pAM3YME9ugLcOIG4JOZTMqMbNBlwEaXkeQdipwWxfQWIlOI41KhriEyofg96Vpg+osoyVArDOqWqAho1fU4WqQPRb0E8vAJEBmma5T8iRCVa3NT5bP6E3VZzpcX012apVKciA4BaKQNxQ9MPX3297ui3dSA8BlokFRbGYJ6qJAVW0RJBWkmVCiYeetyCaDSaORBfgI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3EJUbfdR9NKZn2/1vRq2C8V+Iwni/zMGtvPIqklb/DWpeh1elE6fH/r0mQ9vTjpFSTW2gPuDUUH9oioWXOXU0eovAXYfMKkwxnsj5Q4754I+FkacNq0tBBP7YkzBau5XpOxYWZ+Rk8yNGhlSFXO/WVDubK5xvFoJ7dFj+fDnozFvPrd791i+U2PsTSTFiIDNVUFM9OyKsyBqep7N0njEHrp9xNIiRQRK1xveTo7Hf7xSCdoDoMlGWc6kGy1gml4yG7PWVlYuM50+4mJB7LUGsecph/ZNiQ8nvPR1eOmzPyuwm/SVNC6/HOcoYHdcSSUDEYIKg5EiE1xvEcqitDQQ6Z5ARmSEaUsnS5FsvsQu3XOq+mx3T4RJSCza1hpdktBARJ2TxGM6GoxwwfYWUF4l1q2MjbA7jSQqyM+ERcF/aWmKX3sPAAA=" />
<h2>Hi. My name is Duke. I'm thinking of a number from
            <span xml:lang="en_US">1</span>
            to
            10
            . Can you guess
            it?
        </h2><img id="helloForm:waveImg" src="/jsf-guessNumber/wave.med.gif;jsessionid=633742E96DC6EA45EDF77E561F9A7746" alt="" /><input id="helloForm:userNo" type="text" name="helloForm:userNo" /><input id="helloForm:submit" type="submit" name="helloForm:submit" value="Submit" /><p/>
</form><p><a href="http://validator.w3.org/check?uri=referer"><img width="88" height="31" alt="Valid XHTML 1.0!" src="http://www.w3.org/Icons/valid-xhtml10"/></a></p></body></html>

#2


控制台上也有输出的随机数

#3


该回复被版主删除

#4


是不是你Tomcat的问题~~

#5


帮顶

#6


我也碰到这问题了,到现在没解决.不过试了另外一个例子,成功的.怪事.楼主也试试?

#7


jsf1.2下的web.xml配置采用的servlet 2.5 的。可以改为2.3
<web-app version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

修改为
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

#8


我的开发工具是netbeans6.0可以用,没有你说的问题

#9


没遇到过

#10


没遇到过

#11


up

#12


友情帮顶