我主要关注此页面:
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html
我用这个命令来创建密钥库
keytool -genkey -alias tomcat -keyalg RSA -keystore/etc/tomcat6/keystore
并回答了提示
然后我编辑了我的server.xml文件并取消注释/编辑了这一行
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/etc/tomcat6/keystore"
keystorePass="tomcat" />
Run Code Online (Sandbox Code Playgroud)
然后我转到我的项目的web.xml文件并将其添加到文件中
<security-constraint>
<web-resource-collection>
<web-resource-name>Security</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)
当我尝试运行我的webapp时,我遇到了这个:
Unable to connect
Firefox can't establish a connection to the server at localhost:8443.
* The site could be temporarily unavailable or too busy. Try again in a few
moments.
* If you are unable to load any pages, check your computer's network
connection.
Run Code Online (Sandbox Code Playgroud)
如果我注释掉我添加到web.xml文件中的行,webapp工作正常.我在/ var/lib/tomcat6/logs中的日志文件什么也没说.我无法弄清楚这是我的密钥库文件,我的server.xml文件还是我的web.xml文件的问题....任何帮助表示赞赏 …
该Javadoc中说,该任务会按顺序执行。但是这里的顺序是否意味着顺序就是任务提交的顺序?还是说一次只能完成一项任务,但可能不会按照提交的顺序完成?
当我在c ++应用程序上工作时,我意识到我正在创建许多可以在其他项目中使用的类和函数.所以我想将所有这些代码放在一个可以"包含"到其他项目中的单独的net beans项目中.(代码完成等)
我已经尝试创建一个新的"静态库"项目,然后我将项目添加到我的主项目(通过首选项 - >链接 - >库并添加我的"库项目"),但代码完成功能找不到当我尝试#include它时,我的库项目的.h文件,该项目也将无法构建.
这样做的正确方法是什么?
我想制作一种特殊的jtable.我希望默认情况下整个表不可编辑.但是当用户单击一行时,然后单击"编辑"j按钮,该特定行是可编辑的.一旦他们选择了行,它就不再可编辑了.
我该怎么做呢?
这里是一段代码,应该循环遍历,直到用户输入0到15之间的数字
int input;
do
{
printf("Enter a number => ");
scanf("%d",&input);
printf("\n %d \n",input);
}
while (!(input>0 && input <15));
Run Code Online (Sandbox Code Playgroud)
但是,如果用户输入类似"gfggdf"的内容,则会导致循环重复一遍又一遍,并且从不提示用户再次输入...控制台看起来像这样
Enter a number =>
0
Enter a number =>
0
Enter a number =>
0
Enter a number =>
0
Enter a number =>
0
Enter a number =>
0
(looping indefinitely)
Run Code Online (Sandbox Code Playgroud)
看完这本书之后,似乎我需要做这样的事情来防止这种情况发生.
int input, error, status;
char skip_ch;
do
{
error = 0;
printf("Enter a number => ");
status = scanf("%d",&input);
printf("\n %d \n",input);
if(status!=1)
{
error=1;
} …Run Code Online (Sandbox Code Playgroud)