Kamesh Rao

Ranch Hand
+ Follow
since Dec 24, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kamesh Rao

I cant get your question
17 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.

Example:
In struts config file you will have an entry like this

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

In your jsp you should submit as follows

http://localhost:8080/contextpath/search?methodType=someMethodName

Hope it helps
17 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)
{
list.add(strings[i]);
}

setUserGroupList(list);
userGroup = strings;
}
public String[] getUserGroup()
{
return userGroup;
}

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

public void setUserGroupList(List<String> groupList){
this.userGroupList=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 ]
17 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.
17 years ago
Always the return statement in the finally block executes irrespective of whether exception is thrown or not.
17 years ago
Use org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager classes evaluate method as defined below

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

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.
17 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;

alert(formObj.name);
alert(formObj.action);
}


Hope I got your question correct
17 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");
st.execute();
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.
17 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.