struts2

Action property of interface type

Hi, guys. With my understading, the nature of a Action is that properties can be pushed w/ request parameter values. And, one wonderful feature is that Struts2 allows you to directly populate parameter values against Class type property ;) Assuming there exists a Action and property class as below, class Action extends ActionSupp...

How to declare a Generics Action in struts2.xml file ?

Hi everyone, My problems is in a Struts2 action, where I have a class : public class MyAction<T> extends ActionSupport with a private member like this : private T myData; And I would like to declare this aciton in the struts.xml file, how can i manage to do so ? Thanks for the answer. Ps : I've tried without declaration of T...

How to use Struts2-jQuery Plugin with sitemesh

Hi I have this error when I try to include the tag (http://code.google.com/p/struts2-jquery/wiki/HeadTag) in a sitemesh decorator main.jsp (decorator) <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> <!D...

Maven struts2 modular archetype failing to generate !

I am trying to generate struts 2 modular archetype using maven but always getting error as archetype not present here is a full output : C:\Users\Administrator>mvn archetype:generate [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] --------------------------------------------------...

how to iterate Set in s:iterator in Struts 2

0 I have a Set with list of objects, i want to iterate this set in s:iterator tag in struts 2 and set one of the property of Object from my jsp page. How can i achieve this? Sample code: class Employee{ String name; String age; .....getters and setters } Set empSet = new HashSet; empSet.add( ...some objects) In Jsp: i want to set...

Displaying JFreeChart in a web page using Struts2

I am using Struts2. I need to display JFreeChart in a web page. Can any body help me on that? Edit: it is getting displayed in binary format. public String execute() throws Exception { System.out.println("Refresh bar Chart"); response.setContentType("image/png"); OutputStream outstream = response.getOutputStream(); try ...

How to change the Struts2 validation error message in the case of an invalid field value?

I'm using Struts2 validation on a web form. In the case that a field is suppose to be an integer or Date, the <s:fielderror> message I receive is a generic Invalid field value for field "[fieldname]" Naturally, I want to customize this for the user. Here's an example validation: <field name="spouseDOB"> <field-validator type="d...

How to print a specific actionerror message with Struts2 validation?

When using Struts2 validation, when you put the <s:actionerror> tag in your JSP, the default behavior is to display all the action errors at that point in the page. Is there a way to display only specific error messages at that point? For example, in the case of fielderror one only needs to add the fieldName attribute. Is there an att...

Struts2 dynamic form elements

Hi, I would like to create little higer-level framework on top of Struts2 which can take form element description from Action and render a complete form, in order to avoid having a separate JSP files with hardcoded form elements for every form in a large web application (so if I manage to do this I will have just a few generic JSPs for ...

pass Multilple values in struts2 action with one param name

Hi I would like to pass Multiple parameters for single param in action tag. Ex: <action name="question" class="com.xxx.xxx.action"> <param name="hint">abc</param> <result name="success">Answers.jsp</result> </action> I have getters and setters for hint (String) variable in my action. Currently i can be able to get parameter v...

[Struts2+tiles] How can I make title dynamically?

I'm developing BBS in struts2 and tiles(2) framework. I want to push a value in ActionSupport class and pop the value in layout.jsp of tiles. but i just keep failing to access to the value. I will explain my works step by step. 1) Users click a link to view an article at list page. And BoardView class will be called as defined in stru...

struts 2 bean is not created

Hello colleagues! At first some precondition to my question, I'm using struts2 + tiles2 + toplink. NO spring at all. The simplest scenario - is to display list of entities on the page. To optimize resolving JPA's EntityManager I would like to create helper (JPAResourceBean) that implements lazy load of entity manager. For this purposes ...

Struts 2 + Reading values from the action

I writing a Struts 2 application. The main operation I'm trying now is to read from the action call a List and display it in the form of a table in the JSP. I've searched the net and check out a lot of examples, but in vain. Can someone point out to a good working example? ...

Changing output of Forms with Struts+Freemarker

I'm working on a Website with Struts2 and Freemarker. Whenever I add form tags such as: <@s.form action="foo"> <@s.combobox (...)/> It generates a bunch of html/css/javascript that I don't need. Is there any way I can specify that no extra elements should be generated or do I really need to go into Freemarker.jar and edit...

Specifying Struts templates source

Say I'm using a form with a text-field. <@s.form action="login"> <@s.textfield label="E-mail" name="email"/> <@s.submit value="send"/> How can I specify that the text-form should be generated by a custom template (text_login.ftl) rather than the standard text.ftl? ...

populating list value in st

I am new to struts2.I am unable to populate value in side a table in my jsp page from my Action class.I have a List in my Action class.Can any body help me. ...

Continuously 'Rendering template' on freemarker+struts2

I'm using struts2 with freemarker (included in struts2 lib) and i'm trying to speed up my web-app. In the logs continuously appear: UIBean.debug(57) | Rendering template /template/xhtml/a FreemarkerTemplateEngine.debug(57) | Rendering template /template/simple/a.ftl and this for each tag. The problem is that i don't know if it's nor...

Json with struts2, How to populate this object?

I have this question: How to populate this object from a struts2 action. My action populates without any problem a lot of my objects, but I have a restriction on a JSON input. My input is like this: I don't now how to populate...The class geometry can have a double[] or double[][] or double[][][] because the JSON input can have multip...

Struts 2 security

Does Struts 2 has complete solution for simple login task? I have simple declaration in struts.xml: <package namespace="/protected" name="manager" extends="struts-default" > <interceptors> <interceptor-stack name="secure"> <interceptor-ref name="roles"> <param name="allowedRoles">registered</pa...

Can I call sitemesh struts tags from a decorator in freemarker?

I know if you are using JSPs, you can call struts tags defined the normal way from a decorator, like this: <html> <body> <decorator:body /> </body> </html> but in the examples I always see using freemarker decorators, they will instead say: <html> <body> ${body} </body> </html> Is this the only way to include the pieces of ...