Thursday, April 23, 2009

use multiple application properites file?

How to use more than one ApplicationResources.properties in struts?

SCENARIO

The scenario is you have two properties files

1. one for English(For Example) - Application.Properties

1. one for Welsh(For Example) - Application_cy.Properties

The two jsp one is for english 1. lost.jsp

for Welsh 2. lost-cy.jsp

The change to be made in the

  1. web.xml 2. struts config.xml 3. lost-cy.jsp

web.xml

<servlet>

<init-param>

<param-name>applicationparam-name>

<param-value>/WEB-INF/classes/com/ips/ApplicationResources.properties>

>

<init-param>

<param-name>application1param-name>

<param-value>/WEB-INF/classes/com/ips/ApplicationResources_cy.properties>

>

servlet>

struts-config.xml

<message-resources parameter="com.ips.ApplicationResources" null="false"/>

<message-resources parameter="com.ips.ApplicationResources_cy" key="welsh" null="false" />

lost-cy.jsp

<html:errors bundle="welsh"/>

<html:form action="/lost-cy" method="post" onsubmit="return lostvalidate()">

<td class="border" align="left">

<html:text property="email" styleId="email" size="35">html:text>

<label class="error" id="emailerror"> <bean:message bundle="welsh" key="errors.email.required" />

label>

td>


Saturday, April 18, 2009

Messaging Exception In Java Mail

If you are getting an exception as below.
Exception in thread "main" javax.mail.MessagingException: Could not connect to SMTP host:
: port
The main reason behind this is the antivirus software(MCafee) which is blocking your port
you need to do the following to make your mail functionality work properly

This is the steps for McAfee
1. go to VirusScan Console
2. Double click Access Protection,in Access Protection tab you have to choose Anti-Virus Standard Protection Category
3. uncheck the Block of "Prevent mass mailing worms from sending mail".

Now you run your application its will works fine

Saturday, April 4, 2009

GENERATE KEYSTORE AND CONVERT INTO .cer File

GENERATE KEYSTORE AND CONVERT INTO .cer File

C:\>keytool -genkey -alias alias -keystore .keystore
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: rajesh
What is the name of your organizational unit?
[Unknown]: VIDYUT INFO SOLUTIONS PVT LTD
What is the name of your organization?
[Unknown]: VIDYUTINFO
What is the name of your City or Locality?
[Unknown]: chennai
What is the name of your State or Province?
[Unknown]: TN
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=vijitraj, OU=VIDYUT INFO SOLUTIONS PVT LTD, O=VIDYUTINFO, L=chennai, ST=TN
, C=IN correct?
[no]: yes

Enter key password for
(RETURN if same as keystore password):


To create a 1024-bit RSA key:
C:\>keytool -genkey -keyalg RSA -keysize 1024 -alias ali -keystore .keystore

Enter keystore password:
What is your first and last name?
[Unknown]: rajesh
What is the name of your organizational unit?
[Unknown]: VIDYUT INFO SOLUTIONS PVT LTD
What is the name of your organization?
[Unknown]: VIDYUTINFO
What is the name of your City or Locality?
[Unknown]: chennai
What is the name of your State or Province?
[Unknown]: TN
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=vijitraj, OU=VIDYUT INFO SOLUTIONS PVT LTD, O=VIDYUTINFO, L=chennai, ST=TN
, C=IN correct?
[no]: yes

Enter key password for
(RETURN if same as keystore password):


To create .cer file

C:\>keytool -storepass tomcat -keystore .keystore -alias ali -export -rfc -file raj.cer

cert file generated successfully

Thursday, April 2, 2009

நல்ல கருத்துகள்

ஆயிரம் உறவுகளை கொண்டவன் பெரியவன் அல்ல, ஆயிரம் உறவுகள் எதிர்த்தாலும் தன்னுடன் கடைசி வரை துணை நிற்க ஒரு உறவை கொண்டவன் - பெரியவன்

குடத்தில் உள்ள நீர், சிறு துளையால் வெற்றாக்க கூடும். அது போல உங்களின் சிறு கோபம் உண்மையான (அன்பான) உள்ளங்களை புண்ணாக்க கூடும்