Re: html:errors / trouble

2003-02-10 Thread alexj
(in fact when I run the app and enter bad datas I didn't get any
errors message displayed on my login page)

- Original Message -
From: alexj [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 10, 2003 6:42 PM
Subject: html:errors / trouble


 Hi I can't figure what I've missed into my code :
 here is my login.jsp
 %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean%

 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html%

 html

 body

 center

 img border=0 src=images/soft-intro.gif width=368 height=321

 html:form action=/login

 table width=45% border=1 style=border-collapse: collapse

 tr

 tdbean:message key='app.userName'//td

 td align=centerhtml:text property=userName / /td

 /tr

 tr

 tdbean:message key='app.userPassword'//td

 td align=centerhtml:password property=userPassword //td

 /tr

 tr

 td colspan=2 align=centerhtml:submit/ /td

 /tr

 /table

 html:errors /

 /html:form

 /center

 /body

 /html



 My login form :

 // Created by Xslt generator for Eclipse.

 // XSL : not found (java.io.FileNotFoundException: (Le chemin d'accès
 spécifié est introuvable))

 // Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl

 package soft.ibmss.struts.form;

 import javax.servlet.http.HttpServletRequest;

 import org.apache.struts.action.ActionErrors;

 import org.apache.struts.action.ActionError;

 import org.apache.struts.action.ActionForm;

 import org.apache.struts.action.ActionMapping;

 /**

 * @author alexj

 * To change this generated comment edit the template variable
typecomment:

 * WindowPreferencesJavaTemplates.

 * To enable and disable the creation of type comments go to

 * WindowPreferencesJavaCode Generation.

 *

 * LoginForm.java created by EasyStruts - XsltGen.

 * http://easystruts.sf.net

 * created on 02-10-2003

 *

 * XDoclet definition:

 * @struts:form name=loginForm

 */

 public class LoginForm extends ActionForm {

 // - Instance
 Variables

 /** userPassword property */

 private String userPassword;

 /** userName property */

 private String userName;

 // - Methods

 /**

 * Method validate

 * @param ActionMapping mapping

 * @param HttpServletRequest request

 * @return ActionErrors

 */

 public ActionErrors validate(

 ActionMapping mapping,

 HttpServletRequest request) {

 ActionErrors errors = new ActionErrors ();

 if ((userName == null) || (userName.length() == 0)) {

 errors.add(userName, new ActionError (errors.userNameRequired));

 }

 if (userPassword == null) {

 errors.add(userPassword, new ActionError
(errors.userPasswordRequired));

 }

 return errors;

 }

 /**

 * Method reset

 * @param ActionMapping mapping

 * @param HttpServletRequest request

 */

 public void reset(ActionMapping mapping, HttpServletRequest request) {

 userPassword = ;

 userName = ;

 }

 /**

 * Returns the userPassword.

 * @return String

 */

 public String getUserPassword() {

 return userPassword;

 }

 /**

 * Set the userPassword.

 * @param userPassword The userPassword to set

 */

 public void setUserPassword(String userPassword) {

 this.userPassword = userPassword;

 }

 /**

 * Returns the userName.

 * @return String

 */

 public String getUserName() {

 return userName;

 }

 /**

 * Set the userName.

 * @param userName The userName to set

 */

 public void setUserName(String userName) {

 this.userName = userName;

 }

 }

 my login action :



 // Created by Xslt generator for Eclipse.

 // XSL : not found (java.io.FileNotFoundException: (Le chemin d'accès
 spécifié est introuvable))

 // Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xsl

 package soft.ibmss.struts.action;

 import javax.servlet.http.HttpServletRequest;

 import javax.servlet.http.HttpServletResponse;

 import javax.servlet.ServletContext;

 import javax.servlet.http.HttpSession;

 import java.sql.Connection;

 import javax.sql.DataSource;

 import java.sql.Statement;

 import java.sql.ResultSet;

 import java.sql.SQLException;

 import org.apache.struts.action.Action;

 import org.apache.struts.action.ActionErrors;

 import org.apache.struts.action.ActionError;

 import org.apache.struts.action.ActionForm;

 import org.apache.struts.action.ActionForward;

 import org.apache.struts.action.ActionMapping;

 import soft.ibmss.struts.form.LoginForm;

 import org.apache.struts.Globals;

 import java.util.Vector;

 /**

 * @author alexj

 * XDoclet definition:

 * @struts:action path=/login name=loginForm input=/login.jsp
 validate=true

 * @struts:action-forward name= path=

 */

 public class LoginAction extends Action {

 // - Instance
 Variables

 // - Methods

 /**

 * Method execute

 * @param ActionMapping mapping

 * @param ActionForm form

 * @param HttpServletRequest request

 * 

Re: html:errors / trouble

2003-02-10 Thread Sean Dockery
What forwards are defined for your action in struts-config.xml?


- Original Message - 
From: alexj [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, February 10, 2003 10:56
Subject: Re: html:errors / trouble


 (in fact when I run the app and enter bad datas I didn't get any
 errors message displayed on my login page)
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: html:errors / trouble

2003-02-10 Thread alexj
Here follow my mapping 

action-mappings type=org.apache.struts.action.ActionMapping

action

attribute=loginForm

input=/login.jsp

name=loginForm

validate=true

path=/login

type=soft.ibmss.struts.action.LoginAction

forward name=success path=/ok.jsp /

forward name=login path=/login.jsp /

forward name=student path= /

forward name=prof path= /

/action

- Original Message - 
From: Sean Dockery [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, February 11, 2003 12:16 AM
Subject: Re: html:errors / trouble


 What forwards are defined for your action in struts-config.xml?
 
 
 - Original Message - 
 From: alexj [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Monday, February 10, 2003 10:56
 Subject: Re: html:errors / trouble
 
 
  (in fact when I run the app and enter bad datas I didn't get any
  errors message displayed on my login page)
  
 
 
 
 -
 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: html:errors / trouble

2003-02-10 Thread alexj
I just saw my mapping definition was incomplete ... :))

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]