Problems with Windows controls running. Net in IE when webspere vs IE

Source: Internet
Author: User

Problems with Windows controls running. Net in IE when webspere vs IE
Recently, my younger brother is engaged in a project, B/S, which is quite troublesome. We need to use. NET and J2EE together.
The server is a J2EE, which is a Java-based publisher such as Apache or Tom, without IIS,
The client is a Windows Form Control written in C # That runs in IE.
A widget embedded in the webpage naturally involves the download and automatic update of controls.
First, install. NET Framework 1.1 on the machine you want to run.
[Control Panel]-[Administrative Tools]-[Microsoft. NET Framework 1.1 configuration]
Then go to [my computer]-[runtime database security policy]-[computer]-[code group]-[all_code] to enter its properties dialog box.
Set its [permission set] to [fulltrus].

The HTML page code of the control is as follows:
<HTML>
<Head>
<Title> demo of the electronic medical record Editor </title>
</Head>
<Body>
<Object ID = "mycontrol" width = "100%" Height = "90%" classid = "documentlib. dll # textdocumentlib. editpanel"
Viewastext>
</Object>
<Input type = "button" value = "initialize" onclick = "Init ()"/>

</Body>
</Html>

However, if you copy documentlib. DLL to the server running J2EE, the page cannot be correctly displayed, and the publisher may be faulty.
So I compiled a port listener and analyzed the difference. It turns out that the contenttype returned by HTTP is different,
I did not go into details about the difference. I added a JSP file named DLL. jsp to the server. The Code is as follows:
Bytes ---------------------------------------------------------------------------------------------------
<% @ Page contenttype = "text/html; charset = GBK" %> <%
Try
{
Com. Haitai. EMR. Common. Debug. println ("DLL. jsp ");
Response. setcontenttype ("application/octet-stream"); // you can specify the type of the returned file.
Fileinputstream hfile = new fileinputstream (pagecontext. getservletcontext (). getrealpath ("/") + "// documentlib. dll"); // open the file as a byte stream
System. Out. println (pagecontext. getservletcontext (). getrealpath ("/") + "// emrtext // emrtextdocumentlib. dll ");
Int I = hfile. Available (); // get the file size
Byte data [] = new byte [I];
Hfile. Read (data); // read data
Hfile. Close ();
Servletoutputstream toclient = response. getoutputstream (); // get the object that outputs binary data to the client
Toclient. Write (data); // output data
Toclient. Flush ();
Toclient. Close ();
}
Catch (illegalstateexception e ){
E. printstacktrace ();
}
Catch (throwable ext ){
Ext. printstacktrace ();
}
%> <% @ Page import = "Java. lang. * "%> <% @ page import =" Java. util. * "%> <% @ page import =" Java. io. * "%>
Bytes -----------------------------------------------------------------------------------------------------

HTML code becomes
<HTML>
<Head>
<Title> demo of the electronic medical record Editor </title>
</Head>
<Body>
<Object ID = "mycontrol" width = "100%" Height = "90%" classid = "DLL. jsp # textdocumentlib. editpanel"
Viewastext>
</Object>
<Input type = "button" value = "initialize" onclick = "Init ()"/>

</Body>
</Html>

The result page is correctly displayed.

The problem is that the page is always connected to DLL. jsp when it is opened. Check the latest version. I guess it can be referenced on the page based on some information.
The application configuration file to avoid repeated operations. A suitable webconfig. XML can be placed on the server, and the HTML page is changed to the following:
<HTML>
<Head>
<Title> demo of the electronic medical record Editor </title>
<LINK rel = "configuration" href = "webconfig. xml"/>
</Head>
<Body>
<Object ID = "mycontrol" width = "100%" Height = "90%" classid = "DLL. jsp # textdocumentlib. editpanel"
Viewastext>
</Object>
<Input type = "button" value = "initialize" onclick = "Init ()"/>

</Body>
</Html>
But I don't know how to write this webconfig. xml. I used sn.exe makecert.exe signcode.exe to make a strong name for that control.
The processed DLL file can be thrown into the Assembly high-speed buffer of Windows2000, and then the following webconfig. XML is written, which seems useless.
<Configuration>
<Runtime>
<Assemblybinding xmlns = "urn: Schemas-Microsoft-com: ASM. V1">
<Dependentassembly>
<Assemblyidentity name = "documentlib" publickeytoken = "4b96b5c6ae565d61" Culture = "neutral"/>
<Bindingredirect newversion = "1.0.1803.20.49"/>
<Codebase version = "1.0.1803.20.49" href = "documentlib. dll"/>
</Dependentassembly>
</Assemblybinding>
</Runtime>
</Configuration>
 
There is another problem. In some machines, the control loading is slow. After careful research, we find that the program is in "system. Resources. ResourceManager. GetObject ()"
It has been stuck for a long time. I also located "system. configtreeparser. parse (string, String, Boolean,
I don't know what the region settings are or what problems or other causes of permissions.
 
Summary:
1. How to automatically download and update the. netwindows control running in IE depends on <LINK rel = "configuration" href = "webconfig. xml"/>
Avoid meaningless download of DLL files
2. You can direct the above DLL. jsp to the DLL file itself without having to use it.
3. How to solve the problem of slow Control Loading in some machines
4. The above publisher is case sensitive to file names. documentlib. dll and documentlib. dll are different. vs.net compiles and generates DLL, While IE is always
When downloading a DLL from a view, I need to change it to a DLL when copying it to the server.
 
 
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.