Iterate the list of Formbean into jsp file

is it possible to creat arraylist with values in formbean and iterate that into jsp file using logic tag?.

i have created arraylist in my actionform class and i want to iterate that list and add that values into optios box injsp file using logic iterator tag

Type-specific application-scoped error messages for standard conversion

Hello all.

Can I declare application-scoped error messages for standard conversion that are specific to the type being converted? Something like: “For all int conversion erros in the whole application use message ‘foo’; for all date conversion errors in the whole application use message ‘bar’; and so forth…”

Actually, it would be ideal if I could reuse the same error messages in validation configuration, but conversion happens before validation and I can’t use validation mechanism because errors would be detected at conversion time.

If, for instance, an int conversion fails, I wouldn’t like to return a generic “Invalid field” message, but something more informative like “A number was expected” or the like.

Using “invalid.fieldvalue.” in a resource bundle involves using always the same name for the field with a specific type, or repeat the message in every action.

Overriding “xwork.default.invalid.fieldvalue” only permits a generic message for all types.

I guess the only option remaining is creating custom converters that override the default framework converters for standard types: int, Date…

By the way, is is possible such an override of default converters for standard types?

Thanks for your time. Antonio.

Retrieving random radio button value

jsp page [code]
//This "upId", is the primary id from the table. So in the loop, the upId, upholidayDate & upholidayDesc iterate accordingly <input type="radio" property="upId" value="">

//here I need to set that same value to that radio button selected.

[/code]

My action class [code] public ActionForward doDel(ActionMapping mapping, ActionForm theForm, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Connection conn = null; HolidayService hdServ = new HolidayService(); List updList = new ArrayList(); ActionErrors errors = new ActionErrors(); HolidayForm delForm = (HolidayForm) theForm; String upId = request.getParameter("upId"); //Will I get the selected radio button with this ? hdServ.delete(upId,conn); //Calling my delete service and dao to delete the radio button selected id .... [/code]

How do I retrieve the random radio button value into my action?

@result dosenot have value

Hi,

I am using @Result but it does not have the value filed !! it only has location,name,type and tiles. I am using struts 2.1.8

So below does not work: @Action(value = “/register”, interceptorRefs = { @InterceptorRef(value = “i18nStack”) },

results = { @Result( value=”register.jsp”,location = “register”, name = “input”, type = “tiles” ) })

~Regards, ~~Alireza Fattahi

redirect not working as expected in portal env

Hi I am trying to use a redirect in portal env ..I am using liferay 5.2.3 and apache struts bridge. I see that the “redirect=true” works fine as standalone webapp but when fails to work in portal env..

Heres a snipped on struts-config

action path=”/portlet/students/dummy1″ type=”com.liferay.training.portlet.students.action.DummyAction1″ scope=”session” validate=”false”>

Since I have enabled redirect I understand that on page refresh only DummyAction2 should be called..But I notice that both the actions are called on pagerefresh..As a result whatever I am persisting in the database through DummyAction1 is getting duplicated on page fresh..Please help to solve this issue…

Weird problem with struts tags

Thanks Greg (and Ken). I appreciate the comments and will get around to updating this code at some point. However I believe these errors to be a symptom of a deeper problem as this code WAS – and still is on some servers – working. I am also getting other strange errors in code which was previously working (such as hibernate PropertyAccessException). I can check out older released versions of the app and they still work on the production and integration servers but I get these errors (and more) on my development machine. I am therefore trying to find out what has changed to produce these errors, and why they are only produced in certain environments.

The same versions of OGNL (ognl-2.6.11.jar) is being used in both environments. As I said, the exact same war file dropped into works on one server but not on another. Further more, it used to work in the environments in which it is now broken. There has also been no java/tomcat/etc updates (that I am aware of) that could have caused this. I am completely flummoxed by this! Any further help much appreciated.

On 2 Jul 2010, at 19:46, Greg Lindholm wrote:

Problem with figuring out Convention Plugin

Top of my head … you either do not have a getMessage() method in your action, or you do, but the value is blank/null.

Post your action code.

Regards

GET method action current value encoding

I’ve create GET method action Page with apache struts 2.1.8.1. I’m making a page in encoding UTF-8.

struts action is setter value. POST method ‘s setter value is encoding UTF-8. but GET method ‘s value is encoding ISO-8859-1.

This trouble resolved this Action setter. but When GET was performed and went on POST. The value is Incomplete.

Fundamentally, would there be a way to correct a change in a character string besides this way?

web.xml: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

java : action: public class SampleAction extends ActionSupport{ public String execute(){return SUCCESS;} public void setData(String data){ if(ServletActionContext.getRequest().getMethod().equals(“GET”)){ try { this._data = StringUtils.encoding(data); } catch (UnsupportedEncodingException e) { } }else{ this._data = data; } } public String getData(){return _data;} }

class: public class StringUtils { static public String encoding(String str) throws UnsupportedEncodingException { return new String(str.getBytes(ServletActionContext.getResponse().getCharacterEncoding()),ServletActionContext.getRequest().getCharacterEncoding()); } }

jsp Page:

GET

POST

thank you.

Mapping a dynamic html form with ActionForm

Hi,

I am developing a application which looks like and online exam. But the format of questions are not same. Questions may be desriptive, Objective and of Multiple choice.

I have a page shownextquestion.jsp. This read the next question from database to be shown to user.

It checks if the question is Description, then it show a Textarea using the tag… if the question is Objective… then it show Radio buttons, according to options available in question. Some question may have 4 options and some question may have 6 option

I want to use tag so that its data can be mapped to ActionForm. But the fields in ActionForm need to be defined in advance, we we want to show on html form.

- I want to know, what structure should I follow to design and implement my application with such requirement. Can I make use of tag and ActionForm OR I should not use them completely.

Thanks

datetimepicker: how to select both date and time

Hello,

I want to select date in format dd.MM.yyyy h:mm:ss. How to do this with datetimepicker? I can select only date (type=date) or time (type=time), but not both to same date text input field… or is there same way to do this?

Thanks a lot. Tom