我正在使用JSF 2.2并实现mojarra。每当我点击命令链接并且请求未提交到服务器时,我收到以下javascript错误。单击命令按钮时,似乎没问题。错误是错误:' mojarra'未定义 在附加的视图源中,它显示在mojarra.jsfcljs的链接号32(..
不确定导致问题的原因。我在web.xml中配置了一个身份验证过滤器,其url模式为/ faces / * 另外,我在浏览器中尝试了这个url(/MyApp/faces/javax.faces.resource/jsf.js?ln=javax.faces)并且工作正常,它将我带到登录页面(因为用户没有签名)在。) 此外,在Web应用程序的某个地方也有对primefaces的引用。 任何输入都会有很大帮助。 谢谢。
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head id="j_idt2">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /><link type="text/css" rel="stylesheet" href="/MyApp/faces/javax.faces.resource/theme.css?ln=primefaces-sam" /><script type="text/javascript" src="/MyApp/faces/javax.faces.resource/jquery/jquery.js;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768?ln=primefaces&v=6.0"></script><script type="text/javascript" src="/MyApp/faces/javax.faces.resource/jquery/jquery-plugins.js;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768?ln=primefaces&v=6.0"></script><script type="text/javascript" src="/MyApp/faces/javax.faces.resource/core.js;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768?ln=primefaces&v=6.0"></script><link type="text/css" rel="stylesheet" href="/MyApp/faces/javax.faces.resource/components.css;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768?ln=primefaces&v=6.0" /><script type="text/javascript" src="/MyApp/faces/javax.faces.resource/components.js;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768?ln=primefaces&v=6.0"></script><script type="text/javascript">if(window.PrimeFaces){PrimeFaces.settings.locale='en';}</script>
<link href="/MyApp/resources/css/cssfile1.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/MyApp/resources/css/cssfile2.css" rel="stylesheet" type="text/css" />
<title>MyApp: Sample</title>
<script type="text/javascript" src="/MyApp/resources/scripts/scriptfile1.js"></script>
<script type="text/javascript" src="/MyApp/resources/scripts/scriptfile2.js"></script>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /></head><body onload=""><html xmlns="http://www.w3.org/1999/xhtml">
<div id="header_background">
<div id="header">
<img src="/MyApp/resources/images/Mylogo.gif" />
</div>
<form id="nsform" name="nsform" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="nsform" value="nsform" />
<div id="nssys" >
<ul>
<li id="nvgreeting">welcome XYZ
</li>
<li id="nvcontact_us"><a id="nsform:nvlink_contact_us" name="nsform:nvlink_contact_us" href="/MyApp/faces/contact_us.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768">contact us</a>
</li>
<li id="nvhelp">
<script type="text/javascript" src="/MyApp/faces/javax.faces.resource/jsf.js?ln=javax.faces"></script>
<a id="nsform:nvlink_help" href="#" onclick="mojarra.jsfcljs(document.getElementById('nsform'),{'nsform:nvlink_help':'nsform:nvlink_help'},'');return false">help</a>
</li>
</ul>
</div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
<span class="hidden">Step 1 Bar: </span>
<form id="nv_form" name="nv_form" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="nv_form" value="nv_form" />
<div id="nav_bar"><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt24':'nv_form:j_idt24'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 1" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt26':'nv_form:j_idt26'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 2" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt28':'nv_form:j_idt28'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 3" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt30':'nv_form:j_idt30'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 4" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt32':'nv_form:j_idt32'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 5" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt34':'nv_form:j_idt34'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 6" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('nv_form'),{'nv_form:j_idt36':'nv_form:j_idt36'},'');return false" >
<img src="/MyApp/resources/images/tn.png" alt="Link 7" /></a>
</div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:1" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
</div>
</html>
<div id="header_sub">
<div class="content_margins">
<html xmlns="http://www.w3.org/1999/xhtml">
<form id="bccform" name="bccform" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="bdform" value="bdform" />
<div class="horznavigation" id="bccs">
<ul>
<li><a href="#" onclick="mojarra.jsfcljs(document.getElementById('bdform'),{'j_idt45:0:j_idt47':'j_idt45:0:j_idt47','actionMethod':'setPersons','actionClass':'pack.alerts.NBean','key':'managedBeanBacking'},'');return false">Filter</a> <img src="/MyApp/resources/images/img3.gif;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" />
</li>
<li> <h1>Filters</h1>
</li>
</ul>
</div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:2" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
<!-- End Breadcrumb -->
</html>
<!--Breadcrumb End-->
<form id="billNavBarForm" name="billNavBarForm" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded" style="margin-bottom: 0">
<input type="hidden" name="billNavBarForm" value="billNavBarForm" />
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="bill_nav_tabs"><a href="#" onclick="mojarra.jsfcljs(document.getElementById('billNavBarForm'),{'billNavBarForm:j_idt59':'billNavBarForm:j_idt59'},'');return false" class="basic_selected">
<img src="/MyApp/resources/images/transparent-wide.png" title="Basic Search" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('billNavBarForm'),{'billNavBarForm:j_idt61':'billNavBarForm:j_idt61'},'');return false" class="textSearch_selected_not">
<img src="/MyApp/resources/images/transparent-wide.png" title="Text Search" /></a><a href="#" onclick="mojarra.jsfcljs(document.getElementById('billNavBarForm'),{'billNavBarForm:j_idt63':'billNavBarForm:j_idt63'},'');return false" class="advanced_selected_not">
<img src="/MyApp/resources/images/transparent-wide.png" title="Advanced Search" /></a><img src="/MyApp/resources/images/right-end.png" />
</div>
</html><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:3" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
<div id="billtext" class="tab_content">
<div class="tab_content_sub_non_text"><html xmlns="http://www.w3.org/1999/xhtml"><head id="j_idt70"><link type="text/css" rel="stylesheet" href="/MyApp/faces/javax.faces.resource/theme.css?ln=primefaces-sam" /><script type="text/javascript">if(window.PrimeFaces){PrimeFaces.settings.locale='en';}</script>
<script type="text/javascript" src="/MyApp/resources/scripts/scriptfile1.js"></script>
<style>
.holder {
width: 100%;
display: none;
}
.popup {
border-radius: 7px;
background: #4b4a43;
padding: 6px;
position : absolute;
width: 41%;
height: 42em;
top: 13%;
left: 33%;
right: 32%;
}
</style></head>
<div id="bill_form">
<form id="filter_form" name="filter_form" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="filter_form" value="filter_form" />
<div id="term_criteria">
<h2>
Filter Condition
</h2><span class="form_input"><label for="filter_form:measure_num">Input:</label><input id="filter_form:measure_num" type="text" name="filter_form:measure_num" maxlength="8" onkeypress="handleSubmitAction(event, this.name, this.form, true ? 'attrSearch' : 'createReport')" /></span><span class="form_input"><label for="filter_form:house">DropDown:</label>
<select id="filter_form:Option" name="filter_form:Option" size="1" onchange="document.getElementById('filter_form:hiddenHouseBtn').click();"> <option value="Both" selected="selected">All</option>
<option value="none">None</option>
<option value="some">Some</option>
</select>
<input id="filter_form:hiddenHouseBtn" type="submit" name="filter_form:hiddenHouseBtn" value="" style="display: none;" /></span>
<span class="form_input">
<input id="filter_form:locationtype" type="hidden" name="filter_form:locationtype" />
<label for="filter_form:session_year">Date of Birth:</label>
<input id="filter_form:hiddenSessionYrBtn" type="submit" name="filter_form:hiddenSessionYrBtn" value="" style="display: none;" /></span>
<span class="form_input"><label for="filter_form:stype">S Type:</label><select id="filter_form:stype" name="filter_form:stype" size="1" style="font-family: Arial, 'Courier New', 'Times New Roman'"> <option value="S1">S1</option>
<option value="All" selected="selected">All</option>
</select>
</span>
</div>
<div style="clear:both;"></div>
<div id="btn"><input id="filter_form:btnsubm" type="submit" name="filter_form:btnsubm" value="Execute" /> <input type="submit" name="filter_form:j_idt194" value="Clear" class="buttons" />
</div><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:4" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
<form id="hidden" name="hidden" method="post" action="/MyApp/faces/Step1/myPage1.xhtml;jsessionid=X3r_Oc5yvD29rewNgrCvvGPD9mSLgrEI9Wvvwvi-VaJCBwXqO_tX!1107612768" enctype="application/x-www-form-urlencoded" target="popup">
<input type="hidden" name="hidden" value="hidden" />
<input id="hidden:ltype" type="hidden" name="hidden:ltype" /><input id="hidden:sessionyr" type="hidden" name="hidden:doy" value="2000" /><a id="hidden:go" href="#" onclick="mojarra.jsfcljs(document.getElementById('hidden'),{'hidden:go':'hidden:go'},'');return false"></a><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:5" value="234044955079246741:5229577762117219928" autocomplete="off" />
</form>
</div>
</html>
</div>
</div>
</div>
</div></body>
</html>
&#13;