Questions tagged [struts2]

Apache Struts 2 is an extensible framework based on servlets and implements model–view–controller (MVC) pattern in its architecture for creating enterprise-ready Java web applications.

Apache Struts 2 is an extensible framework based on servlets and implements (MVC) pattern in its architecture for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time.

It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture.

Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts2. This new version of Struts is simpler to use and closer to how Struts was always meant to be.

Features of Struts2

  • Simple POJO-based actions
  • Simplified testability
  • Thread safe AJAX support
  • Template support
  • Support for different result types
  • Easy to extend with plugins


References

Related tags :

11368 questions
14
votes
2 answers

Struts2: Why to extend ActionSupport class?

I am a beginner to Struts2. Please tell me why to extend ActionSupport class? (When one doesn't have the requirement of validation or internationalization) Are there any other benefits provided by extending ActionSupport class?
user663724
14
votes
6 answers

Eclipse takes long time to save web.xml

Well, I'm using Eclipse to build a dynamic web project(in Mac OS X). But there is something confused for me. When I start Eclipse and click the project explorer to expend the project folder, it takes long time to finish it. What's more, when I…
Lynn
  • 665
  • 8
  • 25
14
votes
9 answers

Error - Can not find the tag library descriptor for "/struts-tags"

I'm receiving this error on my jsp file - 'Can not find the tag library descriptor for "/struts-tags"' Strange thing is my app still seems to work. I'm following the tutorials at - http://struts.apache.org/2.x/docs/using-struts-2-tags.html Here is…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
14
votes
8 answers

How to solve this Java type safety warning?

Map session = ActionContext.getContext().getSession(); session.put("user", user); This code generates a warning: Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map should be…
Nicolas Raoul
  • 58,567
  • 58
  • 222
  • 373
14
votes
9 answers

Whats the best way to notify admin about new exceptions of the Java application?

My question is that whats the best way to keep track of the exceptions for the administrator of the application. (Notify administrator of the thrown exceptions for maintenance purposes). To users of the system, I believe should catch the exceptions…
Jack
  • 6,430
  • 27
  • 80
  • 151
14
votes
5 answers

Slow to start after upgraded to Spring 3

I use Struts2 and my application has thousands of action classes managed by Spring. I used Spring 2.5.6 before and my application starts quickly. But when I changed Spring to 3.0. I got a extremely slow start up of Tomcat. For each action class, I…
Matt
  • 1,671
  • 5
  • 23
  • 34
14
votes
4 answers

OSGi - How mature is this technology?

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this? Can some one give some pointers on how to achieve…
peakit
  • 28,597
  • 27
  • 63
  • 80
14
votes
6 answers

How to deploy war files into cPanel and remove the project name?

I need to run my Java application on cPanel. I have successfully installed Tomcat, I can run my application by copying war file into my www folder but the problem is that it shows the Project name (war file name) in the address, I need to know how…
user2071377
14
votes
4 answers

Struts2 How to Return a JSON Response

I am currently creating a web-application where the users can fetch tags from the database as JSON, here is my struts action public String execute(){ Gson gson = new Gson(); String tagsAsJson =…
user962206
  • 15,637
  • 61
  • 177
  • 270
14
votes
3 answers

Get the current user Liferay using a simple Java code

I'm working with : Liferay 6.0.6 with JBoss 5.1 and Struts2. My question is, how to get the current user in Liferay once logged in, using a Java code.
Sabrina
  • 143
  • 1
  • 1
  • 5
13
votes
13 answers

SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher

I am trying to make a small login application in struts 2. My web.xml:
Sanju
  • 3,187
  • 10
  • 41
  • 55
13
votes
5 answers

How to understand Open Source projects/libraries?

There are few open source projects/APIs/libraries that we use in our project (Spring, Struts, iBatis etc.) and I want to understand their design and how they work internally. What is the best way to understand these projects? Note that I am already…
peakit
  • 28,597
  • 27
  • 63
  • 80
13
votes
6 answers

struts.xml and struts-config.xml

What is the difference between struts.xml and struts-config.xml? Are both the same or is there any difference between them?
bharanitharan
  • 2,539
  • 5
  • 32
  • 30
13
votes
10 answers

Can I propagate struts2 ActionErrors between different action classes?

If I have an action where the result is a redirectAction to another action in a different class, is it possible to get validation errors to display in the resulting action? E.g. in the following example, if a user executes actionA (which has no…
sk.
  • 6,336
  • 5
  • 38
  • 46
13
votes
4 answers

Difference between Interceptors and Filters - Is this right?

I'm researching this so that I can respond better in interviews. I've been searching around for a clear and concise answer. So far, and by all means correct me if I am wrong or lacking in detail: Filters are part of the Servlet API, Interceptors…
user447607
  • 5,149
  • 13
  • 33
  • 55