Re: [SATURDAY] *sigh*
A true geek is never off-duty! :-) On 8/6/05, Jason Lea <[EMAIL PROTECTED]> wrote: > I am at home! and it's Sunday! (in New Zealand :) ) > > Dave Newton wrote: > > >Wait, they let you guys go home on weekends?! > > > >Dave > > > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > -- > Jason Lea > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- www.simonpeter.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SATURDAY] *sigh*
I am at home! and it's Sunday! (in New Zealand :) ) Dave Newton wrote: Wait, they let you guys go home on weekends?! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SATURDAY] *sigh*
David G. Friedman wrote: If we went away on Saturdays, it would be the 'Strut' group, not the 'Struts' group. :) Whew, I feel so much... uh... better now that I know I'm not the only lucky one. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SATURDAY] *sigh*
If we went away on Saturdays, it would be the 'Strut' group, not the 'Struts' group. :) Regards, David -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Saturday, August 06, 2005 3:39 PM To: Struts Users Mailing List Subject: [SATURDAY] *sigh* Wait, they let you guys go home on weekends?! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SATURDAY] *sigh*
Dreamer! > -Ursprüngliche Nachricht- > Von: Dave Newton [mailto:[EMAIL PROTECTED] > Gesendet: Samstag, 6. August 2005 21:39 > An: Struts Users Mailing List > Betreff: [SATURDAY] *sigh* > > Wait, they let you guys go home on weekends?! > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SATURDAY] *sigh*
Wait, they let you guys go home on weekends?! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using XHTML and no form name tag
Titi is correct - this is an issue introduced in Struts 1.2.7 - it is mentioned in the upgrade notes http://wiki.apache.org/struts/StrutsUpgradeNotes124to127 ...but to recap here the change for Bug 34027 caused this problem and it has been reported in Bug 35127 http://issues.apache.org/bugzilla/show_bug.cgi?id=34027 http://issues.apache.org/bugzilla/show_bug.cgi?id=35127 Niall - Original Message - From: "Laurie Harper" <[EMAIL PROTECTED]> Sent: Friday, August 05, 2005 7:02 PM > Titi Wangsa wrote: > > i'm havig problem with struts. > > i'm using 1.2.7 and i'm using the validator plug-in > > the problem is when i'm using html:javascript forname= > > > > the name attribiute for form > > > > is not rendered when > > > > however when only is specified, without turning on the > > xhtml feature, > > the tag is rendered. > > > > the question is, how to use the > > feature for client side validation when using > A very quick look at the code for the form tag suggests that xhtml=true > should make no difference to whether the name attribute gets generated. Are > you sure that's the only thing different between working and not working? > > Or did you mean the entire 'form' tag doesn't show up in the HTML if you > include xhtml=true? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validating form and what then?
One more thing ... Why are you not checking the form in your FormClass overriding the validate method... public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { } Rgds albi -Original Message- From: peceka [mailto:[EMAIL PROTECTED] Sent: Saturday, August 06, 2005 6:34 PM To: user@struts.apache.org Subject: validating form and what then? Hi, i've got a problem. i've done in my app an form where user must input login and password then this form is validated and then a want to test if this values are good or bad (LoginCheck.java), but form is null, why? How can I get login and password values and test if they are good? now my app: (struts-config.xml) ... Login.jsp: <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/tags/struts-bean" prefix="bean" %> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> LoginAction.java: package peceka; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public final class LoginAction extends Action { private Log log = LogFactory.getFactory().getInstance(this.getClass().getName()); public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Was this transaction cancelled? if (isCancelled(request)) { if (log.isInfoEnabled()) { log.info( " " + mapping.getAttribute() + " - Registration transaction was cancelled"); } removeFormBean(mapping, request); return (mapping.findForward("success")); } return mapping.findForward("success"); } protected void removeFormBean( ActionMapping mapping, HttpServletRequest request) { // Remove the obsolete form bean if (mapping.getAttribute() != null) { if ("request".equals(mapping.getScope())) { request.removeAttribute(mapping.getAttribute()); } else { HttpSession session = request.getSession(); session.removeAttribute(mapping.getAttribute()); } } } } LoginForm.java: package peceka; import java.io.Serializable; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.ValidatorForm; public final class LoginForm extends ValidatorForm implements Serializable { private String action = null; private String sLogin = null; private String sPassword = null; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getLogin() { return sLogin; } public void setLogin(String sLogin) { this.sLogin = sLogin; } public String getPassword() { return sPassword; } public void setPassword(String sPassword) { this.sPassword = sPassword; } public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; sLogin = null; sPassword = null; } } LoginCheck.java: package peceka; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import java.sql.PreparedStatement; import java.sql.ResultSet; public class LoginCheck extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if ( form != null ) { LoginForm loginForm = (LoginForm)form; System.out.println("login: " + loginForm); return(mapping.findForward("success")); } else { System.out.println("error. form == null");
RE: validating form and what then?
Might be because of the scope="request" ? I assume the form is present in loginsubmit, but not in the login-check. There's two things you could do, try to put the form in the session, or handle the checking in the loginsubmit... Rgds albi -Original Message- From: peceka [mailto:[EMAIL PROTECTED] Sent: Saturday, August 06, 2005 6:34 PM To: user@struts.apache.org Subject: validating form and what then? Hi, i've got a problem. i've done in my app an form where user must input login and password then this form is validated and then a want to test if this values are good or bad (LoginCheck.java), but form is null, why? How can I get login and password values and test if they are good? now my app: (struts-config.xml) ... Login.jsp: <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/tags/struts-bean" prefix="bean" %> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> LoginAction.java: package peceka; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public final class LoginAction extends Action { private Log log = LogFactory.getFactory().getInstance(this.getClass().getName()); public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Was this transaction cancelled? if (isCancelled(request)) { if (log.isInfoEnabled()) { log.info( " " + mapping.getAttribute() + " - Registration transaction was cancelled"); } removeFormBean(mapping, request); return (mapping.findForward("success")); } return mapping.findForward("success"); } protected void removeFormBean( ActionMapping mapping, HttpServletRequest request) { // Remove the obsolete form bean if (mapping.getAttribute() != null) { if ("request".equals(mapping.getScope())) { request.removeAttribute(mapping.getAttribute()); } else { HttpSession session = request.getSession(); session.removeAttribute(mapping.getAttribute()); } } } } LoginForm.java: package peceka; import java.io.Serializable; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.ValidatorForm; public final class LoginForm extends ValidatorForm implements Serializable { private String action = null; private String sLogin = null; private String sPassword = null; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getLogin() { return sLogin; } public void setLogin(String sLogin) { this.sLogin = sLogin; } public String getPassword() { return sPassword; } public void setPassword(String sPassword) { this.sPassword = sPassword; } public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; sLogin = null; sPassword = null; } } LoginCheck.java: package peceka; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import java.sql.PreparedStatement; import java.sql.ResultSet; public class LoginCheck extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if ( form != null ) { LoginForm loginForm = (LoginForm)form; System.out.println("login: " + loginForm); return(mapping.findForward("success")); } else { System.out.println("error. form == null");
validating form and what then?
Hi, i've got a problem. i've done in my app an form where user must input login and password then this form is validated and then a want to test if this values are good or bad (LoginCheck.java), but form is null, why? How can I get login and password values and test if they are good? now my app: (struts-config.xml) ... Login.jsp: <%@ page contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/tags/struts-bean" prefix="bean" %> <%@ taglib uri="/tags/struts-html" prefix="html" %> <%@ taglib uri="/tags/struts-logic" prefix="logic" %> LoginAction.java: package peceka; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public final class LoginAction extends Action { private Log log = LogFactory.getFactory().getInstance(this.getClass().getName()); public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Was this transaction cancelled? if (isCancelled(request)) { if (log.isInfoEnabled()) { log.info( " " + mapping.getAttribute() + " - Registration transaction was cancelled"); } removeFormBean(mapping, request); return (mapping.findForward("success")); } return mapping.findForward("success"); } protected void removeFormBean( ActionMapping mapping, HttpServletRequest request) { // Remove the obsolete form bean if (mapping.getAttribute() != null) { if ("request".equals(mapping.getScope())) { request.removeAttribute(mapping.getAttribute()); } else { HttpSession session = request.getSession(); session.removeAttribute(mapping.getAttribute()); } } } } LoginForm.java: package peceka; import java.io.Serializable; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.ValidatorForm; public final class LoginForm extends ValidatorForm implements Serializable { private String action = null; private String sLogin = null; private String sPassword = null; public String getAction() { return action; } public void setAction(String action) { this.action = action; } public String getLogin() { return sLogin; } public void setLogin(String sLogin) { this.sLogin = sLogin; } public String getPassword() { return sPassword; } public void setPassword(String sPassword) { this.sPassword = sPassword; } public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; sLogin = null; sPassword = null; } } LoginCheck.java: package peceka; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import java.sql.PreparedStatement; import java.sql.ResultSet; public class LoginCheck extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { if ( form != null ) { LoginForm loginForm = (LoginForm)form; System.out.println("login: " + loginForm); return(mapping.findForward("success")); } else { System.out.println("error. form == null"); return ( mapping.findForward("error") ); } } } Best Regards, p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Tiles as Email Templates
LOL... After diving into tiles I too wonder myself WHY all this fuzz ... Velocity is still the best bet for that ;) I was concerned about the memory used to fire up additional stuff. Now I have a central service providing the parsing functionality, keeping only one instance. Mind sometimes goes dizzy after long hours of thinking in circles ;) Rgds albi -Original Message- From: Larry Meadors Sent: Saturday, August 06, 2005 4:10 PM To: Struts Users Mailing List Subject: Re: Using Tiles as Email Templates On 8/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I still wonder, how one would do it with the standard struts/tiles combination. Hmm, I wonder WHY? Larry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Tiles as Email Templates
On 8/6/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I still wonder, how one would do it with the standard struts/tiles > combination. Hmm, I wonder WHY? Larry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Tiles as Email Templates
BTW: I went back doing it with Velocity but I still wonder, how one would do it with the standard struts/tiles combination. Rgds albi -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] Sent: Saturday, August 06, 2005 11:47 AM To: 'Struts Users Mailing List' Subject: Using Tiles as Email Templates Hi all, I have a tile layout that renders an email text (plain). Now after the user selects an action(ie. password retrieval), I want to use the output of the tile (configured as an action path) as the source for my email in the other action (ie. password retrieval). I know how to pull the output performing an HttpClient request(using the apache commons) to get that, but is there a different way to do just that. In the past I used velocity to render the emailtemplates, and that didn't require me to use a HttpClient request. any ideas ? rgds albi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Main class for a struts webapp...
Noted. I thank you all for your clarification and information. --- Yan Hu <[EMAIL PROTECTED]> wrote: > --- "O. Oke" <[EMAIL PROTECTED]> wrote: > > > Can anyone please tell me where the "main" (public > > static void main...) class of a Strus web > application > > can be found. To put it another way, when I click > a > > button in an HTML form, which "main" class kick > starts > > the chain of processing that eventually leads to > my > > action class being executed? > > > > Thank you. > > Struts is in fact a servlet. Servlets do not need a > main in order to run. Instead, they are > registered with your servlet containers such as > Tomcat. And then Tomcat will run them. I would > suggest you read a servlet book or tutorial before > you learn Struts. > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Tiles as Email Templates
This is what I meant btw ;) PWRetrievalForm User enters his answer to the secret PWRetrievalAction checks the answer against the DB and pulls the data beans containing the information needed for the template pulls the email text<+-+(pwretrieval.template) | |mailto:[EMAIL PROTECTED] Sent: Saturday, August 06, 2005 11:47 AM To: 'Struts Users Mailing List' Subject: Using Tiles as Email Templates Hi all, I have a tile layout that renders an email text (plain). Now after the user selects an action(ie. password retrieval), I want to use the output of the tile (configured as an action path) as the source for my email in the other action (ie. password retrieval). I know how to pull the output performing an HttpClient request(using the apache commons) to get that, but is there a different way to do just that. In the past I used velocity to render the emailtemplates, and that didn't require me to use a HttpClient request. any ideas ? rgds albi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using Tiles as Email Templates
Hi all, I have a tile layout that renders an email text (plain). Now after the user selects an action(ie. password retrieval), I want to use the output of the tile (configured as an action path) as the source for my email in the other action (ie. password retrieval). I know how to pull the output performing an HttpClient request(using the apache commons) to get that, but is there a different way to do just that. In the past I used velocity to render the emailtemplates, and that didn't require me to use a HttpClient request. any ideas ? rgds albi
Re: Multiple Input Bean
Instead of creating name and address fields as your form fields,Prepare a bean class eg empBean with these fields and 'collection' of this new bean as ur action forms fields.Struts has documentation on how to use collections as actionForm variables. Hope this helps u. Best luck, On Sat, 06 Aug 2005 Tony Smith wrote : >Hi, > >Suppose I have a UserBean: > >class UserBean{ > String name, > String address, > ... > > public String getName() >... >} > >In one jsp page, I want to input multiple people beans >and send back to server. The jsp UI is something like: > >People 1: >Name [ ] address [] >People 2: >Name [ ] address [] >People 3: >Name [ ] address [] > >[Submit Button] > >How do I design my ActionForm and Action? > >Thanks, > > > >__ >Do You Yahoo!? >Tired of spam? Yahoo! Mail has the best spam protection around >http://mail.yahoo.com > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >
Multiple Input Bean
Hi, Suppose I have a UserBean: class UserBean{ String name, String address, ... public String getName() ... } In one jsp page, I want to input multiple people beans and send back to server. The jsp UI is something like: People 1: Name [ ] address [] People 2: Name [ ] address [] People 3: Name [ ] address [] [Submit Button] How do I design my ActionForm and Action? Thanks, __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]