struts2

Changing struts-rest idParameterName per action class

I want to have different idParameterNames for different action classes. Is that possible or do I have to write my own mapper? ...

Action tag not executes in Struts 2

Hi, I have a problem invoking actions from my jsp pages with tag in struts2. I have the login.jsp file: <s:action name="headerMenu" executeResult="true" namespace="/menu"</s:action> <s:form action="executeLogin"> <s:textfield name="username" label="Username"></s:textfield> <s:password name="password" label="Password"></s:pass...

Last few html tags not rendering?

An interesting issue which I've googled and can find absolutely no reference too, perhaps because I'm too vague on the cause myself. I have a simple jsp page that is run from a struts 2 action. It' fairly javascript heavy, but its an internal app on my company's intranet so thats not a great problem. All seems normal so far, right? but...

help with struts2 form & combobox

hi, i have a combobox in a form and when i click submit i get this error. HTTP ERROR: 404 No result defined for action MyAction and result input in the action i tried to return INPUT instead of SUCCESS but still doesnt work. any ideas what can be wrong? thanks. ...

struts2 combobox - pass Integer id and not String name through the form to the action

hi, my form is passing the String name of the country to the action. how can i pass the id of the object country from the combobox to the action? this is what i have: s:combobox label="Country" name="country" headerValue="Select" headerKey="1" list="%{countries}" listValue="name"/> thanks. ...

struts2 - optiontransferselect - pass list of integers to the action

I have an optiontransferselect in a form but i dont know how to get the selected items in the rightlist back in my action. I need to get a list with all the visited countries' ids. i tried in my action List (Integer) countriesVisitedId; but it returns nullPointerException. then i tried Integer id but it returns null. this is what i hav...

Struts 2 URL Parameter inside foreach

Can someone explain to me why the following code results in the error: According to TLD or attribute directive in tag file, attribute value does not accept any expressions. It always breaks whenever I am trying to set the value dynamically for the parameter of the URL. `<%@ page contentType="text/html; charset=UTF-8" %>` <%@ taglib p...

Creating navigation links in Struts 2

Is there some way to replicate rails' "link-to-unless-current"? Ie. if i have a list of links in my navigation, and I want to mark the current page with a different css style (or even have it be plain text, not a link)? Now I just made a method in my action-class (getPage()) which returns a name that I assign for each action, and test ...

How do you get a Struts2 value from the .properties file programatically?

Say I have a struts.properties file with a defined value uploads.directory . How can I access that value from an Actioncontext programatically? ...

Ajaxifying Struts2 application

I just started working on an application that is build on the Struts2 framework. I am coming from a .Net application with lot of Ajax features like dimming the rest of the site and show dialog box 'please wait while X is happening' ...auto complete and such other ajax features. I searched google for Ajax plugins for Struts2 but did no...

Struts2 example, not inserting records in mysql database because connection object is getting null

This Code is working fine with simple application so the drivers are fine. so why the connection object is not able to initialise with drivers. import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import com.opensymphony.xwork2.ActionSupport; public class Insert extend...

How can I maintain the checkbox state on a page that is refreshed by Ajax?

I have a html table in my application that shows the state of various jobs running in the system. Each job has a state associated with it e.g a swirly gif for running jobs. New jobs have a checkbox next to them that allows the user to select and kick off the associated job. The table is a struts2 auto refreshing div (sx:div), it refres...

how can i fetch combo box value into my DAO using struts 2?

I have one simple User Registration form. It includes name, age, sex & city. But here city is coming form city master table & displaying user as a combo box. But when i am trying to store full user registration information through my UserDAO, how can i access that current selected city value ? My User Registration jsp form contains : <s...

struts2 <s:select...> tag

I have simple user registration form. In which i am puting city as a tag. Here drop down box value coming from city master table from mysql database. But when i storing whole user registration values, i m not be able to fetch currently selected city value. Can anyone help me...? My user registration form contains : <s:form action="Use...

How to create wizard screen layout using struts2?

I want to build a wizard screens for my project. For that i am using struts2 framework. Can anyone help me.... ...

Struts2, best practice for using method={1}

I'm new to Struts 2 and I've come across this syntax (recommended in the tutorial). <action name="Register_*" method="{1}" class="Register"> <result name="input">/member/Register.jsp</result> <result type="redirectAction">Menu</result> </action> I understand that it calls Register.{1} method. The problem is a user could put in...

Struts2 Tiles - how to implement ?

I am just experimenting with struts2 tiles. I don't know how to implement it. Can anyone give any link for simple example of using strus2 tiles ? What is the basic requirement for that ? ...

Wizard Creation through struts2

I am developing system in which i am using struts2. I have a requirement to develop a wizard for some of my forms. Anyone can give me any link for creation of wizard through struts2 ? or any suggestion how to create wizard through struts2 ? ...

struts2 Tiles - getting error while executing....

I am new to struts2 tiles. Here i am trying to execute 1 simple application using struts2 tiles. While executing following application i m getting error : Cannot load org.apache.tiles.web.startup.TilesListener reason : org.apache.tiles.web.startup.TilesListener java.lang.ClassNotFoundException: org.apache.tiles.web.startup.TilesListene...

struts2 tiles integreated example required

I want a link of simple struts2 with tiles integrated example. Can anyone provide it to me?? Thanks in advance... ...