Struts 1.2.4 validator framework.
Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily.
Struts2 - The requested list key 'state' could not be resolved as a collection/array/map/enumeration/iterator type
Hi everyone, Please help me in Struts2, I am stucked in action The problem is that I have a application form for accessing that form you should be registered in the database. So the login utility will check for the password email in the database if it is there than it will go to the app. form otherwise it will throw an error. It is working fine until I want a dropdown in the form say that contains all the States and Cities of India. I want this thing to retrieve from the database but initially I am checking by hardcoding whether its working or not. So, my Action contains 2 method one is default execute() method which is populating the States of India but the problem is that in the struts.xml file when I am not stating any method than it is executing the default execute method and populating the dropdown but the validation method is not executing and when I am passing the validating method than it is not populating the dropdown. I am sending my codes please help where I am wrong, its very urgent yaar. I tried redirection also by Message-Store-Interceptor also but that is also not working when I tried to write the states addition list separately in a class file. *Struts.xml* action name=ApplyOL class=net.Candidate.application.ApplyAction method=applyinterface()* -- For validation if I remove this method than validation is not working but populating the dropdown.* result name=input type=tilesApply/result result name=error type=tilesApply/result result name=success type=tilesOLAppForm/result /action *tiles.xml* definition name=OLAppForm extends=CandidateBaseLayout put-attribute name=title value=INAT Online Application Registration / put-attribute name=menu value=/Tiles/candidateMenu.jsp / put-attribute name=body value=/pages/application/OLAppForm.jsp / /definition *ApplyAction.java* package net.Candidate.application; import java.io.*; import java.sql.*; import java.util.*; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ActionContext; import net.database.*; import net.Candidate.application.model.Apply; import net.Candidate.application.State; public class ApplyAction extends ActionSupport { private Apply apply; private List state; public String execute() throws Exception{ System.out.println(state); state = new ArrayList(); state.add(Maharashtra); state.add(Kerala); state.add(Karnataka); state.add(TamilNadu); return SUCCESS; } public List getState(){ return state; } public String applyinterface() { try { Connection connect = null; ResultSet result = null; PreparedStatement pstmt = null; DBConnection getConnect = new DBConnection(); connect = getConnect.getCon(); int id=0; String qry = SELECT id FROM Register WHERE AppEmail=? RegPasswd=?; pstmt = connect.prepareStatement(qry); pstmt.setString(1, apply.getEmail()); pstmt.setString(2, apply.getPassword()); result = pstmt.executeQuery(); while(result.next()) { id = result.getInt(1); } System.out.println(id); boolean comparing = (id == 0); if (comparing == true) { addActionError(getText(validate_notRegistered)); return ERROR; } else { return SUCCESS; } } catch (SQLException e) { e.printStackTrace(); } return SUCCESS; } public Apply getApply() { return apply; } public void setApply(Apply apply) { this.apply = apply; } } *Apply.java* package net.Candidate.application.model; import com.opensymphony.xwork2.ActionSupport; public class Apply extends ActionSupport{ private String password; private String email; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Apply() { } } *JSP File* --- --- --- s:select label=Select Day name=daysname headerKey=1 headerValue=-- Please Select -- list=state/ --- --- --- I am also trying like this.. *ApplyAction.java* package net.Candidate.application; import java.io.*; import java.sql.*; import java.util.*; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ActionContext; import net.database.*; import net.Candidate.application.model.Apply; import net.Candidate.application.State; public class ApplyAction extends ActionSupport { private Apply apply; public String applyinterface() { try { Connection connect = null; ResultSet result = null; PreparedStatement pstmt = null; DBConnection getConnect = new DBConnection(); connect = getConnect.getCon(); int id=0; String qry = SELECT id FROM Register WHERE AppEmail=? RegPasswd=?; pstmt = connect.prepareStatement(qry); pstmt.setString(1, apply.getEmail()); pstmt.setString(2, apply.getPassword()); result = pstmt.executeQuery(); while(result.next()) { id = result.getInt(1); } System.out.println(id); boolean comparing = (id == 0); if (comparing == true) { addActionError(getText(validate_notRegistered)); return ERROR; } else { //return SUCCESS; sx:head
JQuery Grid Tag [ avoid ajax on load? ]
Hi, I am using jquery grid. Following *s:url id=remoteurl action=some_url/* *sjg:grid* *id=gridtable* *dataType=json* *href=%{remoteurl}* Is there a way that I can replace this remote url call with a grid model placed on the value stack (like we do normally with form elements with a name property)? s:textfield label=some_label *name*=property_name / Any help in this is appreciated. Thanks Hassan
Re: JQuery Grid Tag [ avoid ajax on load? ]
Currently not. The sj:grid / tag only works together with a JSON Data Provider. Johannes - web: http://www.jgeppert.com twitter: http://twitter.com/jogep -- View this message in context: http://struts.1045723.n5.nabble.com/JQuery-Grid-Tag-avoid-ajax-on-load-tp4527455p4527629.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Transparent Proxy and redirect
Hello. I am running Tomcat behind a transparent proxy which provides SSL. This way the tomcat server is serving http and the clients connecting through the proxy get https service. The problem is when I make a forward with redirect=true with struts the http response specifies a complete URL and since the application environment is configured to use http the clients are redirected to http even though they originally accessed the app using http. An example of a redirect I have: forward name=success path=/Home.do redirect=true / This results on a HTTP 302 redirect with Location: http://fqdn_of_server/Home.do;. I have tried with success, to specify the complete URL like this: forward name=success path=https://fqdn_of_server/Home.do; redirect=true / But I have a couple of developing environments and I don't want to hard code the FQDN of the server in all redirects. Is it possible to configure a HTTP 302 Redirect with the Location field with a relative path? Thanks -- **
Re: Struts 1.2.4 validator framework.
{1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily.
Struts2 - he requested list key 'state' could not be resolved as a collection/array/map/enumeration/iterator type
Please help me in Struts2, I am stucked in action The problem is that I have a application form for accessing that form you should be registered in the database. So the login utility will check for the password email in the database if it is there than it will go to the app. form otherwise it will throw an error. It is working fine until I want a dropdown in the form say that contains all the States and Cities of India. I want this thing to retrieve from the database but initially I am checking by hardcoding whether its working or not. So, my Action contains 2 method one is default execute() method which is populating the States of India but the problem is that in the struts.xml file when I am not stating any method than it is executing the default execute method and populating the dropdown but the validation method is not executing and when I am passing the validating method than it is not populating the dropdown. I am sending my codes please help where I am wrong, its very urgent yaar. I tried redirection also by Message-Store-Interceptor also but that is also not working when I tried to write the states addition list separately in a class file. *Struts.xml* - Hide quoted text - action name=ApplyOL class=net.Candidate.application.ApplyAction method=applyinterface() -- For validation if I remove this method than validation is not working but populating the dropdown. result name=input type=tilesApply/result result name=error type=tilesApply/result result name=success type=tilesOLAppForm/result /action *tiles.xml* definition name=OLAppForm extends=CandidateBaseLayout put-attribute name=title value=INAT Online Application Registration / put-attribute name=menu value=/Tiles/candidateMenu.jsp / put-attribute name=body value=/pages/application/OLAppForm.jsp / /definition *ApplyAction.java* package net.Candidate.application; import java.io.*; import java.sql.*; import java.util.*; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ActionContext; import net.database.*; import net.Candidate.application.model.Apply; import net.Candidate.application.State; public class ApplyAction extends ActionSupport { private Apply apply; private List state; public String execute() throws Exception{ System.out.println(state); state = new ArrayList(); state.add(Maharashtra); state.add(Kerala); state.add(Karnataka); state.add(TamilNadu); return SUCCESS; } public List getState(){ return state; } public String applyinterface() { try { Connection connect = null; ResultSet result = null; PreparedStatement pstmt = null; DBConnection getConnect = new DBConnection(); connect = getConnect.getCon(); int id=0; String qry = SELECT id FROM Register WHERE AppEmail=? RegPasswd=?; pstmt = connect.prepareStatement(qry); pstmt.setString(1, apply.getEmail()); pstmt.setString(2, apply.getPassword()); result = pstmt.executeQuery(); while(result.next()) { id = result.getInt(1); } System.out.println(id); boolean comparing = (id == 0); if (comparing == true) { addActionError(getText(validate_notRegistered)); return ERROR; } else { return SUCCESS; } } catch (SQLException e) { e.printStackTrace(); } return SUCCESS; } public Apply getApply() { return apply; } public void setApply(Apply apply) { this.apply = apply; } } *Apply.java* package net.Candidate.application.model; import com.opensymphony.xwork2.ActionSupport; public class Apply extends ActionSupport{ private String password; private String email; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; }
include tag problem
Hi all, I need help, please. I have collection of User object... In my jsp page, I have foreach block for print all user contains in my collection. I want use other jsp for print it! For example: % CollectionUser users = (CollectionUser)request.getAttribute(users); IteratorUser it = users.iterator(); while (it.hasNext()) { User user = it.next(); % s:include value=user.jsp s:param name=user value=user/s:param ? /s:include % } % I want use include page for print single user. Is it possible? How pass I my user object to user.jsp? And then, how I can get user param in user.jsp? Thanks in advance -- View this message in context: http://struts.1045723.n5.nabble.com/include-tag-problem-tp4527676p4527676.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 - The requested list key 'state' could not be resolved as a collection/array/map/enumeration/iterator type
You're only populating the list in the execute method, but that isn't run on a validation error--input is. Consider implementing Preparable. IIRC this is in the faq (I might be recalling wrong). Dave On Jun 27, 2011 3:18 AM, akshat [PG8] akshat-...@iiitmk.ac.in wrote: Hi everyone, Please help me in Struts2, I am stucked in action The problem is that I have a application form for accessing that form you should be registered in the database. So the login utility will check for the password email in the database if it is there than it will go to the app. form otherwise it will throw an error. It is working fine until I want a dropdown in the form say that contains all the States and Cities of India. I want this thing to retrieve from the database but initially I am checking by hardcoding whether its working or not. So, my Action contains 2 method one is default execute() method which is populating the States of India but the problem is that in the struts.xml file when I am not stating any method than it is executing the default execute method and populating the dropdown but the validation method is not executing and when I am passing the validating method than it is not populating the dropdown. I am sending my codes please help where I am wrong, its very urgent yaar. I tried redirection also by Message-Store-Interceptor also but that is also not working when I tried to write the states addition list separately in a class file. *Struts.xml* action name=ApplyOL class=net.Candidate.application.ApplyAction method=applyinterface()* -- For validation if I remove this method than validation is not working but populating the dropdown.* result name=input type=tilesApply/result result name=error type=tilesApply/result result name=success type=tilesOLAppForm/result /action *tiles.xml* definition name=OLAppForm extends=CandidateBaseLayout put-attribute name=title value=INAT Online Application Registration / put-attribute name=menu value=/Tiles/candidateMenu.jsp / put-attribute name=body value=/pages/application/OLAppForm.jsp / /definition *ApplyAction.java* package net.Candidate.application; import java.io.*; import java.sql.*; import java.util.*; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ActionContext; import net.database.*; import net.Candidate.application.model.Apply; import net.Candidate.application.State; public class ApplyAction extends ActionSupport { private Apply apply; private List state; public String execute() throws Exception{ System.out.println(state); state = new ArrayList(); state.add(Maharashtra); state.add(Kerala); state.add(Karnataka); state.add(TamilNadu); return SUCCESS; } public List getState(){ return state; } public String applyinterface() { try { Connection connect = null; ResultSet result = null; PreparedStatement pstmt = null; DBConnection getConnect = new DBConnection(); connect = getConnect.getCon(); int id=0; String qry = SELECT id FROM Register WHERE AppEmail=? RegPasswd=?; pstmt = connect.prepareStatement(qry); pstmt.setString(1, apply.getEmail()); pstmt.setString(2, apply.getPassword()); result = pstmt.executeQuery(); while(result.next()) { id = result.getInt(1); } System.out.println(id); boolean comparing = (id == 0); if (comparing == true) { addActionError(getText(validate_notRegistered)); return ERROR; } else { return SUCCESS; } } catch (SQLException e) { e.printStackTrace(); } return SUCCESS; } public Apply getApply() { return apply; } public void setApply(Apply apply) { this.apply = apply; } } *Apply.java* package net.Candidate.application.model; import com.opensymphony.xwork2.ActionSupport; public class Apply extends ActionSupport{ private String password; private String email; public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Apply() { } } *JSP File* --- --- --- s:select label=Select Day name=daysname headerKey=1 headerValue=-- Please Select -- list=state/ --- --- --- I am also trying like this.. *ApplyAction.java* package net.Candidate.application; import java.io.*; import java.sql.*; import java.util.*; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ActionContext; import net.database.*; import net.Candidate.application.model.Apply; import net.Candidate.application.State; public class ApplyAction extends ActionSupport { private Apply apply; public String applyinterface() { try { Connection connect = null; ResultSet result = null; PreparedStatement pstmt = null; DBConnection getConnect = new DBConnection(); connect = getConnect.getCon(); int id=0; String qry = SELECT id FROM Register WHERE AppEmail=? RegPasswd=?; pstmt = connect.prepareStatement(qry);
Re: include tag problem
Why not use a JSP-based custom tag? Dave On Jun 27, 2011 7:03 AM, k3v1n mitn...@email.it wrote: Hi all, I need help, please. I have collection of User object... In my jsp page, I have foreach block for print all user contains in my collection. I want use other jsp for print it! For example: % CollectionUser users = (CollectionUser)request.getAttribute(users); IteratorUser it = users.iterator(); while (it.hasNext()) { User user = it.next(); % s:include value=user.jsp s:param name=user value=user/s:param ? /s:include % } % I want use include page for print single user. Is it possible? How pass I my user object to user.jsp? And then, how I can get user param in user.jsp? Thanks in advance -- View this message in context: http://struts.1045723.n5.nabble.com/include-tag-problem-tp4527676p4527676.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1.2.4 validator framework.
Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily.
Re: Struts 1.2.4 validator framework.
Oh, you're saying that the error message *renders* as ... less than ${var.minlength} characters? What happens when you declare the var as ${var:minlength} as in the docs? Dave On Mon, Jun 27, 2011 at 8:17 AM, Maithily maithily.koh...@gmail.com wrote: Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1.2.4 validator framework.
Yeah, it renders as you have said. I have declared the var as per the struts validator documents. field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field I also tried this configuring it like this - field property=password depends=required,minlength arg0 key=LoginForm.password/ arg1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field None of them seem to work for me. Could any lib file be missing which is not able to interpret teh ${...} expression? On Mon, Jun 27, 2011 at 5:51 PM, Dave Newton davelnew...@gmail.com wrote: Oh, you're saying that the error message *renders* as ... less than ${var.minlength} characters? What happens when you declare the var as ${var:minlength} as in the docs? Dave On Mon, Jun 27, 2011 at 8:17 AM, Maithily maithily.koh...@gmail.com wrote: Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1.2.4 validator framework.
From http://struts.apache.org/1.2.4/userGuide/dev_validator.html * minlength - validate input data isn't less than a specified minimum length. Requires a minlength variable. field property=name depends=required,minlength arg0 key=customer.name/ arg1 name=minlength key=${var:minlength} resource=false/ varvar-nameminlength/var-namevar-value3/var-value/var /field So, it's a colon there. Dave On Mon, Jun 27, 2011 at 8:31 AM, Maithily maithily.koh...@gmail.com wrote: Yeah, it renders as you have said. I have declared the var as per the struts validator documents. field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field I also tried this configuring it like this - field property=password depends=required,minlength arg0 key=LoginForm.password/ arg1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field None of them seem to work for me. Could any lib file be missing which is not able to interpret teh ${...} expression? On Mon, Jun 27, 2011 at 5:51 PM, Dave Newton davelnew...@gmail.com wrote: Oh, you're saying that the error message *renders* as ... less than ${var.minlength} characters? What happens when you declare the var as ${var:minlength} as in the docs? Dave On Mon, Jun 27, 2011 at 8:17 AM, Maithily maithily.koh...@gmail.com wrote: Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1.2.4 validator framework.
Oh! yes, thanks for pointing that out. It works smoothly. Apologies for the silly mistake. Regards, Maithily. On Mon, Jun 27, 2011 at 6:03 PM, Dave Newton davelnew...@gmail.com wrote: From http://struts.apache.org/1.2.4/userGuide/dev_validator.html * minlength - validate input data isn't less than a specified minimum length. Requires a minlength variable. field property=name depends=required,minlength arg0 key=customer.name/ arg1 name=minlength key=${var:minlength} resource=false/ varvar-nameminlength/var-namevar-value3/var-value/var /field So, it's a colon there. Dave On Mon, Jun 27, 2011 at 8:31 AM, Maithily maithily.koh...@gmail.com wrote: Yeah, it renders as you have said. I have declared the var as per the struts validator documents. field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field I also tried this configuring it like this - field property=password depends=required,minlength arg0 key=LoginForm.password/ arg1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field None of them seem to work for me. Could any lib file be missing which is not able to interpret teh ${...} expression? On Mon, Jun 27, 2011 at 5:51 PM, Dave Newton davelnew...@gmail.com wrote: Oh, you're saying that the error message *renders* as ... less than ${var.minlength} characters? What happens when you declare the var as ${var:minlength} as in the docs? Dave On Mon, Jun 27, 2011 at 8:17 AM, Maithily maithily.koh...@gmail.com wrote: Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 1.2.4 validator framework.
Cool; glad you got it working. Dave On Mon, Jun 27, 2011 at 8:37 AM, Maithily maithily.koh...@gmail.com wrote: Oh! yes, thanks for pointing that out. It works smoothly. Apologies for the silly mistake. Regards, Maithily. On Mon, Jun 27, 2011 at 6:03 PM, Dave Newton davelnew...@gmail.com wrote: From http://struts.apache.org/1.2.4/userGuide/dev_validator.html * minlength - validate input data isn't less than a specified minimum length. Requires a minlength variable. field property=name depends=required,minlength arg0 key=customer.name/ arg1 name=minlength key=${var:minlength} resource=false/ varvar-nameminlength/var-namevar-value3/var-value/var /field So, it's a colon there. Dave On Mon, Jun 27, 2011 at 8:31 AM, Maithily maithily.koh...@gmail.com wrote: Yeah, it renders as you have said. I have declared the var as per the struts validator documents. field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field I also tried this configuring it like this - field property=password depends=required,minlength arg0 key=LoginForm.password/ arg1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field None of them seem to work for me. Could any lib file be missing which is not able to interpret teh ${...} expression? On Mon, Jun 27, 2011 at 5:51 PM, Dave Newton davelnew...@gmail.com wrote: Oh, you're saying that the error message *renders* as ... less than ${var.minlength} characters? What happens when you declare the var as ${var:minlength} as in the docs? Dave On Mon, Jun 27, 2011 at 8:17 AM, Maithily maithily.koh...@gmail.com wrote: Thanks for the reply Dave. The default error message configured as follows errors.minlength={0} can not be less than {1} characters. Regards, Maithily On Mon, Jun 27, 2011 at 4:30 PM, Dave Newton davelnew...@gmail.com wrote: {1} like the default message. Dave On Jun 27, 2011 3:14 AM, Maithily maithily.koh...@gmail.com wrote: Hi, I am new to this mailing list and am facing a problem using the minlength field validation provided by the Struts Validation Framework. Struts version - 1.2.4 Application Server - Apache Tomcat (5.5) I have configured the following in my validation.xml file - field property=password depends=required,minlength arg position=0 key=LoginForm.password/ arg position=1 name=minlength key=${var.minlength} resource=false/ var var-nameminlength/var-name var-value6/var-value /var /field However, the value of the minlength variable is not being substituted in the error message and the following is displayed when the validation fails - Password can not be less than ${var.minlength} characters. I have searched through the mailing list archives but could not find a solution. Pl. advise what could go wrong. Thanks and Regards, Maithily. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: include tag problem
Can you send example code please? -- View this message in context: http://struts.1045723.n5.nabble.com/include-tag-problem-tp4527676p4528142.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: include tag problem
On Mon, Jun 27, 2011 at 8:32 AM, k3v1n mitn...@email.it wrote: Can you send example code please? ... http://download.oracle.com/javaee/5/tutorial/doc/bnalj.html http://www.javascriptdownload.net/site/page.asp?dsy_id=501 http://onjava.com/pub/a/onjava/excerpt/jserverpages3_ch11/index.html http://today.java.net/pub/a/today/2003/11/14/tagfiles.html ... etc ... Try searching. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: POJO's collection not populated when submitting form
Hi folks, Not possible to populate a java.util.Set from a form post in Struts 2? A discussion on Stack Overflow concluded that you can't populate a java.util.Set type Collection with a form post in Struts 2. Can you guys confirm? Basically, I'm able to successfully iterate over a Set in a JSP to display the Collection but when I post a form to the Action all the POJO's fields get populated except the field that is of type java.util.Set. For those that use Hibernate I'm guessing this would be a common issue since Set is the most common collection mapping. http://stackoverflow.com/questions/6443498/pojos-collection-not-populated-when-submitting-form Many thanks for your input. On Wed, Jun 22, 2011 at 3:53 PM, Justin Robbins justinhrobb...@gmail.com wrote: Hi folks, I have a POJO which has a field of type java.util.Set that is collection of domain objects. When I submit a form to my Action, all the POJO fields are populated with values from the form except the field which is the collection. I have no idea why this collection isn't getting populated. Any advice on how to resolve this problem or how to better troubleshoot it would be much appreciated. I'm posting some code excerpts below but please not that I posted larger code excerpts for my example in a separate post StackOverflow. I hope that's not considered a faux pas for cross posting but it didn't seem these emails are a great place to copy and paste a bunch of code. http://stackoverflow.com/questions/6443498/pojos-collection-not-populated-when-submitting-form I also have a second related question. My POJO's collection is a java.util.Set. Does it matter to Struts 2 (or complicate things) that I'm using a Set and not a List? Is it common to use a Set as a collection field in a POJO used in Struts 2? The reason I'm using a Set is that I'm using Hibernate for ORM and according to the documentation a Set is the most common collection used association based mappings in Hibernate. s:textfield name=flashCard.links.url key=label.flashcard.link size=66 / I've also tried: s:textfield name=flashCard.links[0].url key=label.flashcard.link size=66 / From the Action class: FlashCard flashCard = new FlashCard(); public FlashCard getFlashCard() { return this.flashCard; } public void setFlashCard(FlashCard flashCard) { this.flashCard = flashCard; } From the POJO: private SetLink links = new HashSetLink(0); public SetLink getLinks() { return this.links; } public void setLinks(SetLink links) { this.links = links; } -- Regards, Justin Robbins -- Regards, Justin Robbins 973.479.0448 justinhrobb...@gmail.com Learn more about me by viewing my professional profile on LinkedIn http://www.linkedin.com/in/justinhrobbins View my professional blog http://javadeveloperjournal.blogspot.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: POJO's collection not populated when submitting form
IMO a set is user-hostile unless you've defined an iterator with known sequence, otherwise the same page might return the same values in a different order. That's just confusing. (And I've never actually used a set in Hibernate, always a list or a map.) I don't think collection syntax (square brackets, as you tried) or indexed notation (paren) would work, since there's no getAt type thing for a set. You may be able to create a custom type converter, but meh. Dave On Mon, Jun 27, 2011 at 10:15 AM, Justin Robbins justinhrobb...@gmail.com wrote: Hi folks, Not possible to populate a java.util.Set from a form post in Struts 2? A discussion on Stack Overflow concluded that you can't populate a java.util.Set type Collection with a form post in Struts 2. Can you guys confirm? Basically, I'm able to successfully iterate over a Set in a JSP to display the Collection but when I post a form to the Action all the POJO's fields get populated except the field that is of type java.util.Set. For those that use Hibernate I'm guessing this would be a common issue since Set is the most common collection mapping. http://stackoverflow.com/questions/6443498/pojos-collection-not-populated-when-submitting-form Many thanks for your input. On Wed, Jun 22, 2011 at 3:53 PM, Justin Robbins justinhrobb...@gmail.com wrote: Hi folks, I have a POJO which has a field of type java.util.Set that is collection of domain objects. When I submit a form to my Action, all the POJO fields are populated with values from the form except the field which is the collection. I have no idea why this collection isn't getting populated. Any advice on how to resolve this problem or how to better troubleshoot it would be much appreciated. I'm posting some code excerpts below but please not that I posted larger code excerpts for my example in a separate post StackOverflow. I hope that's not considered a faux pas for cross posting but it didn't seem these emails are a great place to copy and paste a bunch of code. http://stackoverflow.com/questions/6443498/pojos-collection-not-populated-when-submitting-form I also have a second related question. My POJO's collection is a java.util.Set. Does it matter to Struts 2 (or complicate things) that I'm using a Set and not a List? Is it common to use a Set as a collection field in a POJO used in Struts 2? The reason I'm using a Set is that I'm using Hibernate for ORM and according to the documentation a Set is the most common collection used association based mappings in Hibernate. s:textfield name=flashCard.links.url key=label.flashcard.link size=66 / I've also tried: s:textfield name=flashCard.links[0].url key=label.flashcard.link size=66 / From the Action class: FlashCard flashCard = new FlashCard(); public FlashCard getFlashCard() { return this.flashCard; } public void setFlashCard(FlashCard flashCard) { this.flashCard = flashCard; } From the POJO: private SetLink links = new HashSetLink(0); public SetLink getLinks() { return this.links; } public void setLinks(SetLink links) { this.links = links; } -- Regards, Justin Robbins -- Regards, Justin Robbins 973.479.0448 justinhrobb...@gmail.com Learn more about me by viewing my professional profile on LinkedIn http://www.linkedin.com/in/justinhrobbins View my professional blog http://javadeveloperjournal.blogspot.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: POJO's collection not populated when submitting form
Many thanks for the confirmation Dave. I'll convert my Hibernate mappings to List or Map. I wonder why the Hibernate docs use Set and mention Set is the most commonly used Collection in mappings. I realize that is a discussion for another venue though. Thanks again. On Wed, Jun 22, 2011 at 3:53 PM, Justin Robbins justinhrobb...@gmail.com wrote: Hi folks, I have a POJO which has a field of type java.util.Set that is collection of domain objects. When I submit a form to my Action, all the POJO fields are populated with values from the form except the field which is the collection. I have no idea why this collection isn't getting populated. Any advice on how to resolve this problem or how to better troubleshoot it would be much appreciated. I'm posting some code excerpts below but please not that I posted larger code excerpts for my example in a separate post StackOverflow. I hope that's not considered a faux pas for cross posting but it didn't seem these emails are a great place to copy and paste a bunch of code. http://stackoverflow.com/questions/6443498/pojos-collection-not-populated-when-submitting-form I also have a second related question. My POJO's collection is a java.util.Set. Does it matter to Struts 2 (or complicate things) that I'm using a Set and not a List? Is it common to use a Set as a collection field in a POJO used in Struts 2? The reason I'm using a Set is that I'm using Hibernate for ORM and according to the documentation a Set is the most common collection used association based mappings in Hibernate. s:textfield name=flashCard.links.url key=label.flashcard.link size=66 / I've also tried: s:textfield name=flashCard.links[0].url key=label.flashcard.link size=66 / From the Action class: FlashCard flashCard = new FlashCard(); public FlashCard getFlashCard() { return this.flashCard; } public void setFlashCard(FlashCard flashCard) { this.flashCard = flashCard; } From the POJO: private SetLink links = new HashSetLink(0); public SetLink getLinks() { return this.links; } public void setLinks(SetLink links) { this.links = links; } -- Regards, Justin Robbins -- Regards, Justin Robbins 973.479.0448 justinhrobb...@gmail.com Learn more about me by viewing my professional profile on LinkedIn http://www.linkedin.com/in/justinhrobbins View my professional blog http://javadeveloperjournal.blogspot.com/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: POJO's collection not populated when submitting form
On Mon, Jun 27, 2011 at 10:57 AM, Justin Robbins justinhrobb...@gmail.com wrote: I wonder why the Hibernate docs use Set and mention Set is the most commonly used Collection in mappings. Maybe it is, I guess I've just never found it helpful in anything I've done--I've usually needed either a known order, or to be able to get specific items in the collection by ID. Dunno :) I honestly don't recall how the default XW2 handles sets (the built-in type conversion irritates me, actually, the way it's implemented) but perhaps it's something worth looking in to and cleaning up. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Java based spell check
Hi Does anyone know of open source Java based spell check which does not call google webservice for spell check? Like pspell in PHP which can be hosted in intranet environment -- Ashish www.ayurwellness.com www.mysoftwareneeds.com
Re: Java based spell check
On Mon, Jun 27, 2011 at 10:15 PM, Ashish Kulkarni ashish.kulkarn...@gmail.com wrote: Hi Does anyone know of open source Java based spell check which does not call google webservice for spell check? Like pspell in PHP which can be hosted in intranet environment Long ago I used JSpell in a Struts app. Looks like they are still around... http://www.jspell.com/ -- Wendy - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org