struts2

Struts 2 validation using annotation and model driven approach

I'm having trouble figuring out the proper way to get validation to work using annotations and a model driven approach. As you can see I have a simple form: <s:form action="register" namespace="/authenticate"> <s:textfield name="username" label="Username"/> <s:password name="password" label="Password"/> ...

Struts2: Session Problem (after reverse proxy)

I store session parameters in a Struts2 session map that I get in my actions using the SessionAware interface. My Application is in the /MyApp path. After setting up the struts2 application on an Apache server with an inverse proxy redirect that makes the URL http://www.appdomain.com/ point to my local tomcat on localhost:8080/MyApp, St...

struts2 forward to different pages

Hello, I have view.jsp and edit.jsp pages. Both call load() method of an action, which returns SUCCESS. Is there a way to forward to the page request came from in struts.xml, instead of this? <action name="call_1" method="load" class="package.action.List"> <result name="success" type="json">/WEB-INF/view.jsp</result> </action> <actio...

Struts 2 + Maven + Struts 2 Rest Plugin help

Hi I am new to Struts 2 and all the java web development, I created a basic struts2 application using maven and then added the struts2-rest-plugin to build my project; here is pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>tutorial</groupId> <artifactId>tutorial</artifactId> <pa...

struts2 not publishing topics

Hi, I am trying to create a form that lets users add 3 schools. They first select select a state then college list will be populated based on the state. States are loaded in prepare method. I'm using struts 2.1.8 and struts-jquery 2.3.1. <label for="state1">State: </label> <s:select id="state1" ...

Struts2 JQuery how to do onchange ajax

Hi all, Let's say I have sj:autocompleter like this : <sj:autocompleter id="idDistributor" name="idDistributor" list="%{idDistributorList}" label="ID Distributor" indicator="indicator" /> when the value is changed, I'd like to pass the detail value to other text field like this : <sj:textfield label="Nama Distributor" id="namaDi...

How to override struts.messages.error.file.too.large property

I am using Struts2 fileUpload interceptor to upload the files. I have configured the maxSize, allowed contentTypes ... props etc. But when user violate the maxSize ... Struts2 display error message which is very long string ... I want to change the message string i.e. how I can override struts.messages.error.file.too.large ... any idea?...

Mapped properties returning string array instead of Integer object in struts2

I have assigned Hahmap to the dropdowns.. each dropdown laues will be set into hashmap. when i try to get these values i am geeting values as string array instead of one object.so, i am not able to repopulate values if validation fails. below is the code i am using to populate the values. <s:iterator value="#actComments.lstEntities"> ...

Struts2 modifying an object with arraylist of objects.

Hi, I have an object in my Action class which contains an arraylist of objects internally, I am trying to create a CRUD screen for this object. My Action Class and bean are given below, /** * @author rohit * */ public class IRFeedMgmtAction extends ActionSupport implements ModelDriven<IRFeeds>,SessionAware,ServletRequestAware { pri...

Generation of code based on the table meta data..

Is there any free tool which can generate data entry and listing screen for a database table(Oracle) based on the metadata. Desired features: Drop downs for reference data Abilty to customise the label name, showing/hiding specific column of the table, ordering of columns etc.. Operation on listing screen (modify,delete,activate,deacti...

How to check for the existence of an action within a namespace in Struts2?

Hello, I'd like to implement in a Struts2 web application some sort of url "fallback" using an own ActionMapper. This means: when http://server/webapp/foo/bar/myaction does not exist, I want the ActionMapper to try to load e.g. http://server/webapp/foo_fallback/bar/myaction instead. Parsing the URL and therefore finding ...

Select tag is not rendering on Jsp

Before this i have used the struts 2 select tag successfully, but i am stuck to a problem now, my jsp is throwing an exception due to the select tag, i have created an array list which i am passing to the 'list' attribute of select tag, i have also defined getters & setters for that list and also for the name property element of the sele...

Loading resourcebundle from non default location in struts2

Is there any mechanism to load the properties file from the file system in struts2? I am coming up with a hot deployment mechanism. If I update the war file, it would be redeployed. I am able to reload properties file on the fly using LocalizedTextUtil.clearDefaultResourceBundles(); LocalizedTextUtil.addDefaultResourceBundle("struts/re...

How to write one action class and action-validation.xml to validate two forms in a two different jsp pages by struts2

I'm creating an struts2 application which has a login page and another user details page. There, i need to create only one action class. Because of that I'm unable to run the application by adding the field validations in both two pages to the action-validation.xml. Because with the login page validation it validate remaining field valid...

Struts2 param tag with javascript

Hi, I'm new to Struts2 but have been struggling with a problem for 2 days now. Basically, I want to set up an <s:param> tag within an <s:url> with the content of a div tag somewhere else in the page. <div id="div1">My value</div> <s:url action="myAction" var="url"> <s:param name="param1">...content of div1...</s:param> </s:url> ...

What to do when Apache Tiles 2.1 does nothing when it has to ?

Hello, readers (girl) and readers (boy), I have a slighly f%*#@ probelm with Apache Tiles 2.1, I work with : Struts 2.1.8.1 Apache Tiles 2.1 Spring 3.0.3 Spring Security 3.0.3 My problem is : Apache Tiles does not work on each JSPs, it seems to have problem with <tiles:insertAttribute name="body" /> This insert no data. When i s...

Is there a way to get the session map within custom ActionMapper?

Hello, I'd like to get/set session parameters within a custom ActionMapper in Struts2. When I call Map<String, Object> session = ActionContext.getContext().getSession(); within my custom MyActionMapper class, session is null. What am I doing wrong? Do i have to configure something to actually have a session? Thanks, Gregor ...

Struts 2 Custom Validator issue

Hi, I have an Action for CRUD operations and 3 custom validators. Two of the validators work correctly, but the other one does not. It handles correctly the validation, and returns the appropriate errors, but if there are no errors, the workflow does not complete, it never reaches the Action. It is as if it is stuck in the validator. ...

Struts 2 on Google app engine. problem

Hi. I use struts2 in google app engine I had an error with my application. result 'null' not found But when I created listener Ognl this error is not displaying. http://whyjava.wordpress.com/2009/08/30/creating-struts2-application-on-google-app-engine-gae/ to resolve this problem I created an ServletContextListner which will set OG...

Call an action when closing a JSP

Hi, I'm new to the java web world, so forgive me if I say something stupid. I'm working with struts 2 and I need to delete a file (which is located on the server) when a jsp is closed. Does any body knows how to do this? Thanks in advance. ...