Share your thoughts and find that its getting better every day. This work of mine helps me realize that.
Wednesday, November 9, 2011
Interceptors with Struts 2
Working with s:bean in Struts 2 - Beware Begineers
Thursday, November 3, 2011
Configuring Struts.xml for Interceptors
Tuesday, November 1, 2011
Ajax in Strut 2 using XmlHTTPRequest
Monday, October 31, 2011
Hello world – Struts 2
Some of the important lessons that I have learnt with this sufferings are,
1. Java frameworks are not reverse compatible. I hate that.
2. Code developed with say jdk1.5 environment probably won't work with jdk1.6 and vice versa
3. Only use prescribed files by all means and do not try including any new stuffs before u know what it is as far as the java technology is concerned.
Since I come from a technology which is RAD and reverse compatibility is never an issue, IT IS REALLY HARD FOR ME TO DIGEST ABOUT THIS IN JAVA WORLD L
Any ways I am starting to getting used to this and here is my hello world to Struts 2.
Prerequisites,
1. Tomcat server version 6.0 or 6.0.33 needs to be installed. No other versions. Probably other versions in 6 might support but I am not sure
2. JDK 1.5 is required. Don't switch to higher version or u might end up having a tough time finding what the problem is. Well if you are a java guy, you would know it better than me.
Following is the folder structure that you need to have
The lib directory should contain all of the following files
All the files that you find in the above screen shot are frame work files that comes with Struts 2 package version 2.1.2 I guess. You can google down with the names of the files to find the appropriate sub version of struts 2. Believe me it did not work with version 2.1.6.
Please don't blame me if you can do it better. I am very new to this technology J
Key in the following code to HelloWorldAction class
You web.xml file should have the following code
The popup text that you find in the above image shows the filter class that helps your web.xml file understand the presence of struts.xml file.
Following is how my struts.xml file looks like.
The action name "helloworldAction" can be any name of your choice.
The class name "web.HelloworldAction" tells the compiler to look into this specific class to execute the specific method
The method name "helloWorld" asks the compiler to look for this particular method and perform the necessary action inside the provided class in the class name parameter
Finally the index.jsp is as follows
Now save your work, move your project to the tomcat server, by doing the following
After doing this click finish.
Now restart your tomcat server or simply start it if its not already running.
Now key in the following url in your browser. I did this one with the browser provided by eclipse it self
http://localhost:8080/HelloWorld/
http://localhost:8080/HelloWorld/helloworldAction.action
Note the differences in the above mentioned images,
When you provide the url for helloworldAction class directly you can see the print statements provided inside the helloWorld method in the console. Possibly you can use this one to your advantage
Hope this helps J
Saturday, October 29, 2011
Configuring ODBC Connection for Oracle in Windows 7
2. Goto Start->Control Panel->Administrative Tools->Data Sources (ODBC)
3. The following screen titled “ODBC Data Source Administrator” will be opened up
4. Now choose the System DSN tab and click on add.
5. This will open up a new window titled “Create New Data Source”
6. Scroll down to “Microsoft ODBC for Oracle” and click Finish
7. This will result in the following window. Provide the credentials as required and click ok
About TNSNames.ora
Again this is my understanding and am a beginner1. The Location where you would find tnsnames.ora file inside a oracle client directory is typically inside the NETWORK\ADMIN folder
2. In My case it is inside d:\oracle\product\11.2.0\client_1\NETWORK\ADMIN
3. This is one file that you should know to create if you want to create connections in SQL Developer client to databases in sever.
4. A sample copy of tnsnames.ora file will be available in the SAMPLE Directory. When in doubt copy paste it and make necessary modification to it
5. The various elements that should be understood in this file are as follows



















