Ravi Veera

Ranch Hand
+ Follow
since Jun 23, 2001
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 Ravi Veera

Couple of things to check
1. Setting of your CATALINA_HOME env. variable.
2. Checking whether you are reffering to the correct verions of commons-digester and the correct version of the xerces parser (Refer to the docs to find out which version works).
21 years ago
As Thomas mentioned log4j is more feature rich. I would say a lot depends on how important logging is to your application.
If it's mainly a debugging tool then either one is good enough.
If you plan to log a lot of stuff in production and need a fancy logging mechanism, I would say go ahead with log4j. Both the libraries are stable enough for basic needs, but in case you run into a problem/bug you are more likely to get help from the log4j community. Of course there are no guarentees as to whether your problem will get fixed but with log4j the source is there for you to hack. The release cycle for log4j is also much shorter than it is for the jdk.
HTH
Ravi


Perhaps, writing my own javascript for those field is the easiest way but then the internationalization problem would pop up because error message is not taken from the ApplicationResources.properties anymore


What I am suggesting is a kludge but may work in your case. You could have the error message as a property in your Bean class and read it in in your JSP file within your javascript function like this.

A nicer alternative would be to put your own conditional Javascript validation in the validator-rules.xml
21 years ago
Check out the nested beans examples at the jakarta struts site. They should get you going.
Ravi
21 years ago
You cannot directly use bean:message directly.
An indirect way of using it would be through a scriptlet.
something like this.
<% String sValue;
//Read from Resource bundle and assign it to sValue
%>
and in the iterate tag you could say
value="<%=sValue%>"
If you plan to use it in a lot of places you could move the scriptlet code into your own custom tag and then work on it.
21 years ago
Here's an example adaptedfrom my code which may be wwhat you are looking for

In this example in my pipingForm class I have an ArrayList element called projectUnits and a corresponding getProjectUnits method. The projectUnits ArrayList is populated with instances of the LabelValueBean class(having label and value properties).
HTT
Ravi
[ September 27, 2002: Message edited by: Ravi Veeraghanta ]
21 years ago
For a start you could create a function
private void processStuff(String sField){
//start processing
//....
//end processing
}
That would reduce some clutter. You could also use reflection and write a loop to go through the form methods and then call a function for methods starting with gets.
HTH
Ravi
21 years ago
Use the Checkboxes onclick/onchange attribute to make a call to a Javascript function.
something like
<html:checkbox property="something" onchange= "copyValue(...)">
21 years ago
You can treat it like other controls and preset the values in the reset method and override it in the Action method. But the key is in how HTML treats checkboxes.
The way HTML would process checkboxes is that it sends in the parameter and a value *only* if it is checked.
E.g say you had a form with
textbox name=text1
checkbox name=check1 value="abc".
OnSubmit Button = someAction.do.
Case 1. text in text1 ="sss"
check1=checked
OnSubmit would generate
SomeAction.do?text1=abc&check1=abc
Case 2. text in text1 =""
check1= not checked
OnSubmit would generate
SomeAction.do?text1=
Note that it dosen't send in the check1 parameter.
You could have multiple checkboxes in HTML having the same name. It would just repeat the values in the URL.
Say you had 3 checkboxes all named check1 with value=1,2,3. Assume all 3 are checked
On form submit you would have this URL generated.
-SomeAction.do?check1=1&check1=2&check1=3
If only the first 2 were checked the URL would be
-SomeAction.do?check1=1&check1=2
and so on.
Struts just collects these and puts it into an array. On the view sides it compares the values in the array to the values of the boxes and checks the appropriate boxes.
HTH
Ravi
21 years ago
You need not make any changes to the strutsconfig.xml file.
This is what you need in your JSP File

Struts will then populate your string array with the checked values.
For struts to set certain values to true you need to initialize the String array with the appropriate values.
Ravi
21 years ago
You could use Jakarta jmeter to do some load testing/profiling. While it's not full featured as the commercial tools it will help you get a good handle on things. The online documentation is good enough to get you started and going.
It will also help if you can load test these components individually. That will give you a better idea of overheads.
For e.g First run the tests with Tomcat, Then with Apache and mod_jk.
Also if you can identify the use cases which are going to be most frequently used that will help you focus your efforts in the right direction.
There is one book on Tomcat by James Goodwill but I didn't like it and I won't recommend it. it covers the configuration part of Tomcat and dosen't touch on the internals.
Regards
Ravi
21 years ago
On the linux environment you should be able to use the logrotate tool. I haven't used it myself. You could probably get more info on logrotate on the Linux/Unix forums.
21 years ago
There's sample chapters for this upcoming book on struts available at theserverside.com.
It includes all the major topics including Tiles and the Validator.
Ravi
21 years ago
Here's a link that will help. I have struts 1.02 running and got the validator plugin from here and installed it a few months ago.
The Validator is now a core part of the Struts 1.1b2 distribution and certain elements have changed. Unfortunately the documentation has not caught up with the changes and there is no simple how-to (yet) on how to use it.
HTH
Ravi
21 years ago