Ravindra B Pawar

Greenhorn
+ Follow
since Jul 18, 2010
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ravindra B Pawar

Hi all,

I have been working on struts2 framework recently and I am quite comfortable with it now. But if i start from scratch I have to struggle with which all jars are needed to work on project.

I have struts-2.2.3-all distribution of struts2

Here are some of my concerns
1) Is it a good idea to include all jars in that distribution.
2) Will application suffer performance wise at run-time if i include jars that i am not using.
3) If I include some jar where can i look for information about the dependent jars that has to be included with it.
4) Is there any place where i can get information about for what all purpose the framework is using that particular jar file


I just took a look at extracted content of struts2-core-2.2.3.jar
And In META-INF\DEPENDENCIES file
It contains some information but again it list all jar that are not really required


quite confused right now

APPRECIATE YOUR HELP ON THIS AS WELL
BY THE WAY YOU CAN TAKE A LOOK AT struts2-blank app in the apps directory of struts2-2.2.3 distribution
It has following files
  • asm-3.1 DON'T KNOW WHAT IT DOES
  • sasm-commons-3.1 DON'T KNOW WHAT IT DOES
  • asm-tree-3.1 DON'T KNOW WHAT IT DOES
  • commons-fileupload-1.2.2
  • commons-io-2.0.1 DON'T KNOW WHAT IT DOES
  • commons-lang-2.5 DON'T KNOW WHAT IT DOES
  • freemaker-2.3.16
  • javassist-3.11.0.GA DON'T KNOW WHAT IT DOES
  • ognl-3.0.1
  • struts2-core-2.2.3
  • xwork-core-2.2.3



  • quite a big post!!
    Thanks,
    Ravi
    7 years ago
    Thanks for quick reply.

    It really good idea to create new folder called resources to put these things like struts.xml and properties file.

    Do you have any idea if we can put the LoginAction-validation.xml in resources folder or it has to be there with the source file LoginAction.java?

    Thanks
    7 years ago
    Hi Mikke ,

    I wanted to know how can we come to know which jars are required to run the struts2 project

    and how can we know struts dependencies and all

    with new version some new jars are needed and it becomes really difficult for newcomers till they figure out what really is going on


    appreciate your help in this

    7 years ago
    Hi,
    I have not used this plugin

    but i have used dojo plugin and it was quite easy.

    In eclipse press ctrl+space after entering tag and it will show what all attribute is accept by that you should be albe to proceed
    7 years ago
    Hi Hemanth,

    I have never used this property files.
    Can you please show me how is you directory strutcture so that i can understand where to put
    struts.PROPERTIES
    LoginAction.PROPERTIES

    Thanks,
    Ravi
    7 years ago
    The problem with your code was you were displaying the login jsp page (for first time visit to page) for that you created one dummy action login
    Then you were submitting the for to same login action which was simply displaying the form again

    if you submit form to the new action which will process your form and corresponding xml should be referred for the validations

    for more info you can see code at
    http://www.vaannila.com/struts-2/struts-2-example/struts-2-validation-using-xml-example-1.html
    7 years ago

    CORRECT CODE

    you have not specified the action class name

    OR BETTER WAY IS TO


    CHANGE THIS TO


    i think you getting the point

    hope this helps
    7 years ago
    I think you have not added all the required jars in the project with latest libraries/ jars.

    with each new jars they are putting some changes which might have dependency on other jars
    i also have lost many hours trying to make it work.

    you can try posting error you get with latest libraries
    7 years ago

    Threading Model
    Struts 1 Actions are singletons therefore they must be thread-safe because only one instance of a class handles all the requests for that Action. The singleton strategy restricts to Struts 1 Actions and requires extra care to make the action resources thread safe or synchronized while developing an application.

    Struts 2 doesn't have thread-safety issues as Action objects are instantiated for each request. A servlet container generates many throw-away objects per request, and one more object does not impose a performance penalty or impact garbage collection.



    and your question is about the struts 1.2
    i feel using static methods will work fine
    STATIC METHOD IS LIKE A METHOD WHICH IS NOT DEPENDENT ON THE INSTANCE VARIABLES IN THE CLASS
    SO WE CAN PUT SOME GENERIC FUNCTIONALITY IN THAT METHOD RELATED TO THAT CLASS

    I think those methods might be used by the some other classes so they are marked as static

    hope this helps
    7 years ago