从HTML5访问Java Bean

时间:2018-12-19 17:46:55

标签: java html5 jsf xhtml

我正在用html构建一个网站,该网站使用Java服务器界面访问Java Bean。我已经使用xhtml使其工作了,但是我意识到我需要html5的某些功能,所以我试图使用html5重建前端。

工作索引。xhtml

 country iso2 year     sector  UNemissions ETSemissions
 Austria   AT 1990 1 - Energy  14025035.91          NaN
 Austria   AT 1991 1 - Energy  14791166.44          NaN
 Austria   AT 1992 1 - Energy  11581927.50          NaN
 Austria   AT 1993 1 - Energy  11623249.52          NaN
 Austria   AT 1994 1 - Energy  11915320.45          NaN
 Austria   AT 1995 1 - Energy  13044941.45          NaN
 Austria   AT 1996 1 - Energy  14048250.53          NaN
 Austria   AT 1997 1 - Energy  14077003.80          NaN
 Austria   AT 1998 1 - Energy  13106015.03          NaN
 Austria   AT 1999 1 - Energy  12548768.26          NaN
 Austria   AT 2000 1 - Energy  12263794.33          NaN
 Austria   AT 2001 1 - Energy  13770416.74          NaN
 Austria   AT 2002 1 - Energy  13380097.16          NaN
 Austria   AT 2003 1 - Energy  15965271.93          NaN
 Austria   AT 2004 1 - Energy  15899196.33          NaN
 Austria   AT 2005 1 - Energy  16194772.33          16539659
 Austria   AT 2006 1 - Energy  15039192.77          15275065
 Austria   AT 2007 1 - Energy  13757091.05          14124646
 Austria   AT 2008 1 - Energy  13582006.99          14572511
 Austria   AT 2009 1 - Energy  12526267.29          12767555
 Austria   AT 2010 1 - Energy  13852187.50          15506112
 Austria   AT 2011 1 - Energy  13666544.68          15131551
 Austria   AT 2012 1 - Energy  12256272.25          13121434
 Austria   AT 2013 1 - Energy  11224625.46          8074514
 Austria   AT 2014 1 - Energy   9499544.19          6426135
 Austria   AT 2015 1 - Energy  10623550.19          7514263
 Austria   AT 2016 1 - Energy  10448925.88          7142937
 Austria   AT 2017 1 - Energy         NaN           7795277  

Bean LoginBean.java

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://xmlns.jcp.org/jsf/html">
<body>
<h:form>
        username:
        <h:inputText id="userName" size="10" maxlength="20" value="#{LoginBean.username}"/>
        <br></br>
        password:
        <h:inputText id="password" size="10" maxlength="20" value="#{LoginBean.password}"/>
        <br></br>
        <h:commandButton id="submit" value="submit" action="#{LoginBean.login()}"/>
        <br></br>
    </h:form>
</body>

该按钮应该保存用户名和密码,如果172.17.0.3:8080/login接受登录,则应该加载UserPage.html。那么有可能在html5中做同样的事情吗?

0 个答案:

没有答案