Setting up SSL on Tomcat is easy and you don’t have to do much for converting your web application to work with the Https protocol.
in the next article i found you will find the three simple steps you need to follow.
i can confirm that its working well !
setting-up-ssl-on-tomcat-in-3-easy-steps
enjoy
Yaniv
This Blog is first of all memos for me!! From time to time I get exposed to new and cool stuff for developers and architects ,most of the time its a solution for a problem or tips or tricks, so, I would like to track my memos and share it with you, it can save your time and nervous, I hope you will enjoy it - by Yaniv Tzanany.
Search This Blog
Monday, February 23, 2009
Monday, February 2, 2009
Open url in Full screen mode
Here is a sample that simulate opening a url in a new browser in a full screen or as a popup, with several variation , you can even put your page name for test.
create two html files e.g a.html & b.html.
copy the next code into a.html file - and navigate to a.html file .
<html>
<script language=javascript>
function getUrl()
{
var myTextField = document.getElementById('myText');
if(myTextField.value != "")
return myTextField.value;
else
return "b.html";
}
function openMaxWithSize(url)
{
var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,top=0,left=0";
strParam += ",height=" + (screen.availHeight-40);
strParam += ",width=" + (screen.availWidth-10);
window.open(url,'',strParam); //remove comment to open full screen
}
function OpenUrl(url)
{
var childWin;
childWin = window.open(url,'window','height=300,width=550,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
childWin.focus();
}
function OpenUrl_yaniv(url)
{
var childWin;
childWin = window.open(url,'window','fullscreen=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
childWin.focus();
}
function Maxfullwin(url){
window.open(url,'MainUI', ',type=fullWindow,fullscreen,scrollbars=yes,channelmode=0')
}
</script>
<body>
<br/>
page to Open <input type=TextBox id="myText" value="b.html"/>
<br/>
<br/>
<input type=button value="open Max With Size" onclick="openMaxWithSize(getUrl());"/>
<input type=button value="Open Url" onclick="OpenUrl(getUrl());"/>
<input type=button value="Open Url yaniv" onclick="OpenUrl_yaniv(getUrl());"/>
<input type=button value="Maxfullwin" onclick="Maxfullwin(getUrl());"/>
<br/>
</body>
</html>
enjoy
Yaniv
create two html files e.g a.html & b.html.
copy the next code into a.html file - and navigate to a.html file .
<html>
<script language=javascript>
function getUrl()
{
var myTextField = document.getElementById('myText');
if(myTextField.value != "")
return myTextField.value;
else
return "b.html";
}
function openMaxWithSize(url)
{
var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,top=0,left=0";
strParam += ",height=" + (screen.availHeight-40);
strParam += ",width=" + (screen.availWidth-10);
window.open(url,'',strParam); //remove comment to open full screen
}
function OpenUrl(url)
{
var childWin;
childWin = window.open(url,'window','height=300,width=550,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes');
childWin.focus();
}
function OpenUrl_yaniv(url)
{
var childWin;
childWin = window.open(url,'window','fullscreen=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
childWin.focus();
}
function Maxfullwin(url){
window.open(url,'MainUI', ',type=fullWindow,fullscreen,scrollbars=yes,channelmode=0')
}
</script>
<body>
<br/>
page to Open <input type=TextBox id="myText" value="b.html"/>
<br/>
<br/>
<input type=button value="open Max With Size" onclick="openMaxWithSize(getUrl());"/>
<input type=button value="Open Url" onclick="OpenUrl(getUrl());"/>
<input type=button value="Open Url yaniv" onclick="OpenUrl_yaniv(getUrl());"/>
<input type=button value="Maxfullwin" onclick="Maxfullwin(getUrl());"/>
<br/>
</body>
</html>
enjoy
Yaniv
Saturday, January 31, 2009
Web.config error - The entry already added
if you get such error as your connection string already added or any key in your web.config file.
you just have to know that your there is a web.config file that already in use , with the same key or connection string that you try to override , to take the key or connection string in your current web.config file add the node
<clear/>
this will clear any exist settings before.
you just have to know that your there is a web.config file that already in use , with the same key or connection string that you try to override , to take the key or connection string in your current web.config file add the node
<clear/>
this will clear any exist settings before.
Tuesday, January 13, 2009
Command line arguments - LPWSTR to char*
if you want to see the command line arguments of you can use the argc and argv parameter , in my program i create a service with ATL (vc++) and the argc / argv are missing .
so to get the arguments in this case i used the next code snippets:
LPWSTR *szArglist;
int nArgs;
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
.......
To convert the character from LPWSTR to char* i use the next macro:
W2A - (vice versa A2W) you will have to add in your function the macro
USES_CONVERSION
e.g.
char *pp = W2A(szArglist[1]);
LocalFree(szArglist);// Free memory allocated
Yaniv
so to get the arguments in this case i used the next code snippets:
LPWSTR *szArglist;
int nArgs;
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
.......
To convert the character from LPWSTR to char* i use the next macro:
W2A - (vice versa A2W) you will have to add in your function the macro
USES_CONVERSION
e.g.
char *pp = W2A(szArglist[1]);
LocalFree(szArglist);// Free memory allocated
Yaniv
Sunday, January 11, 2009
How to Handle the ctrl-c or ctrl-break event in c++ application
the next tip tested on windows platform via c++ console application.
sometimes there is a need to handle the ctrl-c or ctrl break event on your console to clean some data or even to release an event, this is the way to do that.
1. create the next function:
BOOL CtrlHandler( DWORD fdwCtrlType )
{
switch( fdwCtrlType )
{
// Handle the CTRL-C and others signal.
case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
printf( "Ctrl-C or break event arrived clean my stuff \n\n" );
char buff[200];
CleanMyStuff(buff);
return( FALSE ); // its important to return false to send this event to the next chain
}
return FALSE;
};
return FALSE from this method is important if you want to send this event to the next chain.
2. in your console app in your main function set the next line .
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE ) ;
Yaniv
sometimes there is a need to handle the ctrl-c or ctrl break event on your console to clean some data or even to release an event, this is the way to do that.
1. create the next function:
BOOL CtrlHandler( DWORD fdwCtrlType )
{
switch( fdwCtrlType )
{
// Handle the CTRL-C and others signal.
case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
printf( "Ctrl-C or break event arrived clean my stuff \n\n" );
char buff[200];
CleanMyStuff(buff);
return( FALSE ); // its important to return false to send this event to the next chain
}
return FALSE;
};
return FALSE from this method is important if you want to send this event to the next chain.
2. in your console app in your main function set the next line .
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE ) ;
Yaniv
Tuesday, December 16, 2008
Linux - how to determine file type (32 bit or 64 bit)
as a developer sometimes you need to know to the file type of a shared object (32 bit or 64 bit) , link to a wrong file type can cause you problem during linkage.
so the command is:
file [name file ]
the output will be the file type (32/64).
for more information
man file
so the command is:
file [name file ]
the output will be the file type (32/64).
for more information
man file
Set Linux/Unix prompt and getting previous command
in case you don't like your Linux prompt , you can change that in very easy way .
you just need to export & declare the PS1 environment parameter.
e.g.
export PS1='$USER@$HOSTNAME $PWD >'
will give you prompt like this:
root@myLinux /usr/src >
you can change your prompt to be as you want .
sometime the current shell could not show you the previous command when you press the up arrow key, to make it work ,in the shell prompt type:
set -o emacs
you just need to export & declare the PS1 environment parameter.
e.g.
export PS1='$USER@$HOSTNAME $PWD >'
will give you prompt like this:
root@myLinux /usr/src >
you can change your prompt to be as you want .
sometime the current shell could not show you the previous command when you press the up arrow key, to make it work ,in the shell prompt type:
set -o emacs
Subscribe to:
Posts (Atom)