This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Kamesh Rao

Ranch Hand
+ Follow
since Dec 24, 2006
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kamesh Rao

I cant get your question
14 years ago
when you declare a variable in a declarative tag these are created as class level variables (available to all the methods of the class). If you declare variables in a scriplet it is created in the service method of the generated servlet class.
When using a dispatch action you need to set the parameter property in the action mapping of the struts-config.xml file with some value and when submitting such an action you have to send a request parameter with the parameter name to the one you entered in the config file and the value of this parameter should be the method which you want to call in your action.

In struts config file you will have an entry like this

< action path="/search" parameter="methodType" .... >

In your jsp you should submit as follows


Hope it helps
14 years ago
Ok let me put in this way.

Say you provide an user an option to select multiple values for an input element(say a list box)

< html:select name="userForm" property="userGroups" size="5" multiple="true" >
< html ptions collection="groupsList" property="groupCode" labelProperty="name" / >

< / html:select >

The property userGroups under the formbean should be declared as String[]

//used by struts
String[] userGroups;
//can be used in the action
List<String> userGroupList =new ArrayList();

public void setUserGroups(String strings[])
Collection list = new ArrayList();
for(int i = 0; i < strings.length; i++)
if(strings[i] != null)

userGroup = strings;
public String[] getUserGroup()
return userGroup;

public List<String> getUserGroupList(){
return userGroupList;

public void setUserGroupList(List<String> groupList){

so whenever the page is rendered struts uses the String[] property and you can use the arraylist property in your action.
[ December 28, 2006: Message edited by: Kamesh Rao ]
14 years ago
You cannot populate an arraylist, instead use a String[] for that property.
Now if you want an arraylist in your action add a simple getter to return an arraylist from the string[] in the formbean.

I think you got what iam saying.
14 years ago
Always the return statement in the finally block executes irrespective of whether exception is thrown or not.
14 years ago
Use classes evaluate method as defined below

public static Object evaluate(String attributeName,
String expression,
Class expectedType,
Tag tag,
PageContext pageContext);
14 years ago

Originally posted by Bear Bibeault:
No, we mean that the term "app server" has no standard definition and so there is no real answer to the question.

Having no standard definition for an appserver doesnot mean that we can call a webserver an appserver.
14 years ago
call the following function on click of the go button by passing an instance of textbox.

function getFormName(obj){
var formObj=obj.form;


Hope I got your question correct
14 years ago
I dont see any problem in the above, but why dont you try these options

1. A wild try
Statement st=con.createStatement("query");
2. Use a PreparedStatement which is a more cleaner approach.

[ December 27, 2006: Message edited by: Kamesh Rao ]
[ December 27, 2006: Message edited by: Kamesh Rao ]
so you mean there is no difference in an application server and a web server responsibilities.
14 years ago
Hibernate is a popular ORM(Object Relational Mapping) tool which bridges the object oriented programming with relational database ie. you say save your java object and the ORM tool takes care of converting your objects property into database table columns and vice versa.

If you use your first and second approach this conversion step has to be done by yourself.
Try to see whether autoCommit is on or not, by calling Connection objects getAutoCommit() method.If it is off set it.