12.22.07
javax.servlet.ServletException: No form found under ‘UserLoginForm’ in locale ‘en_US’
This is the exception thrown when i try to perform client-side validations using dynavalidatorform in struts:
solution: check for the form name in the following files, this is where the problem occurs most of the times. Even is we add ‘/’ to the formname somewhere it throws the above exception.
1) In Jsp file
<html:form action=”/UserLoginAction” onsubmit=”return validateUserLoginForm(this)”>
<html:javascript formName=”UserLoginForm“/> It looks for the form name in the below file.
3) In validation.xml file
<form name=”UserLoginForm“>
……..
</form>
4) In struts-config.xml file
<form-bean name=”UserLoginForm” type=”org.apache.struts.validator.DynaValidatorForm”>
……………………..
</form-bean>
<action input=”/userlogin.jsp” name=”UserLoginForm” path=”/UserLoginAction”
scope=”request” type=”com.myapp.struts.UserLoginAction” validate=”true”>
<forward name=”success” path=”/userloginsuccess.jsp”/>
</action>
12.21.07
DataSource Creation for MSSQLServer2005 using SJSAS8.2:
1)Open server admin console by giving username and password if exists.
2)There goto Application Server -> Resources -> JDBC-> Connection Pools -> select New->
Name: mssqlpool
Resource Type: javax.sql.DataSource
Database Vendor: mssql
Next-> Enter DataSource Class Name: com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource
[u can find the this class name in the sqljdbc.jar, if u are using different database then goto corresponding jdbc driver jar file and find the class that ends with ConnectionPoolDataSource]
Next-> goto Properties section, enter the following details:
Datasource name: sample_ds
User name: sa
Password: ********
Database name: SampleAppDB
Server name: VENU-PC
Click on Save.
3)Goto Jdbc Resources on left pane-> select New on right pane and create jndi name for the above connection pool. -> Save
JNDI name :jdbc/mssql
Connection pool: mssqlpool [scroll down it will show all the available connection pools]
4)Now add sqljdbc.jar to the SUN/Applicationserver/lib folder
5)If we select the Application Server tab on left pane , It displays different tabs on right pane.
Goto JVM settings-> Path settings-> In Classpath Prefix textbox: Add the below information
${com.sun.aas.installRoot}/lib/sqljdbc.jar [ this is like telling driver jar to the application server]
6)Stop the server if it is running and restart it. Now open admin console -> select mssqlpool under connection pools-> click on ping
7)If everything goes fine It diaplays the message like Ping succeeded.
Now we can get the connection like below from java:
InitialContext ctx=new InitialContext();
DataSource ds=(DataSource)ctx.lookup(“java:comp/env/jdbc/mssql”);
Connection con=ds.getConnection();
12.20.07
Coconut burfy
coconut: 2cups
sweetend condensed milk : 11/2cup
Ghee: 1spoon
Process: take a pan and kept on stove with medium heat, pore coconut on pan and fry on medium heat until its color changed to gold color and then add condensed milk to that. keep stiring it on medium heat until the mix become thick. It tooks 5 to 7mins.
Then take a plate add ghee and then place the mix in that plate. After it came to room temperature cut it into pieces if u want.
Connecting to MSSQL SERVER 2005 from NetBeans5.5:
1)Download SQL server driver -> unzip it to folder like MicroSoft SQLSERVER 2005 Driver
2)Open Netbeans IDE-> open Runtime window -> select Databases-> right click on Drivers ->
Select New driver -> Enter the following details
i)Driver file: Here we need to add “sqljdbc.jar” file.
click on Add-> It opens Wizard select MicroSoft SQLSERVER 2005 Driver folder->sqljdbc1.2->enu->
select sqljdbc -> open [it adds jar file ]
ii) Driver class : com.microsoft.sqlserver.jdbc.SQLServerDriver
iii)click OK
3)It adds SQLServerDriver to the drivers list. Rightclick on this driver and select
ConnectUsing ->It opens new Database Connection Window->
Where we need to give the following details:
i)By default it displays name and driver.
ii)Database URL: jdbc:sqlserver://VENU-PC:1433;databaseName=chaitu
Where VENU-PC is the SQLServer name
1433 : port number
Chaitu :database name [the information here is case-sensitive]
iii)Username: sa
iv)Password : Server2005
Click OK
4)It adds our database (chaitu) to databases list as admin.
12.05.07
Connecting to SQLServer from java
1) download the Microsoft SQLServer 2005 JDBC Driver1.2 from here.
2) Unzip it in any folder like
D:\Microsoft SQL Server 2005 JDBC Driver\
3) add the sqljdbc.jar to the classpath
D:\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_1.2\enu\sqljdbc.jar
4)connect to sqlserver database like below:
try{
Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);
System.out.println(“driver loaded:”);
String connectionUrl = “jdbc:sqlserver://localhost:1433;” +
“databaseName=mydatabase;user=sa;password=Server2005;”;
Connection con = DriverManager.getConnection(connectionUrl);
System.out.println(“driver connected:”);
}
catch(ClassNotFoundException e)
{e.printStackTrace();}
catch(SQLException e)
{e.printStackTrace();}
5) If u r in IDE, want to connect sqlserver add sqljdbc.jar to lib folder of ur application.