struts2

Struts what method is being called?

How can I get the name of the method that will be called in the action from within an interceptor? ...

Comparing Struts 2 Iterator Objects with Spring Security Context

Suppose that I am using the Struts 2 iterate tag on a list of objects. Each object has a property called creatorUserId. I would like to compare the creatorUserId with the Id number of the currently logged in user. How do I do this with Spring Security and Struts 2 in the JSP page? <security:authentication property="principal.userID" /...

Is there something special required to use dijit widgets within a Struts2 application with the DOJO plugin?

I am taking a prototype of a web page and implementing it. The prototype makes heavy use of DOJO for some fancy UI elements. The application is built using Struts 2.1.8.1 with the DOJO plugin enabled. I am able to use the dojo specific tags within struts but I can't get the any of the dijit widgets to work. <%@ page contentType="text/ht...

how to add elements dynamically in <updownselect > tag in struts jsp

hi i'm currently working on struts.. don't know how to initialize arraylist to a List(updownselect tag).... i am storing values in a arraylist called sitename.. Sitename and SelectedSites are ArrayList... i got error like this " tag 'updownselect', field 'list', name 'SelectedSites': The requested list key 'S' could not be resolve...

json Object access properties problem

Hi all, i've a problem with json object (created from java Object1) that contains a List of Object2... i cannot access to the value of the object2 in the list og object1.. the json Object is { "object": { "idItemGroup": "45", "path": "1", "dealer": "6", "refIdMacroItemGroup": "6", "descrip...

Using OGNL to return data from a Map<String,Object>

Using Struts 2.1.6, xwork 2.1.2 and ognl 2.6.11 In my struts action I have a Map that I am fetching elements from using OGNL. If the key I am using to fetch with does not exist in the map then OGNL returns an empty object array, that OGNL converts to a string and I get the object reference java.lang.Object@6.... This occurs in several p...

Error while building Struts2 Application by Ant

I'm following Rose India Hello World Tutorial for Struts2 development, I'm Getting, Buildfile: D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\struts2tutorial\WEB-INF\src\build.xml clean: [delete] Deleting directory D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\struts2tutorial\WEB-INF\classes [mkd...

struts 2 intercepter with ntlm filter

How we can write the Struts 2 interceptor to include the ntlm filter. ...

struts.xml extends attribute

Hi, can you please tell me how we can extend more then one package in the tag extends attribute in the strtus.xml using struts 2 Usman.sk ...

struts2 i18n java properties, how to escape characters?

I don't know how to escape ' in a java properties file. I'm using struts2 and getText function to fill i18n and text tags. For example I use: config.users.title= taula d'usuaris ---> config.users.title= taula d\'usuaris But in my JSP, I get : taula dusuaris. I use this to display text on my JSP: <label for="title"><s:text name="con...

Why is struts validation not working for me?

I'm trying to use Struts validation to check various fields entered by users. If anyone is able to help me see what I lack, I would be extremely grateful. Here's what I have: I put validation.xml and TestAction-validation.xml in WEB-INF/classes/ Here is validation.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE validators PUBL...

Where JSF and struts2 fails/goods

I am begining a web system and can't decide what technology use! Struts2 and JSF (with jboss seam) are a nice choices, but I can't decide which's better. In JSF have some that I don't like, maybe its "paradigm" no action like. And Struts2, the peoples here don't use more. The system is a map collaborative web site. ...

How to create Struts 2 project in Eclipse Galileo ?

I want to create a struts 2 project in eclipse. I have downloaded the latest struts distribution. But things always become confusing when i try to create a struts project in ECLIPSE. Whenever I create a dynamic web project and add struts libraries to that project, some error or the other pops up. How do I properly setup an eclipse Stru...

Where should I setup a Database connection in Struts 2 app ?

I am developing a small web application using struts 2. I want to setup a database connection when the web application starts. After that, I want that database connection object to be used in the the entire web application to update records in the database server. Where should I include the database connection setup code in my struts2 ...

How to iterate over an array list of beans in a JSP using struts2 tags

My JSP receives an ArrayList of beans from a Struts2 action. I want to iterate over them and print every bean and its properties per line. How can I do this using Struts2 tags? ...

Struts2 form elements

Why is it that when I insert an element in between the s:textfield it gets placed on top? Is there a way to fix that? Thanks for helping on this. <s:textfield label="First Name" required="true"/> <s:textfield label="Last Name" required="true"/> <s:text name="testing1">test1</s:text> <s:textfield label="Address" required="false"/> <s:tex...

struts2 UI components problem

Why is it that the s:textfield is placed on bottom when I insert it in between other HTML elements inside a form? How can I fix this? <label><span class="required">*</span>First name</label> <input type="text" id="firstName" name="firstName" value=""><br> <div> <s:select id="selectDrop" l...

Pass parameter to Getter Function in Struts 2

I'm pretty sure this isn't possible but I figured it wouldn't hurt to ask.... I have a jsp that tries to get an array from it's java action class. however that array is in a list... So I'm wondering if I can pass a parameter to my getter function to return a specific array from my list. Such as <s:iterator value="List.arrayName"> ...

struts 2 checkboxlist validation question

I have struts 2 checkboxlist as followed: <s:checkboxlist list="listOfOptions" name="someName" /> I would like to add validation to make sure that at least ONE of the checkboxes has been checked. Any thoughts? Thanks ...

Struts 2 nesting iterators

I can't believe how something this simple can seem so hard to do in Struts 2. This is approximately what I would like to do as it would be done in Java. for (Parent parent : parents){ for (Child child: parent.getChildren()){ System.out.println(child.getName()); } } That should translate to something close to this in Stuts t...