struts2

Html radio tag question

I have a jsp page with two radio tags. The page contains a struts2 form. When I submit the form one of two radio must be automatically checked. Is it possible to do that? ...

Struts2 parameters between actions

I have to pass some parameter from an action to another action,for example to keep trace of an event. What is the best way to do that? I would not use session parameters. Thanks ...

How to get ul structure from HTML

I am making a configuration page, that splits a category tree over 3 columns for easy browsing like: **Column 1** **Column 2** **Column3** Category1 Category3 Category5 *SubCategory1* Category4 *SubCategory5* Category2 *SubCategory4*...

struts2: s:checkbox doesn't go on the same row with s:checkbox

Here's the .jsp code: <table> <s:iterator value="allAgents"> <tr> <td><s:property value="firstName" /></td> <td><s:property value="middleName" /></td> <td><s:property value="lastName" /></td> <td><s:checkbox name="ss"/></td> </tr> </s:iterator> </table> When rendered, the checkbox would occupy a whole row bel...

how to pass the stream result response in a jsp page(client)!!

I have a popup window in which i have a button which is invoking a action method for uploading a file.if this method throws a exception i have to open another popup window.how to do that.can any body help..!!!!ASAP!!thanks in advance ...

Dojo Struts 2.0.12

In my struts 2.0.12 application I'm trying to use s:datetimepicker but it does not render. Firebug error: dojo is not defined on dojo.require("dojo.widget.DatePicker"); My jsp page <%@taglib prefix="s" uri="/struts-tags" %> . . . . . . . . What's wrong? Did I miss something? ...

Rendering complete page and not "progressively" (using struts 2 / tiles)

Is there a way to get struts 2 (using tiles) to build the whole page before sending it to the browser? I don't want the page to be build "progressively" in the browser one part at a time. The main problem I'm trying to solve is that internet explorer 7 flashes/blinks the page even if only some of the content changes (firefox does this m...

Loading an object in ServletContext (application scope)

I would like to put two small constant objects (one TreeMap and one ArrayList) somewhere in the ServletContext of a Struts2 webapp (running under Tomcat 6), such that those objects may be accessible from any JSP, through the Application Scope. Under Struts1, I would have used one of those startup "plug-ins" (defined in struts-config.xml...

Struts2 JSON Plugin not working with "lazy" data

I have an Entity with a OneToOne relation that is fetched lazily: @Entity public class Person { @Id private Integer id; @Column(length=60) private String address; @OneToOne(fetch=FetchType.LAZY) @JoinColumn(name="idProvince") private Province province; } This is the test I do, trying to get all the entiti...

Can any one help me to do struts2 tiles2 in netbeans.

I'm new to struts2 tiles . I just need how to configure my directory structure and what are the configuration files that are needed. If possible please give some sample example... Thanks in advance. ...

Validation in struts 2

Hi all, Please solve my following confusions about validation in Struts2 - 1) Can we do client side and server side validation through JavaScript ? 2) Can we do client side and server side validation through AJAX ? If possible then which one is beneficial for client side validation and which one for server side ? Looking for your rep...

Struts errors/messages with div, not span

We add Struts errors and messages using ActionSupport.addActionError(...) and addActionMessage(...) and then output the results using <actionerror class="x"/> and <actionmessage class="x"/>. When these tags output the messages they output in the form: <ul><li><span class="x">msg</span></li></ul> As you can see you can specify the css ...

struts2 problem in action

I've started an application using struts 2.0.14 and web server is apache tomcat 6.0. I am getting an error, please help me to solve this. Application name: strutsTest Welcome page: EmpDetails.jsp in a package named ‘validTest’ having action like: <s:form action="takeAction" method="post> Action class: Employee.java and also I wrote...

action-validation.xml in struts 2

I have started a web application using struts 2. Apache tomcat 6.0 is my web server. It is clear to me that we can validate data using action-validation.xml as my login-validation.xml is – <validators> <field name="username"> <field-validator type="requiredstring"> <message>Login name is required</message> </field-validator> </field> <...

using struts-tags in struts 2 is mandatory. is it?

Is it mandatory in struts2 to use struts-tags. I mean can't we use following: <td bgcolor="DEDBC6"><div align="left"><font color="#000000"><strong> Employee Name * :</strong></font></div></td> <td><input name="empname" type="text" id="empname" size="32"></td> instead of following: <s:textfield label="Employee Salary " name="empsal" ...

Getting struts s:url includeparams to work on jboss when deploying as ROOT.war

I'm working on a webapp that uses struts 2, spring, URL Rewrite Filter and a couple of other dependencies that I'm not sure are relevant to this. One of the url's we construct is constructed as follows: <s:url id="blah" includeParams="get"> This works fine when deploying in jboss as a normal webapp dropped in deploy/. So then all urls...

Combining UrlRewriteFilter and struts 2 with get parameters

Following up on an older question of mine, I managed to get URL Rewriting working somewhat correctly for my struts project where URLs like search?q=blah get converted to queries search.action?q=blah. We use UrlRewriteFilter for this. This seems to forward fine to struts (if making sure it has a filter mapping with FORWARD), but when the ...

use struts tags inside attributes in jspx files

I have some old jsp code that uses the struts tags inside attributes, like this: <link href="<s:url value='/styles/layout.css'/>" rel="stylesheet" type="text/css" media="all"/> I can't get this to work in jspx files though. Is there a good alternative to sort of get the same functionality without too much clutter? ...

before Warning login

i need to alert or warn the user.. while user login into particular account 'your account has been expired next week' like that.. my user table having validfrom and validto date. Before 1 week of validto date.. i need to warn users at every time login. my application using strus2.. for above business logic i need any schedular.. otherw...

Struts2 time (HH:mm) mapping to action field

I have a simple struts2 from: <s:form ...> <s:textfield name="initialTime" maxlength="5" size="5" /> </s:form> Where the user has to enter a time in HH:mm format. In the corresponding Action, I have a property: private Date initialTime; along with its getter/setter. I am getting a validation problem, as the received initialTime (...