首页 \ 问答 \ Eclipse WTP:如何在Tomcat上启用SSL?(Eclipse WTP: How do I enable SSL on Tomcat?)

Eclipse WTP:如何在Tomcat上启用SSL?(Eclipse WTP: How do I enable SSL on Tomcat?)

Eclipse WTP创建自己的server.xml文件,该文件放置在一些文件夹中,该文件夹为您的Web项目配置正在运行的tomcat实例。 如果您双击服务器列表中的服务器,您将获得一个漂亮的屏幕,这样可以轻松配置server.xml文件的某些方面。

如何配置新的连接以允许端口8443上的SSL连接。每当我手动编辑server.xml文件时,eclipse将使用存储在配置的服务器属性页面中的设置来覆盖我的更改,并且似乎没有办法从eclipse提供的接口添加一个新的连接器。

这可能吗? 以下是我要添加的连接器:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    keystoreFile="D:\apache-tomcat-6.0.18\keystore\key.ssl" keystorePass="pass"
    clientAuth="false" sslProtocol="TLS" />

Eclipse WTP creates its own server.xml file which it places in some folder which configures the tomcat instance you are running for your web project. If you double click on the server in the servers list you get a nice screen which makes it simple to configure some aspects of the server.xml file.

How do I configure a new connection to allow SSL connections on port 8443. Everytime I edit the server.xml file manually, eclipse overwrites my changes with the settings it has stored in the server properties page of the configuration and it seems there is no way to add a new connector from the interface that eclipse provides.

Is this possible? Here is the connector I want to add:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    keystoreFile="D:\apache-tomcat-6.0.18\keystore\key.ssl" keystorePass="pass"
    clientAuth="false" sslProtocol="TLS" />

原文:https://stackoverflow.com/questions/951890
更新时间:2022-03-19 22:03

最满意答案

要在Mych的答案上进行一些扩展,您需要处理DetailsView的ItemCreated事件:

<asp:DetailsView
    id="dtlShipModes"
    DataSourceID="SqlDataSource1"
    AutoGenerateRows="False"
    DefaultMode="Insert"
    ItemCreated="dtlShipModes_ItemCreated"
    Runat="server" BackColor="White" BorderColor="White" BorderStyle="Ridge" 
    BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None">

然后像这样编写事件处理程序:

protected void dtlShipModes_ItemCreated(Object sender, EventArgs e)
{
    Dim txtupdatedby As TextBox = DirectCast(dtlShipModes.FindControl("txtUpdateDate"), TextBox)
    txtupdatedby.Text = DateTime.Now.ToString
}

请注意,我稍微更改了您的实现,以使用对TextBox的引用,而不是字符串。

这一切都是必需的,因为DetailsView没有在Page的Load事件中加载数据。


To expand a little on Mych's answer, you would want to handle the ItemCreated event of the DetailsView:

<asp:DetailsView
    id="dtlShipModes"
    DataSourceID="SqlDataSource1"
    AutoGenerateRows="False"
    DefaultMode="Insert"
    ItemCreated="dtlShipModes_ItemCreated"
    Runat="server" BackColor="White" BorderColor="White" BorderStyle="Ridge" 
    BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None">

And then write the event handler like this:

protected void dtlShipModes_ItemCreated(Object sender, EventArgs e)
{
    Dim txtupdatedby As TextBox = DirectCast(dtlShipModes.FindControl("txtUpdateDate"), TextBox)
    txtupdatedby.Text = DateTime.Now.ToString
}

Notice that I changed your implementation a little, to use a reference to the TextBox, rather than the string.

This is all necessary because the DetailsView is not loaded with data yet in the Page's Load event.

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。