struts

understanding of struts1.x configuration file

Hi, below is the code in struts config file <action-mappings type="com.jpmc.invconfirm.presentation.struts.controllers.InvestorConfirmActionMapping"> <action path="/getLoanDetail" type="com.jpmc.invconfirm.base.presentation.struts.actions.StrutsIoCAction" name="InvConfLoanDetailPageLoadForm" ...

Equivalent to Struts 1.x "bean:define" tag?

Hi guys, I'm working on converting an old Struts 1.x application to Spring MVC, and in some of the jsp pages the "bean:define" tag is being used to get a string from a resource bundle, and is then used later in the page: <bean:define id="example_title"><fmt:message bundle="${example_Labels}" key="example_field"/></bean:define> then...

How to display a Struts <html:hidden> field?

I have a JSP with a Struts <html:hidden property="message"> field and I want to display it in the generated HTML to the enduser. ...

How to do background tasks in struts2?

Hi, i had a look on the struts plugins list here and wasn't able to find a plugin to do background/scheduled tasks. What i want to do, is run a daily task that pulls files from a few servers. I'd like this task to be run from within the web app, so that my importer gets access to all the data classes, also it would be less complicated I...

logic: equal with the contents of a hidden field

I have a hidden field: <input type="hidden" name="champs" id="champs"> I want do a <logic:equal> with the content of this field hidden, I tried the solutions but not work <logic:equal name="virement" property="statut" value='champs' > just be there is a syntax very precise in the value property of the logic: equal that I can found...

String[] vs Integer[] in Struts2 action attribute

I am new t struts2. i built one page, that shows list of employees. I can seach the employes based on his name by applying filter criteria and click on find button. At the same time, i provided check box in the left side for each employee name for delete operation. for all checkboxes, i gave Integer[] attribute name which is declared in ...

HOW-TO: remote file access from a web server ?

Hello Everyone, We have a web application which which is deployed and used within an intranet. The application reads in text files from a specified location on the web server itself. Now we have a requirement of reading in text files from other machines as well, so i'm exploring possible options to implement this. Possible options i'v...

want to make web site using Java, should i implement struts ?

I want to make discussion form kind of website using java, should i just make it using JSP- Servlet - Java code or should i use some framework like struts ... I am new to Java, but i have sufficient exposure of programming ...

Multiple Submit in one Form using struts 1.3

Hello! It happens that in my app I throw a lot of data to one logic:iterate, but they need more data, data that is dependent on each row of the iterate. So I thought to put one submit button in each row of the iterate (or maybe a link), so I can redirect the app to the next page. Problem is, the actionForm always submit the first row of...

Struts validation

Hi guys, i am using struts 1.2. i need to design a validation that reject charactes %,/,?,<,>. As you can identify last two characters need to be escaped but i am unable to find any specific rules of regex in struts. ...

Saving the selected options into one field in JSP

<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> <%@ page import="java.sql.*" %> <%@ page import="java.io.*" %> <HTML> <HEAD> <TITLE> Test Run </TITLE> <script> </script> </...

How to recognize redirect and submit in struts action

Hi. My website use struts and tiles. I use this link to link to register form: <a href='<s:url action="register" namespace="/vtv" />' >Register</a> here is the register.jsp: <s:form namespace="/vtv" action="register"> <s:textfield label="Username" name="username" /> <s:textfield label="Password" name="password" /> </...

Struts 2 type conversion problem

I'm having a problem creating a custom converter. It works if I type in the correct value, but if I intentionally type something incorrectly, instead of giving me the errors nicely, I get a long and mean looking stack trace. Here is my converter: public class CircleTypeConverter extends StrutsTypeConverter { public Object conver...

Parameter "method" not working (Struts 1)

I have the following action declared in my struts.xml: <action path="/updateAccountInfo" type="org.myCompany.UpdateAccountAction" name="myAccountForm" scope="session" validate="true" parameter="method" input="/updateAccountInfo.jsp"> <forward name="succ...

nullPointer Exception with my validator Form

hello i have a class Form where i implement the validator like this public class LoginForm extends ActionForm { private String login; private String password; public void setLogin(String login) { this.login = login; } public string getLogin() { return login; } public void setPassword(String p...

how to export/generate two files at once?

I have an requirement of generating two excel files at once. We are using Apache POI for generating excel files and struts framework. Within the action class, the steps are like, OutputStream outputStream = response.getOutputStream(); and then populate data from db and created one file using POI and called, response.setContentType("...

Struts Validation with multiple validation rules for a single field

This might be a basic question: I'm trying to understand how the Struts validation code below works: <field property="myField" depends="validwhen, maxlength"> <msg name="validwhen" key="error1.key" /> <msg name="maxlength" key="error2.key"/> <var> <var-name>test</var-name> <var-value> isFieldsShown == "no" </...

Struts / Internationalization (I18N)

I've got a web app that I am working on, and I have each of my languages broken up into *_lang.properties. If I change the browser language, the appropriate language appears in the UI which is great, but it requires my browser (both FF and IE) to be restarted. Other websites recognize the language change with just a page refresh. Is t...

struts2 interceptor problems

Hi, I am new to struts2, prior to this I have been using struts1.2, Spring and Hibernate combination. I have just started using Struts2,Spring and Hibernate application, but I seem to be plagued with interceptor exceptions, There are two error which keep happening, all in different scenarios 1) 2010-07-26 19:50:58,031 ERROR org.apa...

Using cookies with Struts 2 struts2 struts

I've got the following (shortened) struts2 action: public class MyAction extends BaseAction implements CookiesAware { public String execute() { if (cookiesMap.containsKey("BLAH")) blah=Integer.parseInt(cookiesMap.get("BLAH")); return "success"; } // For handling cookies Map<String, String> cookiesMap; @Over...