Recent posts by Sandy Chatterjee

In Struts 1
Form data can be validated on the client side as well as on the server side using the Validator Framework,
which was developed as a third-party add on to Struts. This framework generates the java script and it can be
used to validate the form data on the client browser. Server side validation of your form can be carried out by
subclassing your form class with DynaValidatorForm class. The Validator Framework uses 2 xml configuration
files validator-rules.xml (defines reusable standard validation routines, which are usable in validator.xml) and
validator.xml (defines validation applicable to a form bean).

Thanks for your reply. I knew it was wrong but I was confused when it was supported by a second user.
Anyways tell me one thing

In the above code is 'myproperties.configured.resources.key' a key in the Resource Bundle?
Because I don't think so.
It has to be initialized in the Action class' execute() method by the following way:

where 'error.name.required' is defined in Resource Bundle.

Correct me if I am wrong as the guy who has posted this question is being misguided by wrong answers.

in our HibernateUtils.class we have a function called createSession() but when it comes to use that function in our action class we simply call the openFactory()/createFactory() function and then use that typecasted object for creating new connection/ to use openSession() menthod and that Thread safe session instance remain unused as that creatSession() is never called in action class

In the above example we have not used the HibernateUtils.java. If you check the Action class you will not find any import statement for HibernateUtils.java.
So, don't be confused. Its by mistake I have pasted the code for HibernateUtils.java.

I knew about <logic:messages> tag. But the thing which was bothering me was the post by Bharat Kasodariya

He has used something called message. That was really a new thing for me to learn.
Also Vidya wanted to explain which was not exactly clear to me.
I just wanted to know about the above code.

@Vidya

As per my knowledge, here in logic:present tag the attribute "name" defines a scripting variable to be used as the variable being tested for existence.
Here we are testing that particular variable is present in the scope or not...? And then if it is present in a scope it will enter into the body of the tag and then bean:write attribute displays the values of the properties in the form.

I understood what you want to mean but what Raghava Chary asked was that he wanted to check a value is present or not from the message ResourceBundle. Where is the Message here. Is that 'anyname'?

It depends on the logic you have applied in your Action class.
Also how you are trying to display multiple rows in your jsp.
Normally for handling multiple Lists we use

inside the Iterator tag.
Setting indexed="true" sets an unique index to your scripting variable.
Its needs some explanation and right now I don't have much time.
Anyways I am trying for a simpler solution, just be patient.
I'll get back to you as soon as possible.
For any clarification reply back to me.

The best way to maintain session in struts application is create a session obj in ActionServlet....
bcz ActionServlet is responsible for taking request and providing response.....
so creating a session is ActionServlet is the best way

A Session object is already created. We don't have to create it.
In the Action class we retrieve it by using
request.getSession() from the HttpRequest object. I guess this is what sneha meant.
By the way could you please clarify how do you create session object in ActionServlet.
As we only create it when one is not present by using the following:

As per my knowledge the 'name' attribute of the <logic:present> tag is the name of any bean in a particular scope.
So, according to the code 'message' is a bean which is stored in some scope.
Is the 'message' bean the message resource bundle bean.
If so then how can we check a particular message is present or not.
Please explain.