here you can find shortly some of the major setting in web.xml.
i like it ... short and easy .
the next post is for advanced user (familiar with servlet,filter ...)
Tomcat web xml reference .
enjoy
Yaniv T
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
Thursday, December 3, 2009
Tuesday, December 1, 2009
Remote Desktop sharing and access
This post is all about the remote desktop access via the Internet.
i am familiar with the next tools :
Logmein - this one have a free tools , i used this one - in the free addition you don't have easy way to access your files like in FTP.
TeamViewer - the All-In-One Solution for Remote Access and Support over the Internet, i just invite into a session its was easy , there is download button there but you don't have to install something in the computer you can run it after downloading (no installation).
Microsoft Remote desktop - the default one that built in the windows OS.
enjoy
Yaniv T
i am familiar with the next tools :
Logmein - this one have a free tools , i used this one - in the free addition you don't have easy way to access your files like in FTP.
TeamViewer - the All-In-One Solution for Remote Access and Support over the Internet, i just invite into a session its was easy , there is download button there but you don't have to install something in the computer you can run it after downloading (no installation).
Microsoft Remote desktop - the default one that built in the windows OS.
enjoy
Yaniv T
Thursday, November 19, 2009
Reports and charts in your web app
recently i looked for a reporting solution for our Web application , i founded the next impressive products - i am sure there are much more :
RenderX.
Crystal reports.
and the lovelly open source solution BIRT.
i played with the BIRT in my eclipse and i get impressed from his drag and drop feature , and the ability to design charts, and use xml or db as a data source for my reports.For more info and step by step tutorial working with BIRT Library goto here, here is a good link about Deploying BIRT , BIRT have the ability to create and show charts as well, here is the Using the BIRT Report Viewer , anoter good design of BIRT PPT .
And here is the way to generate BIRT report via schedular without tomact.
About Charts in my web page - i think the jfreechart is the one - whatever is good for my banking is perfect for me.
another community project is the Jchart.
i am also looking for a work flow diagram to integrate into our Web solution , i found this java work flow solution - JDiagram .
enjoy
Yaniv T
RenderX.
Crystal reports.
and the lovelly open source solution BIRT.
i played with the BIRT in my eclipse and i get impressed from his drag and drop feature , and the ability to design charts, and use xml or db as a data source for my reports.For more info and step by step tutorial working with BIRT Library goto here, here is a good link about Deploying BIRT , BIRT have the ability to create and show charts as well, here is the Using the BIRT Report Viewer , anoter good design of BIRT PPT .
And here is the way to generate BIRT report via schedular without tomact.
About Charts in my web page - i think the jfreechart is the one - whatever is good for my banking is perfect for me.
another community project is the Jchart.
i am also looking for a work flow diagram to integrate into our Web solution , i found this java work flow solution - JDiagram .
enjoy
Yaniv T
Sunday, November 8, 2009
Create self signed Certificate for IIS via OpenSSL
hello
i follow the instruction at Creating a Self-Signed Certificate using OpenSSL for use with Microsoft Internet Information Services (IIS) and its works just fine with my IIS 5.1 on my XP sp2 laptop.
this article is very good and simple & clear.
Enjoy
Yaniv
i follow the instruction at Creating a Self-Signed Certificate using OpenSSL for use with Microsoft Internet Information Services (IIS) and its works just fine with my IIS 5.1 on my XP sp2 laptop.
this article is very good and simple & clear.
Enjoy
Yaniv
Tuesday, November 3, 2009
Max Application memory size under AIX
First i like to mention a very good article that describe in more details this issue , 64-Bit Addressing for Technical Applications .
In general 32bit application under aix 5.X can use maximum 256M of memory - that not too match, to increase the memory you can use the next parameter while compile your application -bmaxdata.
The default value of maxdata (-bmaxdata:0 or not included in the load command) for 32-bit applications is 256 MB. The maximum allowed for 32-bit applications is 2 GB. For 64-bit applications, the maxdata default value is unlimited. A maximum can be imposed if restrictions are necessary, but a large limit doesn't penalize job or system performance.
These recommendations are applicable to most applications:
32-bit applications: -bmaxdata: 0x80000000 (eight 256 Mbyte segments)
64-bit applications: don't use -bmaxdata; the default is unlimited .
On later versions of AIX 5L (5.1 maintenance release 2 or higher), a new allocation scheme called dsa is available for 32-bit applications. It's specified by:
-bmaxdata:0x80000000/dsa
The difference between the 2 options is as follows:
Large address space model:
-bmaxdata:0x80000000 allows to use 8 segments (2GB) of data.
Very Large Address space model:
-bmaxdata:0xD0000000/dsa
Same as above but dsa = Dynamic Segment Allocation:
Segments are not saved for data area, but are obtained dynamically.
With dsa a program can have maximum 13 segments (3.25GB)
So if you don't need more than 2GB, you don't need dsa option.
read more about Large Program Support.
Now i hope you understand why you are getting yours segmentation fault.
Yaniv T
In general 32bit application under aix 5.X can use maximum 256M of memory - that not too match, to increase the memory you can use the next parameter while compile your application -bmaxdata.
The default value of maxdata (-bmaxdata:0 or not included in the load command) for 32-bit applications is 256 MB. The maximum allowed for 32-bit applications is 2 GB. For 64-bit applications, the maxdata default value is unlimited. A maximum can be imposed if restrictions are necessary, but a large limit doesn't penalize job or system performance.
These recommendations are applicable to most applications:
32-bit applications: -bmaxdata: 0x80000000 (eight 256 Mbyte segments)
64-bit applications: don't use -bmaxdata; the default is unlimited .
On later versions of AIX 5L (5.1 maintenance release 2 or higher), a new allocation scheme called dsa is available for 32-bit applications. It's specified by:
-bmaxdata:0x80000000/dsa
The difference between the 2 options is as follows:
Large address space model:
-bmaxdata:0x80000000 allows to use 8 segments (2GB) of data.
Very Large Address space model:
-bmaxdata:0xD0000000/dsa
Same as above but dsa = Dynamic Segment Allocation:
Segments are not saved for data area, but are obtained dynamically.
With dsa a program can have maximum 13 segments (3.25GB)
So if you don't need more than 2GB, you don't need dsa option.
read more about Large Program Support.
Now i hope you understand why you are getting yours segmentation fault.
Yaniv T
Wednesday, October 7, 2009
ASP.NET Caching
I read a starter document to deal and understand the caching mechanism in .NET .
especially the page caching but there are some words on the sqldatasource caching too.
here is your link ASP.NET caching basics.
And here another good description ASP.NET 2.0 Caching Features
Enjoy Yaniv
especially the page caching but there are some words on the sqldatasource caching too.
here is your link ASP.NET caching basics.
And here another good description ASP.NET 2.0 Caching Features
Enjoy Yaniv
Tuesday, September 22, 2009
Calling MFC C++ API from C# (e.g. CString& param)
I have a C++ dll that written via MFC, I exposed an API from my dll, for this sample :
HRESULT __declspec( dllexport )RunTest(const CString& strIn, CString& strOut);
now i want to call it from my c# code, so i tried the next decalrtion:
[DllImport("myDLL.dll", CharSet = CharSet.Ansi)]
public static extern int RunTest(ref StringBuilder strIn, ref StringBuilder strOut);
the strings arrived to the c++ dlls , the problem was getting some unexpcted assertion in destructor and operator= of Cstring , any way as you know CString is a Class with buffer in it , and its looks like the marshal didn’t get well in runtime , I get the string but I get crashed from time to time.
so my workaround was as follow , in the C++ dll i created a new API method (wrapper one):
HRESULT __declspec( dllexport )RunTestManaged(LPCTSTR strXmlIn, LPTSTR strXmlOut, int buffCount)
//--------------------------------------------------------------------------
{
CString param1;
RunTest(strXmlIn,param1);
strncpy(strXmlOut,param1,buffCount);
return 0;
}
and in the C# code i created the next import section:
[DllImport("myDLL.dll", CharSet = CharSet.Ansi)]
public static extern int RunTestManaged(String strIn, ref StringBuilder strOut,int strOutBuffCount);
Make sure to allocate enough buffer in the string builder, this way the strIn and the strOut will be transferred perfectly.
Yaniv T
HRESULT __declspec( dllexport )RunTest(const CString& strIn, CString& strOut);
now i want to call it from my c# code, so i tried the next decalrtion:
[DllImport("myDLL.dll", CharSet = CharSet.Ansi)]
public static extern int RunTest(ref StringBuilder strIn, ref StringBuilder strOut);
the strings arrived to the c++ dlls , the problem was getting some unexpcted assertion in destructor and operator= of Cstring , any way as you know CString is a Class with buffer in it , and its looks like the marshal didn’t get well in runtime , I get the string but I get crashed from time to time.
so my workaround was as follow , in the C++ dll i created a new API method (wrapper one):
HRESULT __declspec( dllexport )RunTestManaged(LPCTSTR strXmlIn, LPTSTR strXmlOut, int buffCount)
//--------------------------------------------------------------------------
{
CString param1;
RunTest(strXmlIn,param1);
strncpy(strXmlOut,param1,buffCount);
return 0;
}
and in the C# code i created the next import section:
[DllImport("myDLL.dll", CharSet = CharSet.Ansi)]
public static extern int RunTestManaged(String strIn, ref StringBuilder strOut,int strOutBuffCount);
Make sure to allocate enough buffer in the string builder, this way the strIn and the strOut will be transferred perfectly.
Yaniv T
using MFC dll's on Azure
Hi
I read somewhere that you can not run MFC dlls in the Azure platform , so its is wrong!!!
i managed to use mfc dll that i developed on .... VC++ 6.0 . in the Azure .
Be aware i didnt test MFC dll that developed on visualstudio 2005/2008.
how did i call my 32bit mfc dll from the web_role that runs in 64 bit ???
i created a WCF self host that using named pipe (net.pipe) , and when the web role loaded i run this self host , and from the self host i call to my native library ,via dllimport , the regular way.
When i deploy my package i didn't add any extra dll , its looks like the instance already have the needed library to support my mfc dll.
more than that my dll connect to sql server via odbc(CDatabase, CRecordSet) , so i just needed to change my connection string to point to sql azure ,and boooom i managed to make it work in the Azure too , again no extra dll needed to the package.
some useful links :
Using a 32bit Native DLL in Windows Azure
Executing Native Code in Windows Azure and the Development Environment
MSDN FullTrust Sample
i hope its save you some test time.
Yaniv
I read somewhere that you can not run MFC dlls in the Azure platform , so its is wrong!!!
i managed to use mfc dll that i developed on .... VC++ 6.0 . in the Azure .
Be aware i didnt test MFC dll that developed on visualstudio 2005/2008.
how did i call my 32bit mfc dll from the web_role that runs in 64 bit ???
i created a WCF self host that using named pipe (net.pipe) , and when the web role loaded i run this self host , and from the self host i call to my native library ,via dllimport , the regular way.
When i deploy my package i didn't add any extra dll , its looks like the instance already have the needed library to support my mfc dll.
more than that my dll connect to sql server via odbc(CDatabase, CRecordSet) , so i just needed to change my connection string to point to sql azure ,and boooom i managed to make it work in the Azure too , again no extra dll needed to the package.
some useful links :
Using a 32bit Native DLL in Windows Azure
Executing Native Code in Windows Azure and the Development Environment
MSDN FullTrust Sample
i hope its save you some test time.
Yaniv
Monday, September 21, 2009
Show directory size in UNIX
the next line works perfectly under AIX.
du -gs /var/* | sort
the results will be the directory size sorted under the /var directory.
YanivT
du -gs /var/* | sort
the results will be the directory size sorted under the /var directory.
YanivT
Monday, September 7, 2009
Connect to SQL Azure - starter links
Recently i am dealing with SQL azura , a relational db on the cloud from Microsoft.
here are some starter links to put you in the map:
SQL Azure Database - HOME .
Microsoft SQL Azure FAQ.
you will have to create your account for SQL Azure (CTP this days), after you will get your code you can manage the DB's.
for a complete set of action how to connect to your DB from your preferred tools , i found the next post First Impressions with the New SQL Azure that will give you a good starting way to interact with your cloud db the
Connecting to SQL Azure from SQL Management Studio 2008 can help too if needed.
NOTES:
if you are in the office and you have a firewall , you will have to open it for:
Access type: outbound
Destination port: 1433
Destination IP range: 65.55.*.*
In addition, if your network has a proxy server for accessing the Internet then you need to configure your proxy server to allow outbound 1433 connections and you need to configure your system to use the proxy server.
this from here Firewall Issues.
hope its help you to start your cloud db - i hope its works well.
and of course MSDN link - SQL Azure .
another good blog The latest news and insight from the SQL Azure team.
enjoy
Yaniv
here are some starter links to put you in the map:
SQL Azure Database - HOME .
Microsoft SQL Azure FAQ.
you will have to create your account for SQL Azure (CTP this days), after you will get your code you can manage the DB's.
for a complete set of action how to connect to your DB from your preferred tools , i found the next post First Impressions with the New SQL Azure that will give you a good starting way to interact with your cloud db the
Connecting to SQL Azure from SQL Management Studio 2008 can help too if needed.
NOTES:
if you are in the office and you have a firewall , you will have to open it for:
Access type: outbound
Destination port: 1433
Destination IP range: 65.55.*.*
In addition, if your network has a proxy server for accessing the Internet then you need to configure your proxy server to allow outbound 1433 connections and you need to configure your system to use the proxy server.
this from here Firewall Issues.
hope its help you to start your cloud db - i hope its works well.
and of course MSDN link - SQL Azure .
another good blog The latest news and insight from the SQL Azure team.
enjoy
Yaniv
Monday, August 31, 2009
MQSeries - enable trace
To Enable WebSphere MQ tracing by executing the following command.
On Windows (Win32) systems: strmqtrc -t api -l 5
On Linux systems: strmqtrc -e -t api -l 5
The strmqtrc tool can be found under the bin directory located under the main MQ
installation directory.
To Stop tracing by executing the command below.
On Windows (Win32) systems: endmqtrc
On Linux systems: endmqtrc -a
The WebSphere MQ trace logs can be found under the (MQ_HOME)\trace directory ,(on AIX its under /var/mqm/trace)
and are all the files that end with extension ".TRC"
i just found a good article how to set trace and decode it
Tracing WebSphere MQ
enjoy
YanivT
On Windows (Win32) systems: strmqtrc -t api -l 5
On Linux systems: strmqtrc -e -t api -l 5
The strmqtrc tool can be found under the bin directory located under the main MQ
installation directory.
To Stop tracing by executing the command below.
On Windows (Win32) systems: endmqtrc
On Linux systems: endmqtrc -a
The WebSphere MQ trace logs can be found under the (MQ_HOME)\trace directory ,(on AIX its under /var/mqm/trace)
and are all the files that end with extension ".TRC"
i just found a good article how to set trace and decode it
Tracing WebSphere MQ
enjoy
YanivT
MQSeries commands for queue manager and queues
The next post will show you how to create queue manager and Queues to start working with MQseries product and some tips to work from unix to windows via mqseries.
i hope you will find it useful for you.
enjoy
YanivT
i hope you will find it useful for you.
1. MQ SERIAS SETTING
1.1 Create queue manager
crtmqm MY_QM
1.2 Creating the QUEUEIN and QUEUEOUT queue
strmqm MY_QM ( start the queue manger)
runmqsc MY_QM ( start the MQSeries command for MY_QM )
DEFINE QLOCAL(QUEUEIN) ( the rest is default)
DEFINE QLOCAL(QUEUEOUT) ( the rest is default)
// for setting maximum handles to the qmgr – for BenchMark
alter qmgr maxhands(1500)
1.3 Creating the Channel for MY_QM
runmqsc MY_QM ( start the MQSeries command for MY_QM )
DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER(‘mqm’)
End (exit from MQSeries command)
1.4 Setting the maximum user connection – optional
Edit the qm.ini file – for the specific queue manager that you created.
Add to the end:
CHANNELS:
MaxChannels = 200 ; Maximum number of Channels allowed.
MaxActiveChannels = 200 ; Maximum number of Channels allowed to be
; active at any time.
1.5 Mq Serias version 6
After creating the queue in version 6 we have to define permission on the queue manager and the queues .
Run the next commands for the queue manager
setmqaut -m MY_QM -t qmgr -p [username] +all
or
setmqaut -m MY_QM -t qmgr -g [Group Name] +all
Run the next commands for the queues:
setmqaut -m MY_QM -n QUEUEIN -t q -p [username] +all
setmqaut -m MY_QM -n QUEUEOUT -t q -p [username] +all
OR
setmqaut -m MY_QM -n QUEUEOUT -t q -g [Group Name] +all
• On the channel – not sure you can set permission too
setmqaut -m [q mgr] -n [channel name] -t chl -g [group name] +all - on the channel name
1.6 Connection from UNIX to MQ server on windows
If you are running your process under user name e.g. root.
Add an account on the windows where the mq server installed and add the user to the mqm group, restart the queue manager .
This way you can access from UNIX to mqserias on windows platform.
1.7 running the MY_QM MQSeries listener
endmqm –i MY_QM (Shut down MY_QM queue Manager)
strmqm MY_QM ( start the queue manger)
strmqcsv MY_QM (Restart the command queue server after restarting the queue manager)
runmqlsr -t tcp -p 1414 -m MY_QM
enjoy
YanivT
Tuesday, July 28, 2009
Java Patterns for MQ Series Clients
here is a great article about Java Patterns for MQ Series Clients.
sample code is there too
http://www.geocities.com/sujitpal/articles/internet/artwb006.html
enjoy
Yaniv T
sample code is there too
http://www.geocities.com/sujitpal/articles/internet/artwb006.html
enjoy
Yaniv T
Friday, July 24, 2009
Convert DataTable to xml the easy way
If you want to convert your data table to xml - here is the function you need:
private string ConvertTableToXml(DataTable table)
{
StringWriter sw = new StringWriter();
table.WriteXml(sw, XmlWriteMode.IgnoreSchema);
return sw.ToString();
}
and if you want to sort your data table before convert it to xml , here is the code snippets
private string ConvertTableToXml(DataTable table)
{
StringWriter sw = new StringWriter();
table.WriteXml(sw, XmlWriteMode.IgnoreSchema);
return sw.ToString();
}
and if you want to sort your data table before convert it to xml , here is the code snippets
myDatatable.DefaultView.Sort = "MaxPrice DESC";
string mystr = ConvertTableToXml(myDatatable.DefaultView.ToTable());
enjoy
Yaniv
Sunday, May 31, 2009
Command line args from Process ID (pid)
Sometime you need more from your task manager , not only the PID , you want to see the full command line , and you don't want to install the process explorer on a production server, so the next script will show you how to get the command line arguments by a process id.
open new text document , rename it to PidToCmd.vbs.
Edit the file.
Copy the next lines into it.
Save the file .
run it .
enjoy
Yaniv T
open new text document , rename it to PidToCmd.vbs.
Edit the file.
Copy the next lines into it.
If WScript.Arguments.Count > 0 Then
Set Processes = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2").ExecQuery("select * from Win32_Process where ProcessID =" & WScript.Arguments.Item(0))
For each Process in Processes
PList = PList & Process.CommandLine & vbLf & vbLf & vbLf
Next
WScript.Echo "command line: " & VBlf & VBlf & UCase(PList)
Else
WScript.Echo "Usage: PidToCmd.vbs [process id]"
End If
Save the file .
run it .
enjoy
Yaniv T
Wednesday, May 27, 2009
web site stress tools
In the next link you can find a complete list (i think ... ) for stress test tools for web application.
Web Site Test Tools and Site Management Tools .
Another good link its for tomcat admin - Tomcat Performance Tuning.
yaniv
Web Site Test Tools and Site Management Tools .
Another good link its for tomcat admin - Tomcat Performance Tuning.
yaniv
Tuesday, May 26, 2009
Update Progress extension & Ajax load gifs
if you are looking for an Ajax icon/gif , in the next site you can design your own ajax gif.
Ajax load
if you are looking for an extended to the update progress control , you can find lovelly extension just here
Using the UpdateProgress control as a modal overlay
Yaniv
Ajax load
if you are looking for an extended to the update progress control , you can find lovelly extension just here
Using the UpdateProgress control as a modal overlay
Yaniv
Monday, May 11, 2009
Calling JavaScript from ASP.NET
I found a very good article that describe several ways to call to java script from asp.net server side , with master page and with Ajax.
Calling JavaScript from ASP.NET
enjoy
Yaniv
Calling JavaScript from ASP.NET
enjoy
Yaniv
Tuesday, May 5, 2009
Monday, March 30, 2009
Connect to an existing IE Browser in c#
if you like to connect to an existing IE browser and get some events , here is a code snippets to do that .
do not forget to add refrence to SHDocVw .
Yaniv
do not forget to add refrence to SHDocVw .
Yaniv
private void btnConnExisting_Click(object sender, EventArgs e)
{
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
if (ie.LocationURL.Contains("what ever"))
{
MessageBox.Show("Location:" + ie.LocationURL);
ie.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.ie_BeforeNavigate2);
}
}
}
public void ie_BeforeNavigate2(object pDisp, ref object url, ref object Flags,
ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel)
{
MessageBox.Show("do what you want!");
}
}
Tuesday, March 24, 2009
WebBrowser control - DocumentCompleted event and Tips
All the developer familiar with the DocumentCompleted event , but you need to be aware of that if you have client side script that handle this event too or do something on the OnLoad event , you will miss the point , we are expecting to get this event after all done , but that the way it is .
i found a solution that works for me - and the credits is not mine , the idea is to call the documentcomplete event later on the same thread after the original call arrived, you can find the solution here :
Triggering DocumentCompleted after the OnLoad event .
another very good resource you can find here
Using Internet Explorer from .NET
enjoy
Yaniv
i found a solution that works for me - and the credits is not mine , the idea is to call the documentcomplete event later on the same thread after the original call arrived, you can find the solution here :
Triggering DocumentCompleted after the OnLoad event .
another very good resource you can find here
Using Internet Explorer from .NET
enjoy
Yaniv
Thursday, March 19, 2009
Read && Write To/From file c++ MFC
two simple function to read & write to/from file in c++ MFC.
Yaniv
void WriteToFile(CString data)
{
CStdioFile file("C:\\TEMP\\chinese.txt",CFile::modeCreate | CFile::modeWrite);
file.WriteString(data);
file.Close();
}
CString ReadFromFile()
{
CStdioFile file("C:\\TEMP\\chinese.txt",CFile::modeRead);
CString data;
file.ReadString(data);
file.Close();
return data;
}
Yaniv
Tuesday, March 17, 2009
See all network computers
if you want to see all network computer , you can run the next command on your windows console
net view
net view
Sunday, March 15, 2009
Windows command line
In the next link you can find all windows command line from A-Z
Command-line reference A-Z
Command-line reference A-Z
Thursday, March 12, 2009
Read && Write To/From file UTF-8 characters in java
Here is the write method :
Here is the read method
Yaniv
private void writeToFile(String data)
{
try {
File file = new File("C:\\TEMP\\chinese1.txt.html");
BufferedWriter bw = new BufferedWriter(
new OutputStreamWriter(new FileOutputStream(file),"UTF8"));
bw.write(data);
bw.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
Here is the read method
private String readFromFile()
{
String retStr="";
try {
File file = new File("C:\\TEMP\\chinese.txt.html");
BufferedReader br = new BufferedReader(
new InputStreamReader(new FileInputStream(file),"UTF8"));
String s;
while((s = br.readLine()) != null) {
retStr += s;//new String(s.getBytes(),"UTF-8");
}
br.close();
} catch (IOException e1) {
e1.printStackTrace();
}
writeToFile(retStr);
return retStr;
}
Yaniv
Sunday, March 8, 2009
Axis Web services with XML Schemas
if you would like to develop AXIS web services with validation schema, you can find here a very good tutorial / article , with project sample .
Developing Axis Web services with XML Schemas
enjoy
Yaniv
Developing Axis Web services with XML Schemas
enjoy
Yaniv
Monday, February 23, 2009
Setting SSL for Tomcat
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
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
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
Subscribe to:
Posts (Atom)