在不同的战争中从jsf调用servlet post
我想调用一个Servlet,它存在于与我的war不同的war中。当用户单击按钮时,我们需要调用servlet的post方法。为了实现这一点,我确实看到了一个现有的示例,该示例稍有不同,但在这种情况下有效 我使用的是jsf,因此在jsp中有一个h:form,其中包含另一个html表单。代码如下:在不同的战争中从jsf调用servlet post,jsf,servlets,post,Jsf,Servlets,Post,我想调用一个Servlet,它存在于与我的war不同的war中。当用户单击按钮时,我们需要调用servlet的post方法。为了实现这一点,我确实看到了一个现有的示例,该示例稍有不同,但在这种情况下有效 我使用的是jsf,因此在jsp中有一个h:form,其中包含另一个html表单。代码如下: <h:form> <div id="gform" class="column span-20 append-1"> <h:outputText value
<h:form>
<div id="gform" class="column span-20 append-1">
<h:outputText value="Text." /><br/><br/>
<h:commandLink id="addPaymentButton" styleClass="button" onclick='autorenew();return false;'> <span><h:outputText value="Payment Option"/></span> </h:commandLink>
<a id="noThanksButton" href="#"><span><h:outputText value="No Thanks"/></span></a><br/><br/><br/>
<h:outputText style="color:grey" value="Some text" />
<div> </div>
</div>
<form id="hiddenSubmit" method="post" action="https://localhost.myapp.com/myapp/LoginRouter" >
<input type="hidden" name="redirectUrl" value="/myapp/customers/addNewSavedCCInfo.faces"/>
<input type="hidden" name="jump_message" value="IAmJumpingToCC"/>
<input type="hidden" name="jump_url" value="/premiumServices/myPage.htm"/>
<input id="hiddenSubmitButton" type="submit" name="submit" style="display: none" value='' />
</form>
</h:form>
<script language="javascript">
function autorenew(){
window.alert('In js fnt');
document.hiddenSubmit.getElementById('hiddenSubmitButton').click();
window.alert('In js fnt COMPLETE');
return false;
}
函数autorenew(){
window.alert('In js fnt');
document.hiddenSubmit.getElementById('hiddenSubmitButton')。单击();
window.alert('In js fnt COMPLETE');
返回false;
}
因此,当单击按钮时,会执行javascript,将表单提交给servlet。然而,我可以在firebug中看到,我需要提交的第二个表单没有出现。我不知道如何在另一场战争中调用servlet类的post方法。欢迎任何想法,我真的被卡住了
谢谢。根据HTML规范,禁止嵌套
元素。(mis)行为取决于浏览器。一些浏览器将发送所有参数,一些浏览器将只发送父窗体的数据,其他浏览器将不发送任何内容
你想在这里有一个单一的表格。您可以将
完全替换为普通的HTML
,使用所需的操作
指向所讨论的servlet