validwhen question

2005-06-15 Thread Andrey Grishin

Good morning/day/evening, All!
I use Struts 1.2.6 and Tomcat 4.1.29

I have a working email validator for my form:
field property=email depends=email
   arg0 key=customer._email/
/field

I want to use validwhen validator, so I changed the validation to:
field property=email depends=email,validwhen
   arg0 key=customer._email/
var
   var-nametest/var-name
   var-valueCONDITION HERE/var-value
/var
/field
But nothing happens whatever condition I place. Even if I place something 
obviously wrong, like sdf OR SDFs12.
Really nothing. No exceptions in the log, generated html remains the same. 
Have I missed something?


Any ideas will be appreciated.

Regards, Andrey Grishin. 


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



RE: [To sum it up] Re: Confused

2005-06-15 Thread Daniel Perry
I took one look at ejbs and ran a mile.

Struts and EJBs seem to be at the opposite end of a scale.
Struts is sensible, nice to work with, efficient, and generally everything
that EJBs arnt!

I personally use it with OJB (made that decision 1.5 yrs ago).  Hibernate
seems to be more popular, and if i was to make the decision now, i'd
probably go with hibernate.  I'm sticking with OJB in the systems i have
because refactoring the whole lot would be such a chore, and OJB works fine
(though i have had to deal with some really annoying intermittent bugs).

Daniel.

 -Original Message-
 From: Pierre Thibault [mailto:[EMAIL PROTECTED]
 Sent: 14 June 2005 19:53
 To: Struts Users Mailing List
 Subject: Re: [To sum it up] Re: Confused


 Le 14 juin 2005 à 04:59, Stéphane Zuckerman a écrit :

 Hello Stéphane,

 
 ...
  Anyway, this little presentation is far from complete, and I
  suggest you read some doc about J2EE applications before going
  further with struts (java.sun.com is a good start).
 
  --
  Stéphane Zuckerman
 

 The difficulty here is that there is lot of pieces that go together.
 There is a lot of choices and it is not clear for the new developers
 which path to fellow. I decided to buy the book 'Struts The Complete
 Reference' and I am only at the beginning. I'll continue to dig on
 the subject. I'm happy to see that there is community here for
 helping me. I fell already a lot more comfortable.

 Thank you.

 A+

 --
 Pierre





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



User Registration

2005-06-15 Thread Anand Vijay

Hi

I have a link in my application for user registration form .

It has combo box in the form that need to be populated from database.

Say : Form action path is register.do and form name is register_form

What should be the link and how we have to do mapping in struts-config.xml

Regards
Vijay

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



[OT] Validating email addresses

2005-06-15 Thread Richard Reyes
Hi Guys,

I plan to validate email addresses and Domain names entered by users
via those downloadable
javascripts. Any suggestions?

Also if I am to validate these fields do I need to know the valid .com
or .net domains?

Please advise
TIA!

Richard

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



BeanUtils.populate error

2005-06-15 Thread Jan Ziniewicz
I get this error when I click on a buttons in my forms. Some buttons work,  
some don't and I don't know where is the error. Any suggestions?


I can give you more detailed information but i guess that it is quite  
typical error.



javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

com.newitech.struts.controller.AccessController.process(AccessController.java:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

com.newitech.struts.controller.AccessController.doPost(AccessController.java:254)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

root cause

java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)

org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)

org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)

org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

com.newitech.struts.controller.AccessController.process(AccessController.java:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

com.newitech.struts.controller.AccessController.doPost(AccessController.java:254)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


--
Pozdrawiam, Janek Ziniewicz
gg:902858
irc.freenode.net: #gore, #dub

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



Multi-channels / Themes

2005-06-15 Thread Martin Ravell
Has anyone had any experiences with the Multi-Channels construct within
Tiles?

Any resources, experiences good or bad would be appreciated.

 

Regards

Marty

 

 

 



Re: BeanUtils.populate error

2005-06-15 Thread delbd
You most probably have the wrong setter parameters for one or several of your 
from's properties.
like have you have a setDate(Date date) instead of setDate(String date)
The only allowed signatures, if am not wrong are setXXX(String) and 
setXXX(FormFile)

Le Mercredi 15 Juin 2005 15:07, Jan Ziniewicz a crit :
 I get this error when I click on a buttons in my forms. Some buttons work,
 some don't and I don't know where is the error. Any suggestions?

 I can give you more detailed information but i guess that it is quite
 typical error.


 javax.servlet.ServletException: BeanUtils.populate
   org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
   
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor
.java:805)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203
) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 com.newitech.struts.controller.AccessController.process(AccessController.ja
va:261)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 com.newitech.struts.controller.AccessController.doPost(AccessController.jav
a:254) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)
   
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.
java:75)

 root cause

 java.lang.IllegalArgumentException: argument type mismatch
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25) java.lang.reflect.Method.invoke(Method.java:585)
   
 org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils
.java:1789)
 org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.
java:1684)
 org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1
713) org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
 org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.
java:805)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203
) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 com.newitech.struts.controller.AccessController.process(AccessController.ja
va:261)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 com.newitech.struts.controller.AccessController.doPost(AccessController.jav
a:254) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)
   
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.
java:75)

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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



Re: [OT] Validating email addresses

2005-06-15 Thread Martin Gainty

Richard-
Can you run basic DNS nslookup utilities and or have access to
BIND a.root-servers.net - m.root-servers.net?
-OR-

You may want to use a combination of parsing the URL such as
http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html

import java.net.*;
import java.io.*;

public class ParseURL {
   public static void main(String[] args) throws Exception {
   URL aURL = new URL(http://java.sun.com:80/docs/books/;
  + tutorial/index.html#DOWNLOADING);
   System.out.println(protocol =  + aURL.getProtocol());
   System.out.println(host =  + aURL.getHost());
   System.out.println(filename =  + aURL.getFile());
   System.out.println(port =  + aURL.getPort());
   System.out.println(ref =  + aURL.getRef());
   }
}

and then attempting to access the URL
http://java.sun.com/docs/books/tutorial/networking/urls/connecting.html
try {
   URL yahoo = new URL(http://www.yahoo.com/;);
   URLConnection yahooConnection = yahoo.openConnection();

} catch (MalformedURLException e) { // new URL() failed
   . . .
} catch (IOException e) {   // openConnection() failed
   . . .
}

Martin-
- Original Message - 
From: Richard Reyes [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 15, 2005 6:02 AM
Subject: [OT] Validating email addresses


Hi Guys,

I plan to validate email addresses and Domain names entered by users
via those downloadable
javascripts. Any suggestions?

Also if I am to validate these fields do I need to know the valid .com
or .net domains?

Please advise
TIA!

Richard

-
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: [To sum it up] Re: Confused / one little question

2005-06-15 Thread Abdullah Jibaly
Spring takes care of all this (http://springframework.org) without the overhead 
of an ejb container.

Acegi is one aspect closely tied to spring that takes care of security 
declaratively.

Regards,
Abdullah

-Original Message-
From: Marco Mistroni [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 15, 2005 5:04 AM
To: 'Struts Users Mailing List'
Subject: RE: [To sum it up] Re: Confused / one little question


Hello all,
Sorry to get into this thread so late...
Since I have same view as Daniel about Hibernate/EJBs, I wanted to ask
one additional
question, since right now I am using EJBs..

Now, EJBs have some features that let the coder concentrate only
On the business logic instead of dealing, for example, with
synchronization, transaction, threading ..and security, meaning that you
can declare in the
Deployment descriptor which roles are allowed to do what with your EJBs.

Where can you do the same with ORM tools?  In the web layer?
Or do you have to have a security framework in place (such as acegi)?

Thanx and regards
Marco




-
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]



[OT] Re: [To sum it up] Re: Confused / one little question

2005-06-15 Thread Radu Badita


In fact, this thread was really about Struts and how it integrates with 
various J2EE technologies and containers, not about Hibernate/EJBs...
Anyway: I don't think that anyone says that Hibernate is better than EJB 
period; but maybe easier and more flexible to use than Entity EJBs CMP, 
which is just one of the species of EJBs.
It is true that EJB (entity beans or not) has these nice features you 
mention: declarative transactions and declarative security (multi 
threading and synchronization are in fact container and coding 
related, and also implemented by Hibernate), BUT the question is: are 
those really necessary?
Hibernate also supports CMT, and, if facaded by SessionBeans (which is a 
very common scenario and is also recomanded for entity beans), you have 
declarative transactions.
Security is a very nice feature, but in scenarios where you only use a 
web application to access the EJBs, and the EJB container is isolated 
from the rest of the world, it becomes either useless, or a burdain to 
use... And I think that this scenario is the most common (especially 
among the subscribers to a list such as Struts Users :)
It's also true that in some scenarios the Entity Beans might be more 
effective than using an ORM such as Hibernate, but these scenarios are 
extremely rare...
Also, even Hibernate is sometimes regarded as being too complicated and 
too hard to learn by some (it was a very hot discussion about this on 
this list), and in even simpler scenarios are preferred even simpler 
tools such as iBatis, ORB, etc..
In my opinion, a discussion with a subject such as EJB is better than 
Hibernate is completely meaningless... The right tool always depends on 
the job, and the right tool for every imaginable job was just not yet 
invented.  :-)
The answer to your last question IMHO is: yes, you can, if the web layer 
is the only thing accessing your beans. But the subject of security is 
much more complicated in a real-life application than what framework do 
I need to best implement it?


You're welcome,
Radu

Marco Mistroni wrote:


Hello all,
Sorry to get into this thread so late...
Since I have same view as Daniel about Hibernate/EJBs, I wanted to ask
one additional
question, since right now I am using EJBs..

Now, EJBs have some features that let the coder concentrate only
On the business logic instead of dealing, for example, with
synchronization, transaction, threading ..and security, meaning that you
can declare in the
Deployment descriptor which roles are allowed to do what with your EJBs.

Where can you do the same with ORM tools?  In the web layer?
Or do you have to have a security framework in place (such as acegi)?

Thanx and regards
Marco
 



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



Re: Sending dynamic parameters to a forward

2005-06-15 Thread gvanmatre
 Here's something I'm using to accomplish this:
 http://www.systemmobile.com/wp/?p=114
 It's pretty simple, but can be refit to be fairly complex.
 

I've done something similar too, just another approach using other extension 
points in Struts.  

I extend the ActionForward adding some properties to hold the arguments.

forward name=Entity path=/BusinessEntityDetail.do 
 redirect=true className=com.rustts.action.RusttsForwardAction

   set-property property=arg1 value=masterFileId/
   set-property property=arg2 value=nameTyp/
   set-property property=arg3 value=srchTyp/
   set-property property=arg4 value=entityId/
   set-property property=arg5 value=entityId2/
/forward

I extended the ActionMapping adding a transient HttpServletRequest and 
ActionForm.   These values where staged by a base Action class.

ActionForward forward = null;
if (mapping instanceof IRusttsActionMapping) {
   ((IRusttsActionMapping) mapping).setState(form, request);
}

The extended ActionMapping had an overridden findForward that passed the 
request and form bean to the ActionForward. 

 public ActionForward findForward(String name) {

  ActionForward forward = super.findForward(name);
  if ((forward != null)
(forward instanceof IRusttsForwardAction)
(request != null)
(form != null)) {
   forward =
((IRusttsForwardAction) forward).stageForward(form, request);
  }

  return forward;

 }

The stageForward method of the action forward would add the parameters to the 
path.  


 /**
  * This is a factory method to handle the prorogation
  * of key arguments to the target of the action forward.
  * if the action is a redirect, a query string of encoded
  * arguments will be added to the path.  Otherwise the data
  * (Map) will be staged on the request.
  */
 public ActionForward stageForward(
  ActionForm form,
  HttpServletRequest request) {

  ActionForward targetForward = null;

  try {
   Map sourceArgs = BeanUtils.describe(form);
   String[] targetNames = getArgs();
   Map targetArgs = (Map) new TreeMap();

   for (int i = 0; i  targetNames.length; ++i) {
if (sourceArgs.containsKey(targetNames[i])) {

 Object arg = sourceArgs.get(targetNames[i]);
 if (arg != null)
  targetArgs.put(targetNames[i], arg);
 arg = null;
}
   }

   if (redirect) {
if (!targetArgs.isEmpty()) {
 StringBuffer buff = new StringBuffer(path);

 //look for an existing query string delimiter
 boolean firstArg = true;
 if (buff.toString().indexOf('?')  -1) {
  firstArg = false;
 } else
  buff.append(?);

 Iterator vi = targetArgs.keySet().iterator();
 while (vi.hasNext()) {
  String name = (String) vi.next();
  Object arg = targetArgs.get(name);
  if (arg != null) {
   String value = URLEncoder.encode(arg.toString());

   buff.append((firstArg) ?  : ).append(
name).append(
=).append(
value);
   firstArg = false;
   value = null;
  }
  arg = null;
  name = null;
 }

 //build an new ActionForward with the new query 
 targetForward = new ActionForward(buff.toString(), true);

 buff = null;
 vi = null;
} else
 targetForward = this;

   } else {
//stage the data pickle in request scope for the next page  
request.setAttribute(
 com.rustts.Globals.RUSTTS_FORWARD_KEY,
 targetArgs);
targetForward = this;

   }

   targetNames = null;
   sourceArgs = null;
   targetArgs = null;
  } catch (Exception e) {
   targetForward = this;
  }

  return targetForward;
 }


It looks like a lot of code but after implemented provided a declarative way to 
handle passing parameters transparent of forward verses redirect.  

Gary


 
 On 6/14/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
  Sorry, my bad... it's not setURL, it's setPath.  It's actually a method
  of ForwardConfig, which ActionForward extends.  Look in the third table
  down in the link you sent, the section labeled Methods inherited from
  class org.apache.struts.config.ForwardConfig.
  
  That's what I get for going from memory ;)
  
  Frank
  
  Zarar Siddiqi wrote:
   Where do you see the af.setURL(String) method in the ActionForward class?
   http://struts.apache.org/api/org/apache/struts/action/ActionForward.html
  
   I had a similar problem where dynamic values needed to be passed in via
   an ActionForward but I wasn't able to find something as simple as you
   suggest. I had to store the values in session scope (because the
   ActionForward had redirect=true) and then clean up the session in my
   receiving code.
  
   So you store the values that you are passing in session scope for a
   quick millisecond while you forward and then clean up once you're in the
   called method.
  
   Zarar
  
  
   - Original Message - From: Frank W. Zammetti
   [EMAIL PROTECTED]
   To: Struts Users Mailing List user@struts.apache.org
   Cc: Struts Users Mailing List user@struts.apache.org
   Sent: Tuesday, June 14, 

Action chaining

2005-06-15 Thread Rafael Taboada
 Hi folks. Do u know any information about action chaining?
  I mean, I have a method in Action1 and it calls another method in Action2.
  I know Actions return ActionForward and Actions too.
  Do u know any site where I can find information about it???
 Thanks in advance

-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


RE: Replace logic:messagesPresent with JSTL tags

2005-06-15 Thread John Fletcher
Well, normally for a request attribute I'd just use
${requestScope.attributeName}, but you can't do this here since there
are periods in the attribute name.  I think you should be able to use:

${!empty requestScope['org.apache.struts.action.ERROR']} 

as your test, since requestScope is a Map object.

John

 -Original Message-
 From: Franz-Josef Herpers [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 15, 2005 6:33 AM
 To: Struts Users Mailing List
 Subject: Replace logic:messagesPresent with JSTL tags
 
 Hi,
 
 I'm using the the html-el:messages tag to print out 
 validation error messages. Now I want to replace the Struts 
 logic tags with JSTL tags. 
 Hence I wrote:
 
 c:if test=${org.apache.struts.action.ERROR != null}
   ul
 html-el:messages id=error bundle=ERRORS_KEY
   li
 span style=color:red
   c:out value=${error} escapeXml=false/
 /span
   /li
 /html-el:messages
   /ul
 /c:if
 
 But error messages are not shown even if there is definitely 
 an request attribute with the name org.apache.struts.action.ERROR.
 And even more strange for me is the fact that it works if i 
 use scriptlets and do it this way:
 
 % if (request.getAttribute(org.apache.struts.action.ERROR) 
 != null) {%
   ul
 html-el:messages id=error bundle=ERRORS_KEY
   li
 span style=color:red
   c:out value=${error} escapeXml=false/
 /span
   /li
 /html-el:messages
   /ul
 %}%
 
 Thanks in advance for any hints to solve this little problem.
 
 Regards
 Franz
 

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



Re: BeanUtils.populate error

2005-06-15 Thread Martin Gainty

Jan-
Can we see how the bean argument is constructed
Can we see how the map argument is constructed
You may want to take a look at the javadoc located at
http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/BeanUtils.html#populate(java.lang.Object,%20java.util.Map)
If you are you using reflection you may have to add the required member 
access grants e.g.

grant {
permission java.lang.RuntimePermission accessDeclaredMembers;
};
IN conversion scenarios Native type conversions are supported ..Optional 
type conversions are not please read

http://husted.com/struts/catalog.html
for further information..
As always identifying the root cause will help out
dziekuje,
Martin-

- Original Message - 
From: Jan Ziniewicz [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, June 15, 2005 9:07 AM
Subject: BeanUtils.populate error


I get this error when I click on a buttons in my forms. Some buttons work, 
some don't and I don't know where is the error. Any suggestions?


I can give you more detailed information but i guess that it is quite 
typical error.



javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
com.newitech.struts.controller.AccessController.process(AccessController.java:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
com.newitech.struts.controller.AccessController.doPost(AccessController.java:254)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

root cause

java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
com.newitech.struts.controller.AccessController.process(AccessController.java:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
com.newitech.struts.controller.AccessController.doPost(AccessController.java:254)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)


--
Pozdrawiam, Janek Ziniewicz
gg:902858
irc.freenode.net: #gore, #dub

-
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: Action chaining

2005-06-15 Thread Michael Jouravlev
First off, there is no clear definition of what chaining is. Some say,
that chaining is the process of transferring control strictly on the
server (forwarding from action to action), thus linking action via
redirect does not count as chaining :) Also there is an opinion that
two actions do not make a chain, only three or more :)

Anyway, search struts wiki for that matter. Do not forget, that if you
chain actions on server, then request data will be applied to the form
bean of the next action, so you need to make sure that form bean of
your second action has different fields or does not have setters. If
you chain action using redirection, then unless you stuck something
in URL, the request object will be clean, and form bean will not be
populated.

http://wiki.apache.org/struts/ActionChaining?highlight=%28chaining%29
http://wiki.apache.org/struts/StrutsMultipleActionForms
http://wiki.apache.org/struts/StrutsCatalogInputOutputSeparation

Michael.
On 6/15/05, Rafael Taboada [EMAIL PROTECTED] wrote:
  Hi folks. Do u know any information about action chaining?
   I mean, I have a method in Action1 and it calls another method in Action2.
   I know Actions return ActionForward and Actions too.

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



Re: Replace logic:messagesPresent with JSTL tags

2005-06-15 Thread Franz-Josef Herpers

Hi John,

 I think you should be able to use:


${!empty requestScope['org.apache.struts.action.ERROR']} 


as your test, since requestScope is a Map object.


Thank you. That's what I forgot: The escaping because of the periods in 
the request attribute name.


Regards
Franz


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



[ERROR] ValidatorForm - -No such validation methodcté

2005-06-15 Thread Venkat Reddy Valluri
Hi
   I am using struts-1.2.4 and latest commons-validator to make use of the 
feature of multiple valiadtions files support

   Here I am getting the error like below.Can some one plEase help me solve 
this 

[ERROR] ValidatorForm - -No such validation method: null 
org.apache.commons.validator.ValidatorException: No such validation method: 
nullorg.apache.commons.validator.ValidatorException: No such validation 
method: null

Thanks in advance
--Venkat



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

Re: Replace logic:messagesPresent with JSTL tags

2005-06-15 Thread Martin Gainty

Franz-
courtesy
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL5.html
could you try
c:if test=${!empty param.org.apache.struts.action.ERROR}
states the request parameter org.apache.struts.action.ERROR is NOT empty
Viel Gluck,
Martin-

- Original Message - 
From: Franz-Josef Herpers [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 15, 2005 9:32 AM
Subject: Replace logic:messagesPresent with JSTL tags



Hi,

I'm using the the html-el:messages tag to print out validation error 
messages. Now I want to replace the Struts logic tags with JSTL tags. 
Hence I wrote:


c:if test=${org.apache.struts.action.ERROR != null}
 ul
   html-el:messages id=error bundle=ERRORS_KEY
 li
   span style=color:red
 c:out value=${error} escapeXml=false/
   /span
 /li
   /html-el:messages
 /ul
/c:if

But error messages are not shown even if there is definitely an request 
attribute with the name org.apache.struts.action.ERROR.
And even more strange for me is the fact that it works if i use scriptlets 
and do it this way:


% if (request.getAttribute(org.apache.struts.action.ERROR) != null) {%
 ul
   html-el:messages id=error bundle=ERRORS_KEY
 li
   span style=color:red
 c:out value=${error} escapeXml=false/
   /span
 /li
   /html-el:messages
 /ul
%}%

Thanks in advance for any hints to solve this little problem.

Regards
Franz


-
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: Action chaining

2005-06-15 Thread Rafael Taboada
Thanks Michael for ur reply.
 I found this information I tried to follow: 
http://struts.apache.org/faqs/newbie.html#chaining
 But what about if BAction extends LookupDispatchAction
 I tried to use: /BAction .do?method=mymethod in the forward path but there 
is an error:
 javax.servlet.ServletException: Action[/BAction ] missing resource 
'mymethod' in key method map


-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


Re: Action chaining

2005-06-15 Thread Rafael Taboada
 Finally I could call a method from an Action which extends 
LookupDispatchAction
  /BAction.do?method=myvaluekey
  where in my resources.properties file:
  key=myvaluekey

Thanks to everybody for ur help =)

-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

No creo en el destino pues no me gusta tener la idea de controlar mi vida


[OT] Session ID in the URL

2005-06-15 Thread Michael Jouravlev
Does anyone know, how to find out that URL contains session ID in it?
Usually this happens only once in the beginning of a session, if
browser supports cookies. I even don't need the value itself, I just
want to know that fact, that session ID is appended to URL, not sent
as cookie.

Session ID is separated with semicolon, and is not treated as query
parameter, so I cannot read as parameter.

Michael.

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



Re: [OT] Session ID in the URL

2005-06-15 Thread Dave Newton

Michael Jouravlev wrote:


Does anyone know, how to find out that URL contains session ID in it?

Session ID is separated with semicolon, and is not treated as query
parameter, so I cannot read as parameter.
 


Check for sessionId in getQueryString?

Dave



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



Re: Wildcard action paths

2005-06-15 Thread Laurie Harper

Michael Jouravlev wrote:

On 6/13/05, Laurie Harper [EMAIL PROTECTED] wrote:


I didn't get any response to this last time so I'm asking again... :-)

I'd like to replace URLs like this:

  /Sections/Subsections/?section=Section1subsection=SubSection1

with URLs like this:

  /Sections/Section1/Subsections/Subsection1



You don't want to solve this with mod_rewrite, do you?


No, I don't want to require Apache.

L.


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



RE: [OT] Session ID in the URL

2005-06-15 Thread David G. Friedman
See the HttpServletRequest API for these methods:

boolean isRequestedSessionIdFromUrl() (pre 2.1)
boolean isRequestedSessionIdFromURL() (2.1 or later)
boolean isRequestedSessionIdFromCookie() 

Regards,
David

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 15, 2005 4:16 PM
To: Struts Users Mailing List
Subject: [OT] Session ID in the URL


Does anyone know, how to find out that URL contains session ID in it?
Usually this happens only once in the beginning of a session, if
browser supports cookies. I even don't need the value itself, I just
want to know that fact, that session ID is appended to URL, not sent
as cookie.

Session ID is separated with semicolon, and is not treated as query
parameter, so I cannot read as parameter.

Michael.

-
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: [OT] Session ID in the URL

2005-06-15 Thread Dave Newton

David G. Friedman wrote:


See the HttpServletRequest API for these methods:

boolean isRequestedSessionIdFromUrl() (pre 2.1)
boolean isRequestedSessionIdFromURL() (2.1 or later)
boolean isRequestedSessionIdFromCookie() 
 


This answer is better than mine :)

Must... keep... reading... JavaDocs...

Dave



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



Re: Wildcard action paths

2005-06-15 Thread Laurie Harper

Van wrote:
 Okay. So maybe this isn't the only wildcard mapping you will have.

Still, you could have one SectionAction class for this particular
wildcard mapping. That would be a vast improvement over status quo.

How many different wildcard mappings do you have in this application?


Almost every page will be delivered through a wild-carded action path. 
We're talking a few tens of patterns with varying amounts of similarity.



You could pass one request parameter that indicated which wildcard
pattern was involved. If you don't want to have branching logic, you
could even make this additional request parameter be a property name
and store in your application properties file the regular expression
to use against the incoming request URL to pull out the matching
wildcard values. That should scale generally to any number of
different wildcard mappings using a single Action class that was
driven by these regular expressions coming from your application
properties file.


That's still multiplying the number of places the patterns must be 
stored and processed, and since Struts already does everything I want 
except (apparently) a way to pass the results along that seems like a 
bad idea.


Looks like my original approach (overloading 'parameter') will have to do.

L.


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



localisation question

2005-06-15 Thread Arno Schatz

Hi,

I want to retrieve a translation given the messaeKey for the current user in the servlet 
(not from within the JSP). How to do that. I found TagUtils.message(..) but it takes a 
pageContext as parameter, which I don't know where to get. Is that the right method? Any 
easier method to get a translation?


thanks,
  Arno


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



Help - Tiles and structured content

2005-06-15 Thread Ramadi Pearse
I am working on a website which has mainly been a
total web application through its lifecycle. It uses
Struts and composes the interface using Tiles,
sometimes nested Tiles. I have setup my structure as
such:

WEB-INF
 |-- jsp
 ||-- tiles
 |||-- dir1
 |||-- dir2

So I have creates a jsp/tiles/ directory under WEB-INF
and placed my jsp there. That's standard practice,
right?

Well now I have to add ALOT of static content, like
promotional writings, help instructions, messages from
the boss, etc... and I am not exactly sure how to do
this.

I still need my static content decorated with Tiles.
What do people recommend? And where should I store
these files? 

And do I create an Action which loads up the JSP
according to some virtual path (to be mapped
internally) in a request parameter? Example:
/viewDoc.do?path=/path1/path2/file.jsp - What i want
to avoid is creating many tile definitions for static
content.

I am looking for best practices. Thank you.


__
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]



Re: BeanUtils.populate error

2005-06-15 Thread Janek Ziniewicz

Thank you delbd, that indeed could produce an error.

I 've found that the error occured when  fields in form didn't have unique  
name attributes and I tried to perform forward to the same form.


logic:iterate id=att name=attAttList
 a class=link name=showattachment.x  
href=/NILTemp/showAttachment.do?attid=bean:write  
name=attproperty=id/[View]/a

/logic:iterate

I use SimpleDispatchAction as parent for my Action classes and changing  
names to unique could cause some problems for me. Do you know any fast and  
easy [:)] way to deal with this?



Dnia Wed, 15 Jun 2005 15:20:27 +0200, delbd [EMAIL PROTECTED] napisa:

You most probably have the wrong setter parameters for one or several of  
your

from's properties.
like have you have a setDate(Date date) instead of setDate(String date)
The only allowed signatures, if am not wrong are setXXX(String) and
setXXX(FormFile)

Le Mercredi 15 Juin 2005 15:07, Jan Ziniewicz a crit :
I get this error when I click on a buttons in my forms. Some buttons  
work,

some don't and I don't know where is the error. Any suggestions?

I can give you more detailed information but i guess that it is quite
typical error.


javax.servlet.ServletException: BeanUtils.populate
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor
.java:805)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203
)  
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

com.newitech.struts.controller.AccessController.process(AccessController.ja
va:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
com.newitech.struts.controller.AccessController.doPost(AccessController.jav
a:254) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.
java:75)

root cause

java.lang.IllegalArgumentException: argument type mismatch
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25) java.lang.reflect.Method.invoke(Method.java:585)

org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils
.java:1789)
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.
java:1684)
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1
713)  
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)

org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.
java:805)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203
)  
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

com.newitech.struts.controller.AccessController.process(AccessController.ja
va:261)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
com.newitech.struts.controller.AccessController.doPost(AccessController.jav
a:254) javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.newitech.struts.filter.LoginFilter.doFilter(LoginFilter.java:62)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.
java:75)






--
Pozdrawiam, Janek Ziniewicz
gg:902858
irc.freenode.net: #gore, #dub

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



another newbie

2005-06-15 Thread Anand Vijay

Hi All

I have a link in my application for user registration form . Form has 
combo box that needs to be populated from database. How to achieve this? 
Where do we write our bean to fetch the data?


Thanks in advance

Regards
Vijay

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



Question about DispatchAction

2005-06-15 Thread Paul Goepfert
I am writing a web app that gets information from a user (first and last 
names, and their address (street, city, state, zip) ) and the user has 
the option to sort the data.  Based on direction(ascending or 
descending) and what to sort by.  Either first or last name. 

Now here is my question, I have four Action classes in my web app.  I 
have them in separate files.  Since I am just beginning to learn Struts 
I  was unaware of the DispatcherAction class.  Now that I am aware of it 
I am going to use it.  There is one question I have though,  What class 
does  my dispatchAction class extend from?  I assume its an extension of 
some class. 

Also, I'm not sure if this is the right place for this but I am having 
some object reference problems.  What's happening is that when I fill up 
the information form with the name and address, I then save those values 
to a bean.  Once I have all the values in a bean I then save that bean 
object into a vector.  Now it seams that when I insert a new name into 
the vector the first position of the vector is overwritten by the new 
info that is being saved into the second position.  However when I added 
a third name I don't have that same problem.  It just enters in 
correctly.  Now when I go and try and sort the contents of the vector 
there seems to be a new object reference.  So I guess my question is, 
Will the Dispatcher class help with this object reference problem?


-Paul

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



Re: [OT] Session ID in the URL

2005-06-15 Thread Michael Jouravlev
D'oh! Thanks, David!

On 6/15/05, David G. Friedman [EMAIL PROTECTED] wrote:
 See the HttpServletRequest API for these methods:
 
 boolean isRequestedSessionIdFromUrl() (pre 2.1)
 boolean isRequestedSessionIdFromURL() (2.1 or later)
 boolean isRequestedSessionIdFromCookie()
 
 Regards,
 David

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



Re: [OT] Session ID in the URL

2005-06-15 Thread Michael Jouravlev
On 6/15/05, Dave Newton [EMAIL PROTECTED] wrote:
 David G. Friedman wrote:
 
 See the HttpServletRequest API for these methods:
 
 boolean isRequestedSessionIdFromUrl() (pre 2.1)
 boolean isRequestedSessionIdFromURL() (2.1 or later)
 boolean isRequestedSessionIdFromCookie()
 
 
 This answer is better than mine :)

Was celebrating too early. Does not work. Here what happens. 
* Very first request to the app. Session is created on server.
* Application redirects to whatever location, server sets cookie with
jsessionid in the response, and at the same time adds jsessionid to
the URL
* Browser navigates to the redirected location, it replies with
jsessionid in the cookie, so next time server won't rewrite URL.
But!!! There is another jsessionid, which was appended to the URL in
the redirected request. I want to detect this one.

The problem is, that redirected request contains *both* session ID in
cookie and session ID in the rewritten URL. Stupid
isRequestedSessionIdFromURL() returns false, because it thinks that I
should be happy by isRequestedSessionIdFromCookie() returning true.

But I want to know both pieces of info: that there is session ID in
the cookie, and that there session ID in the URL!

getQueryString() returns null, because session ID is not treated as
regular query parameter.

iamsad. Michael.

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



Re: another newbie

2005-06-15 Thread Nitesh

You could populate the combo independently using a logic:iterate tag in the
JSP
Use a bean/helper to get the values as a collection and pass the same to the
iterator.

alternate method is to have an action class before the control comes to the
JSP where in you could get the collection. (Here also you need to use the
logic:iterate tag in the JSP)

HTH

Regards

Nitesh

- Original Message - 
From: Anand Vijay [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Wednesday, June 15, 2005 4:00 PM
Subject: another newbie



Hi All

I have a link in my application for user registration form . Form has 
combo box that needs to be populated from database. How to achieve this? 
Where do we write our bean to fetch the data?


Thanks in advance

Regards
Vijay

-
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]



http 404 page

2005-06-15 Thread Tony Smith
If there is a problem, e.g. an action/page can not be
found, the ugly Http 404 page not found page will be
display. Is there a way to handle such event as Struts
Exception handling?

Thanks,

 




__ 
Discover Yahoo! 
Find restaurants, movies, travel and more fun for the weekend. Check it out! 
http://discover.yahoo.com/weekend.html 


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



Re: [OT] Validating email addresses

2005-06-15 Thread Richard Reyes
Unfortunately guys all will be done on javascript. Any suggestion on
proven downloadble javascript components would be very much
appreciated. I might just code for the domain name validations.

Can I get the valid list from whois.org?

Thanks All
Richard

On 6/15/05, Martin Gainty [EMAIL PROTECTED] wrote:
 Richard-
 Can you run basic DNS nslookup utilities and or have access to
 BIND a.root-servers.net - m.root-servers.net?
 -OR-
 
 You may want to use a combination of parsing the URL such as
 http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html
 
 import java.net.*;
 import java.io.*;
 
 public class ParseURL {
public static void main(String[] args) throws Exception {
URL aURL = new URL(http://java.sun.com:80/docs/books/;
   + tutorial/index.html#DOWNLOADING);
System.out.println(protocol =  + aURL.getProtocol());
System.out.println(host =  + aURL.getHost());
System.out.println(filename =  + aURL.getFile());
System.out.println(port =  + aURL.getPort());
System.out.println(ref =  + aURL.getRef());
}
 }
 
 and then attempting to access the URL
 http://java.sun.com/docs/books/tutorial/networking/urls/connecting.html
 try {
URL yahoo = new URL(http://www.yahoo.com/;);
URLConnection yahooConnection = yahoo.openConnection();
 
 } catch (MalformedURLException e) { // new URL() failed
. . .
 } catch (IOException e) {   // openConnection() failed
. . .
 }
 
 Martin-
 - Original Message -
 From: Richard Reyes [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wednesday, June 15, 2005 6:02 AM
 Subject: [OT] Validating email addresses
 
 
 Hi Guys,
 
 I plan to validate email addresses and Domain names entered by users
 via those downloadable
 javascripts. Any suggestions?
 
 Also if I am to validate these fields do I need to know the valid .com
 or .net domains?
 
 Please advise
 TIA!
 
 Richard
 
 -
 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: [OT] Validating email addresses

2005-06-15 Thread Nitesh

Richard,

JavaScript validations are majorly done on client side and so it would be 
possible to do a actual validation of the email addresses. The JavaScript 
email validations mostly will check
whether the email is in a valid format. (i.e. even [EMAIL PROTECTED] would pass a 
validation)


If you have to do a whois validation the best would be to use the struts 
validator framework. This gives you a two-pronged validation - both client 
side as well as server side. The clientside Javascript validation ill check 
if the email is of valid format. You could probably override the server side 
validation to actually plug-in the code to validate with whois.


The other option would be to have a hidden frame, while validating the email 
address, use the hidden frame to redirect to a JSP or servlet which 
validates the email with whois and prompt the user accordingly.


HTH

Regards,
Nitesh


- Original Message - 
From: Richard Reyes [EMAIL PROTECTED]

To: Martin Gainty [EMAIL PROTECTED]
Cc: Struts Users Mailing List user@struts.apache.org
Sent: Thursday, June 16, 2005 9:21 AM
Subject: Re: [OT] Validating email addresses


Unfortunately guys all will be done on javascript. Any suggestion on
proven downloadble javascript components would be very much
appreciated. I might just code for the domain name validations.

Can I get the valid list from whois.org?

Thanks All
Richard

On 6/15/05, Martin Gainty [EMAIL PROTECTED] wrote:

Richard-
Can you run basic DNS nslookup utilities and or have access to
BIND a.root-servers.net - m.root-servers.net?
-OR-

You may want to use a combination of parsing the URL such as
http://java.sun.com/docs/books/tutorial/networking/urls/urlInfo.html

import java.net.*;
import java.io.*;

public class ParseURL {
   public static void main(String[] args) throws Exception {
   URL aURL = new URL(http://java.sun.com:80/docs/books/;
  + tutorial/index.html#DOWNLOADING);
   System.out.println(protocol =  + aURL.getProtocol());
   System.out.println(host =  + aURL.getHost());
   System.out.println(filename =  + aURL.getFile());
   System.out.println(port =  + aURL.getPort());
   System.out.println(ref =  + aURL.getRef());
   }
}

and then attempting to access the URL
http://java.sun.com/docs/books/tutorial/networking/urls/connecting.html
try {
   URL yahoo = new URL(http://www.yahoo.com/;);
   URLConnection yahooConnection = yahoo.openConnection();

} catch (MalformedURLException e) { // new URL() failed
   . . .
} catch (IOException e) {   // openConnection() failed
   . . .
}

Martin-
- Original Message -
From: Richard Reyes [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Wednesday, June 15, 2005 6:02 AM
Subject: [OT] Validating email addresses


Hi Guys,

I plan to validate email addresses and Domain names entered by users
via those downloadable
javascripts. Any suggestions?

Also if I am to validate these fields do I need to know the valid .com
or .net domains?

Please advise
TIA!

Richard

-
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]



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