简体   繁体   English

如何在ExtJs窗口中显示JSP内容?

[英]How to show jsp content in ExtJs window?

I have a jsp with ExtJs application. 我在ExtJs应用程序中有一个jsp。 I click a button new Ext.Window appers . 我单击一个新的Ext.Window appers按钮。 In this window i want to show forms from another jsp. 在此窗口中,我想显示另一个jsp的表单。 Its mean that i want: 1 Send parametrs to jsp. 我想要的意思是:1将参数发送到jsp。 2 Fill a forms according to these parameters. 2根据这些参数填写表格。 3 Show froms in window. 3在窗口中显示发件人。 4 After send parametrs to first jsp. 4将参数发送到第一个jsp之后。

Another way its send a parameters in second jsp and create window and forms in this jsp and show it. 它在第二个jsp中发送参数的另一种方法,并在该jsp中创建窗口和表单并显示它。

Which way is more correct and how to realize it? 哪种方法更正确以及如何实现?

Second way might be easier. 第二种方法可能更容易。 The Ext Window (or it's parent Panel) component has contentEl property that can be specified. Ext Window(或其父面板)组件具有可以指定的contentEl属性。 What this does is load the html of the element into the Panel component as html property. 这是将元素的html作为html属性加载到Panel组件中。 So you can take an existing JSP with all of its rendered html on the server side and show it as is inside a Window panel. 因此,您可以将现有的JSP及其所有呈现的html放在服务器端,并在“窗口”面板中按原样显示。

The first way might be achieved through a component loader . 第一种方法可以通过组件加载器来实现。 What this does is lets you load content of a remote page (JSP in your case) into your Ext component. 它的作用是让您将远程页面的内容(在您的情况下为JSP)加载到Ext组件中。 I have not used this so I am not sure what limitations you might face with this. 我没有使用过它,所以我不确定您可能会遇到什么限制。 There are however some interesting possibilities described in the docs: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.ComponentLoader 但是,文档中描述了一些有趣的可能性: http : //docs.sencha.com/ext-js/4-1/#!/api/Ext.ComponentLoader

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM